/* ============================================================
   HOST — TV display. Game Show 2.0.
   Deep indigo-black stage, bold state-driven color, one accent
   at a time. State communicates through color + scale, not glow.
   ============================================================ */

body {
  background:
    radial-gradient(ellipse 85% 60% at 30% 15%, rgba(0, 120, 200, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 85%, rgba(14, 44, 130, 0.30) 0%, transparent 55%),
    linear-gradient(160deg, rgba(20, 60, 155, 0.18) 0%, transparent 50%),
    var(--stage-deep);
  min-height: 100vh;
  overflow-x: hidden;
}

.frame {
  min-height: 100vh;
  padding: 16px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.surface {
  width: 100%;
  max-width: none;
  background: rgba(12, 22, 40, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  padding: 28px 44px 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  border: 1px solid var(--hairline-2);
  box-shadow:
    inset 0 1px 0 var(--hairline-2),
    0 28px 64px -16px rgba(0, 0, 0, 0.7);
}

/* ============================================================
   LOBBY
   ============================================================ */

/* Lobby: QR full-height left | 3 stacked cards right (info / players / how-to) */
.lobby-surface {
  width: 100%;
  height: min(960px, calc(100vh - 32px));
  align-self: center;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto 1fr;
  gap: 16px;
}

.lobby-card {
  background: rgba(14, 26, 58, 0.80);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 0 rgba(0, 0, 0, 0.5),
    0 32px 72px -16px rgba(0, 0, 0, 0.75);
}

/* QR spans all 3 rows on the left */
.qr-card {
  grid-column: 1;
  grid-row: 1 / span 3;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.qr-card .qr { margin: 0; }
.qr-card .label {
  font-size: 1rem;
  letter-spacing: 0.22em;
  color: var(--ink);
}

/* Room info: top right */
.lobby-info-card {
  grid-column: 2;
  grid-row: 1;
  gap: 20px;
  justify-content: center;
  border-top: 3px solid rgba(245, 183, 0, 0.5);
}
.lobby-info-card .label {
  font-size: 0.9rem;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

/* Players: middle right (flex: fills remaining space) */
.lobby-players-card {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  justify-content: center;
}

.lobby-players-card .players-section {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  height: auto;
}

/* How to play: bottom right */
.how-to-play {
  grid-column: 2;
  grid-row: 3;
}

/* ─── Masthead ─── */

.masthead {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}
.masthead-sep   { color: var(--hairline-2); }
.masthead-spacer { flex: 1; }
.masthead .mono { color: var(--gold); letter-spacing: 0.14em; }
.masthead-bit.live {
  color: var(--magenta);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

/* ─── Wordmark ─── */

.wordmark { display: block; }
.wordmark-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 7vw, 6rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: var(--chrome);
  display: inline-flex;
  align-items: baseline;
  column-gap: 0.04em;
}
.wordmark-title .word:first-child { color: var(--gold); }
.word-dot {
  display: inline-block;
  color: var(--magenta);
  margin-left: -0.03em;
}

/* ─── QR ─── */
.qr {
  width: clamp(280px, 48vh, 500px);
  height: clamp(280px, 48vh, 500px);
  background: #FFFFFF;
  padding: 16px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow:
    0 0 0 2px rgba(245, 183, 0, 0.75),
    0 0 32px rgba(245, 183, 0, 0.18),
    0 28px 60px -12px rgba(0, 0, 0, 0.75);
}
.qr svg { width: 100%; height: 100%; display: block; }
.qr-fallback {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin: 0;
}
.join-url-label {
  margin: 16px 0 6px;
  font-size: clamp(0.9rem, 1.1vw, 1.1rem);
  color: var(--ink-soft);
  text-align: center;
}
.join-url {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 1.45vw, 1.4rem);
  letter-spacing: 0.04em;
  color: var(--ink);
  text-align: center;
  word-break: break-all;
}

.join-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.join-info .label { margin-bottom: -8px; }
.room-code {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 7.5vw, 6rem);
  letter-spacing: 0.06em;
  margin: 0;
  line-height: 1;
  color: var(--gold);
}
.join-info button.primary {
  font-size: clamp(1.4rem, 1.8vw, 1.8rem);
  padding: 22px 52px;
}
.hint {
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink-soft);
  margin: 0;
}
.sound-hint {
  margin-top: 6px;
  font-style: normal;
  color: var(--gold);
  animation: sound-hint-pulse 1.8s ease-in-out infinite;
}
@keyframes sound-hint-pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.95; }
}

