/* Quizify prototype design tokens + components.
   Direction: "TV studio, not terminal" — keep legacy's dark game-show
   identity (near-black stage, electric blue + gold, glow, big type),
   modernized: intentional spacing, one accent system, no noise. */

:root {
  --bg-stage: #07090f;
  --bg-deep: #0a0e18;
  --bg-panel: #101627;
  --bg-raised: #161e33;
  --line: #22304f;
  --line-soft: #182338;

  /* Text tiers — all three clear WCAG AAA (>=7:1) on the panel/raised
     backgrounds for normal-size text (audited 2026-06-14). */
  --text: #e8edf8;     /* >=14:1 everywhere */
  --text-dim: #b8c4db; /* secondary — ~10:1 on panels */
  --text-faint: #9eadce; /* faintest readable tier — ~7.4:1 on raised */

  --blue: #4da3ff;
  --gold: #f5c542;
  --pink: #ff5fa2;
  --teal: #2fd6a3;
  --green: #1ed760;       /* playback affordances only */
  --danger: #ff4d5e;
  --purple: #b07cff;

  --glow-blue: 0 0 18px rgba(77, 163, 255, 0.45);
  --glow-gold: 0 0 22px rgba(245, 197, 66, 0.4);

  --radius: 14px;
  --radius-sm: 9px;

  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-stage);
  color: var(--text);
  font-family: var(--font);
}

body {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(77, 163, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at 85% 110%, rgba(176, 124, 255, 0.07), transparent 60%),
    var(--bg-stage);
}

h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: 0.02em; }

/* --- brand ----------------------------------------------------------- */

.wordmark {
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.wordmark .q { color: var(--gold); }
.wordmark .rest { color: var(--text); }
.wordmark .sub {
  display: block;
  font-size: max(11px, 0.32em); /* never shrink below a readable 11px */
  letter-spacing: 0.5em;
  color: var(--blue);
  text-shadow: var(--glow-blue);
  margin-top: 0.4em;
}

/* --- layout ----------------------------------------------------------- */

.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(12px, 2.5vw, 36px);
  gap: clamp(10px, 2vh, 24px);
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.stage-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vh, 32px);
  text-align: center;
}

.panel {
  background: linear-gradient(180deg, var(--bg-raised), var(--bg-panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }

/* --- chips / badges ----------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 14px;
}
.chip .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--chip-color, var(--blue));
  box-shadow: 0 0 8px var(--chip-color, var(--blue));
}
.chip.active { border-color: var(--gold); box-shadow: var(--glow-gold); }
.chip.qm { border-color: var(--purple); }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.badge.gold { color: #100c02; background: var(--gold); border-color: var(--gold); }
.badge.blue { color: #06121f; background: var(--blue); border-color: var(--blue); }
.badge.pink { color: #1f0612; background: var(--pink); border-color: var(--pink); }
.badge.outline-danger { color: var(--danger); border-color: var(--danger); }
.badge.outline-teal { color: var(--teal); border-color: var(--teal); }
.badge.outline-gold { color: var(--gold); border-color: var(--gold); }

/* --- buttons ----------------------------------------------------------- */

.btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 12px 20px;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn.primary { background: var(--blue); border-color: var(--blue); color: #06121f; box-shadow: var(--glow-blue); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #181203; box-shadow: var(--glow-gold); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.green { background: var(--green); border-color: var(--green); color: #04240f; }
.btn.ghost { background: transparent; }

.btn.huge {
  width: 100%;
  padding: 28px;
  font-size: clamp(20px, 6vw, 30px);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: var(--radius);
}

/* --- forms ----------------------------------------------------------- */

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
}
/* Default browser placeholders sit at ~50% opacity, which halves contrast.
   Pin them to the faint tier at full opacity (AAA on the input bg). */
::placeholder { color: var(--text-faint); opacity: 1; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); border-color: var(--blue); }

/* Phone-style sliding toggle — used everywhere instead of a checkbox for
   on/off settings (clearer + more intuitive than a tick box). */
input.switch {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; padding: 0;
  width: 48px; height: 28px; border-radius: 999px;
  background: var(--line); border: 1px solid var(--line); position: relative; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
input.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: #f4f7ff; box-shadow: 0 1px 3px rgba(0,0,0,0.4); transition: transform 0.16s ease;
}
input.switch:checked { background: var(--green); border-color: var(--green); }
input.switch:checked::after { transform: translateX(20px); }
input.switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* −/+ stepper (replaces the native number spinner) */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper-btn { background: var(--bg-raised); border: none; color: var(--gold); font-size: 20px; font-weight: 800; width: 40px; height: 38px; cursor: pointer; line-height: 1; }
.stepper-btn:hover { background: var(--bg-panel); }
.stepper-val { min-width: 64px; text-align: center; font-weight: 800; font-size: 16px; padding: 0 6px; }
input.code {
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-weight: 800;
  text-align: center;
}

/* --- big board typography ----------------------------------------------- */

.board-kicker {
  font-size: clamp(14px, 1.8vw, 22px);
  font-weight: 800;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--blue);
  text-shadow: var(--glow-blue);
}

