/* Scoreboard-Overlay — eigenes, bildschirmfreundliches Design (großer
   Kontrast, große Schrift, wenig Ablenkung), farblich abgestimmt auf
   assets/css/style.css, aber mit eigenem, ruhigerem Layout fürs Screenshare. */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@500;700;800&family=JetBrains+Mono:wght@600;700&display=swap');

:root {
  --bg: #0a0b0f;
  --row-bg: #14151f;
  --row-bg-alt: #1a1c29;
  --border: #272a3a;
  --text: #f3f4f8;
  --text-dim: #8b91a6;
  --gold: #ffc93c;
  --accent: #22d3ee;
  --flash: #2ee6a6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Kein overflow:hidden — sonst wird auf kleinen Bildschirmen (Handy als
     Zweitgerät) alles unterhalb der Falz abgeschnitten. */
}

.board {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 20px 32px;
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
}

.board-header h1 {
  font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 0;
  text-transform: uppercase;
}

.board-header .now-playing {
  font-size: 1rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* Nur so hoch wie nötig — vorher schob "flex: 1" die Frage weit nach unten
     bzw. aus dem Bild heraus. */
  flex: 0 0 auto;
}

.row {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--row-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 24px;
  transition: background-color 0.6s ease, transform 0.3s ease;
}

.row:nth-child(even) { background: var(--row-bg-alt); }

.row.flash {
  background: var(--flash);
  color: #06251b;
}

.rank {
  font-size: 1.6rem;
  font-weight: 700;
  width: 56px;
  text-align: center;
  color: var(--text-dim);
}