/* ─── How to play ─── */

.how-to-play {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 36px 36px;
  background: rgba(10, 20, 46, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  align-self: stretch;
  justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 0 transparent,
    0 24px 48px -16px rgba(0, 0, 0, 0.6);
}
.how-to-play > .label {
  font-size: 0.9rem;
  letter-spacing: 0.24em;
  color: var(--gold);
}
.how-to-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  counter-reset: how-to;
}
.how-to-list li {
  counter-increment: how-to;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: clamp(1.35rem, 1.75vw, 1.75rem);
  color: var(--ink);
  line-height: 1.35;
}
.how-to-list li::before {
  content: counter(how-to);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  flex-shrink: 0;
  background: var(--answer-a-bg);
  color: var(--answer-a-fg);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.how-to-list li:nth-child(2)::before {
  background: var(--answer-b-bg);
  color: var(--answer-b-fg);
}
.how-to-list li:nth-child(3)::before {
  background: var(--answer-c-bg);
  color: var(--answer-c-fg);
}

/* ─── Player list ─── */

.players-section {
  border-top: 1px solid var(--hairline);
  padding-top: 20px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.players-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
}
.readers-count {
  margin-left: 8px;
  font-family: var(--font-mono);
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.1em;
}
.micro {
  margin: 0;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.player-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  counter-reset: reader;
}
.player-list .chip {
  counter-increment: reader;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  color: var(--chrome);
  padding: 10px 14px;
  background: var(--stage-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  animation: chip-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.player-list .chip::before {
  content: counter(reader, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--gold);
  background: rgba(245, 183, 0, 0.10);
  border-radius: var(--radius-sm);
  padding: 3px 7px;
  min-width: 32px;
  text-align: center;
}
.player-list .chip::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--correct);
  margin-left: auto;
  flex-shrink: 0;
}
@keyframes chip-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.player-count-big {
  list-style: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding: 4px 0;
  animation: chip-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.player-count-num {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 5.5vw, 5.5rem);
  line-height: 1;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.player-count-label {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  color: var(--ink);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.colophon {
  display: flex;
  gap: 10px;
  font-style: italic;
  font-size: 0.8rem;
  color: var(--ink-dim);
  border-top: 1px solid var(--hairline);
  padding-top: 14px;
}

/* ─── Lobby responsive: laptop / smaller screens ─── */

@media (max-height: 860px) {
  /* Lobby */
  .lobby-surface { gap: 12px; }
  .lobby-card { padding: 22px 28px; }
  .qr { width: clamp(280px, 54vh, 540px); height: clamp(280px, 54vh, 540px); }
  .wordmark-title { font-size: clamp(2.4rem, 5vw, 4rem); }
  .room-code { font-size: clamp(2rem, 5.5vw, 4rem); }
  .join-info { gap: 12px; }
  .join-info button.primary { padding: 14px 28px; font-size: 1.1rem; }
  .how-to-play { gap: 14px; }
  .how-to-list { gap: 14px; }
  .how-to-list li { font-size: 1rem; }
  .how-to-list li::before { width: 34px; height: 34px; font-size: 1.1rem; }

  /* Game shell */
  .surface { padding: 20px 32px 24px; }
  .game-shell { gap: 20px; }
  .image-wrap { max-height: 44vh; }
  .draw-canvas { max-height: 44vh; }
  .game-pane { gap: 10px; }
  .choice { padding: 14px 18px; font-size: clamp(1.2rem, 1.5vw, 1.8rem); }
  .choice .badge { width: 36px; height: 36px; font-size: 1.1rem; }
  .game-side { padding: 18px 20px; }
  .question-row { padding-bottom: 6px; }
}

@media (max-height: 720px) {
  /* Lobby */
  .lobby-surface { gap: 8px; }
  .lobby-card { padding: 16px 22px; }
  .qr { width: clamp(200px, 44vh, 420px); height: clamp(200px, 44vh, 420px); }
  .wordmark-title { font-size: clamp(2rem, 4vw, 3rem); }
  .room-code { font-size: clamp(1.8rem, 4.5vw, 3.2rem); }
  .how-to-list { gap: 10px; }
  .how-to-list li { font-size: 0.92rem; }
  .how-to-list li::before { width: 28px; height: 28px; font-size: 1rem; }

  /* Game shell */
  .surface { padding: 14px 24px 18px; }
  .image-wrap { max-height: 38vh; }
  .draw-canvas { max-height: 38vh; }
  .choice { padding: 10px 14px; font-size: clamp(1rem, 1.3vw, 1.6rem); }
  .choice .badge { width: 30px; height: 30px; font-size: 1rem; }
}

/* ============================================================
   GAME SHELL
   ============================================================ */

.game-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 360px;
  grid-template-rows: 1fr;
  gap: 32px;
  align-items: start;
  padding: 4px 0;
}
.game-main {
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.game-shell.side-hidden { grid-template-columns: 1fr; }
.game-shell.side-hidden .game-side { display: none; }
.game-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: pane-in 0.2s ease both;
}
.game-pane.hidden { display: none; }
@keyframes pane-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Round header ─── */

.question-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.question-row .round-question { margin: 0; }
.question-row .max-points { flex-shrink: 0; white-space: nowrap; }
.round-eyebrow {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.round-eyebrow .eyebrow em {
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-soft);
  font-weight: 400;
  font-size: 0.9em;
}
.round-eyebrow .serif {
  font-family: var(--font-display);
  font-size: 1.8em;
  color: var(--gold);
  letter-spacing: 0.04em;
}
.dot-sep { color: var(--ink-dim); }
.max-points {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.max-points strong {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--gold);
  font-size: 1.3rem;
  margin: 0 4px;
  letter-spacing: 0.04em;
}

/* ─── Image stage ─── */

.image-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  aspect-ratio: 3 / 2;
  max-height: 60vh;
  background: #000;
  overflow: hidden;
  border-radius: var(--radius);
  isolation: isolate;
  box-shadow:
    0 0 0 1px var(--hairline),
    0 16px 40px -14px rgba(0, 0, 0, 0.8);
}
.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}
.image-corner { display: none; }   /* removed in Game Show 2.0 */