.board-title {
  font-size: clamp(34px, 7vw, 110px);
  font-weight: 900;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.board-title.gold { color: var(--gold); text-shadow: var(--glow-gold); }

.board-sub { font-size: clamp(20px, 3vw, 46px); color: var(--text-dim); font-weight: 600; }

.room-code {
  font-size: clamp(40px, 9vw, 120px);
  font-weight: 900;
  letter-spacing: 0.35em;
  padding-left: 0.35em; /* visually center the letterspacing */
  color: var(--gold);
  text-shadow: var(--glow-gold);
}

/* --- Hittavlen two-step lobby (board) -------------------------------- */

.lobby-two-step {
  display: grid;
  gap: clamp(18px, 4vh, 46px);
  justify-items: center;
  margin-top: clamp(10px, 2vh, 24px);
}
.lobby-step { display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 1.6vh, 18px); }
.qr-box { background: #fff; border-radius: 16px; padding: clamp(10px, 1vw, 16px); line-height: 0; align-self: center; max-width: 80vw; }
.qr-box img { display: block; max-width: 100%; height: auto; aspect-ratio: 1; }
.qm-foldable {
  border: 1px solid var(--teal); border-radius: 14px;
  padding: 10px 18px; color: var(--teal); text-align: center;
}
.qm-foldable > summary { cursor: pointer; font-weight: 800; font-size: clamp(15px, 1.6vw, 22px); list-style: none; }
.qm-foldable > summary::-webkit-details-marker { display: none; }
.qm-foldable-body { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 14px; }

/* --- wheel ----------------------------------------------------------- */

.wheel-wrap { position: relative; width: min(46vh, 80vw); aspect-ratio: 1; }
.wheel {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 6px solid var(--line);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.6), var(--glow-blue);
  transition: transform 2.4s cubic-bezier(0.12, 0.8, 0.16, 1);
}
.wheel-pointer {
  position: absolute;
  top: -18px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 26px solid var(--gold);
  filter: drop-shadow(0 0 8px rgba(245,197,66,0.7));
  z-index: 2;
}
.wheel-labels { position: absolute; inset: 0; }
.wheel-labels span {
  position: absolute;
  top: 50%; left: 50%;
  font-weight: 800;
  font-size: clamp(12px, 2.4vh, 22px);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
  white-space: nowrap;
}

/* --- listening visualizer ------------------------------------------------ */

.viz { display: flex; align-items: flex-end; gap: clamp(10px, 1.4vw, 22px); height: clamp(120px, 30vh, 360px); }
.viz span {
  width: clamp(12px, 2.4vw, 34px);
  background: linear-gradient(180deg, var(--blue), var(--purple));
  border-radius: 4px;
  animation: vizbar 1s ease-in-out infinite;
  box-shadow: var(--glow-blue);
}
@keyframes vizbar {
  0%, 100% { height: 18%; }
  50% { height: var(--peak, 90%); }
}

/* --- reveal card ----------------------------------------------------- */

