/* QNI — design tokens and base styles. Mobile-first, large text, light + dark. */

:root {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #ebe8e0;
  --text: #16211f;
  --muted: #5a6764;
  --border: #d6d2c8;
  --accent: #0b6b5c;       /* QNI teal */
  --accent-strong: #084f44;
  --accent-ink: #ffffff;
  --accent-soft: #d9eee9;
  --onair: #c2611a;        /* amber: "read on air" / live */
  --onair-soft: #fbe6d4;
  --ok: #1e7b3a;
  --danger: #b3261e;
  --danger-soft: #f8dcda;
  --focus: #1f6feb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1514; --surface: #182120; --surface-2: #1f2a28; --text: #edf1ef; --muted: #9fb0ac;
    --border: #2c3a37; --accent: #3fb8a3; --accent-strong: #6bd0bf; --accent-ink: #06211d;
    --accent-soft: #163a35; --onair: #f2a65a; --onair-soft: #3d2a17; --ok: #5fcf7e; --danger: #ff7b73;
    --danger-soft: #4a1f1c; --focus: #79b8ff; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1514; --surface: #182120; --surface-2: #1f2a28; --text: #edf1ef; --muted: #9fb0ac;
  --border: #2c3a37; --accent: #3fb8a3; --accent-strong: #6bd0bf; --accent-ink: #06211d;
  --accent-soft: #163a35; --onair: #f2a65a; --onair-soft: #3d2a17; --ok: #5fcf7e; --danger: #ff7b73;
  --danger-soft: #4a1f1c; --focus: #79b8ff; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  color-scheme: dark;
}

/* ---- Nostalgic themes: colors and texture only; type stays large and high-contrast ---- */
:root[data-theme="phosphor"] {
  --bg: #050a06; --surface: #0b140d; --surface-2: #10211a; --text: #b9ffc9; --muted: #6fcf8a;
  --border: #1d4a2a; --accent: #39ff7a; --accent-strong: #7dffa8; --accent-ink: #042410; --accent-soft: #0f3a1e;
  --onair: #ffd166; --onair-soft: #3a2f0a; --ok: #39ff7a; --danger: #ff6b6b; --danger-soft: #3a1414; --focus: #7dffa8;
  --choice-a: #1f8a4c; --choice-b: #0f7a7a; --choice-c: #6a8f1f; --choice-d: #2f6f3f; --gold: #ffd166; --silver: #9fd9a9; --bronze: #c9a24a;
  --shadow: 0 0 0 1px rgba(57,255,122,.08), 0 4px 16px rgba(0,0,0,.6); color-scheme: dark;
}
:root[data-theme="phosphor"] body { text-shadow: 0 0 .5px rgba(57,255,122,.35); }
:root[data-theme="phosphor"] .callsign, :root[data-theme="phosphor"] .join-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

:root[data-theme="amber"] {
  --bg: #0f0903; --surface: #1a1006; --surface-2: #26180a; --text: #ffcf7a; --muted: #d19a4a;
  --border: #4a2f10; --accent: #ffb347; --accent-strong: #ffd08a; --accent-ink: #2a1600; --accent-soft: #3a2608;
  --onair: #ff7f3f; --onair-soft: #3d1f0c; --ok: #ffd08a; --danger: #ff6b6b; --danger-soft: #3a1414; --focus: #ffd08a;
  --choice-a: #a85f1a; --choice-b: #7a4a10; --choice-c: #b8862a; --choice-d: #8f5a3a; --gold: #ffd166; --silver: #d9b88a; --bronze: #c9843a;
  --shadow: 0 0 0 1px rgba(255,179,71,.08), 0 4px 16px rgba(0,0,0,.6); color-scheme: dark;
}
:root[data-theme="amber"] body { text-shadow: 0 0 .5px rgba(255,179,71,.35); }
:root[data-theme="amber"] .callsign, :root[data-theme="amber"] .join-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