/* ─── Reveal styles ─── */

@property --spot-r {
  syntax: '<length>';
  initial-value: 60px;
  inherits: true;
}

.image-wrap[data-reveal-mode="continuous"][data-reveal="deblur"] img,
.image-wrap[data-reveal-mode="continuous"][data-reveal="deblur"]::before,
.image-wrap[data-reveal-mode="continuous"][data-reveal="zoom"] img,
.image-wrap[data-reveal-mode="continuous"][data-reveal="zoom"]::before,
.image-wrap[data-reveal-mode="continuous"][data-reveal="spotlight"] {
  transition-duration: var(--reveal-duration, 0.7s) !important;
  transition-timing-function: linear !important;
}

.image-wrap[data-reveal="deblur"] img { transition: filter 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.image-wrap[data-reveal="deblur"][data-stage="1"] img { filter: blur(28px) saturate(0.5); }
.image-wrap[data-reveal="deblur"][data-stage="2"] img { filter: blur(14px) saturate(0.7); }
.image-wrap[data-reveal="deblur"][data-stage="3"] img { filter: blur(5px)  saturate(0.9); }
.image-wrap[data-reveal="deblur"][data-stage="4"] img,
.image-wrap[data-reveal="deblur"][data-stage="5"] img { filter: blur(0) saturate(1); }

.image-wrap[data-reveal="deblur"]::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 85% 75% at 50% 50%, transparent 35%, rgba(0,0,0,0.7) 100%);
  transition: opacity 0.6s ease;
}
.image-wrap[data-reveal="deblur"][data-stage="1"]::before { opacity: 1; }
.image-wrap[data-reveal="deblur"][data-stage="2"]::before { opacity: 0.65; }
.image-wrap[data-reveal="deblur"][data-stage="3"]::before { opacity: 0.3; }
.image-wrap[data-reveal="deblur"][data-stage="4"]::before,
.image-wrap[data-reveal="deblur"][data-stage="5"]::before { opacity: 0; }