.reveal-card {
  display: flex;
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  text-align: left;
  background: linear-gradient(180deg, var(--bg-raised), var(--bg-panel));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(24px, 3.5vw, 60px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
  animation: cardin 0.5s cubic-bezier(0.2, 1.2, 0.3, 1);
  max-width: 90vw;
}
@keyframes cardin {
  from { transform: translateY(26px) scale(0.94); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.artwork {
  width: clamp(240px, 44vh, 600px);
  aspect-ratio: 1;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--art-a, #1c2742), var(--art-b, #4da3ff));
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  position: relative;
  flex: none;
}
.artwork::after {
  content: "♪";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: clamp(40px, 8vh, 90px);
  color: rgba(255,255,255,0.85);
  text-shadow: 0 4px 18px rgba(0,0,0,0.6);
}
.reveal-meta .title { font-size: clamp(34px, 5.5vw, 92px); font-weight: 900; }
.reveal-meta .artist { font-size: clamp(24px, 3.6vw, 58px); color: var(--gold); font-weight: 800; }
.reveal-meta .detail { font-size: clamp(18px, 2.4vw, 36px); color: var(--text-dim); margin-top: 10px; }
.reveal-meta .accept { font-size: clamp(12px, 1.4vw, 18px); color: var(--text-faint); margin-top: 12px; }
.reveal-meta .asked {
  display: inline-block;
  color: var(--gold);
  text-shadow: var(--glow-gold);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 2px 14px;
  box-shadow: 0 0 18px rgba(245,197,66,0.32), inset 0 0 14px rgba(245,197,66,0.08);
}
.reveal-meta .reveal-prompt {
  font-size: clamp(18px, 2.4vw, 38px); font-weight: 800; color: var(--blue);
  text-shadow: var(--glow-blue); margin-bottom: clamp(8px, 1.4vh, 20px);
}

/* --- progression board ---------------------------------------------------- */

.prog { width: 100%; max-width: 1300px; border-collapse: separate; border-spacing: 6px; }
.prog th {
  font-size: clamp(12px, 1.6vw, 20px);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  padding: 6px 10px;
  font-weight: 800;
}
.prog td { background: var(--bg-panel); border: 1px solid var(--line-soft); border-radius: 12px; padding: clamp(6px, 1vh, 14px) 12px; }
.prog td.player-cell { text-align: left; border-color: var(--line); }
.prog .player-name { font-weight: 800; font-size: clamp(14px, 1.8vw, 24px); display: flex; align-items: center; gap: 10px; }
.prog tr.active-row td { border-color: rgba(245, 197, 66, 0.55); }

.pips { display: flex; gap: clamp(3px, 0.6vw, 8px); justify-content: center; align-items: center; }
.pips i {
  width: clamp(8px, 1.4vw, 16px);
  height: clamp(8px, 1.4vw, 16px);
  border-radius: 50%;
  background: var(--bg-deep);
  border: 1px solid var(--line);
}
.pips i.on { background: var(--p-color, var(--blue)); border-color: transparent; box-shadow: 0 0 8px var(--p-color, var(--blue)); }
.pips .crown { font-size: clamp(14px, 2vw, 24px); line-height: 1; filter: drop-shadow(0 0 6px rgba(245,197,66,0.8)); }

/* --- disks ----------------------------------------------------------- */

/* Generic disk tokens (donut shape = reads clearly as a disk/token). */
.disks { display: inline-flex; align-items: center; gap: clamp(6px, 0.8vw, 10px); }
.disks-label {
  font-size: clamp(13px, 1.1vw, 16px); font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-faint); margin-right: 4px;
}
/* A disk is a disk: the SAME coin graphic in the overview and on the buttons
   (.disc-coin), just bigger here and without the action emoji. */
.disk-token {
  width: clamp(22px, 2vw, 32px); height: clamp(22px, 2vw, 32px); border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.28);
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,0.6), transparent 55%),
    conic-gradient(from 220deg, var(--gold), #b8801b, var(--gold));
  box-shadow: 0 0 8px rgba(245,197,66,0.5), inset 0 0 6px rgba(0,0,0,0.45);
}
.disk-token.spent {
  background: radial-gradient(circle at center, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  box-shadow: none; border-color: var(--line); opacity: 0.5;
}

/* Board progression: a touch larger + clearer, sits after the name. */
.prog .disks { margin-left: 10px; gap: 5px; }
.prog .disks-label { font-size: clamp(9px, 0.8vw, 13px); }
.prog .disk-token { width: clamp(14px, 1.3vw, 20px); height: clamp(14px, 1.3vw, 20px); }

/* --- banners ----------------------------------------------------------- */

.banner {
  font-size: clamp(20px, 3.6vw, 48px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 14px 34px;
  border-radius: 999px;
  border: 2px solid var(--gold);
  color: var(--gold);
  text-shadow: var(--glow-gold);
  animation: pulse 1.6s ease-in-out infinite;
}
.banner.duel { border-color: var(--danger); color: var(--danger); text-shadow: 0 0 18px rgba(255,77,94,0.6); }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

/* --- spin result (both wheels, unmissable) -------------------------------- */

.spin-result {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 44px);
  flex-wrap: wrap;
  justify-content: center;
}
.spin-result-cell { text-align: center; }
.spin-result-divider {
  font-size: clamp(30px, 4vw, 60px);
  font-weight: 900;
  color: var(--text-faint);
}

/* --- jeopardy board ----------------------------------------------------- */

/* Optional-feature opt-in cards (Daily Double, Final Jeopardy) — deliberate
   choices, off by default, highlighted when active. */
.feature-toggle {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  padding: 14px 16px; border-radius: 14px;
  background: var(--bg-raised); border: 1px solid var(--line);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.feature-toggle:hover { border-color: var(--gold); }
.feature-toggle.on {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(245,197,66,0.1), rgba(255,255,255,0.02));
  box-shadow: inset 0 0 0 1px rgba(245,197,66,0.25);
}
.ft-icon { font-size: 22px; line-height: 1.2; flex-shrink: 0; }
.ft-text { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.ft-title-row { display: flex; align-items: center; gap: 10px; }
.ft-title { font-weight: 800; font-size: 15px; }
.ft-state {
  font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; color: var(--text-faint);
  border: 1px solid var(--line);
}
.ft-state.on { color: #100c02; background: var(--gold); border-color: var(--gold); }
.ft-adds { font-size: 13px; color: var(--text-faint); line-height: 1.45; }
.feature-toggle .switch { flex-shrink: 0; margin-top: 2px; }

.jeopardy-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: clamp(6px, 0.8vw, 12px);
  width: min(92vw, 1300px);
}
.jeopardy-cat {
  background: linear-gradient(180deg, var(--bg-raised), var(--bg-panel));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(8px, 1.4vh, 18px) 6px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(13px, 1.6vw, 24px);
  color: var(--blue);
  text-shadow: var(--glow-blue);
  text-align: center;
}
.jeopardy-cell {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2.2vh, 26px) 6px;
  font-weight: 900;
  font-size: clamp(18px, 2.6vw, 40px);
  color: var(--gold);
  text-shadow: var(--glow-gold);
}
.jeopardy-cell.used { opacity: 0.18; color: var(--text-faint); text-shadow: none; }
.jeopardy-cell.current {
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
  animation: pulse 1.4s ease-in-out infinite;
}

.jeopardy-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.jeopardy-pick .btn { padding: 14px 8px; font-size: 15px; }
.jeopardy-pick .btn.dd { border-color: var(--gold); color: var(--gold); }

/* Text / image clue display on the TV board */
.jp-clue {
  font-size: clamp(22px, 3.4vw, 46px); font-weight: 800; line-height: 1.25;
  text-align: center; max-width: 18ch; margin: 0 auto; color: var(--text);
}
img.jp-image {
  max-height: clamp(160px, 40vh, 420px); max-width: min(90vw, 640px);
  border-radius: 14px; border: 1px solid var(--line); object-fit: contain;
}

/* Create-quiz mode cards */
.mode-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; color: var(--text);
}
.mode-card:hover { border-color: var(--line-bright, #3a4660); }
.mode-card.on { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.mode-card .mode-radio {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--text-faint);
  flex: none; position: relative;
}
.mode-card.on .mode-radio { border-color: var(--teal); }
.mode-card.on .mode-radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--teal);
}
.field-label { font-size: 13px; font-weight: 700; }

