:root {
  --bg: #16130f;
  --panel: #221d17;
  --panel-2: #2c251d;
  --line: #3a3127;
  --text: #f6efe4;
  --muted: #a89a86;
  --amber: #f4a51c;
  --amber-deep: #c97d05;
  --go: #2fbf71;
  --go-deep: #1d8a4f;
  --bad: #e5484d;
  --bad-deep: #a8282d;
  --idle: #4a4036;
  --radius: 18px;
  --display: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --on-amber: #1a1206;
  --on-go: #06150c;
  --amber-soft: #3b2a10;
  --amber-soft-text: #ffd99a;
  --go-soft: #12301f;
  --console: #110e0b;
  --buzz-idle-text: #d7cbb9;
  --buzz-depth: #2a241e;
  --amber-depth: #7a4b02;
  --go-depth: #125b33;
  --warn: #ff7a00;
  --warn-deep: #b35500;
  --knob: #f6efe4;
  --accent-text: var(--amber);
  --go-text: var(--go);
  --dw: 400;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .35; cursor: default; }
input {
  font: inherit; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; width: 100%;
}
input:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
h1, h3 { font-family: var(--display); letter-spacing: .01em; font-weight: var(--dw); }
h1 { font-size: 1.6rem; margin: 0 0 18px; }
h3 { font-size: 1rem; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--bad); margin: 0; }

/* top bar */
.bar {
  display: flex; align-items: center; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--display); color: var(--accent-text); font-size: 1.25rem; font-weight: var(--dw); }
.who { flex: 1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; font-size: .85rem; font-weight: 600;
}

.notice {
  margin: 16px; padding: 14px 16px; border-radius: 12px;
  background: var(--amber-soft); border: 1px solid var(--amber-deep); color: var(--amber-soft-text);
}

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.join { max-width: 420px; margin: 32px auto; margin-inline: 16px; }
@media (min-width: 460px) { .join { margin-inline: auto; } }
.join form { display: grid; gap: 14px; }
.join label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.code-input { font-family: var(--display); font-size: 1.8rem; letter-spacing: .3em; text-transform: uppercase; text-align: center; font-weight: var(--dw); }

.btn {
  border: 1px solid var(--line); background: var(--panel-2);
  border-radius: 12px; padding: 12px 16px; font-weight: 700;
}
.btn.big { padding: 16px 20px; font-size: 1.1rem; }
.btn.primary { background: var(--amber); color: var(--on-amber); border-color: var(--amber-deep); }
.btn.go { background: var(--go); color: var(--on-go); border-color: var(--go-deep); }
.btn.bad { background: transparent; color: var(--bad); border-color: var(--bad-deep); }

/* ---------------- player buzzer ---------------- */
body.player { display: flex; flex-direction: column; min-height: 100dvh; overflow: hidden; }
#buzzView { flex: 1; display: flex; flex-direction: column; }
.buzz-wrap { flex: 1; display: grid; place-items: center; padding: 16px; }
.buzzer {
  width: min(78vw, 50vh, 380px); aspect-ratio: 1; border-radius: 50%;
  border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  background: var(--idle); color: var(--buzz-idle-text);
  box-shadow: 0 14px 0 var(--buzz-depth), 0 24px 40px rgba(0,0,0,.45);
  transition: transform .06s, box-shadow .06s, background .15s;
}
.buzzer:active { transform: translateY(8px); box-shadow: 0 6px 0 var(--buzz-depth), 0 12px 24px rgba(0,0,0,.4); }
.buzz-label { font-family: var(--display); font-size: clamp(1.8rem, 9vw, 3.2rem); line-height: 1; text-align: center; padding: 0 12px; font-weight: var(--dw); }
.buzz-sub { font-weight: 600; font-size: 1rem; min-height: 1.2em; text-align: center; padding: 0 20px; }

.buzzer.is-open { background: var(--go); color: var(--on-go); box-shadow: 0 14px 0 var(--go-deep), 0 24px 50px rgba(47,191,113,.35); animation: pulse 1.2s ease-in-out infinite; }
.buzzer.is-buzzed { background: var(--amber-deep); color: var(--on-amber); box-shadow: 0 14px 0 var(--amber-depth); }
.buzzer.is-won { background: var(--amber); color: var(--on-amber); box-shadow: 0 14px 0 var(--amber-deep), 0 0 80px rgba(244,165,28,.6); }
.buzzer.is-excluded, .buzzer.is-penalty { background: var(--bad); color: #fff; box-shadow: 0 14px 0 var(--bad-deep); }
@keyframes pulse { 50% { filter: brightness(1.12); } }

.player-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.player-foot b { font-family: var(--display); color: var(--accent-text); font-size: 1.2rem; font-weight: var(--dw); }

/* ---------------- host ---------------- */
.host-grid {
  display: grid; gap: 16px; padding: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 1000px) { .host-grid { grid-template-columns: 280px 1fr 320px; align-items: start; } }

.joinbox { text-align: center; }
.join-url { font-weight: 800; font-size: 1.1rem; margin: 4px 0 12px; word-break: break-all; }
.room-code { font-family: var(--display); font-size: 3.6rem; letter-spacing: .12em; color: var(--accent-text); line-height: 1; margin-bottom: 16px; font-weight: var(--dw); }
.qr { display: inline-block; background: #fff; padding: 10px; border-radius: 12px; }
.qr img, .qr canvas { display: block; max-width: 100%; height: auto; }

.stage-top { display: flex; align-items: center; gap: 12px; }
.stage-top .muted { flex: 1; font-weight: 600; }
.pill { border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: .85rem; text-transform: uppercase; background: var(--idle); }
.pill.is-open { background: var(--go); color: var(--on-go); }
.pill.is-locked { background: var(--amber); color: var(--on-amber); }
.timer { font-family: var(--display); font-size: 1.4rem; min-width: 3ch; text-align: right; font-weight: var(--dw); }

.winner {
  margin: 18px 0; min-height: 150px; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--panel-2); border: 2px dashed var(--line); text-align: center; padding: 16px;
}
.winner.has { background: var(--amber); border: 0; color: var(--on-amber); }
.w-name { font-family: var(--display); font-size: clamp(2rem, 6vw, 4.2rem); line-height: 1.05; font-weight: var(--dw); }
.w-team { font-weight: 800; font-size: 1.2rem; margin-top: 6px; }

.controls { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.controls #btnOpen { grid-column: 1 / -1; }

.order { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; }
.order li { font-weight: 600; }
.delta { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; margin-left: 6px; }
.struck { text-decoration: line-through; opacity: .55; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); }
.list .pname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list b { font-family: var(--display); color: var(--accent-text); font-weight: var(--dw); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--go); flex: none; }
.list li.off .dot { background: var(--idle); }
.x { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: 0 4px; }
.x:hover { color: var(--bad); }

.settings { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.settings summary { font-weight: 800; cursor: pointer; }
.settings label { display: grid; gap: 4px; margin: 12px 0; font-size: .9rem; }
.settings label.check { display: flex; gap: 10px; align-items: flex-start; }
.settings label.check input { width: auto; margin-top: 2px; }
.settings .btn { width: 100%; margin-top: 8px; }

/* brand logo in the top bar */
.logo { height: 40px; width: auto; display: block; flex: none; }
body.host .logo { height: 48px; }

/* reaction times — host list */
.order li { display: flex; align-items: baseline; gap: 10px; }
.order .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order .rt { font-family: var(--display); color: var(--accent-text); font-variant-numeric: tabular-nums; font-weight: var(--dw); }
.order .delta { min-width: 7ch; text-align: right; margin-left: 0; }

/* reaction times — player panel */
.stats {
  margin: 0 16px 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  display: grid; gap: 4px; text-align: center;
}
.stats .st-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.stats .st-time { font-family: var(--display); font-size: 1.8rem; color: var(--accent-text); line-height: 1.1; font-weight: var(--dw); }
.stats .st-line { font-weight: 600; }
.stats .st-faster { color: var(--muted); font-size: .9rem; }
.stats .st-faster b { color: var(--text); font-weight: 600; }
.order { list-style: none; padding-left: 0; }
.order .rank { color: var(--muted); min-width: 2ch; font-variant-numeric: tabular-nums; }

/* late window: someone already won, press to record your time */
.buzzer.is-late { background: var(--go-deep); color: #fff; box-shadow: 0 14px 0 var(--go-depth), 0 24px 40px rgba(0,0,0,.45); }

/* ================= answer countdown ================= */
.winner { position: relative; overflow: hidden; transition: background .2s; }
.ans-num {
  font-family: var(--display); line-height: 1; margin-top: 12px;
  font-size: clamp(4rem, 12vw, 9rem); font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 0 rgba(0,0,0,.18); font-weight: var(--dw); }
.ans-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: rgba(0,0,0,.18); }
.ans-bar i { display: block; height: 100%; width: 100%; background: var(--on-amber); transition: width .1s linear; }

/* 5 s left: hot orange, heartbeat */
.winner.has.warn { background: var(--warn); }
.winner.has.warn .ans-num { animation: beat .5s ease-in-out infinite; }

/* 3 s left: deep red pulse, slight tremble (nervous, not strobing) */
.winner.has.crit { background: #d93a3f; color: #fff; animation: red-pulse .5s ease-in-out infinite alternate, tremble .18s linear infinite; }
.winner.has.crit .ans-num { animation: beat .5s ease-in-out infinite; }
.winner.has.crit .ans-bar i { background: rgba(255,255,255,.85); }

/* time's up */
.winner.has.timeup { background: var(--bad); color: #fff; animation: red-pulse 1s ease-in-out infinite alternate; }
.winner.has.timeup .ans-num { font-size: clamp(2.6rem, 7vw, 5.5rem); }

@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes red-pulse { from { background: #e5484d; box-shadow: 0 0 18px 2px rgba(229,72,77,.35); } to { background: #9e1f24; box-shadow: 0 0 46px 8px rgba(229,72,77,.55); } }
@keyframes tremble { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-1.5px, .5px); } 75% { transform: translate(1.5px, -.5px); } }
@keyframes shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-4px, 1px) rotate(-.4deg); }
  75% { transform: translate(4px, -1px) rotate(.4deg); }
}