.image-wrap[data-reveal="zoom"] img {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}
.image-wrap[data-reveal="zoom"][data-stage="1"] img { transform: scale(10); }
.image-wrap[data-reveal="zoom"][data-stage="2"] img { transform: scale(5); }
.image-wrap[data-reveal="zoom"][data-stage="3"] img { transform: scale(2); }
.image-wrap[data-reveal="zoom"][data-stage="4"] img,
.image-wrap[data-reveal="zoom"][data-stage="5"] img { transform: scale(1); }

.image-wrap[data-reveal="zoom"]::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 70% at 50% 50%, transparent 25%, rgba(0,0,0,0.65) 100%);
  transition: opacity 0.6s ease;
}
.image-wrap[data-reveal="zoom"][data-stage="1"]::before { opacity: 0.85; }
.image-wrap[data-reveal="zoom"][data-stage="2"]::before { opacity: 0.5; }
.image-wrap[data-reveal="zoom"][data-stage="3"]::before { opacity: 0.2; }
.image-wrap[data-reveal="zoom"][data-stage="4"]::before,
.image-wrap[data-reveal="zoom"][data-stage="5"]::before { opacity: 0; }

.image-wrap[data-reveal="spotlight"] {
  --spot-r: 60px;
  --spot-feather: 90px;
  transition: --spot-r 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.image-wrap[data-reveal="spotlight"][data-stage="1"] { --spot-r: 0px; }
.image-wrap[data-reveal="spotlight"][data-stage="2"] { --spot-r: 120px; }
.image-wrap[data-reveal="spotlight"][data-stage="3"] { --spot-r: 260px; }
.image-wrap[data-reveal="spotlight"][data-stage="4"],
.image-wrap[data-reveal="spotlight"][data-stage="5"] { --spot-r: 900px; }

.image-wrap[data-reveal="spotlight"] img {
  -webkit-mask-image: radial-gradient(circle at center, black 0%, black var(--spot-r), transparent calc(var(--spot-r) + var(--spot-feather)));
  mask-image: radial-gradient(circle at center, black 0%, black var(--spot-r), transparent calc(var(--spot-r) + var(--spot-feather)));
}
.image-wrap[data-reveal="spotlight"]::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at center,
      transparent 0%,
      transparent calc(var(--spot-r) - 4px),
      rgba(245, 183, 0, 0.15) calc(var(--spot-r) + var(--spot-feather) * 0.2),
      rgba(0, 0, 0, 0.5) 100%);
}