:root[data-theme="heathkit"] {
  --bg: #e6dfcc; --surface: #f5f0e3; --surface-2: #d9d0b6; --text: #26241c; --muted: #5d5a4a;
  --border: #b8ad8c; --accent: #5f7a2e; --accent-strong: #44591f; --accent-ink: #ffffff; --accent-soft: #dfe6c6;
  --onair: #b5541a; --onair-soft: #f3dcc8; --ok: #4f7a2e; --danger: #9c2a1f; --danger-soft: #f1d4cf; --focus: #2f5bb5;
  --choice-a: #5f7a2e; --choice-b: #b5541a; --choice-c: #6b4e8a; --choice-d: #3b6ea5; --gold: #b8860b; --silver: #7f8a8f; --bronze: #9c6b3a;
  --shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 2px 6px rgba(60,50,20,.18); color-scheme: light;
}
:root[data-theme="heathkit"] body { background-image: repeating-linear-gradient(0deg, rgba(0,0,0,.025) 0 1px, transparent 1px 3px); }
:root[data-theme="heathkit"] .card { border-width: 2px; }
:root[data-theme="heathkit"] .join-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Heathkit two-tone: dark olive header on cream */
:root[data-theme="heathkit"] .topbar { background: #3f5a3a; color: #f1efe3; border-bottom: 4px solid #a9b8a0; max-width: none; }
:root[data-theme="heathkit"] .topbar .brand, :root[data-theme="heathkit"] .topbar .tagline { color: #f1efe3; border-color: #a9b8a0; }
:root[data-theme="heathkit"] .topbar .brand-mark { color: #a9b8a0; }

/* Collins S-line: St. James gray panels, black trim, a touch of emblem red */
:root[data-theme="collins"] {
  --bg: #c9c9c2; --surface: #dededa; --surface-2: #b9b9b2; --text: #141414; --muted: #4a4a48;
  --border: #8a8a85; --accent: #2b2b2b; --accent-strong: #000000; --accent-ink: #f4f4f2; --accent-soft: #d2d2cd;
  --onair: #a3261f; --onair-soft: #ecd0cd; --ok: #2f6b3a; --danger: #a3261f; --danger-soft: #ecd0cd; --focus: #a3261f;
  --choice-a: #2b2b2b; --choice-b: #a3261f; --choice-c: #5a5a56; --choice-d: #3a5a7a; --gold: #b08d1f; --silver: #6f6f6c; --bronze: #8a5a2b;
  --shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 2px 5px rgba(0,0,0,.25); color-scheme: light;
}
:root[data-theme="collins"] .topbar { background: #1c1c1c; color: #e8e8e4; max-width: none; border-bottom: 3px solid #a3261f; }
:root[data-theme="collins"] .topbar .brand, :root[data-theme="collins"] .topbar .tagline { color: #e8e8e4; border-color: #555; }
:root[data-theme="collins"] .topbar .brand-mark { color: #a3261f; }
:root[data-theme="collins"] .card { border-width: 2px; }
:root[data-theme="collins"] .join-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .3em; }

* { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5; min-height: 100dvh; display: flex; flex-direction: column;
}
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.callsign { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .04em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; max-width: 1100px; width: 100%; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.35rem; letter-spacing: .06em; }
.brand svg { width: 30px; height: 30px; }
.brand .brand-mark { color: var(--accent); }
.topbar nav { display: flex; gap: .5rem; align-items: center; margin-left: auto; }
.tagline { color: var(--muted); font-size: .95rem; margin-left: .25rem; padding-left: .75rem; border-left: 1px solid var(--border); }
@media (max-width: 520px) { .tagline { display: none; } }
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1rem 2rem; }
main.narrow { max-width: 640px; }
footer { padding: 1.5rem 1rem; text-align: center; color: var(--muted); font-size: .9rem; }
footer a { color: inherit; }
footer { display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.theme-label { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; }
.theme-label select { width: auto; min-height: 36px; padding: .25rem .5rem; font-size: .9rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-2.wide-left { grid-template-columns: 2fr 1fr; } }

/* Forms */
label { display: block; font-weight: 600; margin-bottom: .3rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .9rem; }
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%; font: inherit; font-size: 1.05rem; padding: .7rem .85rem; border: 2px solid var(--border);
  border-radius: 10px; background: var(--surface); color: var(--text); min-height: 48px;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input.callsign { text-transform: uppercase; font-size: 1.3rem; }
textarea { resize: vertical; min-height: 4.5rem; }
.field { margin-bottom: 1rem; }
.choices { display: grid; gap: .5rem; grid-template-columns: 1fr 1fr; }
.choices label { position: relative; margin: 0; }
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choices span { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: .5rem .75rem; border: 2px solid var(--border); border-radius: 10px; background: var(--surface); text-align: center; cursor: pointer; font-weight: 600; }
.choices input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.choices input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Buttons */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .6rem 1.2rem; font: inherit; font-weight: 700; font-size: 1.05rem; border-radius: 10px; border: 2px solid transparent; cursor: pointer; text-decoration: none; background: var(--surface-2); color: var(--text); }
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn-outline { background: transparent; border-color: var(--border); }
.btn-onair { background: var(--onair); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: .35rem .8rem; font-size: .95rem; }

/* Alerts */
.alert { padding: .85rem 1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 1rem; }
.alert-error { background: var(--danger-soft); border-color: var(--danger); }
.alert-ok { background: var(--accent-soft); border-color: var(--accent); }
.alert-onair { background: var(--onair-soft); border-color: var(--onair); }

/* Big numbers / code */
.stat { text-align: center; }
.stat .num { font-size: 3.2rem; font-weight: 800; line-height: 1; color: var(--accent); }
.stat .label { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.join-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 3.4rem; font-weight: 800; letter-spacing: .25em; text-align: center; color: var(--text); line-height: 1.1; }
.join-url { text-align: center; font-size: 1.15rem; word-break: break-all; }
.phonetic { text-align: center; color: var(--muted); font-size: .95rem; }
.live-dot { display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: var(--ok); margin-right: .35em; box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(30,123,58,.5);} 70% { box-shadow: 0 0 0 8px rgba(30,123,58,0);} 100% { box-shadow: 0 0 0 0 rgba(30,123,58,0);} }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-onair { background: var(--onair-soft); color: var(--onair); }
.badge-new { background: var(--accent-soft); color: var(--accent-strong); }

/* Log table */
.log { width: 100%; border-collapse: collapse; }
.log th, .log td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.log th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.log tr.read td { opacity: .62; }
.log tr.read td.callsign-cell { text-decoration: line-through; text-decoration-color: var(--muted); }
.log td.seq { font-weight: 800; color: var(--muted); width: 2.5rem; }
.log .comment { color: var(--muted); font-style: italic; }
.log .time { white-space: nowrap; color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) {
  .log thead { display: none; }
  .log tr { display: grid; grid-template-columns: 2.5rem 1fr auto; gap: .2rem .5rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
  .log td { border: 0; padding: 0; }
  .log td.seq { grid-row: span 2; font-size: 1.2rem; }
  .log td.details { grid-column: 2; }
  .log td.actions { grid-column: 3; grid-row: span 2; align-self: center; }
}

/* Listener roster (public) */
.roster { list-style: none; margin: 0; padding: 0; }
.roster li { display: flex; gap: .6rem; align-items: baseline; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.roster li .seq { color: var(--muted); font-weight: 700; min-width: 2.2rem; }
.roster li.read { opacity: .7; }
.roster li .who { flex: 1; }

.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .7rem 1.1rem; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); z-index: 50; max-width: calc(100% - 2rem); }

/* ===================== Game: trivia, polls, scoreboard ===================== */
:root {
  --choice-a: #0b6b5c; --choice-b: #c2611a; --choice-c: #6d4ea2; --choice-d: #2f63a8;
  --gold: #d9a21b; --silver: #9aa5ad; --bronze: #b4753b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --choice-a: #2fa58f; --choice-b: #e8904a; --choice-c: #9b7fd0; --choice-d: #5b8fd6; }
}
:root[data-theme="dark"] { --choice-a: #2fa58f; --choice-b: #e8904a; --choice-c: #9b7fd0; --choice-d: #5b8fd6; }

.game-card { border-width: 2px; }
.game-card.live { border-color: var(--accent); }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab { border: 2px solid var(--border); background: transparent; color: var(--text); font: inherit; font-weight: 700; padding: .45rem .9rem; border-radius: 999px; cursor: pointer; min-height: 44px; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.qlist { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.qlist li { display: flex; gap: .75rem; align-items: center; padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.qlist li:last-child { border-bottom: 0; }
.qlist li.used { opacity: .45; }
.qlist .qtext { flex: 1; }
.qlist .qmeta { color: var(--muted); font-size: .85rem; }

.prompt-big { font-size: 1.6rem; font-weight: 800; line-height: 1.25; margin: .25rem 0 1rem; }
@media (min-width: 820px) { .prompt-big { font-size: 1.9rem; } }

/* Answer tiles (listener) and answer rows (net control) */
.tiles { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile { display: flex; align-items: center; gap: .9rem; min-height: 72px; padding: .9rem 1rem; border-radius: 14px; border: 3px solid transparent; font: inherit; font-size: 1.15rem; font-weight: 700; text-align: left; color: #fff; cursor: pointer; box-shadow: var(--shadow); transition: transform .08s ease, opacity .2s ease; }
.tile:active { transform: scale(.98); }
.tile:disabled { cursor: default; }
.tile .letter { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 10px; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 1.2rem; }
.tile.a { background: var(--choice-a); } .tile.b { background: var(--choice-b); } .tile.c { background: var(--choice-c); } .tile.d { background: var(--choice-d); }
.tile.picked { border-color: var(--text); }
.tile.dim { opacity: .35; }
.tile.correct { outline: 4px solid var(--gold); outline-offset: 2px; }

/* Countdown ring */
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 8; }
.ring .track { stroke: var(--surface-2); }
.ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.ring.hurry .bar { stroke: var(--onair); }
.ring .secs { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; }

/* Result bars */
.bars { display: grid; gap: .6rem; margin: 1rem 0; }
.bar-row { display: grid; grid-template-columns: 2.2rem 1fr auto; gap: .6rem; align-items: center; }
.bar-row .letter { width: 2.2rem; height: 2.2rem; border-radius: 8px; color: #fff; display: grid; place-items: center; font-weight: 800; }
.bar-row .letter.a { background: var(--choice-a); } .bar-row .letter.b { background: var(--choice-b); } .bar-row .letter.c { background: var(--choice-c); } .bar-row .letter.d { background: var(--choice-d); }
.bar-row .track { position: relative; height: 2.2rem; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.bar-row .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--border); border-radius: 8px; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.bar-row.correct .fill { background: var(--accent); }
.bar-row .text { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 .6rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .count { font-weight: 800; min-width: 2.5rem; text-align: right; }
.bar-row.correct .count { color: var(--accent); }

/* Scoreboard */
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem; align-items: end; margin: 1rem 0; }
.podium .spot { text-align: center; background: var(--surface-2); border-radius: 12px; padding: .75rem .4rem; animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
.podium .spot.first { order: 2; padding-top: 1.4rem; border-top: 6px solid var(--gold); }
.podium .spot.second { order: 1; border-top: 6px solid var(--silver); animation-delay: .15s; }
.podium .spot.third { order: 3; border-top: 6px solid var(--bronze); animation-delay: .3s; }
.podium .rank { font-size: .8rem; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.podium .call { font-size: 1.15rem; }
.podium .pts { font-size: 1.4rem; font-weight: 800; color: var(--accent); }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.scores { width: 100%; border-collapse: collapse; }
.scores td, .scores th { padding: .5rem .4rem; border-bottom: 1px solid var(--border); text-align: left; }
.scores th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.scores td.num { text-align: right; font-weight: 800; }
.scores tr.me td { background: var(--accent-soft); }

/* Jeopardy board */
.board { display: grid; gap: .4rem; overflow-x: auto; }
.board .col { display: grid; gap: .4rem; }
.board .cat { background: var(--surface-2); border-radius: 8px; padding: .5rem .4rem; text-align: center; font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; min-height: 3.4rem; display: grid; place-items: center; }
.board .cell { border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 800; font-size: 1.25rem; min-height: 56px; cursor: pointer; }
.board .cell:disabled { background: var(--surface-2); color: var(--muted); cursor: default; text-decoration: line-through; }

/* Roulette wheel */
.wheel-wrap { position: relative; width: min(440px, 90vw); margin: 1rem auto; }
.wheel-wrap .pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 26px solid var(--onair); z-index: 2; }
.wheel { width: 100%; aspect-ratio: 1; border-radius: 50%; transition: transform 4.2s cubic-bezier(.12,.72,.08,1); box-shadow: var(--shadow); }
.wheel text { font-size: 6.2px; font-weight: 800; fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.45); stroke-width: .9px; letter-spacing: .02em; }

/* Listener result banner */
.result-banner { text-align: center; padding: 1.25rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; animation: rise .5s both; }
.result-banner.good { background: var(--accent-soft); border: 2px solid var(--accent); }
.result-banner.bad { background: var(--surface-2); border: 2px solid var(--border); }
.result-banner .big { font-size: 1.6rem; font-weight: 800; }
.result-banner .pts { font-size: 2.4rem; font-weight: 900; color: var(--accent); line-height: 1.1; }
.sparkle { position: fixed; pointer-events: none; width: 10px; height: 10px; border-radius: 50%; z-index: 60; animation: sparkle 1s ease-out forwards; }
@keyframes sparkle { from { transform: translate(0,0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.streak { display: inline-block; margin-left: .5rem; }

/* QR code + full-screen join card */
.qr { display: flex; justify-content: center; margin: .5rem 0 .75rem; }
.qr svg { width: 160px; height: 160px; background: #fff; padding: 6px; border-radius: 10px; }
.qr.big svg { width: min(60vh, 70vw); height: min(60vh, 70vw); }
.bigcode { position: fixed; inset: 0; background: var(--bg); z-index: 100; display: grid; place-items: center; cursor: pointer; overflow: auto; padding: 1rem; }
.bigcode-inner { text-align: center; max-width: 900px; }
.bigcode .label { text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.bigcode .join-code { font-size: clamp(3rem, 12vw, 8rem); }
.bigcode .phonetic { font-size: 1.2rem; margin-bottom: .5rem; }
.bigcode .join-url { font-size: clamp(1.2rem, 4vw, 2.2rem); font-weight: 700; margin-top: .5rem; }
.explain { background: var(--surface-2); border-left: 4px solid var(--accent); border-radius: 8px; padding: .7rem .9rem; margin: .75rem 0; line-height: 1.45; }
.fact { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: .9rem 1rem; text-align: center; animation: rise .5s both; transition: opacity .4s; }
.fact.fade { opacity: 0; }
.fact .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 800; margin-bottom: .25rem; }
.fact-text { font-size: 1.05rem; }
.figure { display: block; max-width: 100%; max-height: 320px; margin: 0 auto 1rem; background: #fff; padding: 8px; border-radius: 10px; }
.plan-bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.plan-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s ease; }
.ring.paused .bar { stroke: var(--muted); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .3rem .8rem; }
.netclock { margin: .25rem 0 0; color: var(--muted); }
.netclock.soon strong { color: var(--onair); }
.netclock.hurry strong { color: var(--danger); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .netclock.hurry strong { animation: none; } }
.over { color: var(--onair); }
.catpick { margin: 0 0 1rem; }
.catpick summary { cursor: pointer; font-weight: 600; }
.catpick .cat-grid { margin-top: .5rem; }
.topic-card { background: var(--surface-2); border-radius: var(--radius); padding: 1rem 1.1rem; }
.points { margin: 0; padding-left: 1.2rem; }
.points li { margin: .25rem 0; }
.hands { list-style: none; margin: .75rem 0 0; padding: 0; }
.hand-row { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.hand-row.done { opacity: .6; }
.hand-row .seq { font-weight: 800; color: var(--muted); min-width: 2rem; }
.hand-row .who { flex: 1; }
.hand-row .note { margin-top: .25rem; font-style: italic; }
.hand-form textarea { margin-top: .25rem; }
.station-form { background: var(--surface-2); border-radius: 10px; padding: .75rem; margin-bottom: .75rem; }
.iconbtn { min-width: 40px; padding: .3rem .5rem; }
.scripts summary { cursor: pointer; }
.script-read { white-space: pre-wrap; font-size: 1.2rem; line-height: 1.6; background: var(--surface-2); border-radius: 10px; padding: 1rem 1.1rem; }
.recap-list li { margin: .5rem 0; }
.awards { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 1rem 0 0; }
.award { display: flex; gap: .7rem; align-items: center; background: var(--surface-2); border-radius: 12px; padding: .7rem .9rem; animation: rise .5s both; }
.award .icon { font-size: 1.6rem; }
.award .title { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; }
.insights { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.insights h3 { margin-bottom: .5rem; }
.catbars { display: grid; gap: .35rem; margin-top: .5rem; }
.catbar { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; gap: .6rem; align-items: center; font-size: .9rem; }
.catbar .track { height: .7rem; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.catbar .fill { height: 100%; background: var(--border); border-radius: 999px; }
.catbar .fill.good { background: var(--accent); }
.catbar .fill.weak { background: var(--onair); }
.catbar .num { color: var(--muted); white-space: nowrap; }
.welcome { border-color: var(--accent); }
.steps li { margin: .35rem 0; }
.statgrid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1rem; }
.statgrid .stat .num { font-size: 2.2rem; }
a.tab { text-decoration: none; display: inline-flex; align-items: center; }