/* winner's phone */
.ans-big { display: block; font-family: var(--display); font-size: clamp(3rem, 18vw, 5.5rem); line-height: 1; font-weight: var(--dw); }
.buzzer.is-won.ans-warn { background: var(--warn); box-shadow: 0 14px 0 var(--warn-deep), 0 0 80px rgba(255,122,0,.6); }
.buzzer.is-won.ans-warn .ans-big { animation: beat .5s ease-in-out infinite; }
.buzzer.is-won.ans-crit { color: #fff; animation: red-pulse .5s ease-in-out infinite alternate, tremble .18s linear infinite; }
.buzzer.is-won.ans-crit .ans-big { animation: beat .5s ease-in-out infinite; }
.buzzer.is-won.ans-timeup { background: var(--bad); color: #fff; box-shadow: 0 14px 0 var(--bad-deep); }
.buzzer.is-won.ans-timeup .ans-big { font-size: clamp(1.6rem, 9vw, 2.6rem); }

@media (prefers-reduced-motion: reduce) {
  .winner.has.warn .ans-num, .winner.has.crit, .winner.has.crit .ans-num,
  .buzzer.is-won.ans-warn .ans-big, .buzzer.is-won.ans-crit, .buzzer.is-won.ans-crit .ans-big { animation-duration: 1s; }
}
.small-btn { width: 100%; margin-top: 8px; padding: 8px 12px; font-size: .85rem; }

/* ================= questions from the Google Sheet ================= */
.cat-chip {
  display: inline-block; background: var(--amber); color: var(--on-amber);
  font-weight: 800; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em;
  border-radius: 999px; padding: 3px 10px;
}
.cat-chip.big { font-size: clamp(.9rem, 1.4vw, 1.3rem); padding: 6px 16px; }

/* host: question panel */
.qpanel { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; background: var(--panel-2); }
.qpanel.empty { padding: 10px 14px; }
.qp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qp-head #qpMeta { margin-left: auto; }
.qp-text { font-size: 1.25rem; font-weight: 700; margin: 10px 0 6px; line-height: 1.3; }
.qp-choices { list-style: none; margin: 6px 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.qp-choices li { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.qp-choices b { color: var(--accent-text); margin-right: 6px; }
.qp-answer { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(47,191,113,.12); border: 1px solid var(--go-deep); }
.qp-answer b { color: var(--go-text); font-size: 1.1rem; }
.qp-answer.revealed::after { content: " 👁"; }
.qp-notes { margin-top: 8px; color: var(--muted); font-size: .9rem; font-style: italic; }
.qp-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
@media (max-width: 600px) { .qp-buttons { grid-template-columns: 1fr 1fr; } .qp-choices { grid-template-columns: 1fr; } }
.sheet-row { display: flex; align-items: center; gap: 10px; margin: -4px 0 8px; }
.sheet-row .btn { width: auto; margin: 0; }

/* host: TV link box */
.tvbox { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 4px; text-align: left; }
.tvbox .btn { display: block; text-align: center; text-decoration: none; width: 100%; }
.tv-status { margin-top: 8px; }

/* player: question card */
.qcard { margin: 12px 16px 0; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.qc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.qc-text { font-weight: 700; line-height: 1.3; font-size: 1.02rem; }
.qc-choices { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: .9rem; }
.qc-choices li { background: var(--panel-2); border-radius: 8px; padding: 5px 8px; }
.qc-choices li.right { background: var(--go); color: var(--on-go); }
.qc-choices b { color: var(--accent-text); margin-right: 4px; }
.qc-choices li.right b { color: inherit; }
.qc-answer { margin-top: 8px; color: var(--go-text); }
body.player.has-q .buzzer { width: min(64vw, 36vh, 340px); }
body.player.has-q .buzz-wrap { padding: 10px 16px; }

/* ================= TV screen ================= */
body.tv { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.tv-bar .logo { height: 56px; }
.tv-bar .who { font-weight: 700; font-size: 1.2rem; color: var(--text); }
.reading { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-text); font-weight: 700; }
.reading i { width: 12px; height: 12px; border-radius: 50%; background: var(--amber); animation: beat .8s ease-in-out infinite; }
.tv-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 340px; gap: 20px; padding: 20px; }
.tv-main { display: flex; flex-direction: column; gap: 20px; min-height: 0; }
.tv-q { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; min-height: 0; }
.tv-text { font-family: var(--display); font-size: clamp(2rem, 3.6vw, 4.2rem); line-height: 1.15; font-weight: var(--dw); }
.tv-text.long { font-size: clamp(1.6rem, 2.7vw, 3rem); }
.tv-text.waiting { color: var(--muted); font-family: var(--body); font-weight: 600; font-size: clamp(1.4rem, 2.2vw, 2.2rem); }
.tv-choices { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tv-choices li {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 16px;
  background: var(--panel); border: 2px solid var(--line); font-size: clamp(1.2rem, 1.9vw, 2.1rem); font-weight: 700;
  transition: background .3s, opacity .3s;
}
.tv-choices b {
  flex: none; display: grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 50%;
  background: var(--amber); color: var(--on-amber); font-family: var(--display); font-weight: var(--dw); }
.tv-choices li.right { background: var(--go); border-color: var(--go); color: var(--on-go); }
.tv-choices li.right b { background: var(--on-go); color: var(--go-text); }
.tv-choices li.dim { opacity: .35; }
.tv-reveal { text-align: center; padding: 16px; border-radius: var(--radius); background: rgba(47,191,113,.14); border: 2px solid var(--go-deep); }
.rv-answer { font-family: var(--display); font-size: clamp(1.8rem, 3.2vw, 3.4rem); color: var(--go-text); line-height: 1.1; margin: 4px 0; font-weight: var(--dw); }
.rv-by { font-weight: 800; font-size: 1.3rem; }
.tv-winner { margin: 0; min-height: 0; }
.tv-winner.has .w-name { font-size: clamp(2.6rem, 5vw, 5.5rem); }
.tv-winner.has .ans-num { font-size: clamp(4rem, 9vw, 9rem); margin-top: 4px; }
.winner.go { background: var(--go); border: 0; color: var(--on-go); animation: pulse 1.2s ease-in-out infinite; }
.w-go { font-family: var(--display); font-size: clamp(2.6rem, 6vw, 6rem); line-height: 1; padding: 18px; font-weight: var(--dw); }
.tv-side { display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow: hidden; }
.tv-side .card { padding: 14px 16px; }
.tv-side h3 { margin-top: 0; }
.tv-join { display: flex; gap: 14px; align-items: center; }
.tv-join .qr { flex: none; padding: 6px; }
.tv-join .qr img, .tv-join .qr canvas { width: 130px; height: 130px; }
.tv-join .room-code { font-size: 2.6rem; margin: 4px 0 0; }
.tv-join .join-url { font-size: .95rem; margin: 2px 0 0; }
.tv-side .order li, .tv-side .list li { font-size: 1.05rem; }
.start-overlay { position: fixed; inset: 0; background: rgba(10,8,6,.85); display: grid; place-items: center; z-index: 10; }
.start-overlay button {
  display: grid; gap: 8px; padding: 34px 54px; border: 0; border-radius: 24px;
  background: var(--amber); color: var(--on-amber); font-family: var(--display); font-size: 2.4rem; font-weight: var(--dw); }
.start-overlay small { font-family: var(--body); font-size: 1rem; font-weight: 600; }
.tv-settings { position: fixed; top: 84px; right: 16px; width: 320px; z-index: 5; display: grid; gap: 12px; }
.tv-settings label { display: grid; gap: 4px; font-size: .9rem; font-weight: 600; }
.tv-settings label.check { display: flex; gap: 10px; align-items: center; }
.tv-settings label.check input { width: auto; }
.tv-settings select { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.tv-settings .row { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 1000px) {
  body.tv { overflow: auto; height: auto; }
  .tv-grid { grid-template-columns: 1fr; }
}
.tv-q > .cat-chip { align-self: flex-start; }
.field-help { margin: -6px 0 10px; }
.tv-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 6;
  max-width: min(90vw, 900px); padding: 12px 18px; border-radius: 12px;
  background: var(--amber-soft); border: 1px solid var(--amber-deep); color: var(--amber-soft-text); font-weight: 600;
}

/* ================= question packages ================= */
.pkg-picker { border: 2px solid var(--amber); border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; background: var(--panel-2); }
.pkg-head { display: flex; align-items: center; gap: 8px; }
.pkg-head h2 { flex: 1; margin: 0; font-family: var(--display); font-size: 1.2rem; font-weight: var(--dw); }
.pkg-head .small-btn { width: auto; margin: 0; }
.pkg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; }
.pkg-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
}
.pkg-card:hover { border-color: var(--amber); }
.pkg-card.current { border: 2px solid var(--go); }
.pkg-card.bad { opacity: .6; }
.pkg-card.loading { opacity: .5; pointer-events: none; }
.pkg-card.buzzer-only { border-style: dashed; }
.pkg-name { font-weight: 800; font-size: 1.05rem; }
.pkg-count { color: var(--accent-text); font-weight: 700; font-size: .9rem; }
.pkg-desc { color: var(--muted); font-size: .85rem; }
.pkg-cur { position: absolute; top: 8px; right: 10px; font-size: .7rem; font-weight: 800; color: var(--go-text); text-transform: uppercase; }
.qp-pkg { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.linklike { white-space: nowrap; background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 700; font-size: .85rem; text-decoration: underline; }

/* package step (full screen between room creation and the game) */
.pkg-view { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.pkg-view .pkg-picker { margin: 0; padding: 22px; }
.pkg-title { flex: 1; display: grid; gap: 2px; }
.pkg-title h2 { font-size: 1.6rem; }
.pkg-view .pkg-list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.pkg-view .pkg-card { padding: 16px 18px; min-height: 120px; }
.pkg-view .pkg-name { font-size: 1.2rem; }

/* ---------- Quiz builder ---------- */
.pkg-view { max-width: 980px; margin: 16px auto; padding: 0 16px; }
.builder .pkg-title { flex: 1; min-width: 0; }
.builder .pkg-title h2 { margin: 0; font-family: var(--display); font-size: 1.3rem; font-weight: var(--dw); }
.b-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 22px; margin-top: 16px; }
.b-field { min-width: 0; }
.b-field.b-wide { grid-column: 1 / -1; }
.b-field > label, .b-label { display: flex; align-items: baseline; gap: 10px; font-weight: 700; margin-bottom: 8px; }
.b-field p { margin: 0 0 8px; }
.b-field label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.b-field label.check input { width: auto; margin-top: 2px; }
.b-field select { width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font: inherit; }
.b-count { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.b-count input { width: 84px; padding: 9px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font: inherit; }
.b-count .chip.on { border-color: var(--amber); color: var(--accent-text); }
.b-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.b-chip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.b-chip small { opacity: .7; font-weight: 400; margin-left: 2px; }
.b-chip.on { background: var(--amber-soft); border-color: var(--amber); color: var(--text); }
.linklike { white-space: nowrap; background: none; border: 0; padding: 0; color: var(--accent-text); font-size: .85rem; font-weight: 600; text-decoration: underline; }
.b-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.b-summary { flex: 1 1 260px; min-width: 0; line-height: 1.4; }
.b-summary .warn { display: block; color: var(--amber-soft-text); font-size: .9rem; margin-top: 4px; }
.b-foot .btn { width: auto; margin: 0; }
@media (max-width: 560px) { .b-foot .btn { flex: 1 1 100%; } }

/* ---------- sign-in box ---------- */
.acct { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.acct p { margin: 0 0 10px; }
.acct-btns { display: flex; gap: 8px; }
.acct-btns .btn { flex: 1; width: auto; margin: 0; padding: 10px 12px; }
.acct-btns .g { color: #4285f4; margin-right: 4px; }
.acct-email { display: flex; gap: 8px; margin-top: 10px; }
.acct-email input { flex: 1; min-width: 0; }
.acct-email .btn { width: auto; margin: 0; white-space: nowrap; }
.acct-msg { margin: 10px 0 0 !important; color: var(--muted); }
.acct-msg.error { color: var(--bad); }
.acct-in { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; color: var(--muted); font-size: .9rem; }

/* ---------- reveal delay: someone buzzed, winner not shown yet ---------- */
.winner.revealing { background: var(--amber-soft); border: 2px solid var(--amber); color: var(--accent-text); animation: reveal-pulse .5s ease-in-out infinite alternate; }
@keyframes reveal-pulse { from { box-shadow: 0 0 0 0 rgba(244,165,28,.0); } to { box-shadow: 0 0 40px 6px rgba(244,165,28,.45); } }
.b-presets { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.b-presets .b-label { margin-bottom: 8px; }
.b-preset { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: .92rem; }
.b-preset:hover, .b-preset.on { border-color: var(--amber); color: var(--accent-text); }
.b-preset.surprise { background: var(--amber); color: var(--on-amber); border-color: var(--amber-deep); }
.b-chip.b-rand { border-style: dashed; }
.b-chip.b-rand.on { background: var(--amber); color: var(--on-amber); border-style: solid; }

/* ---------- final results ---------- */
.final { max-width: 520px; margin: 16px auto; padding: 22px 18px; text-align: center; }
.final h1 { font-family: var(--display); margin: 0 0 14px; font-weight: var(--dw); }
.final-me { margin-bottom: 18px; }
.fm-rank { font-family: var(--display); font-size: 5rem; line-height: 1; color: var(--accent-text); font-weight: var(--dw); }
.fm-rank sup { font-size: 1.6rem; }
.fm-line { color: var(--muted); margin-top: 6px; }
.fm-score { font-family: var(--display); font-size: 1.5rem; margin-top: 4px; font-weight: var(--dw); }
.podium { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.podium li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); text-align: left; }
.podium li.p1 { background: var(--amber-soft); border-color: var(--amber); font-size: 1.15em; }
.podium .pm { font-size: 1.6em; }
.podium .pn { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium li.me, .final-list li.me { outline: 2px solid var(--go); }
.final-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 4px; text-align: left; }
.final-list li { display: flex; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--panel); }
.final-list .pname { flex: 1; }
.final .btn { width: 100%; }
.tv-final { text-align: center; padding: 10px 0; }
.tv-final h2 { font-family: var(--display); font-size: clamp(2rem, 4vw, 3.4rem); margin: 0 0 18px; color: var(--accent-text); font-weight: var(--dw); }
.podium.big { max-width: 900px; margin: 0 auto 16px; font-size: clamp(1.2rem, 2.4vw, 2rem); }
.tv-final .final-list { max-width: 700px; margin: 0 auto; font-size: clamp(1rem, 1.6vw, 1.4rem); }

/* ---------- answer race on the phones ---------- */
.choice-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px; }
.choice-box .ch { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 104px; padding: 12px; border-radius: 18px; border: 0; color: #fff; font-weight: 800; font-size: 1.05rem; line-height: 1.2; text-align: center; box-shadow: 0 6px 0 rgba(0,0,0,.35); transition: transform .08s, opacity .2s; }
.choice-box .ch b { font-family: var(--display); font-size: 1.4rem; opacity: .85; font-weight: var(--dw); }
.choice-box .ch:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.choice-box .c0 { background: #d64545; } .choice-box .c1 { background: #2f7fd6; } .choice-box .c2 { background: #d9a017; } .choice-box .c3 { background: #2fa36b; }
.choice-box.tf .c0 { background: #2fa36b; } .choice-box.tf .c1 { background: #d64545; }
.choice-box.tf .ch { min-height: 150px; font-size: 1.5rem; }
.choice-box .ch:disabled { opacity: .55; cursor: default; }
.choice-box .ch.mine { opacity: 1; outline: 4px solid #fff; outline-offset: 2px; }
.choice-box.revealed .ch.right { opacity: 1; outline: 4px solid #fff; animation: beat .6s ease-in-out 2; }
.choice-box.revealed .ch.wrong { opacity: .8; filter: grayscale(.4); }
.choice-box.revealed .ch.dim { opacity: .25; }
.race-msg { grid-column: 1 / -1; text-align: center; font-family: var(--display); font-size: 1.5rem; padding: 10px 0 4px; font-weight: var(--dw); }
.race-msg.ok { color: var(--go-text); } .race-msg.bad { color: var(--bad); }
.winner.race { background: var(--panel-2); border: 2px solid var(--amber); }
.winner.race .ans-num { font-size: clamp(2.4rem, 6vw, 4.5rem); }
.tv-choices.race li { position: relative; }
.tv-choices .cnt { margin-left: auto; font-family: var(--display); opacity: .8; font-weight: var(--dw); }

/* ---------- flags ---------- */
.qc-flagbtn { display: block; margin-top: 10px; font-size: .85rem; color: var(--muted); }
.qc-flag { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.qc-flag.done { color: var(--go-text); font-size: .9rem; }
.flag-menu { position: fixed; z-index: 50; left: 50%; top: 30%; transform: translateX(-50%); display: grid; gap: 8px; min-width: 260px; padding: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.flag-menu .btn { width: 100%; margin: 0; }
#btnFlags { margin-top: 8px; }
.flags-box { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); display: grid; gap: 10px; max-height: 420px; overflow: auto; }
.flag-item { padding: 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.flag-item.bad { opacity: .6; } .flag-item.ok { border-color: var(--go-deep); }
.fi-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .9rem; }
.fi-q { margin: 6px 0 2px; } .fi-a { color: var(--accent-text); font-weight: 700; }
.fi-btns { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.fi-btns .btn { width: auto; margin: 0; }

/* ================= host: la régie ================= */
body.host:has(.regie:not([hidden])) { overflow: hidden; display: flex; flex-direction: column; height: 100dvh; }
.regie { display: grid; grid-template-rows: auto 1fr auto; flex: 1; min-height: 0; }
.rg-top { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.rg-room { display: flex; align-items: baseline; gap: 8px; margin-right: 6px; }
.rg-code { font-family: var(--display); font-size: 1.6rem; letter-spacing: .12em; color: var(--accent-text); font-weight: var(--dw); }
.rg-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: .9rem; }
.rg-pill:hover, .rg-icon:hover { border-color: var(--amber); }
.rg-pill #pCount { font-family: var(--display); color: var(--accent-text); font-weight: var(--dw); }
.rg-pill .dot { background: var(--idle); }
.rg-pill .dot.on { background: var(--go); box-shadow: 0 0 8px var(--go); }
.rg-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); font-size: 1.15rem; }
.rg-spacer { flex: 1; }

.rg-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); min-height: 0; }
.rg-stage { padding: 18px; overflow: auto; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.rg-stage .qpanel { margin: 0; padding: 16px 18px; }
.rg-stage .qp-text { font-size: clamp(1.25rem, 2.1vw, 1.7rem); line-height: 1.25; }
.rg-stage .qp-head #qpMeta { margin-left: 0; }
.rg-stage .qp-answer { font-size: 1.05rem; }
.rg-stage .winner { min-height: 150px; display: flex; flex-direction: column; justify-content: center; }
.rg-stage .winner .w-name { font-size: clamp(1.8rem, 3.6vw, 3rem); }
.rg-order h3 { margin: 4px 0 8px; font-size: .95rem; color: var(--muted); font-weight: 700; }

.rg-players { border-left: 1px solid var(--line); background: var(--panel); padding: 16px; overflow: auto; min-height: 0; }
.rg-ph { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.rg-ph h3 { margin: 0; }
.rg-teams { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.rg-teams li { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: var(--amber-soft); border: 1px solid var(--amber-deep); font-weight: 700; }
.rg-teams b { font-family: var(--display); color: var(--accent-text); font-size: 1.2rem; font-weight: var(--dw); }
.rg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rg-empty { grid-column: 1 / -1; }
.tile { position: relative; padding: 10px 12px 8px; border-radius: 14px; background: var(--panel-2); border: 2px solid transparent; transition: border-color .15s, background .15s; }
.tile .t-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 30px; }
.tile .t-name small { display: block; color: var(--muted); font-weight: 600; font-size: .78rem; }
.tile .t-score { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.tile .t-score b { font-family: var(--display); font-size: 1.5rem; min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; font-weight: var(--dw); }
.t-adj { width: 28px; height: 28px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); font-weight: 800; color: var(--muted); opacity: .55; }
.tile:hover .t-adj, .t-adj:focus-visible { opacity: 1; }
.t-x { position: absolute; right: 6px; bottom: 6px; background: none; border: 0; color: var(--muted); opacity: 0; font-size: 1.1rem; }
.tile:hover .t-x, .t-x:focus-visible { opacity: .8; }
.tile .tb { position: absolute; top: 8px; right: 8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; display: grid; place-items: center; font-family: var(--display); font-size: .9rem; background: var(--panel); font-weight: var(--dw); }
.tile.in { border-color: var(--amber-deep); }
.tile.in .tb { background: var(--amber); color: var(--on-amber); }
.tile.win { border-color: var(--amber); background: var(--amber-soft); box-shadow: 0 0 22px rgba(244,165,28,.35); }
.tile.win .tb { background: var(--amber); color: var(--on-amber); }
.tile.ok { border-color: var(--go); background: var(--go-soft); }
.tile.ok .tb { background: var(--go); color: var(--on-go); font-family: var(--body); font-weight: 800; font-size: .78rem; }
.tile.ko { border-color: var(--bad-deep); opacity: .8; }
.tile.ko .tb { background: var(--bad); color: #fff; font-family: var(--body); font-weight: 800; font-size: .78rem; }
.tile.off { opacity: .45; }
.tile.struck .t-name { text-decoration: line-through; color: var(--muted); }

.rg-console { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--console); flex-wrap: wrap; }
.rg-tools { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 380px; min-width: 0; }
.rg-tools .btn { width: auto; margin: 0; padding: 9px 12px; font-size: .88rem; }
.rg-main { display: flex; gap: 10px; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; }
.rg-main .btn { width: auto; margin: 0; }
.rg-main kbd { margin-left: 10px; font: inherit; font-size: .75rem; opacity: .6; border: 1px solid currentColor; border-radius: 6px; padding: 1px 6px; }
.rg-primary { min-width: 300px; padding: 18px 26px; font-size: 1.2rem; font-weight: 800; border-radius: 16px; background: var(--amber); color: var(--on-amber); border: 0; box-shadow: 0 5px 0 var(--amber-deep); }
.rg-primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--amber-deep); }
.rg-primary.waiting { background: var(--panel-2); color: var(--muted); box-shadow: none; opacity: 1; animation: pulse 1.6s ease-in-out infinite; }
.rg-judge { padding: 18px 22px; font-size: 1.1rem; font-weight: 800; border-radius: 16px; }
.rg-judge.go { min-width: 220px; box-shadow: 0 5px 0 var(--go-deep); border: 0; }
.rg-judge.bad { background: var(--bad); color: #fff; border: 0; box-shadow: 0 5px 0 var(--bad-deep); }
.rg-judge.bad.soft { background: transparent; color: var(--bad); border: 2px solid var(--bad-deep); box-shadow: none; }
.rg-judge:disabled { opacity: .35; }

.rg-shade { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; }
.rg-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 41; background: var(--panel); border-left: 1px solid var(--line); padding: 22px 20px; overflow: auto; box-shadow: -20px 0 60px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 10px; }
.rg-drawer h2 { margin: 0 0 4px; font-family: var(--display); font-weight: var(--dw); }
.rg-drawer .btn { width: 100%; margin: 0; text-align: center; text-decoration: none; display: block; }
.rg-drawer .qr { align-self: center; background: #fff; padding: 12px; border-radius: 12px; }
.rg-drawer .room-code { font-size: 3.4rem; }
.rg-drawer.settings label { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .92rem; }
.rg-drawer.settings label input[type=number] { width: 80px; }
.rg-drawer.settings label.check { justify-content: flex-start; align-items: flex-start; }
.rg-drawer.settings label.check input { margin-top: 3px; }
.rg-close { position: absolute; top: 14px; right: 14px; background: none; border: 0; color: var(--muted); font-size: 1.2rem; }
.flag-menu { z-index: 60; }

@media (max-width: 900px) {
  body.host:has(.regie:not([hidden])) { overflow: auto; display: block; height: auto; }
  .rg-body { grid-template-columns: 1fr; }
  .rg-players { border-left: 0; border-top: 1px solid var(--line); }
  .rg-console { position: sticky; bottom: 0; z-index: 30; }
  .rg-main { width: 100%; }
  .rg-primary, .rg-judge { flex: 1 1 100%; min-width: 0; }
  .rg-main kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) { .rg-primary.waiting { animation: none; } }
.regie h3 { text-transform: none; letter-spacing: 0; }
@media (max-width: 900px) {
  .rg-tools { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .rg-tools .btn { white-space: nowrap; flex: none; }
}
/* judging buttons sit right next to the player who is answering */
.rg-live { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.rg-live.judging { grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); align-items: stretch; }
.rg-judges { display: flex; flex-direction: column; gap: 10px; }
.rg-judges .btn { width: 100%; margin: 0; display: flex; align-items: center; justify-content: center; }
.rg-judges .rg-judge.go { flex: 1.4; min-width: 0; font-size: 1.3rem; }
.rg-judges .rg-judge.bad { flex: 1; }
.rg-judges .rg-judge.bad.soft { flex: .8; }
.rg-judges kbd { margin-left: 10px; font: inherit; font-size: .75rem; opacity: .6; border: 1px solid currentColor; border-radius: 6px; padding: 1px 6px; }
@media (max-width: 900px) { .rg-live.judging { grid-template-columns: 1fr; } .rg-judges kbd { display: none; } }
.rg-live .winner { margin: 0; }
.regie { grid-template-columns: minmax(0, 1fr); width: 100%; }
.rg-top, .rg-console { min-width: 0; }
@media (max-width: 900px) {
  .rg-top { padding: 8px 12px; gap: 8px; }
  .rg-top #qLabel { display: none; }
  .rg-room .muted { display: none; }
  .rg-stage { padding: 12px; }
  .rg-stage .qpanel { padding: 12px 14px; }
  .rg-stage .qp-head { gap: 6px 8px; }
  .rg-stage .qp-head .rg-spacer { flex-basis: 100%; height: 0; }
  .rg-stage .qp-text { font-size: 1.2rem; }
  .rg-stage .qp-choices { grid-template-columns: 1fr; }
  .rg-stage .winner { min-height: 0; padding: 14px; }
  .rg-stage .winner .w-name { font-size: 1.8rem; }
  .rg-stage .winner .ans-num { font-size: 3.4rem; margin-top: 4px; }
  .rg-judges .btn { padding: 14px; }
  .rg-console { padding: 10px 12px; }
  .rg-primary { padding: 15px 18px; font-size: 1.1rem; }
  .rg-players { padding: 12px; }
  .rg-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 900px) {
  .rg-top > .rg-spacer { display: none; }
  .rg-top #btnSettings { margin-left: auto; }
  body.host .bar { padding-top: 6px; padding-bottom: 6px; }
  body.host .logo { height: 36px; }
}
.tv-ctrl { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.tv-ctrl label { display: flex; align-items: center; gap: 10px; justify-content: space-between; font-size: .92rem; }
.tv-ctrl label.check { justify-content: flex-start; }
.tv-ctrl select { max-width: 230px; padding: 8px; border-radius: 8px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); font: inherit; }
.tv-ctrl input[type=range] { flex: 1; }
.tv-ctrl #hRateVal { min-width: 4ch; font-variant-numeric: tabular-nums; }

/* ---------- settings drawer ---------- */
.rg-drawer.settings { gap: 0; padding-bottom: 30px; }
.s-sec { padding: 14px 0 10px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.s-sec:first-of-type { border-top: 0; }
.rg-drawer.settings .s-sec h3 { margin: 0 0 4px; color: var(--accent-text); font-size: .95rem; }
.s-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; cursor: default; }
.rg-drawer.settings label.s-row { font-size: 1rem; }
.s-txt { display: grid; gap: 2px; flex: 1; min-width: 0; font-weight: 600; }
.s-txt small { color: var(--muted); font-weight: 400; font-size: .8rem; line-height: 1.3; }
.s-tog { cursor: pointer; }
.s-tog input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.s-switch { flex: none; width: 46px; height: 26px; border-radius: 13px; background: var(--idle); position: relative; transition: background .15s; }
.s-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--knob); transition: transform .15s; }
.s-tog input:checked + .s-switch { background: var(--go); }
.s-tog input:checked + .s-switch::after { transform: translateX(20px); }
.s-tog input:focus-visible + .s-switch { outline: 2px solid var(--amber); outline-offset: 2px; }
.s-step { flex: none; display: flex; align-items: center; gap: 4px; }
.s-step button { width: 34px; height: 34px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 800; font-size: 1.1rem; }
.s-step button:hover { border-color: var(--amber); }
.rg-drawer.settings .s-step input { width: 52px; text-align: center; padding: 7px 4px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); color: var(--text); font: inherit; font-weight: 700; -moz-appearance: textfield; }
.s-step input::-webkit-outer-spin-button, .s-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.s-step em { font-style: normal; color: var(--muted); font-size: .85rem; min-width: 2.2ch; }
.s-link { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 12px 14px; margin-top: 6px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; text-align: left; }
.s-link:hover { border-color: var(--amber); }
.s-danger { gap: 8px; }
.s-danger .btn { width: 100%; margin: 0; }
.rg-drawer .s-txt, .rg-drawer.settings label.s-txt { display: grid; justify-content: start; align-items: start; gap: 2px; }
.rg-drawer .s-row { padding: 7px 0; }
.rg-drawer .s-tog { display: flex; justify-content: space-between; align-items: center; }
.tv-ctrl .s-tog { font-size: 1rem; }
.rg-drawer.settings { margin: 0; }
.rg-drawer.settings .s-row, .rg-drawer.settings label.s-row { margin: 0; padding: 6px 0; }
.rg-drawer.settings .s-sec { gap: 2px; }
.rg-drawer.settings label.s-txt { margin: 0; font-size: 1rem; }

/* ================= polish pass ================= */
h3 { text-transform: none; letter-spacing: 0; }
.stats .st-label { text-transform: none; letter-spacing: 0; font-size: .85rem; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* host start */
.join.start { max-width: 460px; padding: 28px 26px; }
.join.start h1 { margin: 0 0 6px; font-size: 2rem; }
.join.start > p { margin: 0 0 20px; line-height: 1.45; }
.join.start #create { width: 100%; }

/* TV: sized for a room, not a laptop */
.tv-grid { grid-template-columns: minmax(0, 1fr) clamp(300px, 25vw, 480px); gap: clamp(16px, 1.6vw, 32px); padding: clamp(16px, 1.8vw, 36px); }
.tv-main { gap: clamp(14px, 1.4vw, 28px); }
.tv-q { justify-content: flex-start; padding-top: clamp(8px, 3vh, 48px); gap: clamp(14px, 1.6vw, 30px); }
.tv-text { font-size: clamp(2.2rem, 3.9vw, 5.4rem); line-height: 1.12; max-width: 28ch; }
.tv-text.long { font-size: clamp(1.8rem, 3vw, 4rem); max-width: 36ch; }
.tv-text.idle { color: var(--muted); align-self: center; margin-top: 18vh; font-size: clamp(3rem, 7vw, 8rem); }
.tv-choices { gap: clamp(10px, 1vw, 20px); }
.tv-choices li { font-size: clamp(1.2rem, 1.9vw, 2.4rem); padding: clamp(12px, 1.2vw, 24px) clamp(14px, 1.4vw, 28px); }
.tv-winner, .tv-reveal { margin-top: auto; }
.tv-reveal + .tv-winner { margin-top: 0; }
.tv-winner .w-go { font-size: clamp(2.6rem, 5vw, 6rem); }
.tv-winner.race .w-name { font-size: clamp(2rem, 3.4vw, 4.4rem); }
.tv-winner.race .w-team { font-size: clamp(1.1rem, 1.6vw, 2rem); margin-top: 6px; }
.tv-reveal .rv-answer { font-size: clamp(2rem, 3.6vw, 4.6rem); }
.tv-side { gap: clamp(12px, 1.2vw, 24px); }
.tv-side .card { padding: clamp(12px, 1.1vw, 22px) clamp(14px, 1.2vw, 24px); }
.tv-side h3 { font-size: clamp(1rem, 1.2vw, 1.5rem); color: var(--muted); margin: 0 0 10px; }
.tv-join { flex-direction: column; align-items: stretch; text-align: center; gap: 10px; }
.tv-join .qr { align-self: center; background: #fff; border-radius: 12px; padding: 8px; }
.tv-join .qr img, .tv-join .qr canvas { width: clamp(120px, 11vw, 230px); height: auto; aspect-ratio: 1; }
.tv-join .qr:empty { display: none; }
.tv-join .room-code { font-size: clamp(2.4rem, 4vw, 5rem); letter-spacing: .14em; line-height: 1; }
.tv-join .join-url { font-size: clamp(.95rem, 1.2vw, 1.5rem); }
.tv-side .order li, .tv-side .list li { font-size: clamp(1rem, 1.35vw, 1.7rem); padding: clamp(6px, .6vw, 12px) clamp(8px, .8vw, 14px); }
.tv-side .list b, .tv-side .order .rt { font-size: 1.1em; }
.tv-bar .who { font-size: clamp(1rem, 1.3vw, 1.6rem); }
.tv-final .podium.big { font-size: clamp(1.4rem, 2.6vw, 3rem); }
.choice-box .ch { min-height: clamp(104px, 19vh, 190px); font-size: 1.15rem; }
.choice-box.tf .ch { min-height: clamp(150px, 30vh, 280px); }

/* =====================================================================
   THEMES — html[data-theme]: classic (above) · neu · brut · mix
   ===================================================================== */

/* theme picker (settings drawer) */
.th-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 4px 0 6px; }
.th-sw { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px; border-radius: 14px; background: var(--panel-2); border: 2px solid var(--line); font-weight: 700; font-size: .9rem; text-align: center; }
.th-sw[aria-pressed="true"] { border-color: var(--accent-text); box-shadow: 0 0 0 2px var(--accent-text); }
.th-sw i { display: block; height: 54px; border-radius: 10px; position: relative; overflow: hidden; }
.th-sw i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; }
.th-neu i { background: #E7E1D8; box-shadow: inset 3px 3px 6px #C4BBAE, inset -3px -3px 6px #fff; }
.th-neu i::after { background: linear-gradient(145deg, #F2A93A, #D9850E); box-shadow: 4px 4px 8px #C4BBAE, -4px -4px 8px #fff; }
.th-brut i { background: #F1ECDF; border: 2px solid #111; border-radius: 0; }
.th-brut i::after { background: #FF4A1C; border: 3px solid #111; box-shadow: 4px 4px 0 #111; }
.th-mix i { background: #ECE6DC; box-shadow: inset 3px 3px 6px #C9C0B2, inset -3px -3px 6px #fff; }
.th-mix i::after { background: #FFC93C; border: 2.5px solid #1D1A16; box-shadow: 3px 3px 0 #1D1A16; }
.th-classic i { background: #16130f; }
.th-classic i::after { background: #f4a51c; box-shadow: 0 4px 0 #c97d05; }

/* ---------------------------------------------------------------------
   Shared light-theme fixes (neu, brut, mix)
   --------------------------------------------------------------------- */
:root:is([data-theme="neu"], [data-theme="brut"], [data-theme="mix"]) { color-scheme: light; }
:is([data-theme="neu"], [data-theme="brut"], [data-theme="mix"]) .logo { filter: brightness(0); opacity: .85; }
:is([data-theme="neu"], [data-theme="brut"], [data-theme="mix"]) .start-overlay { background: rgba(240,235,226,.9); }
:is([data-theme="neu"], [data-theme="brut"], [data-theme="mix"]) .rg-shade { background: rgba(40,32,24,.28); }
:is([data-theme="neu"], [data-theme="brut"], [data-theme="mix"]) .ans-bar { background: rgba(0,0,0,.12); }
:is([data-theme="neu"], [data-theme="brut"], [data-theme="mix"]) .qp-answer { background: var(--go-soft); }
:is([data-theme="neu"], [data-theme="brut"], [data-theme="mix"]) .tv-reveal { background: var(--go-soft); }
:is([data-theme="neu"], [data-theme="brut"], [data-theme="mix"]) .winner.has.crit,
:is([data-theme="neu"], [data-theme="brut"], [data-theme="mix"]) .winner.has.timeup { color: #fff; }

/* ---------------------------------------------------------------------
   NEUMORPHISM — soft clay, raised and pressed surfaces
   --------------------------------------------------------------------- */
[data-theme="neu"] {
  --bg: #E7E1D8; --panel: #E7E1D8; --panel-2: #E7E1D8; --line: rgba(80,62,40,.12);
  --text: #3D342B; --muted: #857868;
  --amber: #EEA02C; --amber-deep: #CF7F0B; --go: #2E9A62; --go-deep: #237A4D;
  --bad: #D9534F; --bad-deep: #B03A36; --idle: #E7E1D8;
  --on-amber: #3A2406; --on-go: #fff;
  --amber-soft: #F3E2C3; --amber-soft-text: #7A4C08; --go-soft: #D8EDDF;
  --console: #E7E1D8; --buzz-idle-text: #857868; --buzz-depth: #C4BBAE;
  --amber-depth: #B36D06; --go-depth: #1D6A42; --warn: #F07C1E; --warn-deep: #C35F0E;
  --knob: #fff; --accent-text: #B0680A; --go-text: #237A4D;
  --radius: 22px; --dw: 900;
  --display: "Nunito", system-ui, sans-serif; --body: "Nunito", system-ui, sans-serif;
  --sh-d: #C4BBAE; --sh-l: #FFFFFF;
  --raise: 8px 8px 18px var(--sh-d), -8px -8px 18px var(--sh-l);
  --raise-sm: 4px 4px 10px var(--sh-d), -4px -4px 10px var(--sh-l);
  --press: inset 4px 4px 9px var(--sh-d), inset -4px -4px 9px var(--sh-l);
}
[data-theme="neu"] body { font-weight: 600; }
[data-theme="neu"] :is(.bar, .rg-top) { border-bottom: 0; box-shadow: 0 6px 16px -8px var(--sh-d); position: relative; z-index: 2; }
[data-theme="neu"] .rg-console { border-top: 0; box-shadow: 0 -8px 18px -10px var(--sh-d); }
[data-theme="neu"] .player-foot { border-top: 0; }
[data-theme="neu"] .rg-players { border-left: 0; background: var(--bg); }
[data-theme="neu"] :is(.card, .rg-drawer, .pkg-picker) { border-color: transparent; box-shadow: var(--raise); }
[data-theme="neu"] .rg-drawer { box-shadow: -14px 0 40px rgba(120,100,80,.25); }
[data-theme="neu"] :is(.qpanel, .stats, .qcard, .tile, .podium li, .tv-choices li, .pkg-card, .b-presets, .flags-box, .flag-item, .rg-teams li, .tv-reveal, .notice, .tv-toast) { border-color: transparent; box-shadow: var(--raise-sm); }
[data-theme="neu"] :is(.list li, .final-list li, .qp-choices li, .qc-choices li) { border-color: transparent; background: var(--bg); box-shadow: var(--press); }
[data-theme="neu"] :is(.btn, .chip, .b-chip, .b-preset, .rg-pill, .rg-icon, .t-adj, .s-step button, .s-link, .th-sw) { border-color: transparent; background: var(--bg); box-shadow: var(--raise-sm); }
[data-theme="neu"] :is(.btn, .chip, .b-chip, .b-preset, .rg-pill, .rg-icon, .t-adj, .s-step button, .s-link, .th-sw):active:not(:disabled) { box-shadow: var(--press); }
[data-theme="neu"] :is(.b-chip.on, .b-preset.on, .b-count .chip.on) { box-shadow: var(--press); background: var(--amber-soft); color: var(--amber-soft-text); }
[data-theme="neu"] .th-sw[aria-pressed="true"] { box-shadow: var(--press); outline: 2px solid var(--accent-text); outline-offset: 2px; }
[data-theme="neu"] :is(.btn.primary, .rg-primary, .b-preset.surprise, .b-chip.b-rand.on) { background: linear-gradient(145deg, #F4AE45, #D9850E); color: var(--on-amber); box-shadow: var(--raise-sm); }
[data-theme="neu"] :is(.btn.go, .rg-judge.go) { background: linear-gradient(145deg, #3DB177, #258553); color: #fff; box-shadow: var(--raise-sm); }
[data-theme="neu"] .btn.bad { background: var(--bg); color: var(--bad); }
[data-theme="neu"] .rg-judge.bad { background: linear-gradient(145deg, #E3625E, #C24440); color: #fff; box-shadow: var(--raise-sm); }
[data-theme="neu"] .rg-judge.bad.soft { background: var(--bg); color: var(--bad); border: 0; box-shadow: var(--raise-sm); }
[data-theme="neu"] .rg-primary:active:not(:disabled) { transform: none; box-shadow: var(--press); }
[data-theme="neu"] .rg-primary.waiting { background: var(--bg); color: var(--muted); box-shadow: var(--press); }
[data-theme="neu"] :is(input, select, .b-field select, .b-count input, .tv-ctrl select, .tv-settings select) { background: var(--bg); border-color: transparent; box-shadow: var(--press); }
[data-theme="neu"] .rg-drawer.settings .s-step input { background: var(--bg); border-color: transparent; box-shadow: var(--press); }
[data-theme="neu"] .s-switch { box-shadow: var(--press); }
[data-theme="neu"] .s-switch::after { box-shadow: 2px 2px 4px var(--sh-d); }
[data-theme="neu"] .cat-chip { background: linear-gradient(145deg, #F4AE45, #D9850E); color: var(--on-amber); box-shadow: 2px 2px 5px var(--sh-d), -2px -2px 5px var(--sh-l); }
[data-theme="neu"] .tv-choices b { background: linear-gradient(145deg, #F4AE45, #D9850E); }
[data-theme="neu"] .tv-choices li.right b { background: #fff; color: var(--go-deep); }
[data-theme="neu"] .tv-choices li.right { color: #fff; }
[data-theme="neu"] .qc-choices li.right { color: #fff; }
[data-theme="neu"] .tile.win { box-shadow: var(--raise-sm), 0 0 0 2px var(--amber); }
[data-theme="neu"] .tile.ok { box-shadow: var(--raise-sm), 0 0 0 2px var(--go); }
/* buzzer */
[data-theme="neu"] .buzzer { background: linear-gradient(145deg, #EFEAE2, #DCD5CB); color: var(--muted); box-shadow: 16px 16px 34px var(--sh-d), -16px -16px 34px var(--sh-l); }
[data-theme="neu"] .buzzer:active { transform: scale(.98); box-shadow: inset 10px 10px 22px var(--sh-d), inset -10px -10px 22px var(--sh-l); }
[data-theme="neu"] .buzzer.is-open { background: linear-gradient(145deg, #45BC80, #258553); color: #fff; box-shadow: 16px 16px 34px var(--sh-d), -16px -16px 34px var(--sh-l), 0 0 40px rgba(46,154,98,.35); }
[data-theme="neu"] .buzzer.is-buzzed { background: linear-gradient(145deg, #E9B871, #CF8A1F); color: var(--on-amber); box-shadow: inset 10px 10px 22px rgba(120,70,0,.35), inset -8px -8px 18px rgba(255,255,255,.35); }
[data-theme="neu"] .buzzer.is-won { background: linear-gradient(145deg, #F7B54B, #D9850E); color: var(--on-amber); box-shadow: 16px 16px 34px var(--sh-d), -16px -16px 34px var(--sh-l), 0 0 60px rgba(238,160,44,.5); }
[data-theme="neu"] .buzzer.is-won.ans-warn { background: linear-gradient(145deg, #F79A48, #E0650B); box-shadow: 16px 16px 34px var(--sh-d), -16px -16px 34px var(--sh-l); }
[data-theme="neu"] :is(.buzzer.is-excluded, .buzzer.is-penalty, .buzzer.is-won.ans-timeup) { background: linear-gradient(145deg, #E3625E, #C24440); color: #fff; box-shadow: inset 8px 8px 18px rgba(110,20,20,.35), inset -8px -8px 18px rgba(255,255,255,.25); }
[data-theme="neu"] .buzzer.is-late { background: linear-gradient(145deg, #2E9A62, #1D6A42); color: #fff; box-shadow: 12px 12px 26px var(--sh-d), -12px -12px 26px var(--sh-l); }
/* winner card */
[data-theme="neu"] .winner { background: var(--bg); border: 0; box-shadow: var(--press); }
[data-theme="neu"] .winner.has { background: linear-gradient(145deg, #F7B54B, #D9850E); box-shadow: var(--raise); }
[data-theme="neu"] .winner.has.warn { background: linear-gradient(145deg, #F79A48, #E0650B); }
[data-theme="neu"] .winner.go { background: linear-gradient(145deg, #45BC80, #258553); color: #fff; box-shadow: var(--raise); }
[data-theme="neu"] .winner.revealing { background: var(--amber-soft); border: 0; color: var(--amber-soft-text); box-shadow: var(--raise); }
[data-theme="neu"] .winner.race { background: var(--bg); border: 0; box-shadow: var(--raise); }
[data-theme="neu"] .choice-box .ch { border-radius: 24px; box-shadow: 6px 6px 14px var(--sh-d), -6px -6px 14px var(--sh-l); }
[data-theme="neu"] .choice-box .ch:active:not(:disabled) { transform: scale(.98); box-shadow: inset 5px 5px 12px rgba(0,0,0,.25); }
[data-theme="neu"] .choice-box .ch.mine, [data-theme="neu"] .choice-box.revealed .ch.right { outline-color: var(--text); }
[data-theme="neu"] .podium li.p1 { box-shadow: var(--raise-sm), 0 0 0 2px var(--amber); }
[data-theme="neu"] .qr, [data-theme="neu"] .rg-drawer .qr, [data-theme="neu"] .tv-join .qr { box-shadow: var(--raise-sm); }

/* ---------------------------------------------------------------------
   BRUTALIST — paper, ink outlines, hard offset shadows, a bit crooked
   --------------------------------------------------------------------- */
[data-theme="brut"] {
  --bg: #F1ECDF; --panel: #FFFFFF; --panel-2: #FFFFFF; --line: #111111;
  --text: #111111; --muted: #57524A;
  --amber: #FFE14D; --amber-deep: #111111; --go: #3DDC84; --go-deep: #111111;
  --bad: #FF4A1C; --bad-deep: #111111; --idle: #FFFFFF;
  --on-amber: #111111; --on-go: #111111;
  --amber-soft: #FFF2A8; --amber-soft-text: #111111; --go-soft: #D4F7E2;
  --console: #111111; --buzz-idle-text: #111111; --buzz-depth: #111111;
  --amber-depth: #111111; --go-depth: #111111; --warn: #FF8A1C; --warn-deep: #111111;
  --knob: #111111; --accent-text: #C2300A; --go-text: #0B7A3E;
  --radius: 0px; --dw: 400;
  --display: "Archivo Black", "Arial Black", sans-serif; --body: "Space Grotesk", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
  --hard: 5px 5px 0 #111; --hard-sm: 3px 3px 0 #111;
}
[data-theme="brut"] body { font-weight: 500; }
[data-theme="brut"] :is(.chip, .rg-pill, kbd, .s-txt small, .muted.small, .pkg-count, .delta, .st-label, .qp-head, #qpMeta, .join-url) { font-family: var(--mono); }
[data-theme="brut"] :is(.bar, .rg-top) { border-bottom: 3px solid #111; background: #fff; }
[data-theme="brut"] .player-foot { border-top: 3px solid #111; background: #fff; }
[data-theme="brut"] .rg-console { border-top: 3px solid #111; }
[data-theme="brut"] .rg-console .rg-tools .btn { box-shadow: 3px 3px 0 #FFE14D; }
[data-theme="brut"] .rg-players { border-left: 3px solid #111; background: var(--bg); }
[data-theme="brut"] :is(.card, .qpanel, .stats, .qcard, .tile, .podium li, .tv-choices li, .pkg-card, .pkg-picker, .b-presets, .flags-box, .rg-teams li, .tv-reveal, .notice, .tv-toast) { border: 3px solid #111; border-radius: 0; box-shadow: var(--hard); }
[data-theme="brut"] .rg-drawer { border-left: 4px solid #111; border-radius: 0; box-shadow: -8px 0 0 #111; }
[data-theme="brut"] :is(.list li, .final-list li, .qp-choices li, .qc-choices li, .flag-item) { border: 2px solid #111; border-radius: 0; background: #fff; }
[data-theme="brut"] :is(.btn, .chip, .b-chip, .b-preset, .rg-pill, .rg-icon, .t-adj, .s-step button, .s-link, .th-sw) { border: 3px solid #111; border-radius: 0; background: #fff; color: #111; box-shadow: var(--hard-sm); }
[data-theme="brut"] .rg-icon { border-radius: 50%; }
[data-theme="brut"] :is(.btn, .chip, .b-chip, .b-preset, .rg-pill, .rg-icon, .t-adj, .s-step button, .s-link, .th-sw):active:not(:disabled) { transform: translate(3px, 3px); box-shadow: none; }
[data-theme="brut"] :is(.b-chip.on, .b-preset.on, .b-count .chip.on) { background: var(--amber); color: #111; }
[data-theme="brut"] .th-sw[aria-pressed="true"] { background: var(--amber); box-shadow: var(--hard); }
[data-theme="brut"] :is(.btn.primary, .b-preset.surprise, .b-chip.b-rand.on) { background: var(--amber); color: #111; }
[data-theme="brut"] .btn.go { background: var(--go); color: #111; }
[data-theme="brut"] .btn.bad { background: #fff; color: var(--accent-text); }
[data-theme="brut"] .rg-primary { background: var(--amber); color: #111; border: 4px solid #111; border-radius: 0; box-shadow: 6px 6px 0 #FFE14D, 6px 6px 0 2px #111; font-family: var(--display); font-weight: 400; letter-spacing: .01em; }
[data-theme="brut"] .rg-primary:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: 2px 2px 0 #FFE14D; }
[data-theme="brut"] .rg-primary.waiting { background: #fff; color: var(--muted); box-shadow: none; }
[data-theme="brut"] .rg-judge { border: 4px solid #111 !important; border-radius: 0; box-shadow: var(--hard) !important; font-family: var(--display); font-weight: 400; }
[data-theme="brut"] .rg-judge.go { background: var(--go); color: #111; }
[data-theme="brut"] .rg-judge.bad { background: var(--bad); color: #fff; }
[data-theme="brut"] .rg-judge.bad.soft { background: #fff; color: #111; }
[data-theme="brut"] .rg-judge:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: none !important; }
[data-theme="brut"] :is(input, select, .b-field select, .b-count input, .tv-ctrl select, .tv-settings select) { background: #fff; border: 3px solid #111; border-radius: 0; color: #111; }
[data-theme="brut"] .rg-drawer.settings .s-step input { background: #fff; border: 2px solid #111; border-radius: 0; }
[data-theme="brut"] input:focus { outline: 3px solid var(--amber); outline-offset: 0; }
[data-theme="brut"] .s-switch { border: 2px solid #111; background: #fff; }
[data-theme="brut"] .s-switch::after { top: 2px; left: 2px; }
[data-theme="brut"] .s-tog input:checked + .s-switch { background: var(--go); }
[data-theme="brut"] :is(.room-code, .rg-code) { color: var(--amber); background: #111; padding: 2px 10px; display: inline-block; }
[data-theme="brut"] .brand { color: #111; }
[data-theme="brut"] .cat-chip { background: var(--bad); color: #fff; border: 2px solid #111; border-radius: 0; transform: rotate(-2deg); font-family: var(--display); font-weight: 400; }
[data-theme="brut"] .tv-choices b { background: #111; color: var(--amber); border-radius: 0; }
[data-theme="brut"] .tv-choices li.right { border-color: #111; color: #111; }
[data-theme="brut"] .tv-choices li.right b { background: #111; color: var(--go); }
[data-theme="brut"] .tile:nth-child(odd) { transform: rotate(-.6deg); }
[data-theme="brut"] .tile:nth-child(even) { transform: rotate(.5deg); }
[data-theme="brut"] .tile.in { border-color: #111; background: var(--amber-soft); }
[data-theme="brut"] .tile.win { border-color: #111; background: var(--amber); box-shadow: 7px 7px 0 #111; }
[data-theme="brut"] .tile.ok { border-color: #111; background: var(--go-soft); }
[data-theme="brut"] .tile.ko { border-color: #111; }
[data-theme="brut"] .tile .tb { border: 2px solid #111; border-radius: 0; }
[data-theme="brut"] .qcard { transform: rotate(-.6deg); }
[data-theme="brut"] .stats { transform: rotate(.5deg); }
[data-theme="brut"] .card.join { transform: rotate(-.4deg); }
[data-theme="brut"] .podium li:nth-child(odd) { transform: rotate(-.6deg); }
[data-theme="brut"] .podium li:nth-child(even) { transform: rotate(.6deg); }
[data-theme="brut"] .podium li.p1 { background: var(--amber); }
/* buzzer */
[data-theme="brut"] .buzzer { border: 5px solid #111; background: #fff; color: #111; box-shadow: 10px 10px 0 #111; transform: rotate(-2deg); }
[data-theme="brut"] .buzzer:active { transform: rotate(-2deg) translate(6px, 6px); box-shadow: 4px 4px 0 #111; }
[data-theme="brut"] .buzzer.is-open { background: var(--go); color: #111; box-shadow: 10px 10px 0 #111; }
[data-theme="brut"] .buzzer.is-buzzed { background: var(--amber-soft); color: #111; box-shadow: 4px 4px 0 #111; }
[data-theme="brut"] .buzzer.is-won { background: var(--amber); color: #111; box-shadow: 10px 10px 0 #111; }
[data-theme="brut"] .buzzer.is-won.ans-warn { background: var(--warn); box-shadow: 10px 10px 0 #111; }
[data-theme="brut"] :is(.buzzer.is-excluded, .buzzer.is-penalty, .buzzer.is-won.ans-timeup) { background: var(--bad); color: #fff; box-shadow: 10px 10px 0 #111; }
[data-theme="brut"] .buzzer.is-late { background: #111; color: #fff; box-shadow: 10px 10px 0 var(--go); }
[data-theme="brut"] .buzz-label { text-transform: uppercase; }
/* winner card */
[data-theme="brut"] .winner { background: #fff; border: 3px dashed #111; border-radius: 0; }
[data-theme="brut"] .winner.has { background: var(--amber); border: 4px solid #111; box-shadow: 9px 9px 0 #111; color: #111; }
[data-theme="brut"] .winner.has .w-name { text-transform: uppercase; }
[data-theme="brut"] .winner.has .ans-num { color: var(--bad); -webkit-text-stroke: 3px #111; text-shadow: none; }
[data-theme="brut"] .winner.has.warn { background: var(--warn); }
[data-theme="brut"] .winner.has.warn .ans-num { color: #fff; }
[data-theme="brut"] .winner.has.crit .ans-num, [data-theme="brut"] .winner.has.timeup .ans-num { color: #fff; }
[data-theme="brut"] .winner.go { background: var(--go); color: #111; border: 4px solid #111; box-shadow: 9px 9px 0 #111; }
[data-theme="brut"] .winner.revealing { background: #111; color: var(--amber); border: 4px solid #111; }
[data-theme="brut"] .winner.race { background: #fff; border: 4px solid #111; box-shadow: var(--hard); }
[data-theme="brut"] .ans-bar i { background: #111; }
[data-theme="brut"] .choice-box .ch { border: 3px solid #111; border-radius: 0; box-shadow: var(--hard); }
[data-theme="brut"] .choice-box .ch:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: 1px 1px 0 #111; }
[data-theme="brut"] .choice-box .c0 { background: #FF4A1C; } [data-theme="brut"] .choice-box .c1 { background: #3E6BFF; }
[data-theme="brut"] .choice-box .c2 { background: #FFE14D; color: #111; } [data-theme="brut"] .choice-box .c3 { background: #3DDC84; color: #111; }
[data-theme="brut"] .choice-box.tf .c0 { background: #3DDC84; color: #111; } [data-theme="brut"] .choice-box.tf .c1 { background: #FF4A1C; color: #fff; }
[data-theme="brut"] .choice-box .ch.mine, [data-theme="brut"] .choice-box.revealed .ch.right { outline: 4px dashed #111; outline-offset: 4px; }
[data-theme="brut"] .qr, [data-theme="brut"] .rg-drawer .qr, [data-theme="brut"] .tv-join .qr { border: 3px solid #111; border-radius: 0; }
[data-theme="brut"] .tv-text, [data-theme="brut"] h1 { letter-spacing: -.01em; }

/* ---------------------------------------------------------------------
   HYBRID — neumorphic clay surfaces + brutalist ink on everything you press
   --------------------------------------------------------------------- */
[data-theme="mix"] {
  --bg: #ECE6DC; --panel: #ECE6DC; --panel-2: #ECE6DC; --line: rgba(29,26,22,.14);
  --text: #1D1A16; --muted: #756A5C;
  --amber: #FFC93C; --amber-deep: #1D1A16; --go: #3DCB7F; --go-deep: #1D1A16;
  --bad: #FF5A36; --bad-deep: #1D1A16; --idle: #ECE6DC;
  --on-amber: #1D1A16; --on-go: #1D1A16;
  --amber-soft: #FBEBC0; --amber-soft-text: #1D1A16; --go-soft: #D5F2E1;
  --console: #ECE6DC; --buzz-idle-text: #1D1A16; --buzz-depth: #1D1A16;
  --amber-depth: #1D1A16; --go-depth: #1D1A16; --warn: #FF8F2E; --warn-deep: #1D1A16;
  --knob: #fff; --accent-text: #B7470C; --go-text: #17824A;
  --radius: 22px; --dw: 400;
  --display: "Archivo Black", "Arial Black", sans-serif; --body: "Nunito", system-ui, sans-serif;
  --ink: #1D1A16; --sh-d: #C9C0B2; --sh-l: #FFFFFF;
  --soft: 7px 7px 16px var(--sh-d), -7px -7px 16px var(--sh-l);
  --soft-sm: 4px 4px 10px var(--sh-d), -4px -4px 10px var(--sh-l);
  --press: inset 4px 4px 9px var(--sh-d), inset -4px -4px 9px var(--sh-l);
  --hard: 4px 4px 0 var(--ink), -5px -5px 12px var(--sh-l);
}
[data-theme="mix"] body { font-weight: 600; }
[data-theme="mix"] :is(.bar, .rg-top) { border-bottom: 0; box-shadow: 0 6px 16px -8px var(--sh-d); position: relative; z-index: 2; }
[data-theme="mix"] .rg-console { border-top: 2px solid var(--ink); }
[data-theme="mix"] .player-foot { border-top: 0; }
[data-theme="mix"] .rg-players { border-left: 0; background: var(--bg); }
[data-theme="mix"] :is(.card, .pkg-picker) { border-color: transparent; box-shadow: var(--soft); }
[data-theme="mix"] .rg-drawer { border-left: 2.5px solid var(--ink); box-shadow: -14px 0 40px rgba(80,60,40,.25); }
[data-theme="mix"] :is(.qpanel, .stats, .qcard, .tile, .podium li, .tv-choices li, .pkg-card, .b-presets, .flags-box, .flag-item, .rg-teams li, .tv-reveal, .notice, .tv-toast) { border-color: transparent; box-shadow: var(--soft-sm); }
[data-theme="mix"] :is(.list li, .final-list li, .qp-choices li, .qc-choices li) { border-color: transparent; background: var(--bg); box-shadow: var(--press); }
[data-theme="mix"] :is(.btn, .chip, .b-chip, .b-preset, .rg-pill, .rg-icon, .t-adj, .s-step button, .s-link, .th-sw) { border: 2px solid var(--ink); background: var(--bg); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); border-radius: 14px; }
[data-theme="mix"] :is(.chip, .b-chip, .rg-pill, .rg-icon) { border-radius: 999px; }
[data-theme="mix"] :is(.btn, .chip, .b-chip, .b-preset, .rg-pill, .rg-icon, .t-adj, .s-step button, .s-link, .th-sw):active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
[data-theme="mix"] :is(.b-chip.on, .b-preset.on, .b-count .chip.on) { background: var(--amber); color: var(--ink); }
[data-theme="mix"] .th-sw[aria-pressed="true"] { background: var(--amber-soft); box-shadow: 4px 4px 0 var(--ink); }
[data-theme="mix"] :is(.btn.primary, .b-preset.surprise, .b-chip.b-rand.on) { background: var(--amber); color: var(--ink); }
[data-theme="mix"] .btn.go { background: var(--go); color: var(--ink); }
[data-theme="mix"] .btn.bad { background: var(--bg); color: #C23A1A; }
[data-theme="mix"] .rg-primary { background: var(--amber); color: var(--ink); border: 2.5px solid var(--ink); box-shadow: var(--hard); border-radius: 18px; font-family: var(--display); font-weight: 400; }
[data-theme="mix"] .rg-primary:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
[data-theme="mix"] .rg-primary.waiting { background: var(--bg); color: var(--muted); border-color: transparent; box-shadow: var(--press); }
[data-theme="mix"] .rg-judge { border: 2.5px solid var(--ink) !important; box-shadow: var(--hard) !important; border-radius: 18px; font-family: var(--display); font-weight: 400; }
[data-theme="mix"] .rg-judge.go { background: var(--go); color: var(--ink); }
[data-theme="mix"] .rg-judge.bad { background: var(--bad); color: #fff; }
[data-theme="mix"] .rg-judge.bad.soft { background: var(--bg); color: #C23A1A; }
[data-theme="mix"] .rg-judge:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink) !important; }
[data-theme="mix"] :is(input, select, .b-field select, .b-count input, .tv-ctrl select, .tv-settings select) { background: var(--bg); border-color: transparent; box-shadow: var(--press); }
[data-theme="mix"] .rg-drawer.settings .s-step input { background: var(--bg); border-color: transparent; box-shadow: var(--press); }
[data-theme="mix"] input:focus { outline: 2.5px solid var(--ink); }
[data-theme="mix"] .s-switch { border: 2px solid var(--ink); background: var(--bg); box-shadow: var(--press); }
[data-theme="mix"] .s-switch::after { top: 1px; left: 1px; background: #fff; border: 2px solid var(--ink); width: 20px; height: 20px; box-sizing: border-box; }
[data-theme="mix"] .s-tog input:checked + .s-switch { background: var(--go); }
[data-theme="mix"] .s-tog input:checked + .s-switch::after { transform: translateX(20px); }
[data-theme="mix"] :is(.room-code, .rg-code) { color: var(--ink); }
[data-theme="mix"] .rg-code { background: var(--amber); border: 2px solid var(--ink); border-radius: 10px; padding: 0 10px; box-shadow: 2px 2px 0 var(--ink); }
[data-theme="mix"] .brand { color: var(--ink); }
[data-theme="mix"] .cat-chip { background: var(--bad); color: #fff; border: 2px solid var(--ink); transform: rotate(-2deg); font-family: var(--display); font-weight: 400; letter-spacing: .03em; }
[data-theme="mix"] .tv-choices b { background: var(--amber); color: var(--ink); border: 2px solid var(--ink); }
[data-theme="mix"] .tv-choices li.right { background: var(--go); color: var(--ink); box-shadow: var(--hard); border: 2.5px solid var(--ink); }
[data-theme="mix"] .tv-choices li.right b { background: var(--ink); color: var(--go); }
[data-theme="mix"] .tile.in { box-shadow: var(--soft-sm), inset 0 0 0 2px var(--ink); }
[data-theme="mix"] .tile.win { background: var(--amber); border: 2.5px solid var(--ink); box-shadow: var(--hard); }
[data-theme="mix"] .tile.ok { background: var(--go-soft); border: 2.5px solid var(--ink); }
[data-theme="mix"] .tile.ko { border: 2.5px dashed var(--ink); }
[data-theme="mix"] .tile .tb { border: 2px solid var(--ink); }
[data-theme="mix"] .podium li.p1 { background: var(--amber); border: 2.5px solid var(--ink); box-shadow: var(--hard); }
/* buzzer */
[data-theme="mix"] .buzzer { border: 4px solid var(--ink); background: var(--bg); color: var(--ink); box-shadow: 9px 9px 0 var(--ink), -12px -12px 26px var(--sh-l); }
[data-theme="mix"] .buzzer:active { transform: translate(6px, 6px); box-shadow: 3px 3px 0 var(--ink), inset 6px 6px 14px rgba(0,0,0,.12); }
[data-theme="mix"] .buzzer.is-open { background: var(--go); color: var(--ink); box-shadow: 9px 9px 0 var(--ink), -12px -12px 26px var(--sh-l), 0 0 40px rgba(61,203,127,.4); }
[data-theme="mix"] .buzzer.is-buzzed { background: var(--amber-soft); color: var(--ink); box-shadow: 3px 3px 0 var(--ink), inset 6px 6px 14px rgba(120,80,0,.2); }
[data-theme="mix"] .buzzer.is-won { background: var(--amber); color: var(--ink); box-shadow: 9px 9px 0 var(--ink), 0 0 60px rgba(255,201,60,.6); }
[data-theme="mix"] .buzzer.is-won.ans-warn { background: var(--warn); box-shadow: 9px 9px 0 var(--ink); }
[data-theme="mix"] :is(.buzzer.is-excluded, .buzzer.is-penalty, .buzzer.is-won.ans-timeup) { background: var(--bad); color: #fff; box-shadow: 9px 9px 0 var(--ink); }
[data-theme="mix"] .buzzer.is-late { background: var(--ink); color: #fff; box-shadow: 9px 9px 0 var(--go); }
/* winner card */
[data-theme="mix"] .winner { background: var(--bg); border: 0; box-shadow: var(--press); }
[data-theme="mix"] .winner.has { background: var(--amber); border: 3px solid var(--ink); box-shadow: 7px 7px 0 var(--ink), -8px -8px 18px var(--sh-l); color: var(--ink); }
[data-theme="mix"] .winner.has .ans-num { text-shadow: 3px 3px 0 rgba(255,255,255,.6); }
[data-theme="mix"] .winner.has.warn { background: var(--warn); }
[data-theme="mix"] .winner.go { background: var(--go); color: var(--ink); border: 3px solid var(--ink); box-shadow: 7px 7px 0 var(--ink); }
[data-theme="mix"] .winner.revealing { background: var(--ink); color: var(--amber); border: 0; }
[data-theme="mix"] .winner.race { background: var(--bg); border: 2.5px solid var(--ink); box-shadow: var(--hard); }
[data-theme="mix"] .ans-bar i { background: var(--ink); }
[data-theme="mix"] .choice-box .ch { border: 2.5px solid var(--ink); border-radius: 22px; box-shadow: 5px 5px 0 var(--ink); }
[data-theme="mix"] .choice-box .ch:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
[data-theme="mix"] .choice-box .c2 { color: var(--ink); }
[data-theme="mix"] .choice-box .ch.mine, [data-theme="mix"] .choice-box.revealed .ch.right { outline: 3px solid var(--ink); outline-offset: 4px; }
[data-theme="mix"] .qr, [data-theme="mix"] .rg-drawer .qr, [data-theme="mix"] .tv-join .qr { border: 2.5px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
/* room for soft/offset shadows inside the clipped TV side column */
:is([data-theme="neu"], [data-theme="brut"], [data-theme="mix"]) .tv-side { padding: 14px 14px 18px; margin: -14px -14px -18px; }

/* TV: buzz countdown while buzzers are open */
.tv-winner.go { position: relative; overflow: hidden; }
.buzz-left { font-family: var(--display); font-weight: var(--dw); font-size: clamp(2rem, 4vw, 4.6rem); line-height: 1; padding-bottom: 22px; font-variant-numeric: tabular-nums; }
.buzz-left.low { animation: beat .5s ease-in-out infinite; }
.tv-winner.go .ans-bar i { background: currentColor; }

/* TV: generous safe margin all around (TVs crop the edges / overscan) */
body.tv { padding: clamp(20px, 4.5vh, 70px) clamp(28px, 5vw, 110px); }
body.tv .tv-bar { padding-left: 0; padding-right: 0; }
body.tv .tv-grid { padding-left: 0; padding-right: 0; padding-bottom: 0; }

/* =====================================================================
   PITON wordmark — neon tube on dark themes, plain on pale themes
   ===================================================================== */
.wordmark { --neon: #ff2e88; --brand-ink: var(--text); display: inline-block; flex: none; font-family: "Vibur", cursive; font-weight: 400; font-size: 2.2rem; line-height: 1; letter-spacing: .01em; color: var(--brand-ink); white-space: nowrap; user-select: none; -webkit-user-select: none; padding: 0 .08em; }
.wordmark i { font-style: normal; }
body.host .bar .wordmark { font-size: 2.4rem; }
.tv-bar .wordmark { font-size: clamp(2.4rem, 3.2vw, 4rem); }
.hero { text-align: center; margin: 0 0 10px; }
.hero .wordmark { font-size: clamp(3.6rem, 16vw, 5rem); }
@media (max-width: 900px) { body.host .bar .wordmark { font-size: 2rem; } }
[data-theme="neu"] .wordmark { --brand-ink: var(--accent-text); }
[data-theme="brut"] .wordmark { --brand-ink: #111; }
[data-theme="mix"] .wordmark { --brand-ink: #1D1A16; }

/* dark themes: lit neon sign with two flickering tubes */
:is([data-theme="neon"], [data-theme="classic"]) .wordmark {
  color: #fff0f6;
  text-shadow: 0 -.25em .9em var(--neon), 0 0 2px #fff, 0 0 1em var(--neon), 0 0 .5em var(--neon), 0 0 .1em var(--neon), 0 .08em .05em #000;
}
[data-theme="classic"] .wordmark { --neon: #ff7a1a; }
:is([data-theme="neon"], [data-theme="classic"]) .wordmark i { animation: neon-blink 2s linear infinite; }
:is([data-theme="neon"], [data-theme="classic"]) .wordmark i:nth-of-type(2) { animation-duration: 3s; }
@keyframes neon-blink {
  78% { color: inherit; text-shadow: inherit; }
  79% { color: #3a2a38; }
  80% { text-shadow: none; }
  81% { color: inherit; text-shadow: inherit; }
  82% { color: #3a2a38; text-shadow: none; }
  83% { color: inherit; text-shadow: inherit; }
  92% { color: #3a2a38; text-shadow: none; }
  92.5% { color: inherit; text-shadow: inherit; }
}
@media (prefers-reduced-motion: reduce) { .wordmark i { animation: none !important; } }

/* ---------------------------------------------------------------------
   NEON — night-club dark, glowing tubes (pink / cyan / green)
   --------------------------------------------------------------------- */
.th-neon i { background: radial-gradient(circle at 50% 120%, #2a0f45, #0a0713 70%); }
.th-neon i::after { background: transparent; border: 3px solid #3fe6ff; box-shadow: 0 0 10px #3fe6ff, inset 0 0 8px #3fe6ff; }
[data-theme="neon"] {
  --bg: #0a0713; --panel: #120c22; --panel-2: #1a1130; --line: rgba(160,140,255,.2);
  --text: #f4ecff; --muted: #a497c2;
  --amber: #ff2e88; --amber-deep: #b3125c; --go: #39ff9f; --go-deep: #12a86a;
  --bad: #ff4d5e; --bad-deep: #a8182a; --idle: #1b1330;
  --on-amber: #fff; --on-go: #04140c;
  --amber-soft: #2b0d24; --amber-soft-text: #ff9ccb; --go-soft: #0b2a1f;
  --console: #07050d; --buzz-idle-text: #a497c2; --buzz-depth: #050309;
  --amber-depth: #6e0a39; --go-depth: #0a6e45; --warn: #ff8a1f; --warn-deep: #a34f05;
  --knob: #fff; --accent-text: #ff5fa8; --go-text: #39ff9f;
  --cyan: #3fe6ff; --pink: #ff2e88;
  --radius: 16px; --dw: 900;
  --display: "Exo 2", "Archivo Black", sans-serif; --body: "Chakra Petch", system-ui, sans-serif;
  --glow-c: 0 0 0 1px rgba(63,230,255,.35), 0 0 16px rgba(63,230,255,.18);
  --glow-p: 0 0 0 1px rgba(255,46,136,.6), 0 0 22px rgba(255,46,136,.45);
  --glow-g: 0 0 0 1px rgba(57,255,159,.6), 0 0 22px rgba(57,255,159,.4);
  color-scheme: dark;
}
[data-theme="neon"] body { background: radial-gradient(120% 80% at 50% 115%, #2a0f45 0%, #140b28 45%, #0a0713 75%) fixed; font-weight: 500; }
[data-theme="neon"] :is(.bar, .rg-top) { background: rgba(10,7,19,.85); border-bottom: 1px solid rgba(63,230,255,.3); box-shadow: 0 1px 18px rgba(63,230,255,.12); }
[data-theme="neon"] .rg-console { background: rgba(7,5,13,.92); border-top: 1px solid rgba(255,46,136,.4); box-shadow: 0 -1px 18px rgba(255,46,136,.15); }
[data-theme="neon"] .player-foot { border-top: 1px solid rgba(63,230,255,.25); }
[data-theme="neon"] .rg-players { background: rgba(18,12,34,.6); border-left: 1px solid rgba(63,230,255,.25); }
[data-theme="neon"] :is(.card, .qpanel, .stats, .qcard, .tile, .podium li, .tv-choices li, .pkg-card, .pkg-picker, .b-presets, .flags-box, .rg-teams li, .notice, .tv-toast) { background: rgba(18,12,34,.82); border-color: rgba(63,230,255,.3); box-shadow: var(--glow-c); }
[data-theme="neon"] .rg-drawer { background: #0e0a1c; border-left: 1px solid var(--cyan); box-shadow: -10px 0 40px rgba(63,230,255,.18); }
[data-theme="neon"] :is(.list li, .final-list li, .qp-choices li, .qc-choices li, .flag-item) { background: rgba(26,17,48,.8); border-color: rgba(160,140,255,.18); }
[data-theme="neon"] :is(.btn, .chip, .b-chip, .b-preset, .rg-pill, .rg-icon, .t-adj, .s-step button, .s-link, .th-sw) { background: rgba(10,7,19,.6); border: 1.5px solid rgba(63,230,255,.55); color: var(--cyan); box-shadow: 0 0 10px rgba(63,230,255,.15); text-shadow: 0 0 8px rgba(63,230,255,.45); }
[data-theme="neon"] :is(.btn, .chip, .b-chip, .b-preset, .rg-pill, .rg-icon, .t-adj, .s-step button, .s-link, .th-sw):hover { box-shadow: 0 0 16px rgba(63,230,255,.4); }
[data-theme="neon"] :is(.b-chip.on, .b-preset.on, .b-count .chip.on) { background: rgba(255,46,136,.16); border-color: var(--pink); color: #ffd1e6; box-shadow: var(--glow-p); text-shadow: 0 0 8px rgba(255,46,136,.6); }
[data-theme="neon"] .th-sw[aria-pressed="true"] { border-color: var(--pink); box-shadow: var(--glow-p); color: #fff; }
[data-theme="neon"] :is(.btn.primary, .rg-primary, .b-preset.surprise, .b-chip.b-rand.on) { background: var(--pink); border: 0; color: #fff; text-shadow: 0 0 6px rgba(255,255,255,.6); box-shadow: 0 0 0 1px #ff8ec0, 0 0 24px rgba(255,46,136,.7), inset 0 0 12px rgba(255,255,255,.25); }
[data-theme="neon"] .rg-primary:active:not(:disabled) { transform: translateY(2px); }
[data-theme="neon"] .rg-primary.waiting { background: transparent; color: var(--muted); box-shadow: 0 0 0 1px rgba(160,140,255,.3); text-shadow: none; }
[data-theme="neon"] :is(.btn.go, .rg-judge.go) { background: var(--go); border: 0; color: #04140c; text-shadow: none; box-shadow: 0 0 0 1px #9dffd0, 0 0 24px rgba(57,255,159,.6) !important; }
[data-theme="neon"] .btn.bad { background: transparent; border-color: var(--bad); color: #ff8a96; text-shadow: 0 0 8px rgba(255,77,94,.5); }
[data-theme="neon"] .rg-judge.bad { background: var(--bad); color: #fff; box-shadow: 0 0 0 1px #ff9aa5, 0 0 22px rgba(255,77,94,.55) !important; }
[data-theme="neon"] .rg-judge.bad.soft { background: transparent; color: #ff8a96; border: 1.5px solid var(--bad); box-shadow: 0 0 12px rgba(255,77,94,.3) !important; }
[data-theme="neon"] :is(input, select, .b-field select, .b-count input, .tv-ctrl select, .tv-settings select) { background: #07050d; border: 1px solid rgba(63,230,255,.4); color: var(--text); }
[data-theme="neon"] .rg-drawer.settings .s-step input { background: #07050d; border-color: rgba(63,230,255,.4); }
[data-theme="neon"] input:focus { outline: 2px solid var(--cyan); box-shadow: 0 0 14px rgba(63,230,255,.5); }
[data-theme="neon"] .s-switch { background: #07050d; box-shadow: 0 0 0 1px rgba(160,140,255,.35); }
[data-theme="neon"] .s-tog input:checked + .s-switch { background: var(--go); box-shadow: var(--glow-g); }
[data-theme="neon"] :is(.room-code, .rg-code) { color: #eaffff; text-shadow: 0 0 4px #fff, 0 0 12px var(--cyan), 0 0 26px var(--cyan); }
[data-theme="neon"] :is(h1, .rg-drawer h2, .tv-final h2) { text-shadow: 0 0 14px rgba(255,46,136,.55); }
[data-theme="neon"] .cat-chip { background: transparent; color: #ffd1e6; border: 1.5px solid var(--pink); box-shadow: var(--glow-p); text-shadow: 0 0 8px var(--pink); }
[data-theme="neon"] .tv-text { text-shadow: 0 0 22px rgba(160,140,255,.35); }
[data-theme="neon"] .tv-choices b { background: transparent; color: var(--cyan); border: 2px solid var(--cyan); box-shadow: 0 0 10px rgba(63,230,255,.5); }
[data-theme="neon"] .tv-choices li.right { background: rgba(57,255,159,.14); border-color: var(--go); color: #eafff4; box-shadow: var(--glow-g); }
[data-theme="neon"] .tv-choices li.right b { background: var(--go); color: #04140c; border-color: var(--go); }
[data-theme="neon"] :is(.qp-answer, .tv-reveal) { background: rgba(57,255,159,.08); border-color: var(--go); box-shadow: var(--glow-g); }
[data-theme="neon"] .rv-answer { text-shadow: 0 0 18px rgba(57,255,159,.7); }
[data-theme="neon"] .tile.in { border-color: rgba(255,46,136,.6); }
[data-theme="neon"] .tile.win { background: rgba(255,46,136,.16); border-color: var(--pink); box-shadow: var(--glow-p); }
[data-theme="neon"] .tile.ok { background: rgba(57,255,159,.1); border-color: var(--go); box-shadow: var(--glow-g); }
[data-theme="neon"] .podium li.p1 { background: rgba(255,46,136,.16); border-color: var(--pink); box-shadow: var(--glow-p); }
[data-theme="neon"] .fm-rank { text-shadow: 0 0 20px var(--pink); }
/* buzzer: a glowing ring */
[data-theme="neon"] .buzzer { background: radial-gradient(circle at 50% 40%, #1d1436, #0c0818 70%); color: var(--muted); border: 3px solid rgba(160,140,255,.35); box-shadow: 0 0 0 6px rgba(10,7,19,.9), 0 0 30px rgba(160,140,255,.15); }
[data-theme="neon"] .buzzer:active { transform: scale(.97); }
[data-theme="neon"] .buzzer.is-open { background: radial-gradient(circle at 50% 40%, #0f3a2a, #06140e 72%); color: #d9fff0; border-color: var(--go); text-shadow: 0 0 12px var(--go); box-shadow: 0 0 0 6px rgba(10,7,19,.9), 0 0 24px var(--go), 0 0 70px rgba(57,255,159,.45), inset 0 0 36px rgba(57,255,159,.35); }
[data-theme="neon"] .buzzer.is-buzzed { background: radial-gradient(circle at 50% 40%, #2a0f2a, #120814 72%); color: #ffc2de; border-color: rgba(255,46,136,.6); box-shadow: 0 0 0 6px rgba(10,7,19,.9), 0 0 20px rgba(255,46,136,.35); }
[data-theme="neon"] .buzzer.is-won { background: radial-gradient(circle at 50% 40%, #ff4f9c, #b3125c 75%); color: #fff; border-color: #ffb3d4; text-shadow: 0 0 10px rgba(255,255,255,.7); box-shadow: 0 0 0 6px rgba(10,7,19,.9), 0 0 30px var(--pink), 0 0 90px rgba(255,46,136,.6); }
[data-theme="neon"] .buzzer.is-won.ans-warn { background: radial-gradient(circle at 50% 40%, #ffa24f, #c4580a 75%); box-shadow: 0 0 0 6px rgba(10,7,19,.9), 0 0 30px #ff8a1f, 0 0 80px rgba(255,138,31,.5); }
[data-theme="neon"] :is(.buzzer.is-excluded, .buzzer.is-penalty, .buzzer.is-won.ans-timeup) { background: radial-gradient(circle at 50% 40%, #ff5a6a, #8f1222 75%); color: #fff; border-color: #ffb0b8; box-shadow: 0 0 0 6px rgba(10,7,19,.9), 0 0 30px var(--bad); }
[data-theme="neon"] .buzzer.is-late { background: radial-gradient(circle at 50% 40%, #0f3a2a, #06140e 72%); color: #d9fff0; border-color: var(--go-deep); box-shadow: 0 0 0 6px rgba(10,7,19,.9), 0 0 18px rgba(57,255,159,.3); }
/* winner card */
[data-theme="neon"] .winner { background: rgba(18,12,34,.6); border: 1.5px dashed rgba(160,140,255,.3); }
[data-theme="neon"] .winner.has { background: linear-gradient(160deg, #ff4f9c, #c0156a); border: 0; color: #fff; box-shadow: 0 0 0 1px #ffb3d4, 0 0 36px rgba(255,46,136,.6); }
[data-theme="neon"] .winner.has .ans-num { text-shadow: 0 0 18px rgba(255,255,255,.7); }
[data-theme="neon"] .winner.has.warn { background: linear-gradient(160deg, #ffa24f, #d4600b); box-shadow: 0 0 0 1px #ffd0a3, 0 0 36px rgba(255,138,31,.6); }
[data-theme="neon"] .winner.go { background: rgba(57,255,159,.12); border: 2px solid var(--go); color: #d9fff0; text-shadow: 0 0 16px var(--go); box-shadow: var(--glow-g), inset 0 0 30px rgba(57,255,159,.2); }
[data-theme="neon"] .winner.revealing { background: rgba(255,46,136,.1); border: 2px solid var(--pink); color: #ffd1e6; text-shadow: 0 0 14px var(--pink); }
[data-theme="neon"] .winner.race { background: rgba(18,12,34,.82); border: 1.5px solid var(--cyan); box-shadow: var(--glow-c); }
[data-theme="neon"] .ans-bar { background: rgba(255,255,255,.12); }
[data-theme="neon"] .ans-bar i { background: #fff; box-shadow: 0 0 10px #fff; }
[data-theme="neon"] .choice-box .ch { background: rgba(10,7,19,.7) !important; border: 2.5px solid; box-shadow: 0 0 18px currentColor, inset 0 0 18px rgba(255,255,255,.04); text-shadow: 0 0 10px currentColor; }
[data-theme="neon"] .choice-box .c0 { color: #ff5a6a; } [data-theme="neon"] .choice-box .c1 { color: #3fe6ff; }
[data-theme="neon"] .choice-box .c2 { color: #ffd23f; } [data-theme="neon"] .choice-box .c3 { color: #39ff9f; }
[data-theme="neon"] .choice-box.tf .c0 { color: #39ff9f; } [data-theme="neon"] .choice-box.tf .c1 { color: #ff5a6a; }
[data-theme="neon"] .choice-box .ch.mine, [data-theme="neon"] .choice-box.revealed .ch.right { outline: 2px solid #fff; outline-offset: 4px; }
[data-theme="neon"] .qr, [data-theme="neon"] .rg-drawer .qr, [data-theme="neon"] .tv-join .qr { box-shadow: 0 0 0 2px var(--cyan), 0 0 22px rgba(63,230,255,.5); }
[data-theme="neon"] .start-overlay { background: rgba(5,3,10,.88); }
[data-theme="neon"] .tv-side { padding: 14px 14px 18px; margin: -14px -14px -18px; }

/* TV: question with choices takes less height so it never runs under the winner card */
.tv-q:has(.tv-choices:not([hidden])) .tv-text { font-size: clamp(1.8rem, 3.1vw, 4.4rem); }
.tv-q:has(.tv-choices:not([hidden])) .tv-text.long { font-size: clamp(1.5rem, 2.4vw, 3.4rem); }
.tv-main { min-height: 0; }
.tv-q { min-height: 0; overflow: hidden; }
.tv-winner, .tv-reveal { flex: none; }

/* =====================================================================
   MICRO-ANIMATIONS
   ===================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes rise-sm { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { 0% { opacity: 0; transform: scale(.82); } 60% { opacity: 1; transform: scale(1.04); } 100% { opacity: 1; transform: scale(1); } }
@keyframes tick-pop { 0% { transform: scale(1.32); filter: brightness(1.6); } 100% { transform: scale(1); filter: none; } }
@keyframes pill-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes bump-up { 0% { transform: scale(1); } 30% { transform: scale(1.45); color: var(--go-text); text-shadow: 0 0 14px var(--go); } 100% { transform: scale(1); } }
@keyframes bump-down { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); color: var(--bad); } 75% { transform: translateX(4px); color: var(--bad); } }
@keyframes float-up { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, -6px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -54px) scale(1); } }
@keyframes ring-out { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes hit-wave { 0% { opacity: .9; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes right-glow { 0% { transform: scale(1); } 35% { transform: scale(1.05); box-shadow: 0 0 0 2px var(--go), 0 0 50px var(--go); } 100% { transform: scale(1); } }
@keyframes shimmer { from { background-position: -150% 0; } to { background-position: 250% 0; } }
@keyframes breathe { 50% { text-shadow: 0 0 6px #fff, 0 0 18px var(--cyan, #3fe6ff), 0 0 44px var(--cyan, #3fe6ff); } }

/* buttons: lift on hover, squish on press */
.btn, .chip, .rg-pill, .rg-icon, .t-adj, .s-step button, .s-link, .b-chip, .b-preset, .rg-primary, .rg-judge { transition: transform .12s ease, box-shadow .2s ease, background-color .2s ease, opacity .2s; }
@media (hover: hover) { :is(.btn, .rg-pill, .rg-icon, .s-link, .b-preset, .rg-primary, .rg-judge):hover:not(:disabled) { transform: translateY(-1px); } }
:is(.btn, .chip, .rg-pill, .rg-icon, .t-adj, .s-step button, .s-link, .b-chip, .b-preset, .rg-primary, .rg-judge):active:not(:disabled) { transform: translateY(1px) scale(.97); }

/* screens and cards arrive */
#joinView:not([hidden]), #startView:not([hidden]), #finalView:not([hidden]), .pkg-view:not([hidden]) { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.hero .wordmark { animation: pop-in .8s .1s cubic-bezier(.2,1.3,.4,1) both; }
.q-in { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.tv-text.q-in { animation-duration: .6s; }
.fresh > li, .choice-box.fresh .ch { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.fresh > li:nth-child(2), .choice-box.fresh .ch:nth-child(2) { animation-delay: .08s; }
.fresh > li:nth-child(3), .choice-box.fresh .ch:nth-child(3) { animation-delay: .16s; }
.fresh > li:nth-child(4), .choice-box.fresh .ch:nth-child(4) { animation-delay: .24s; }
.tv-reveal:not([hidden]) { animation: pop-in .55s cubic-bezier(.2,1.3,.4,1) both; }
.qp-answer:not([hidden]) { animation: rise-sm .35s ease both; }
.qc-answer { animation: rise-sm .35s ease both; }

/* countdowns, status and scores */
.tick { display: inline-block; animation: tick-pop .35s cubic-bezier(.2,.9,.3,1) both; }
.ans-num.tick, .buzz-left.tick { display: block; }
.pill.pop { animation: pill-pop .35s cubic-bezier(.2,1.4,.4,1); }
.bump-up { display: inline-block; animation: bump-up .7s cubic-bezier(.2,1.2,.4,1); }
.bump-down { display: inline-block; animation: bump-down .45s ease; }
.player-foot { position: relative; }
.player-foot > span { position: relative; }
.float-pts { position: absolute; left: calc(100% - .4em); top: -10px; pointer-events: none; font-family: var(--display); font-weight: var(--dw); font-size: 1.5rem; color: var(--go-text); text-shadow: 0 0 12px var(--go); animation: float-up 1.3s ease-out forwards; }
.float-pts.neg { color: var(--bad); text-shadow: 0 0 12px var(--bad); }
.row-new { animation: rise-sm .45s ease both; }
.tile.pop { animation: pop-in .5s cubic-bezier(.2,1.4,.4,1); }

/* winner cards and live states */
.winner.has, .winner.go, .winner.race { animation: pop-in .5s cubic-bezier(.2,1.3,.4,1) both; }
.winner.has.crit, .winner.has.timeup { animation: red-pulse .5s ease-in-out infinite alternate, tremble .18s linear infinite; }
.winner.has.timeup { animation: red-pulse 1s ease-in-out infinite alternate; }
.tile { transition: border-color .2s, background-color .2s, box-shadow .3s, opacity .3s, transform .2s; }
.tv-choices li.right { animation: right-glow 1.1s cubic-bezier(.2,.9,.3,1); }
.tv-choices li, .qc-choices li { transition: opacity .4s, background-color .3s, border-color .3s, filter .4s; }
.choice-box .ch.mine { animation: chosen-glow .5s ease-out; }
@keyframes chosen-glow { 0% { filter: brightness(1.8); } 100% { filter: none; } }
.choice-box.revealed .ch.wrong { animation: bump-down .45s ease; }
.race-msg.tick { display: block; }

/* the buzzer: a ring that breathes out while open, a shockwave on press */
.buzzer { position: relative; }
.buzzer::before, .buzzer::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; pointer-events: none; opacity: 0; }
.buzzer.is-open::before { border: 3px solid var(--go); animation: ring-out 1.6s ease-out infinite; }
.buzzer.hit::after { border: 4px solid #fff; animation: hit-wave .45s ease-out; }
.buzzer.is-won::before { border: 3px solid var(--amber); animation: ring-out 1.2s ease-out infinite; }

/* host drawers slide in */
.rg-drawer:not([hidden]) { animation: drawer-in .28s cubic-bezier(.2,.8,.2,1); }
.rg-shade:not([hidden]) { animation: fade-in .25s ease; }

/* final results cascade */
.podium li, .final-list li { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; }
.podium li:nth-child(1) { animation-delay: .15s; } .podium li:nth-child(2) { animation-delay: .35s; } .podium li:nth-child(3) { animation-delay: .55s; }
.podium li:nth-child(n+4) { animation-delay: .7s; }
.final-list li { animation-delay: .8s; }
.fm-rank { animation: pop-in .7s .1s cubic-bezier(.2,1.4,.4,1) both; }
.podium li.p1 { position: relative; overflow: hidden; }
.podium li.p1::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%) no-repeat; background-size: 60% 100%; animation: shimmer 2.8s 1s ease-in-out infinite; pointer-events: none; }

/* neon room code breathes on the TV */
[data-theme="neon"] .tv-join .room-code { animation: breathe 3.2s ease-in-out infinite; }

/* ---------------------------------------------------------------------
   TV: the winner moment — calm spotlight, soft beams, name fades in
   --------------------------------------------------------------------- */
.tv-cheer { position: fixed; inset: 0; z-index: 30; display: none; place-items: center; pointer-events: none; overflow: hidden;
  background: radial-gradient(ellipse at center, rgba(14,8,28,.82) 0%, rgba(5,3,10,.95) 75%); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.tv-cheer.go { display: grid; animation: cheer-bg .9s ease forwards; }
.tv-cheer.out { animation: cheer-out .9s ease forwards; }
@keyframes cheer-bg { from { opacity: 0; } to { opacity: 1; } }
@keyframes cheer-out { from { opacity: 1; } to { opacity: 0; } }
.ch-beams { position: absolute; left: 50%; top: 50%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax;
  background: conic-gradient(from 0deg, transparent 0 7%, rgba(255,46,136,.11) 10%, transparent 13% 32%, rgba(63,230,255,.09) 35%, transparent 38% 57%, rgba(255,46,136,.11) 60%, transparent 63% 82%, rgba(63,230,255,.09) 85%, transparent 88%);
  -webkit-mask: radial-gradient(circle, transparent 0 5%, #000 14%, transparent 45%); mask: radial-gradient(circle, transparent 0 5%, #000 14%, transparent 45%);
  opacity: 0; }
.go .ch-beams { animation: beams-in 1.6s .2s ease forwards, beams-spin 30s linear infinite; }
@keyframes beams-in { to { opacity: 1; } }
@keyframes beams-spin { to { transform: rotate(360deg); } }
.ch-ring { position: absolute; left: 50%; top: 50%; width: 40vmin; height: 40vmin; margin: -20vmin 0 0 -20vmin; border-radius: 50%;
  border: 1.5px solid rgba(255,46,136,.7); box-shadow: 0 0 18px rgba(255,46,136,.35); opacity: 0; }
.go .ch-ring { animation: ch-ring 2.6s .3s cubic-bezier(.2,.6,.3,1) forwards; }
@keyframes ch-ring { 0% { opacity: 0; transform: scale(.5); } 25% { opacity: .8; } 100% { opacity: 0; transform: scale(2.4); } }
.ch-body { position: relative; text-align: center; width: 100%; max-width: 88vw; padding: 0 2vw; box-sizing: border-box; }
.ch-kicker { font-family: var(--display); font-weight: var(--dw); text-transform: uppercase; letter-spacing: .28em; font-size: clamp(.95rem, 1.5vw, 1.8rem); color: #bff6ff;
  text-shadow: 0 0 10px rgba(63,230,255,.7); opacity: 0; }
.go .ch-kicker { animation: soft-in .8s .15s ease-out forwards; }
@keyframes soft-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ch-name { display: block; margin: .12em 0 0; font-family: var(--display); font-weight: var(--dw); line-height: 1.05;
  font-size: clamp(3rem, 8vw, 9rem); color: #fff; overflow-wrap: anywhere;
  text-shadow: 0 0 4px rgba(255,255,255,.8), 0 0 18px rgba(255,46,136,.75), 0 0 46px rgba(255,46,136,.4); }
.ch-name.l { font-size: clamp(2.6rem, 6vw, 7rem); }
.ch-name.xl { font-size: clamp(2.2rem, 4.4vw, 5.2rem); }
.ch-name span { display: inline-block; opacity: 0; }
.go .ch-name span { animation: letter-in .9s calc(.35s + var(--i) * .04s) ease-out forwards; }
@keyframes letter-in { from { opacity: 0; transform: translateY(.15em); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.ch-team { margin-top: .2em; font-family: var(--display); font-weight: var(--dw); font-size: clamp(1.2rem, 2.4vw, 2.8rem); color: #bff6ff; text-shadow: 0 0 12px rgba(63,230,255,.6); opacity: 0; overflow-wrap: anywhere; }
.go .ch-team { animation: soft-in .8s .9s ease-out forwards; }
.ch-pts { margin-top: .25em; font-family: var(--display); font-weight: var(--dw); font-size: clamp(1.6rem, 3.2vw, 3.8rem); color: #d9fff0; text-shadow: 0 0 14px rgba(57,255,159,.6); opacity: 0; }
.ch-pts b { font-variant-numeric: tabular-nums; }
.go .ch-pts { animation: soft-in .8s 1s ease-out forwards; }
.ch-ans { margin-top: .5em; font-size: clamp(1rem, 1.7vw, 2rem); font-weight: 600; color: rgba(244,236,255,.7); opacity: 0; }
.go .ch-ans { animation: soft-in .8s 1.2s ease-out forwards; }

/* phone: a smaller version, only on the winner's phone */
.ph-cheer { position: fixed; inset: 0; z-index: 40; display: none; place-items: center; pointer-events: none; overflow: hidden; background: radial-gradient(circle, rgba(10,6,22,.94), rgba(5,3,10,.97) 75%); }
.ph-cheer.go { display: grid; animation: ph-cheer 2.4s ease forwards; }
@keyframes ph-cheer { 0% { opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.ph-cheer .ch-ring { width: 60vw; height: 60vw; margin: -30vw 0 0 -30vw; }
.ph-cheer.go .ch-kicker { animation: soft-in .6s .1s ease-out forwards; }
.ph-cheer.go .ph-c-pts { animation: soft-in .6s .25s ease-out forwards; }
.ph-cheer.go .ch-ring { animation: ch-ring 1.4s .1s cubic-bezier(.1,.6,.3,1) forwards; }
.ph-c-body { text-align: center; }
.ph-cheer .ch-kicker { font-size: 1.1rem; }
.ph-c-pts { font-family: var(--display); font-weight: var(--dw); font-size: 6rem; line-height: 1; color: #d9fff0; text-shadow: 0 0 14px #39ff9f, 0 0 40px #39ff9f; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .tv-cheer.go, .ph-cheer.go { animation: none !important; opacity: 1; }
  .ch-name span, .ch-kicker, .ch-pts, .ch-ans, .ph-c-pts { opacity: 1 !important; }
}

/* answer race: no zoom on tap, early taps = penalty */
html, body, .choice-box, .choice-box .ch, .buzzer { touch-action: manipulation; }
.choice-box .ch { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.choice-box .ch:active:not(:disabled) { transform: translateY(3px); }
.choice-box.early .ch { opacity: .45; filter: saturate(.6); }
.choice-box.penalty .ch { opacity: .25; filter: grayscale(.8); }
.choice-box.penalty .race-msg { color: var(--bad); }

/* =====================================================================
   HOST GUIDANCE — preset cards, lobby checklist, coach, more menu, help
   ===================================================================== */
.b-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.b-cards .b-preset { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px 16px; min-height: 88px; border-radius: 14px; }
.b-cards .b-preset b { font-size: 1.05rem; }
.b-cards .b-preset small { font-weight: 500; font-size: .85rem; line-height: 1.35; color: var(--muted); text-shadow: none; }
.b-cards .b-preset.on small, .b-cards .b-preset.surprise small { color: inherit; opacity: .85; }
[data-theme="neon"] .b-cards .b-preset.on { background: rgba(255,46,136,.16); border-color: var(--pink); color: #fff; box-shadow: var(--glow-p); }
.b-adv { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.b-adv > summary { cursor: pointer; font-weight: 700; color: var(--accent-text); list-style: none; padding: 6px 0; }
.b-adv > summary::-webkit-details-marker { display: none; }
.b-adv > summary::before { content: "▸ "; display: inline-block; transition: transform .2s; }
.b-adv[open] > summary::before { transform: rotate(90deg); }
.b-adv[open] > .b-grid { animation: rise-sm .3s ease both; }

/* lobby: shown until the first question */
.lobby { padding: 18px 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
[data-theme="neon"] .lobby { background: rgba(18,12,34,.82); border-color: rgba(63,230,255,.3); box-shadow: var(--glow-c); }
.lobby h2 { margin: 0 0 12px; font-family: var(--display); font-weight: var(--dw); font-size: 1.3rem; }
.lb-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.lb-steps > li { display: flex; gap: 14px; align-items: flex-start; }
.lb-n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: var(--dw); border: 2px solid var(--line); color: var(--muted); transition: all .3s; }
.lb-steps > li.done .lb-n { border-color: var(--go); background: var(--go); color: var(--on-go); box-shadow: 0 0 14px rgba(57,255,159,.45); }
.lb-steps > li.ready .lb-n { border-color: var(--amber); color: var(--accent-text); animation: pill-pop 1.6s ease-in-out infinite; }
.lb-body { display: grid; gap: 4px; min-width: 0; flex: 1; }
.lb-body b { font-size: 1.05rem; }
.lb-body small { color: var(--muted); line-height: 1.4; }
.lb-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.lb-row .btn { width: auto; margin: 0; }
.lb-state { font-weight: 700; color: var(--muted); }
li.done .lb-state { color: var(--go-text); }
.lb-join { display: flex; gap: 16px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.lb-join .qr { background: #fff; padding: 8px; border-radius: 10px; }
.lb-join .qr img, .lb-join .qr canvas { width: 130px; height: 130px; display: block; }
.lb-join .join-url { margin: 0; font-size: 1rem; }
.lb-join .room-code { font-size: 2.6rem; margin: 2px 0 6px; }
@media (max-width: 600px) { .lb-join .qr img, .lb-join .qr canvas { width: 110px; height: 110px; } }

/* coach line next to the big button */
.rg-main { align-items: center; }
.rg-coach { margin: 0; flex: 1 1 260px; max-width: 520px; font-size: .95rem; line-height: 1.35; color: var(--text); opacity: .85; text-align: right; }
@media (max-width: 900px) { .rg-coach { text-align: left; max-width: none; flex-basis: 100%; } }

/* judging captions */
.rg-judge .jl { display: grid; gap: 2px; text-align: left; }
.rg-judge .jl small { font-family: var(--body); font-weight: 600; font-size: .78rem; opacity: .85; letter-spacing: 0; text-transform: none; text-shadow: none; }
.rg-judges .rg-judge { justify-content: space-between; text-align: left; padding-left: 20px; padding-right: 16px; }

/* waiting dots in the live box */
.wait-dots { display: flex; gap: 10px; justify-content: center; }
.wait-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--go); box-shadow: 0 0 10px var(--go); animation: dot-b 1.2s ease-in-out infinite; }
.wait-dots i:nth-child(2) { animation-delay: .15s; } .wait-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot-b { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* "More" menu */
.rg-more { position: relative; }
.rg-menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 35; display: grid; gap: 6px; min-width: 240px; padding: 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: rise-sm .2s ease both; }
[data-theme="neon"] .rg-menu { background: #0e0a1c; border-color: rgba(63,230,255,.4); box-shadow: 0 0 24px rgba(63,230,255,.2), 0 16px 40px rgba(0,0,0,.6); }
.rg-menu .btn { width: 100%; text-align: left; margin: 0; }
@media (max-width: 900px) { .rg-tools { overflow: visible; flex-wrap: wrap; } .rg-menu { position: fixed; left: 12px; right: 12px; bottom: 150px; } }

/* help drawer */
.help-steps { margin: 4px 0 6px; padding-left: 1.3em; display: grid; gap: 8px; line-height: 1.45; }
.help-list { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; line-height: 1.45; color: var(--muted); }
.help-keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.help-keys kbd { display: inline-block; min-width: 2.4em; text-align: center; font: inherit; font-size: .8rem; border: 1px solid currentColor; border-radius: 6px; padding: 1px 6px; margin-right: 8px; color: var(--accent-text); }
.rg-drawer.help h3 { margin: 14px 0 6px; color: var(--accent-text); }

/* the big button while waiting: clearly "not now" */
[data-theme="neon"] .rg-main .rg-primary.waiting { background: transparent; color: var(--muted); box-shadow: 0 0 0 1px rgba(160,140,255,.35); text-shadow: none; }
.rg-tools > .btn:disabled { display: none; }
.lb-join .qr:empty { display: none; }
.buzzer.is-done { opacity: .55; cursor: default; }
.buzzer.is-done .buzz-label { font-size: clamp(1.4rem, 7vw, 2.2rem); }

/* phone: the "fail" flash for a wrong answer — red, a short shake, the tube flickers out */
.ph-fail { position: fixed; inset: 0; z-index: 40; display: none; place-items: center; pointer-events: none; overflow: hidden;
  background: radial-gradient(circle, rgba(40,4,12,.93), rgba(8,2,5,.97) 75%); }
.ph-fail.go { display: grid; animation: ph-cheer 2.3s ease forwards; }
.pf-kicker { font-family: var(--display); font-weight: var(--dw); text-transform: uppercase; letter-spacing: .25em; font-size: 1.2rem; color: #ffc2c8; text-shadow: 0 0 10px #ff4d5e; opacity: 0; }
.ph-fail.go .pf-kicker { animation: soft-in .4s .05s ease-out forwards; }
.pf-big { font-family: var(--display); font-weight: var(--dw); font-size: 6rem; line-height: 1; color: #ffd6da; text-shadow: 0 0 14px #ff4d5e, 0 0 40px #ff4d5e; opacity: 0; }
.ph-fail.go .pf-big { animation: fail-drop .7s .15s cubic-bezier(.3,1.4,.5,1) forwards, fail-flicker 1.4s .9s steps(1) forwards; }
@keyframes fail-drop { 0% { opacity: 0; transform: translateY(-30px) rotate(0); } 55% { opacity: 1; transform: translateY(6px) rotate(-4deg); } 70% { transform: translateX(-8px) rotate(3deg); } 85% { transform: translateX(6px) rotate(-2deg); } 100% { opacity: 1; transform: none; } }
@keyframes fail-flicker { 0% { opacity: 1; } 10% { opacity: .3; } 16% { opacity: 1; } 30% { opacity: .5; } 34% { opacity: 1; } 60% { opacity: .75; text-shadow: 0 0 6px #ff4d5e; } 100% { opacity: .75; text-shadow: 0 0 6px #ff4d5e; } }
.pf-crack { position: absolute; inset: 0; border: 3px solid rgba(255,77,94,.55); box-shadow: inset 0 0 60px rgba(255,77,94,.35); opacity: 0; }
.ph-fail.go .pf-crack { animation: fail-edge 1.2s ease-out forwards; }
@keyframes fail-edge { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
.ph-fail.go .ph-c-body { animation: bump-down .45s .2s ease; }

/* =====================================================================
   PITON.BUZZ logo (inline SVG) — neon tubes on dark themes, plain on pale
   ===================================================================== */
.wordmark { font-size: 0; line-height: 0; padding: 0; }
.pb-logo { display: block; height: 48px; width: auto; overflow: visible; }
body.host .bar .pb-logo { height: 50px; }
.tv-bar .pb-logo { height: clamp(52px, 5.2vw, 84px); }
.hero .pb-logo { height: clamp(120px, 34vw, 170px); margin: 0 auto; }
.lg-blue { fill: #499bd5; } .lg-pink { fill: #e04197; } .lg-yellow { fill: #f9ed25; }
:is([data-theme="neon"], [data-theme="classic"]) .lg-blue { fill: #7cc4f5; filter: drop-shadow(0 0 2px rgba(255,255,255,.55)) drop-shadow(0 0 6px #499bd5) drop-shadow(0 0 16px rgba(73,155,213,.7)); }
:is([data-theme="neon"], [data-theme="classic"]) .lg-pink { fill: #ff7cc0; filter: drop-shadow(0 0 2px rgba(255,255,255,.55)) drop-shadow(0 0 6px #e04197) drop-shadow(0 0 16px rgba(224,65,151,.7)); }
:is([data-theme="neon"], [data-theme="classic"]) .lg-yellow { fill: #fff59a; filter: drop-shadow(0 0 2px rgba(255,255,255,.6)) drop-shadow(0 0 6px #f9ed25) drop-shadow(0 0 14px rgba(249,237,37,.6)); }
/* nested groups: don't stack the glow twice */
:is([data-theme="neon"], [data-theme="classic"]) .lg-buzz .lg-b { filter: none; }
/* two tubes that flicker, like a real sign: the yellow rays and the "B" */
:is([data-theme="neon"], [data-theme="classic"]) .lg-rays-y { animation: tube-flick 2s linear infinite; }
:is([data-theme="neon"], [data-theme="classic"]) .lg-b { animation: tube-flick 3s linear infinite; }
:is([data-theme="neon"], [data-theme="classic"]) .lg-btn-top { animation: btn-glow 2.6s ease-in-out infinite; }
@keyframes tube-flick {
  0%, 78% { opacity: 1; }
  79% { opacity: .25; }
  81% { opacity: 1; }
  82% { opacity: .2; }
  83% { opacity: 1; }
  92% { opacity: .25; }
  92.5%, 100% { opacity: 1; }
}
@keyframes btn-glow { 50% { fill: #ffb0d9; } }
@media (prefers-reduced-motion: reduce) { .pb-logo * { animation: none !important; } }

/* header: the type-only Piton.Buzz, glowing like the original neon wordmark */
.pb-type { display: block; height: 40px; width: auto; overflow: visible; }
body.host .bar .pb-type { height: 42px; }
.tv-bar .pb-type { height: clamp(44px, 4.2vw, 70px); }
.lt-blue { fill: #499bd5; } .lt-pink { fill: #e04197; } .lt-yellow { fill: #f9ed25; }
:is([data-theme="neon"], [data-theme="classic"]) .lt-blue { fill: #eaf6ff; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 4px #499bd5) drop-shadow(0 0 10px #499bd5) drop-shadow(0 0 22px rgba(73,155,213,.8)); }
:is([data-theme="neon"], [data-theme="classic"]) .lt-pink { fill: #fff0f6; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 4px #ff2e88) drop-shadow(0 0 10px #e04197) drop-shadow(0 0 22px rgba(224,65,151,.8)); }
:is([data-theme="neon"], [data-theme="classic"]) .lt-yellow { fill: #fffbe0; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 4px #f9ed25) drop-shadow(0 0 10px #f9ed25); }
/* two tubes flicker at different speeds, like the first sign */
:is([data-theme="neon"], [data-theme="classic"]) .lt-b { animation: tube-out 3s linear infinite; }
:is([data-theme="neon"], [data-theme="classic"]) .lt-p { animation: tube-out 2.2s linear infinite; }
@keyframes tube-out {
  0%, 78% { opacity: 1; }
  79% { opacity: .18; }
  81% { opacity: 1; }
  82% { opacity: .15; }
  83% { opacity: 1; }
  92% { opacity: .2; }
  92.5%, 100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .pb-type * { animation: none !important; } }

/* ---- logo neon v2: colored tubes, soft outer glow that breathes (overrides the rules above) ---- */
:is([data-theme="neon"], [data-theme="classic"]) :is(.lt-blue, .lg-blue) { fill: #7fd3ff; filter: none; animation: glow-blue 3.4s ease-in-out infinite alternate; }
:is([data-theme="neon"], [data-theme="classic"]) :is(.lt-pink, .lg-pink) { fill: #ff86c8; filter: none; animation: glow-pink 3.9s ease-in-out infinite alternate; }
:is([data-theme="neon"], [data-theme="classic"]) :is(.lt-yellow, .lg-yellow) { fill: #ffe37a; filter: none; animation: glow-yellow 3s ease-in-out infinite alternate; }
:is([data-theme="neon"], [data-theme="classic"]) .lg-btn-top { animation: glow-pink 3.9s ease-in-out infinite alternate; }
@keyframes glow-blue { from { filter: drop-shadow(0 0 1.5px rgba(90,200,255,.9)) drop-shadow(0 0 7px rgba(90,200,255,.35)) drop-shadow(0 0 26px rgba(150,200,235,.16)) drop-shadow(0 0 60px rgba(150,200,235,.10)); } to { filter: drop-shadow(0 0 2px rgba(90,200,255,1)) drop-shadow(0 0 9px rgba(90,200,255,.45)) drop-shadow(0 0 34px rgba(150,200,235,.24)) drop-shadow(0 0 80px rgba(150,200,235,.16)); } }
@keyframes glow-pink { from { filter: drop-shadow(0 0 1.5px rgba(255,90,185,.9)) drop-shadow(0 0 7px rgba(255,90,185,.35)) drop-shadow(0 0 26px rgba(235,160,205,.16)) drop-shadow(0 0 60px rgba(235,160,205,.10)); } to { filter: drop-shadow(0 0 2px rgba(255,90,185,1)) drop-shadow(0 0 9px rgba(255,90,185,.45)) drop-shadow(0 0 34px rgba(235,160,205,.24)) drop-shadow(0 0 80px rgba(235,160,205,.16)); } }
@keyframes glow-yellow { from { filter: drop-shadow(0 0 1.5px rgba(255,220,90,.9)) drop-shadow(0 0 7px rgba(255,220,90,.35)) drop-shadow(0 0 26px rgba(235,220,160,.16)) drop-shadow(0 0 60px rgba(235,220,160,.10)); } to { filter: drop-shadow(0 0 2px rgba(255,220,90,1)) drop-shadow(0 0 9px rgba(255,220,90,.45)) drop-shadow(0 0 34px rgba(235,220,160,.24)) drop-shadow(0 0 80px rgba(235,220,160,.16)); } }
/* the flicker now lives on the tube itself, so the glow can keep breathing on the group */
:is([data-theme="neon"], [data-theme="classic"]) :is(.lt-p, .lt-b, .lg-b, .lg-rays-y) { animation-name: glow-blue; }
:is([data-theme="neon"], [data-theme="classic"]) :is(.lt-b, .lg-b) { animation: glow-pink 3.9s ease-in-out infinite alternate; }
:is([data-theme="neon"], [data-theme="classic"]) .lt-p { animation: glow-blue 3.4s ease-in-out infinite alternate; }
:is([data-theme="neon"], [data-theme="classic"]) .lg-rays-y { animation: glow-yellow 3s ease-in-out infinite alternate; }
:is([data-theme="neon"], [data-theme="classic"]) .lt-p > path { animation: tube-out 4.2s linear infinite; }
:is([data-theme="neon"], [data-theme="classic"]) :is(.lt-b, .lg-b) > path { animation: tube-out 5.3s linear infinite; }
:is([data-theme="neon"], [data-theme="classic"]) .lg-rays-y > path { animation: tube-out 4.6s linear infinite; }
:is([data-theme="neon"], [data-theme="classic"]) .lg-buzz .lg-b { filter: none; animation: none; }

/* neon on a wall: a soft, wide, low-saturation wash of light behind the sign (blue left, pink right) */
.wordmark { position: relative; isolation: isolate; display: inline-block; }
:is([data-theme="neon"], [data-theme="classic"]) .wordmark::before {
  content: ""; position: absolute; inset: -55% -25%; z-index: -1; pointer-events: none; border-radius: 50%;
  background:
    radial-gradient(ellipse 48% 58% at 34% 55%, rgba(120,195,240,.38), rgba(120,195,240,0) 72%),
    radial-gradient(ellipse 48% 58% at 70% 58%, rgba(235,140,200,.34), rgba(235,140,200,0) 72%);
  filter: blur(16px); opacity: .75;
  animation: wall-wash 3.6s ease-in-out infinite alternate;
}
.hero .wordmark::before { inset: -38% -24%; }
@keyframes wall-wash { from { opacity: .6; transform: scale(.97); } to { opacity: 1; transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .wordmark::before { animation: none !important; } }

/* ---------- picture questions ---------- */
.tv-img { margin: 0; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 18px; background: rgba(0,0,0,.25); }
.tv-img img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 14px; animation: rise .5s ease both; }
.tv-img.fx-blur img { filter: blur(var(--blur, 38px)) saturate(1.1); transform: scale(var(--zoom, 1.08)); transition: filter .25s linear, transform .25s linear; }
[data-theme="neon"] .tv-img { border: 1px solid rgba(63,230,255,.3); box-shadow: 0 0 24px rgba(63,230,255,.15); }
.tv-q:has(.tv-img:not([hidden])) .tv-text { font-size: clamp(1.6rem, 2.6vw, 3.4rem); max-width: none; }
.tv-q:has(.tv-img:not([hidden])) { padding-top: clamp(4px, 1.5vh, 24px); }
.qp-img { display: block; max-width: 220px; max-height: 140px; object-fit: contain; border-radius: 10px; margin: 6px 0 8px; border: 1px solid var(--line); }
/* gros plan qui dézoome: starts ×6 on one spot, zooms out while the buzzers are open */
.tv-img.fx-zoom img { transform: scale(var(--close, 6)); transform-origin: var(--ox, 50%) var(--oy, 50%); transition: transform .25s linear; }
/* silhouette: a glowing white shape until the answer is shown */
.tv-img.fx-sil img { filter: brightness(0) invert(1) drop-shadow(0 0 18px rgba(160,140,255,.6)); transition: filter .8s ease; }
.tv-img.fx-sil.revealed img { filter: none; }
/* small vector pictures (emoji are 32×32) must fill the frame */
.tv-img img { width: 100%; height: 100%; object-fit: contain; padding: clamp(8px, 1.5vw, 24px); box-sizing: border-box; }
.qp-img { width: 220px; height: 140px; }
/* use the separate `scale` property so the entrance animation (transform) can't cancel the zoom */
.tv-img.fx-zoom img { transform: none; scale: var(--close, 6); transform-origin: var(--ox, 50%) var(--oy, 50%); transition: scale .25s linear; }
.tv-img.fx-blur img { transform: none; scale: var(--zoom, 1.08); transition: filter .25s linear, scale .25s linear; }

/* ---------- picture questions: keep the picture big ---------- */
/* image on the left, choices stacked on the right */
.tv-q:has(.tv-img:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); align-content: stretch; }
.tv-q:has(.tv-img:not([hidden])):has(.tv-choices:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(240px, 32%); column-gap: clamp(14px, 1.6vw, 30px); }
.tv-q:has(.tv-img:not([hidden])) > :is(.cat-chip, .tv-text) { grid-column: 1 / -1; }
.tv-q:has(.tv-img:not([hidden])) .tv-img { grid-column: 1; grid-row: 3; height: 100%; }
.tv-q:has(.tv-img:not([hidden])) .tv-choices { grid-column: 2; grid-row: 3; grid-template-columns: 1fr; align-content: center; }
.tv-q:has(.tv-img:not([hidden])) .tv-choices li { font-size: clamp(1.1rem, 1.6vw, 2.1rem); }
/* compact buzz card: name + team on the left, timer on the right */
.tv-main:has(.tv-img:not([hidden])) .tv-winner { padding: clamp(10px, 1vw, 18px) clamp(18px, 2vw, 32px); }
.tv-main:has(.tv-img:not([hidden])) .tv-winner.has { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 24px; text-align: left; }
.tv-main:has(.tv-img:not([hidden])) .tv-winner.has .w-name { grid-column: 1; font-size: clamp(1.8rem, 3vw, 3.4rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-main:has(.tv-img:not([hidden])) .tv-winner.has .w-team { grid-column: 1; margin-top: 0; font-size: clamp(1rem, 1.3vw, 1.6rem); }
.tv-main:has(.tv-img:not([hidden])) .tv-winner.has .ans-num { grid-column: 2; grid-row: 1 / span 2; margin: 0; font-size: clamp(2.6rem, 4.5vw, 5rem); line-height: 1; }
.tv-main:has(.tv-img:not([hidden])) .tv-winner.has.timeup .ans-num { font-size: clamp(1.8rem, 3vw, 3.4rem); }
.tv-main:has(.tv-img:not([hidden])) .tv-winner .w-go { font-size: clamp(1.8rem, 3vw, 3.6rem); }
.tv-main:has(.tv-img:not([hidden])) .tv-winner .buzz-left { font-size: clamp(2rem, 3.4vw, 4rem); margin: 0; }
.tv-main:has(.tv-img:not([hidden])) .tv-winner.go { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 24px; }
.tv-main:has(.tv-img:not([hidden])) .tv-winner.go .buzz-left { padding-bottom: 8px; }
.tv-q:has(.tv-img:not([hidden])) > .cat-chip { justify-self: start; }
.tv-q:has(.tv-img:not([hidden])) .tv-choices { height: 100%; min-height: 0; grid-template-rows: repeat(4, minmax(0, 1fr)); align-content: stretch; gap: clamp(8px, .8vw, 16px); }
.tv-q:has(.tv-img:not([hidden])) .tv-choices li { min-height: 0; overflow: hidden; display: flex; align-items: center; padding-block: clamp(6px, .6vw, 14px); }
.tv-main:has(.tv-img:not([hidden])) .tv-winner:is(.has, .go) { grid-template-rows: auto auto; align-content: center; }
.tv-main:has(.tv-img:not([hidden])) .tv-winner.has .ans-num { grid-row: 1 / -1; }
.tv-main:has(.tv-img:not([hidden])) .tv-winner.has:not(:has(.w-team)) .w-name { grid-row: 1 / -1; }
.tv-main:has(.tv-img:not([hidden])) .tv-winner.has .w-team { align-self: start; }
.tv-main:has(.tv-img:not([hidden])) .tv-winner.has:has(.w-team) .w-name { align-self: end; }

/* never crop a picture: the blur effect no longer enlarges the image (only "zoom" may, and it ends at ×1) */
.tv-img.fx-blur img { scale: 1; }
.tv-img img { border-radius: 4px; }

/* cross links under the join / host sign-in cards */
.xlink { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 18px 0 0; font-size: .9rem; }
.xlink a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.xlink a:hover { color: var(--text); }

/* =====================================================================
   TV pairing — /tv shows a code, the host types it in the control room
   ===================================================================== */
.tv-pair { flex: 1; display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: clamp(32px, 6vw, 110px); align-items: center; max-width: 1500px; width: 100%; margin: 0 auto; }
.tv-pair h1 { font-size: clamp(2.2rem, 4.2vw, 4.4rem); margin: 0 0 .3em; }
.tv-pair-linked { font-size: clamp(1.1rem, 1.7vw, 1.6rem); color: var(--go-text); margin: 0 0 1em; max-width: 36em; }
.tv-pair-code {
  font: 900 clamp(5rem, 15vw, 15rem)/1 var(--display); letter-spacing: .12em; color: #fff;
  text-shadow: 0 0 2px #fff, 0 0 24px var(--cyan), 0 0 60px rgba(63,230,255,.55);
  margin: .1em 0 .25em;
}
.tv-pair-steps { margin: 0; padding-left: 1.3em; font-size: clamp(1.1rem, 1.7vw, 1.7rem); color: var(--muted); max-width: 34em; }
.tv-pair-steps li { margin: .35em 0; }
.tv-pair-qr { display: grid; justify-items: center; gap: 14px; color: var(--muted); text-align: center; font-size: clamp(.95rem, 1.2vw, 1.25rem); }
.tv-pair-qr .qr { background: #fff; padding: 14px; border-radius: 16px; }
@media (max-width: 800px) { .tv-pair { grid-template-columns: 1fr; } }

/* host side: "Connect a TV" form and the list of connected TVs */
.tv-pair-form { display: grid; gap: 8px; margin: 10px 0 14px; width: 100%; }
.tv-pair-form label { display: grid; gap: 2px; font-weight: 700; }
.tv-pair-form label small { font-weight: 400; color: var(--muted); font-size: .82rem; }
.tv-pair-row { display: flex; gap: 8px; }
.tv-pair-in { flex: 1; min-width: 0; max-width: 12ch; text-align: center; font: 800 1.35rem var(--display); letter-spacing: .25em; padding: 8px 6px 8px calc(6px + .25em); }
.tv-pair-msg { margin: 0; color: var(--go-text); }
.tv-pair-msg.error { color: var(--bad); }
.tv-linked { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.tv-linked li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.tv-linked .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.tv-linked .dot.on { background: var(--go); box-shadow: 0 0 8px var(--go); }
.tv-or { margin-top: 4px; }
.lb-row .tv-pair-form { margin: 6px 0 2px; max-width: 420px; }
.tv-pair-row .btn { width: auto; flex: none; margin: 0; }
.tv-pair-row .tv-pair-in { width: auto; flex: 1 1 8ch; }
.lb-row .tv-pair-form label { display: none; }
body.tv .bar .pill:empty { display: none; }

/* picture reveal in steps (TV): each step is a visible "click", dots show how many clues are out */
.tv-img.fx-blur img { transition: filter .6s cubic-bezier(.2,.7,.2,1), scale .6s ease; }
.tv-img.fx-zoom img { transition: scale .6s cubic-bezier(.2,.7,.2,1); }
.tv-img { position: relative; }
.tv-img .fx-dots { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; padding: 8px 10px; border-radius: 999px; background: rgba(7,5,13,.72); }
.tv-img .fx-dots i { width: clamp(10px, 1vw, 16px); height: clamp(10px, 1vw, 16px); border-radius: 50%; border: 2px solid rgba(63,230,255,.7); }
.tv-img .fx-dots i.on { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.tv-img .fx-dots i.new { animation: fx-dot .5s ease; }
@keyframes fx-dot { 0% { transform: scale(1.8); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .tv-img img { transition: none !important; } .tv-img .fx-dots i { animation: none !important; } }
.my-id { margin: 18px 0 0; word-break: break-all; user-select: all; }

/* =====================================================================
   v4: host tools, TV show, game mechanics, profiles
   ===================================================================== */
/* host console */
.rg-undo small { color: var(--muted); font-size: .75rem; font-weight: 600; margin-left: 2px; }
.rg-special { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); padding: 2px 4px; }
.rg-special select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; font: inherit; font-size: .85rem; }
.rg-special small { font-size: .72rem; }
.rg-pause { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-basis: 100%; padding: 10px 14px; border-radius: 12px; background: var(--amber-soft); border: 1px solid var(--amber-deep); color: var(--amber-soft-text); font-weight: 800; }
.rg-pause .btn { width: auto; margin: 0; }
.qp-audio { width: 100%; margin-top: 8px; height: 36px; }
.t-av { font-style: normal; margin-right: 4px; }
.t-joker { display: inline-block; font-size: .7rem; padding: 0 5px; border-radius: 6px; background: var(--panel); color: var(--muted); vertical-align: middle; }
/* typed answers: the host checks the doubtful ones */
.winner.typed { text-align: left; align-items: stretch; }
.winner.typed .w-name { font-size: clamp(1.2rem, 2.4vw, 1.8rem); text-align: center; }
.tj-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; max-height: 46vh; overflow: auto; }
.tj-list li { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(0, 1.4fr) auto auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.tj-list li.ok { border-color: var(--go-deep); }
.tj-list li.maybe { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }
.tj-n { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tj-a { overflow-wrap: anywhere; }
.tj-q { font-style: normal; font-size: .72rem; font-weight: 800; color: var(--amber-soft-text); background: var(--amber-soft); padding: 2px 6px; border-radius: 6px; }
.tj-btns { display: inline-flex; gap: 4px; grid-column: 4; }
.tj-b { width: 38px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 900; }
.tj-b.on { background: var(--go); color: var(--on-go); border-color: var(--go); }
.tj-b.bad.on { background: var(--bad); color: #fff; border-color: var(--bad); }
.tj-v { font-size: 1.2rem; }
.tj-list li.ok .tj-v { color: var(--go-text); } .tj-list li.ko .tj-v { color: var(--bad); }
/* drawers: results, league */
.rg-drawer.wide { width: min(560px, 100vw); }
.res-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.res-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.res-table th, .res-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.res-table th { color: var(--muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; background: var(--panel-2); position: sticky; top: 0; }
.res-table td:nth-child(2) { white-space: normal; }
.lg-tabs { display: flex; gap: 6px; }
.lg-tabs .chip.on { background: var(--amber); color: var(--on-amber); border-color: var(--amber); }
.s-row.s-col { flex-direction: column; align-items: stretch; gap: 6px; }
/* builder: saved quizzes, prepared list */
.b-saved { margin: 12px 0 4px; }
.saved-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.saved-list li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.saved-list li > div { flex: 1; min-width: 0; display: grid; }
.saved-list li .btn { width: auto; margin: 0; }
.prep { margin-top: 14px; }
.prep-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; max-height: 60vh; overflow: auto; }
.prep-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); }
.pr-n { font-family: var(--display); color: var(--muted); min-width: 2ch; text-align: right; }
.pr-q { flex: 1; min-width: 0; display: grid; gap: 2px; }
.prep-list select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 5px; font: inherit; font-size: .8rem; max-width: 140px; }
.prep-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.prep-foot input { flex: 1 1 200px; width: auto; }
.prep-foot .btn { width: auto; margin: 0; }

/* TV: special round banner, typed answers, wager */
.tv-special { align-self: center; margin: 0 auto 10px; padding: 10px 28px; border-radius: 999px; font-family: var(--display); font-weight: var(--dw); font-size: clamp(1.2rem, 2.4vw, 2.4rem); letter-spacing: .06em; text-transform: uppercase; background: var(--amber); color: var(--on-amber); box-shadow: 0 0 30px rgba(244,165,28,.45); }
.tv-special.sp-flash { background: #3fe6ff; color: #04222a; box-shadow: 0 0 34px rgba(63,230,255,.55); animation: pulse .6s ease-in-out infinite; }
.tv-special.sp-steal { background: #b46bff; color: #fff; box-shadow: 0 0 34px rgba(180,107,255,.55); }
.tv-special.sp-wager { background: linear-gradient(90deg, #ff4fa3, #f4a51c); color: #160a12; }
.tv-special.sp-in { animation: pop-in .6s cubic-bezier(.2,1.3,.4,1) both; }
.cat-chip.audio { background: #2f7fd6; color: #fff; }
.tv-text.wager { display: grid; gap: 14px; text-align: center; }
.wg-title { font-family: var(--display); font-weight: var(--dw); font-size: clamp(2.6rem, 6vw, 6.4rem); line-height: 1; background: linear-gradient(90deg, #ff4fa3, #f4a51c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wg-sub { font-size: clamp(1.1rem, 2vw, 2rem); color: var(--muted); }
.rv-names { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.rv-names span { padding: 6px 14px; border-radius: 999px; background: rgba(47,191,113,.2); border: 1px solid var(--go-deep); font-weight: 800; font-size: clamp(.9rem, 1.4vw, 1.4rem); }
.ch-av { font-size: clamp(3rem, 7vw, 7rem); line-height: 1; margin-top: .1em; animation: pop-in .6s .4s cubic-bezier(.2,1.3,.4,1) both; }
.ch-sp { margin-top: .3em; font-family: var(--display); font-weight: var(--dw); font-size: clamp(1rem, 2vw, 2.2rem); color: #ffd99a; animation: soft-in .5s 1.1s both; }
/* TV final: rising podium, awards */
.stage-podium { list-style: none; margin: 0 auto 18px; padding: 0; display: flex; justify-content: center; align-items: flex-end; gap: clamp(8px, 1.6vw, 24px); max-width: 1000px; }
.stage-podium li { flex: 1; max-width: 300px; display: grid; gap: 8px; text-align: center; }
.sp-who { display: grid; gap: 2px; justify-items: center; opacity: 0; animation: rise .6s ease both; }
.sp-who .pa { font-size: clamp(2.2rem, 4.6vw, 4.6rem); line-height: 1; }
.sp-who .pn { font-weight: 900; font-size: clamp(1.1rem, 2.2vw, 2.2rem); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-who b { font-family: var(--display); font-weight: var(--dw); font-size: clamp(1.4rem, 2.8vw, 3rem); color: var(--accent-text); }
.sp-step { display: grid; place-items: start center; padding-top: 10px; border-radius: 16px 16px 0 0; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-bottom: 0; transform-origin: bottom; animation: step-up .8s cubic-bezier(.2,1,.3,1) both; }
.sp-step span { font-family: var(--display); font-weight: var(--dw); font-size: clamp(2rem, 4vw, 4.4rem); color: var(--muted); }
.sp1 .sp-step { height: clamp(120px, 22vh, 230px); background: linear-gradient(180deg, var(--amber), var(--amber-deep)); border-color: var(--amber); }
.sp1 .sp-step span { color: var(--on-amber); }
.sp2 .sp-step { height: clamp(90px, 16vh, 170px); }
.sp3 .sp-step { height: clamp(70px, 12vh, 130px); }
.sp3 .sp-step, .sp3 .sp-who { animation-delay: .2s; }
.sp2 .sp-step, .sp2 .sp-who { animation-delay: .9s; }
.sp1 .sp-step, .sp1 .sp-who { animation-delay: 1.7s; }
.sp1 .sp-who { animation: rise .7s 2.3s ease both, pulse 1.4s 3s ease-in-out infinite; }
@keyframes step-up { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.awards { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0 auto 16px; max-width: 1000px; }
.award { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); text-align: left; opacity: 0; animation: rise .6s 3.2s ease both; }
.award:nth-child(2) { animation-delay: 3.5s; } .award:nth-child(3) { animation-delay: 3.8s; }
.award i { font-style: normal; font-size: clamp(1.6rem, 2.6vw, 2.6rem); }
.award div { display: grid; }
.award small { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: .72em; letter-spacing: .06em; }
.award b { font-size: 1.05em; }
.award span { color: var(--accent-text); font-weight: 800; font-size: .9em; }
.tv-final .awards { font-size: clamp(.9rem, 1.4vw, 1.3rem); }
.small-awards .award { animation-delay: .3s; padding: 8px 12px; font-size: .9rem; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 25; }
/* TV: waiting screen between games */
.tv-attract { position: fixed; inset: 0; z-index: 8; display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; align-items: center; gap: 2vh; padding: 4vh 4vw; background: radial-gradient(circle at 50% 30%, #2a1a3a, var(--bg) 70%); text-align: center; }
.at-logo svg { height: clamp(50px, 9vh, 110px); width: auto; }
.at-kick { font-family: var(--display); font-weight: var(--dw); font-size: clamp(1.6rem, 3.4vw, 3.6rem); color: var(--accent-text); margin-bottom: 1vh; }
.at-join { display: flex; align-items: center; gap: 4vw; text-align: left; }
.at-join .qr { background: #fff; padding: 14px; border-radius: 18px; }
.at-join .room-code { font-size: clamp(3rem, 8vw, 8rem); }
.at-people { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2vh; max-width: 46vw; }
.at-people span { padding: 6px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; font-size: clamp(.9rem, 1.3vw, 1.3rem); animation: pop-in .4s both; }
.at-board { width: min(900px, 90vw); }
.at-board ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: clamp(1.1rem, 2vw, 2rem); }
.at-board li { display: flex; align-items: center; gap: 16px; padding: 10px 20px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); animation: rise .5s both; }
.at-board li:nth-child(1) { background: var(--amber-soft); border-color: var(--amber); }
.at-board li:nth-child(2) { animation-delay: .08s; } .at-board li:nth-child(3) { animation-delay: .16s; } .at-board li:nth-child(4) { animation-delay: .24s; } .at-board li:nth-child(5) { animation-delay: .32s; } .at-board li:nth-child(n+6) { animation-delay: .4s; }
.at-board .rank { font-family: var(--display); color: var(--muted); min-width: 2ch; }
.at-board .pname { flex: 1; text-align: left; font-weight: 800; }
.at-next { font-family: var(--display); font-weight: var(--dw); font-size: clamp(1.4rem, 3vw, 3.2rem); padding: 1.2vh 3vw; border-radius: 999px; background: var(--amber); color: var(--on-amber); }
.at-dots { display: flex; gap: 8px; }
.at-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.at-dots i.on { background: var(--amber); }
/* TV: pause */
.tv-pause { position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; text-align: center; gap: 2vh; background: rgba(10,8,6,.92); backdrop-filter: blur(6px); }
.tp-kick { font-family: var(--display); font-weight: var(--dw); font-size: clamp(3rem, 9vw, 9rem); color: var(--accent-text); letter-spacing: .05em; }
.tp-sub { font-size: clamp(1.2rem, 2.4vw, 2.4rem); color: var(--muted); }
.tp-time { font-family: var(--display); font-weight: var(--dw); font-size: clamp(4rem, 14vw, 14rem); font-variant-numeric: tabular-nums; line-height: 1; }

/* phone: avatar, typed answers, wager, joker, pause */
.av-field { display: grid; gap: 6px; margin: 4px 0 12px; font-weight: 600; }
.av-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.av-pick .av { height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-size: 1.4rem; line-height: 1; padding: 0; }
.av-pick .av.on { border-color: var(--amber); background: var(--amber-soft); box-shadow: 0 0 0 2px var(--amber); }
.type-box { margin: 12px 16px; padding: 16px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); text-align: center; display: grid; gap: 10px; }
.type-box.live { border-color: var(--amber); box-shadow: 0 0 24px rgba(244,165,28,.2); }
.type-box p { margin: 0; }
.tb-form { display: flex; gap: 8px; }
.tb-form input { flex: 1; font-size: 1.15rem; min-width: 0; }
.tb-form .btn { width: auto; margin: 0; }
.tb-clock { font-family: var(--display); font-weight: var(--dw); font-size: 2rem; font-variant-numeric: tabular-nums; }
.tb-answer { font-size: 1.3rem; font-weight: 800; overflow-wrap: anywhere; }
.tb-title { font-family: var(--display); font-weight: var(--dw); font-size: 1.6rem; background: linear-gradient(90deg, #ff4fa3, #f4a51c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tb-big { font-family: var(--display); font-weight: var(--dw); font-size: 3.2rem; color: var(--accent-text); }
.tb-quick { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.tb-result { font-family: var(--display); font-weight: var(--dw); font-size: 1.6rem; }
.tb-result.ok { color: var(--go-text); } .tb-result.bad { color: var(--bad); }
.joker-btn { display: grid; justify-items: center; margin: 10px auto 0; padding: 8px 18px; border-radius: 999px; border: 2px dashed var(--amber); background: transparent; color: var(--accent-text); font-weight: 900; font-size: 1rem; grid-column: 1 / -1; }
.joker-btn small { font-weight: 600; font-size: .7rem; color: var(--muted); }
.qc-choices li.gone { opacity: .25; text-decoration: line-through; }
.choice-box .ch.gone { opacity: .12; filter: grayscale(1); }
.sp-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 900; text-transform: uppercase; background: var(--amber); color: var(--on-amber); }
.sp-chip.sp-flash { background: #3fe6ff; color: #04222a; } .sp-chip.sp-steal { background: #b46bff; color: #fff; }
.ph-pause { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--amber-soft); border: 1px solid var(--amber); color: var(--amber-soft-text); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.ph-pause span { font-variant-numeric: tabular-nums; font-weight: 800; }
.final-league { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--panel-2); font-weight: 700; }
.install-btn { margin-top: 10px; }
.tv-winner.typed { text-align: center; align-items: center; }
.tv-winner.typed .w-go { font-size: clamp(2rem, 4.6vw, 4.6rem); padding: 10px 0 0; }
.tv-winner.typed .ans-num { font-family: var(--display); font-weight: var(--dw); font-size: clamp(2.6rem, 6vw, 6rem); }
.tv-pause { z-index: 32; }
.tile.left { opacity: .6; border-style: dashed; border-color: var(--line); }
.t-left { position: absolute; top: -8px; left: 10px; font-size: .65rem; font-weight: 800; text-transform: uppercase; padding: 1px 6px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
/* the join form (with avatars) can be taller than the phone: let the page scroll; the buzzer itself doesn't move the page */
body.player { overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.av-pick { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 5px; }
.av-pick .av { height: 38px; font-size: 1.25rem; }
.music-sel { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font: inherit; }
.music-vol { width: 100%; padding: 0; accent-color: var(--amber); }