/* TILE reveal */
.tile-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  z-index: 2;
  pointer-events: none;
  perspective: 1200px;
  perspective-origin: 50% 50%;
}
.tile-overlay.hidden { display: none; }
.tile {
  background: linear-gradient(135deg, #0F0F1E, #1F1F35 60%, #0F0F1E);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 -1px 0 rgba(0,0,0,0.4);
  transform-origin: center;
  transition:
    opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.65s cubic-bezier(0.5, 0, 0.2, 1),
    filter 0.5s ease;
  backface-visibility: hidden;
}
.tile.removed {
  opacity: 0;
  transform: rotateY(80deg) scale(0.88);
  filter: brightness(1.5);
}
.tile:nth-child(7n+1).removed { transition-delay: 0.00s; }
.tile:nth-child(7n+2).removed { transition-delay: 0.10s; }
.tile:nth-child(7n+3).removed { transition-delay: 0.22s; }
.tile:nth-child(7n+4).removed { transition-delay: 0.05s; }
.tile:nth-child(7n+5).removed { transition-delay: 0.16s; }
.tile:nth-child(7n+6).removed { transition-delay: 0.28s; }
.tile:nth-child(7n).removed   { transition-delay: 0.08s; }

/* ─── Timer bar ─── */

.timer-bar {
  height: 6px;
  background: var(--hairline);
  position: relative;
  border-radius: 3px;
  overflow: visible;
}
.timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-hot) 100%);
  border-radius: inherit;
  box-shadow: 0 0 6px rgba(245, 183, 0, 0.4);
  transform-origin: left;
}
.timer-bar::before,
.timer-bar::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 12px;
  background: var(--gold);
  top: -4px;
}
.timer-bar::before { left: 0; }
.timer-bar::after  { right: 0; }

.bonus-timer .timer-fill {
  background: linear-gradient(90deg, var(--magenta) 0%, var(--magenta-hot) 100%);
  box-shadow: 0 0 6px rgba(232, 37, 106, 0.4);
}
.bonus-timer::before,
.bonus-timer::after { background: var(--magenta); }

/* ─── Question + choices ─── */

.round-question {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: var(--chrome);
  margin: 4px 0;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.choice {
  --c-bg: var(--answer-a-bg);
  --c-fg: var(--answer-a-fg);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 26px;
  background: var(--c-bg);
  color: var(--c-fg);
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 1.9vw, 2.2rem);
  letter-spacing: 0.03em;
  position: relative;
  box-shadow: 0 6px 22px color-mix(in srgb, var(--c-bg) 38%, transparent);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.choice-a { --c-bg: var(--answer-a-bg); --c-fg: var(--answer-a-fg); }
.choice-b { --c-bg: var(--answer-b-bg); --c-fg: var(--answer-b-fg); }
.choice-c { --c-bg: var(--answer-c-bg); --c-fg: var(--answer-c-fg); }
.choice-d { --c-bg: var(--answer-d-bg); --c-fg: var(--answer-d-fg); }

.choice .badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.20);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  flex-shrink: 0;
  border: none;
}
.choice .text { flex: 1; }
.choice .lock-count {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  opacity: 0.75;
  padding: 3px 7px;
  background: rgba(0, 0, 0, 0.16);
  border-radius: 3px;
}

/* ─── Input kit ─── */