img.artwork { object-fit: cover; }
img.artwork::after { content: none; }

/* --- mobile app frame (player/host) -------------------------------------- */

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 14px;
}
.app-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.app-main { flex: 1; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.split { justify-content: space-between; }
.grow { flex: 1; }

.status-line {
  text-align: center;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 17px;
  padding: 10px;
}

.toast {
  position: fixed;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; }

.connection {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.connection.ok { color: var(--teal); }
.connection.down { color: var(--danger); }

/* --- admin (neutral, not show-themed) ------------------------------------ */

.admin {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 80px;
  font-size: 15px;
}
.admin h1 { font-size: 26px; }
.admin table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.admin th { text-align: left; color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.admin td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.admin .sub { color: var(--text-faint); font-size: 13px; }
.admin input.year { width: 84px; }
.tabs { display: flex; gap: 8px; margin: 18px 0; }
.tabs .btn.on { background: var(--blue); border-color: var(--blue); color: #06121f; }

/* --- debug harness ----------------------------------------------------- */

.harness { display: grid; gap: 10px; padding: 10px; grid-template-columns: repeat(5, 1fr); height: 100vh; }
.harness .board-frame { grid-column: 1 / -1; height: 52vh; }
.harness iframe { width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-stage); }
.harness .frame-cell { display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.harness .frame-cell label { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }

/* --- celebration / confetti --------------------------------------------- */

.confetti {
  position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1;
}
.confetti i {
  position: absolute; top: -12vh;
  width: 11px; height: 16px; border-radius: 2px;
  background: var(--c, var(--gold));
  opacity: 0.9;
  animation: confetti-fall var(--dur, 3.2s) linear var(--delay, 0s) infinite;
}
@keyframes confetti-fall {
  0% { transform: translateY(-12vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.95; }
  100% { transform: translateY(112vh) rotate(720deg); opacity: 0.9; }
}

.celebrate {
  position: relative; z-index: 2;
  animation: celebrate-pop 0.8s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}
@keyframes celebrate-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

.trophy {
  font-size: clamp(70px, 14vh, 180px);
  filter: drop-shadow(0 0 30px rgba(245, 197, 66, 0.7));
  animation: trophy-bob 2.2s ease-in-out infinite;
}
@keyframes trophy-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14px) rotate(4deg); }
}

.master-name {
  font-size: clamp(48px, 11vw, 170px);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(245, 197, 66, 0.6);
  line-height: 1;
}
.master-title {
  font-size: clamp(20px, 3.2vw, 44px);
  font-weight: 900;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  border: 3px solid var(--gold);
  border-radius: 999px;
  padding: 12px 40px;
  text-shadow: var(--glow-gold);
  box-shadow: var(--glow-gold), inset 0 0 30px rgba(245,197,66,0.12);
  animation: pulse 1.6s ease-in-out infinite;
}

/* Finalist face-off cards for the finale screens. */
.finalist-vs { display: flex; align-items: center; gap: clamp(14px, 4vw, 60px); justify-content: center; flex-wrap: wrap; }
.finalist-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: clamp(14px, 2.5vw, 32px) clamp(20px, 4vw, 56px);
  border-radius: 20px;
  border: 2px solid var(--fc, var(--blue));
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
  box-shadow: 0 0 28px var(--fc, var(--blue));
  animation: celebrate-pop 0.7s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}
.finalist-card .fname { font-size: clamp(26px, 4vw, 60px); font-weight: 900; color: var(--fc); text-shadow: 0 0 18px var(--fc); }
.finalist-card .fcrown { font-size: clamp(22px, 3vw, 40px); }
.vs-mark { font-size: clamp(28px, 4vw, 64px); font-weight: 900; color: var(--text-faint); }

@media (prefers-reduced-motion: reduce) {
  .wheel { transition-duration: 0.4s; }
  .banner, .viz span, .trophy, .master-title, .confetti i, .celebrate, .finalist-card { animation: none; }
  .confetti { display: none; }
  .disc-btn:hover .disc-coin { animation: none; }
}

/* === Board menu + host control bar (host device becomes the board) ======== */
.board-menu { gap: 8px; align-items: center; }
.board-menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; text-decoration: none;
  background: var(--bg-raised); border: 1px solid var(--line); color: var(--text-dim);
  font-size: 18px; cursor: pointer;
}
.board-menu-btn:hover { color: var(--text); border-color: var(--teal); }