.rank.medal { font-size: 2rem; }

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.name {
  flex: 1;
  font-size: 1.5rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.members {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.row.flash .members { color: #0d3826; }

.score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 90px;
  text-align: right;
}

.placeholder-msg {
  color: var(--text-dim);
  text-align: center;
  margin-top: 60px;
  font-size: 1.2rem;
}

/* --- Frage-Bereich der Zuschauer-Ansicht ---------------------------------- */

.stage {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px solid rgba(255, 255, 255, 0.12);
}
/* Während einer Frage bekommt der Inhalt den ganzen Bildschirm */
.stage--solo {
  margin-top: 8px;
  padding-top: 8px;
  border-top: none;
}

.stage-question {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 14px;
}

.stage-banner {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.8rem;
  letter-spacing: 4px;
  text-align: center;
  padding: 22px 10px;
}
.stage-banner--red { color: #ff5470; }
.stage-banner--gold { color: #ffc93c; }

.stage-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.1rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  margin-bottom: 14px;
}
.stage-timer.urgent { color: #ff5470; }

.stage-step { margin-bottom: 10px; text-align: center; }
.stage-step-label {
  font-size: 1.05rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.stage-media {
  max-width: 100%;
  max-height: 34vh;
  border-radius: 12px;
  display: block;
  margin: 0 auto;
}
audio.stage-media { width: 70%; max-width: 640px; }

.stage-textstep {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 11px 16px;
  margin-bottom: 8px;
  font-size: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.stage-points {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  font-size: 1rem;
  white-space: nowrap;
}

.stage-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stage-option {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 1.15rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.stage-option-line { display: flex; align-items: baseline; gap: 10px; }
.stage-option b { color: #22d3ee; font-size: 1.4rem; }

/* Nach dem Auflösen: richtige Option grün, gewählte falsche rot */
.stage-option.correct {
  background: rgba(46, 230, 166, 0.16);
  border-color: rgba(46, 230, 166, 0.55);
}
.stage-option.correct b { color: #2ee6a6; }
.stage-option.wrong {
  background: rgba(255, 84, 112, 0.13);
  border-color: rgba(255, 84, 112, 0.45);
}
.stage-option.wrong b { color: #ff5470; }

/* Wer hat was gewählt */
.stage-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.avatar-initial {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
  color: #06121a;
  flex-shrink: 0;
}

.stage-ranking { display: grid; gap: 5px; }
/* Ab sechs Einträgen zweispaltig — spart die Hälfte der Höhe */
.stage-ranking--two {
  grid-template-columns: 1fr 1fr;
  gap: 5px 14px;
  grid-auto-flow: column;
  grid-template-rows: repeat(var(--rank-rows, 5), auto);
}
.stage-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 1.05rem;
  color: var(--text-dim);
}
/* Erratene Plätze grün hervorheben … */
.stage-rank-row.revealed {
  background: rgba(46, 230, 166, 0.14);
  color: #2ee6a6;
  font-weight: 700;
}
/* … und beim Auflösen zeigen, was niemand hatte */
.stage-rank-row.missed {
  background: rgba(255, 84, 112, 0.12);
  color: #ff5470;
  font-weight: 600;
}
.stage-rank-pos {
  font-family: 'JetBrains Mono', monospace;
  min-width: 44px;
}
.stage-rank-label { flex: 1; }

.stage-solution {
  background: rgba(46, 230, 166, 0.12);
  border: 2px solid rgba(46, 230, 166, 0.4);
  border-radius: 14px;
  padding: 14px;
  margin-top: 12px;
  text-align: center;
}
.stage-solved-by { font-size: 1.1rem; color: #2ee6a6; margin-bottom: 6px; }
.stage-solution-text { font-size: 1.7rem; font-weight: 700; }

.board-category { margin-bottom: 14px; }
.board-category-name { font-size: 1.3rem; margin-bottom: 6px; }
.board-cells { display: flex; gap: 10px; flex-wrap: wrap; }
.board-cell {
  background: rgba(34, 211, 238, 0.16);
  border-radius: 8px;
  padding: 10px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem;
}
.board-cell.used { opacity: 0.35; }

/* --- Kleine Bildschirme (Handy/Tablet als Zweitgerät) ---------------------
   Auf dem Beamer sollen Schrift und Medien groß sein; auf dem Handy muss
   dagegen alles hineinpassen, ohne abgeschnitten zu werden. */
@media (max-width: 780px) {
  .board { padding: 14px 16px; min-height: auto; }

  .board-header { margin-bottom: 10px; }
  .board-header h1 { font-size: 1.15rem; }
  .board-header .now-playing { font-size: 0.8rem; }

  .row { padding: 8px 12px; gap: 10px; }
  .rank { font-size: 1.2rem; min-width: 34px; }
  .avatar { width: 34px; height: 34px; }
  .name { font-size: 1.05rem; }
  .members { font-size: 0.78rem; }
  .score { font-size: 1.3rem; min-width: 52px; }

  .stage { margin-top: 16px; padding-top: 14px; }
  .stage-question { font-size: 1.15rem; margin-bottom: 10px; }
  .stage-banner { font-size: 1.8rem; letter-spacing: 2px; padding: 16px 8px; }
  .stage-timer { font-size: 1.7rem; margin-bottom: 8px; }

  .stage-media { max-height: 30vh; }
  audio.stage-media { width: 100%; }
  .stage-step iframe { height: 190px !important; }

  .stage-step-label { font-size: 0.85rem; }
  .stage-textstep { font-size: 1rem; padding: 10px 12px; }
  .stage-points { font-size: 0.8rem; }

  .stage-options { grid-template-columns: 1fr; gap: 8px; }
  .stage-option { font-size: 1rem; padding: 10px 12px; }
  .stage-option b { font-size: 1.2rem; }
  .stage-picks { gap: 4px; }

  .stage-rank-row { font-size: 0.95rem; padding: 6px 10px; gap: 8px; }
  .stage-rank-pos { min-width: 32px; }

  .stage-solution { padding: 14px; }
  .stage-solved-by { font-size: 1rem; }
  .stage-solution-text { font-size: 1.3rem; }

  .board-category-name { font-size: 1.05rem; }
  .board-cell { font-size: 1rem; padding: 8px 14px; }
}

.conn-warning {
  font-size: 0.8rem;
  color: #ff5470;
  font-family: 'JetBrains Mono', monospace;
  margin-left: 12px;
}

.stage-attempts {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  text-align: center;
  color: var(--text-dim);
  margin-bottom: 12px;
}