.answer-kit {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 22px 26px;
  background: var(--stage-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.answer-kit.hidden { display: none; }
.answer-kit-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.kit-prompt {
  margin: 0;
  font-style: italic;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  color: var(--ink-soft);
}

.kit-typebar {
  height: 52px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(245, 183, 0, 0.2);
  display: flex;
  align-items: center;
  padding: 0 16px;
}
.kit-caret {
  width: 2px;
  height: 26px;
  background: var(--gold);
  border-radius: 2px;
  animation: kit-caret-blink 1.1s step-end infinite;
}
@keyframes kit-caret-blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

.kit-scale { display: flex; flex-direction: column; gap: 10px; }
.kit-scale-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-hot) 100%);
  opacity: 0.85;
}
.kit-scale-ends {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.kit-end {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  letter-spacing: 0.02em;
  color: var(--chrome);
}
.kit-unit {
  font-family: var(--font-mono);
  font-size: 0.5em;
  color: var(--gold);
  margin-left: 2px;
}

.answered-line {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.answered-count {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.answered-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ============================================================
   SIDEBAR — live standings
   ============================================================ */

.game-side {
  background: rgba(14, 26, 56, 0.60);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.game-side .eyebrow { color: var(--gold); }

.leaderboard {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: standing;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-variant-numeric: tabular-nums;
}
.leaderboard li {
  counter-increment: standing;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--hairline);
  will-change: transform;
  transition: background 0.3s ease;
}
.leaderboard li:last-child { border-bottom: none; }
.leaderboard .rank {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}
.leaderboard li:first-child .rank { color: var(--gold); }
.leaderboard .name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  color: var(--chrome);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leaderboard .score {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--gold);
}
.leaderboard li.score-changed {
  animation: score-pulse 0.9s ease-out;
}
@keyframes score-pulse {
  0%   { background: rgba(245, 183, 0, 0.16); }
  100% { background: transparent; }
}
.leaderboard .eligible-mark {
  display: inline-block;
  margin-left: 6px;
  font-weight: 700;
  color: var(--magenta);
  font-family: var(--font-mono);
}

/* ============================================================
   REVEAL PANE
   ============================================================ */

.reveal-pane {
  gap: 20px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 16px 8px;
}
.reveal-pane .eyebrow {
  font-size: 0.9rem;
  letter-spacing: 0.28em;
  color: var(--gold);
}
.reveal-correct {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 7.5vw, 6rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--chrome);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.reveal-correct em {
  font-family: var(--font-sans);
  font-style: italic;
  font-weight: 400;
  font-size: 0.22em;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-shadow: none;
}
.reveal-correct strong { color: var(--gold); }
.reveal-correct .word-dot { color: var(--magenta); }

.reveal-pane .divider { width: 100%; margin-top: 10px; }

.reveal-results {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 700px;
  align-self: center;
  text-align: left;
}
.reveal-results .result {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  align-items: baseline;
  gap: 16px;
  padding: 13px 4px;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--hairline);
}
.reveal-results .result:last-child { border-bottom: none; }
.reveal-results .result .mark {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--ink-dim);
}
.reveal-results .result.correct .mark { color: var(--correct); }
.reveal-results .result.wrong   .mark { color: var(--wrong); }
.reveal-results .result.answered .mark {
  color: var(--gold);
  font-size: 1.1rem;
}
.reveal-results .result .name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  color: var(--chrome);
}
.reveal-results .result .delta {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.reveal-results .result .total {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  min-width: 76px;
  text-align: right;
  color: var(--gold);
}
.reveal-results .result.spectator { opacity: 0.42; }
.reveal-results .result.spectator .mark  { color: var(--ink-dim); }
.reveal-results .result.spectator .total { color: var(--ink-soft); }

/* ============================================================
   BONUS PANE
   ============================================================ */

.bonus-pane { gap: 22px; }
.bonus-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.bonus-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--magenta);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
}
.bonus-star { color: var(--gold); }
.bonus-points {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--gold);
  letter-spacing: 0.04em;
}

/* ============================================================
   FINAL — podium
   ============================================================ */

.final-surface {
  gap: 28px;
  justify-content: center;
}
.final-header { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; }
.final-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: var(--chrome);
}
.final-title::after {
  content: '';
  display: inline-block;
  width: 0.28em; height: 0.28em;
  background: var(--magenta);
  border-radius: 50%;
  margin-left: 0.12em;
  vertical-align: 0.12em;
}

.podium {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  align-items: end;
  gap: 12px;
  padding: 4px 0 2px;
}
.podium-seat {
  background: var(--stage-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  box-shadow: 0 14px 36px -14px rgba(0,0,0,0.6);
}
.podium-seat.empty { opacity: 0.35; }
.seat-first  { min-height: 195px; }
.seat-second { min-height: 155px; }
.seat-third  { min-height: 130px; }
.seat-first {
  border-color: var(--gold);
  box-shadow:
    0 0 0 1px rgba(245, 183, 0, 0.25),
    0 20px 56px -10px rgba(245, 183, 0, 0.25),
    0 20px 56px -14px rgba(0,0,0,0.7);
}
.podium-rank {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.seat-first .podium-rank { color: var(--gold); }
.podium-name {
  font-family: var(--font-display);
  font-size: 1.85rem;
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--chrome);
}
.seat-first .podium-name {
  font-size: 2.8rem;
  color: var(--gold);
}
.podium-score {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--gold);
  margin-top: auto;
  letter-spacing: 0.04em;
}
.seat-first .podium-score {
  font-size: 2rem;
  color: var(--chrome);
}