.board-control {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: linear-gradient(180deg, rgba(8,12,24,0.78), rgba(6,9,18,0.97));
  border-top: 1px solid var(--gold); backdrop-filter: blur(8px);
  max-height: 48vh; overflow-y: auto;
  box-shadow: 0 -10px 34px rgba(0,0,0,0.5);
}
.board-control-inner {
  max-width: 780px; margin: 0 auto;
  padding: 14px clamp(12px,3vw,28px) calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 10px;
}
body.has-control #root.stage { padding-bottom: clamp(130px, 28vh, 340px); }

/* === Game-like disc actions (player) ===================================== */
.disc-btn {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 12px 16px; border-radius: 16px; cursor: pointer; text-align: left;
  color: var(--text); border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  transition: transform 0.08s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.disc-btn:hover { border-color: var(--gold); box-shadow: 0 0 18px rgba(245,197,66,0.22); }
.disc-btn:active { transform: scale(0.97); }
.disc-coin {
  flex: none; width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; font-size: 24px;
  border: 2px solid rgba(255,255,255,0.28);
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,0.55), transparent 55%),
    conic-gradient(from 220deg, var(--gold), #b8801b, var(--gold));
  box-shadow: 0 0 14px rgba(245,197,66,0.5), inset 0 0 9px rgba(0,0,0,0.45);
}
.disc-btn:hover .disc-coin { animation: disc-spin 0.85s ease; }
@keyframes disc-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.disc-text { display: flex; flex-direction: column; gap: 2px; }
.disc-label { font-weight: 800; font-size: 17px; }
.disc-hint { font-size: 12px; color: var(--text-dim); }
.disc-throw {
  border-color: rgba(255,95,162,0.5);
  background: linear-gradient(135deg, rgba(255,95,162,0.18), rgba(255,255,255,0.02));
}
.disc-throw:hover { box-shadow: 0 0 20px rgba(255,95,162,0.3); }
.disc-throw .disc-coin {
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,0.55), transparent 55%),
    conic-gradient(from 220deg, #ff5fa2, #a31457, #ff5fa2);
  box-shadow: 0 0 16px rgba(255,95,162,0.55), inset 0 0 9px rgba(0,0,0,0.45);
}

