*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #111;
  color: #fff;
  font-family: sans-serif;
}

/* ── Join screen ─────────────────────────────────────── */
#join-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
}

h1 { font-size: 1.8rem; }

#join-screen label { font-size: 1rem; color: #aaa; align-self: flex-start; }

#competitionId {
  width: 100%;
  max-width: 340px;
  padding: 0.75rem 1rem;
  font-size: 1.4rem;
  border-radius: 6px;
  border: 1px solid #444;
  background: #222;
  color: #fff;
  text-align: center;
}

#submitBtn {
  width: 100%;
  max-width: 340px;
  padding: 0.9rem;
  font-size: 1.2rem;
  border-radius: 6px;
  border: none;
  background: #2980b9;
  color: #fff;
  cursor: pointer;
}

#cancelBtn {
    width: 100%;
    max-width: 340px;
    padding: 0.9rem;
    font-size: 1.2rem;
    border-radius: 6px;
    border: none;
    background: #444;
    color: #fff;
    cursor: pointer;
}

#message { font-size: 0.9rem; color: #e74c3c; min-height: 1.2em; }

/* ── Competition status bar ──────────────────────────── */
#competition-status {
  text-align: center;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #333;
  color: #aaa;
}

#competition-status[data-status="CREATED"] { background: #1a3a5c; color: #7ec8e3; }
#competition-status[data-status="STARTED"] { background: #1e5c2a; color: #7ed894; }
#competition-status[data-status="COMPLETED"] { background: #2a2a2a; color: #666; }

/* ── Scoring screen ──────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#score-screen {
  display: flex;
  flex: 1;
  flex-direction: column;
}

#score-header {
  padding: 0.75rem 1rem;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

#score-header .label { font-size: 0.85rem; color: #aaa; }
#score-header .label-spaced { margin-left: 1rem; }
#score-header .value { font-size: 1.1rem; font-weight: bold; }

#current-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  gap: 0.25rem;
}

#current-score .score-label {
  font-size: 0.8rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#current-score .score-value {
  font-size: 3rem;
  font-weight: bold;
}

#score-buttons {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.score-btn {
  border: none;
  font-size: clamp(2rem, 10vw, 4rem);
  font-weight: bold;
  cursor: pointer;
  transition: filter 0.1s;
  color: #fff;
}

.score-btn:active { filter: brightness(0.75); }

#score01 { background: #c0392b; }
#score03 { background: #922b21; }

/* ── Submit final score ──────────────────────────────── */
#submitFinalScore {
  display: block;
  margin: 1rem 1.5rem;
  padding: 0.9rem;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 6px;
  border: none;
  background: #2980b9;
  color: #fff;
  cursor: pointer;
}

#submitFinalScore:disabled {
  background: #444;
  color: #888;
  cursor: default;
}

/* ── Sliders ─────────────────────────────────────────── */
#sliders {
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  border-top: 1px solid #333;
}

.slider-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #2a2a2a;
}

.slider {
  width: 100%;
  accent-color: #2980b9;
  height: 0.4rem;
  cursor: pointer;
}