.final-grid { display: block; }
.final-awards-col { display: none; }
.final-standings-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.final-standings-col .eyebrow { color: var(--gold); }
.final-standings {
  display: block;
  columns: 240px;
  column-gap: 48px;
  font-size: 1rem;
}
.final-standings li {
  break-inside: avoid;
  padding: 9px 6px;
}

.awards { display: flex; flex-direction: column; gap: 14px; }
.award {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}
.award:last-child { border-bottom: none; }
.award-title {
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  grid-row: 1 / 3;
  align-self: center;
  min-width: 180px;
}
.award-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.03em;
  color: var(--gold);
}
.award-desc {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
}
.awards h3 { display: none; }

.final-actions { display: flex; justify-content: center; gap: 16px; }
.final-actions .primary { font-size: 1.25rem; padding: 18px 36px; }

/* ─── Lobby logo ─── */
.lobby-logo {
  display: block;
  max-height: 64px;
  max-width: 240px;
  object-fit: contain;
  margin-bottom: 12px;
}
.lobby-logo[hidden] { display: none; }

/* When logo is visible, compact wordmark + room-code to prevent overflow */
.lobby-info-card:has(.lobby-logo:not([hidden])) {
  gap: 12px;
}
.lobby-info-card:has(.lobby-logo:not([hidden])) .wordmark-title {
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
}
.lobby-info-card:has(.lobby-logo:not([hidden])) .room-code {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

/* ─── Draw canvas stimulus ─── */
.draw-canvas {
  width: 100%;
  flex: 1;
  min-height: 0;
  aspect-ratio: 4 / 3;
  max-height: 60vh;
  border-radius: var(--radius);
  background: var(--stage-card);
  box-shadow: 0 0 0 1px var(--hairline), 0 16px 40px -14px rgba(0,0,0,0.7);
}
.draw-canvas[hidden] { display: none; }

/* ─── Text stimulus panel ─── */
.text-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2.5rem;
  gap: 1.25rem;
  border-radius: var(--radius);
  background: rgba(10, 20, 46, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 48px -14px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
}
.text-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 48%, rgba(30, 100, 220, 0.18) 0%, transparent 70%);
  pointer-events: none;
}
.text-panel[hidden] { display: none; }
.text-panel-meta {
  font-size: 0.78rem;
  opacity: 0.45;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-family: var(--font-mono);
  margin: 0;
  position: relative;
}
.text-panel-question {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.5vw, 4.2rem);
  font-weight: 400;
  text-align: center;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--chrome);
  margin: 0;
  max-width: 24ch;
  text-wrap: balance;
  position: relative;
  text-shadow: 0 2px 32px rgba(60, 140, 255, 0.25);
}

/* ── Countdown overlay ──────────────────────────────────────── */
.countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy, #0b0e1a);
}

.countdown-overlay.hidden { display: none; }

.countdown-number {
  font-family: 'Anton', sans-serif;
  font-size: 40vw;
  line-height: 1;
  color: var(--magenta, #e91e8c);
  text-shadow: 0 0 60px color-mix(in srgb, var(--magenta, #e91e8c) 50%, transparent);
  animation: none;
}

.countdown-number.punch {
  animation: countdown-punch 0.15s ease-out forwards;
}

.countdown-number.go {
  font-size: 10vw;
  letter-spacing: 0.04em;
}

@keyframes countdown-punch {
  0%   { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