/* === Rejoin seat buttons (play join screen) ============================== */
.seat-claim { display: flex; align-items: center; gap: 10px; justify-content: flex-start; }
.seat-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }

/* === Board listening: big decade + the question being asked ============== */
.board-decade {
  font-size: clamp(44px, 9vw, 150px); font-weight: 900; letter-spacing: 0.04em;
  line-height: 1.02; color: var(--blue); text-shadow: var(--glow-blue);
}
.board-ask { font-size: clamp(20px, 3.2vw, 50px); color: var(--text-dim); font-weight: 700; }
.board-ask b { color: var(--text); }

/* === Reveal: labelled metadata, only the asked field gold-framed ========= */
.reveal-meta .meta-row {
  display: flex; align-items: baseline; gap: clamp(10px, 1.4vw, 22px);
  font-size: clamp(22px, 3vw, 48px); font-weight: 800; line-height: 1.35;
  margin: clamp(3px, 0.6vh, 10px) 0;
}
.reveal-meta .meta-label {
  color: var(--text-faint); font-weight: 800; flex: none;
  min-width: clamp(86px, 9vw, 168px);
  font-size: 0.56em; text-transform: uppercase; letter-spacing: 0.09em;
}
.reveal-meta .meta-val { color: var(--text); }

/* === Prominent disk status (player views) ================================ */
.disk-banner {
  display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2vw, 18px);
  padding: 12px 18px; border-radius: 14px; align-self: center;
  background: linear-gradient(135deg, rgba(245,197,66,0.1), rgba(255,255,255,0.02));
  border: 1px solid rgba(245,197,66,0.3);
}
.disk-banner-label { font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.disk-banner-coins { display: inline-flex; gap: 8px; }
.disk-banner .disk-token { width: clamp(28px, 5vw, 38px); height: clamp(28px, 5vw, 38px); }
.disk-banner-count { font-size: clamp(15px, 2vw, 18px); font-weight: 800; color: var(--gold); }

/* Lobby waiting screen on the phone — reassure the player they're in the right
   room and the game just hasn't started. Room code is the hero. */
.wait-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin: auto; padding: clamp(20px, 6vw, 32px) clamp(24px, 8vw, 40px);
  border-radius: 22px; text-align: center;
  background: linear-gradient(160deg, rgba(245,197,66,0.08), rgba(255,255,255,0.02));
  border: 1px solid rgba(245,197,66,0.28);
}
.wait-badge {
  font-size: 14px; font-weight: 800; letter-spacing: 0.08em;
  color: var(--teal); text-transform: uppercase;
}
.wait-code-label {
  font-size: 13px; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-faint); margin-top: 8px;
}
.wait-code {
  font-size: clamp(54px, 18vw, 88px); font-weight: 900; line-height: 1;
  letter-spacing: 0.06em; color: var(--gold); text-shadow: var(--glow-gold);
}
.wait-status { font-size: clamp(14px, 3.6vw, 17px); color: var(--text-faint); margin-top: 10px; }
