/* Layout: one stage. The host view fills a projector screen with a single focal block per phase;
   the player view is a one-thumb phone screen whose answer pads take all spare height.
   Single dark look by choice (rooms with projectors are dim). */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url("/fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url("/fonts/dm-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 500; font-display: swap; src: url("/fonts/dm-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 700; font-display: swap; src: url("/fonts/dm-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --stage: #151938;
  --stage-2: #1d2350;
  --panel: #262d66;
  --line: #3b4491;
  --ink: #f7f4ff;
  --mute: #aab0dc;
  --gold: #ffc94a;
  --on-color: #13152f;
  --a: #ff6b78;
  --b: #4fb2ff;
  --c: #ffb52e;
  --d: #45d69a;
  --ok: #45d69a;
  --no: #ff6b78;
  --display: "Bricolage Grotesque", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--stage);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px);
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .display { font-family: var(--display); font-weight: 800; line-height: 1.05; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.mute { color: var(--mute); }
.label { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); font-weight: 700; }
.h-xxl { font-size: clamp(3rem, 12vw, 8rem); }
.h-xl { font-size: clamp(2.4rem, 9vw, 4rem); }
.h-lg { font-size: clamp(2rem, 6vw, 3.6rem); }
.h-md { font-size: clamp(1.6rem, 5vw, 2.6rem); }
.gold { color: var(--gold); }

#app { min-height: 100%; display: flex; flex-direction: column; margin: 0 auto; padding-block: 16px; gap: 16px; }
#app.host { max-width: 1180px; }
#app.player { max-width: 520px; }

.btn {
  border: 0; border-radius: 999px; padding: .7em 1.4em; font-weight: 700; cursor: pointer;
  background: var(--gold); color: var(--on-color); transition: transform .08s; text-decoration: none; display: inline-block;
}
.btn:active { transform: scale(.97); }
.btn.big { font-size: 1.25rem; padding: .8em 1.8em; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.small { font-size: .85rem; padding: .45em 1em; }
.btn.danger { background: transparent; color: var(--no); box-shadow: inset 0 0 0 2px var(--no); }
.btn[disabled] { opacity: .45; cursor: default; }
.field { width: 100%; background: var(--stage); border: 2px solid var(--line); border-radius: 12px; padding: .65em .8em; }
.field::placeholder { color: var(--mute); opacity: .7; }
select.field { width: auto; padding: .4em .6em; }
.note { background: var(--stage-2); border-radius: 14px; padding: 14px 16px; color: var(--mute); font-size: .92rem; display: grid; gap: 4px; }
.note b { color: var(--ink); }
.err { color: var(--no); font-weight: 700; }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; }
.center.top { justify-content: flex-start; }
.narrow { max-width: 34em; }

.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bar .brand { font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
.bar .brand i { font-style: normal; color: var(--gold); }
.bar .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mute); }
.pill { background: var(--stage-2); border-radius: 999px; padding: .3em .9em; font-weight: 700; font-size: .9rem; }

/* login */
.login { display: grid; gap: 14px; width: 100%; max-width: 380px; }

/* editor */
.ed-head { display: grid; gap: 12px; }
.ed-head input.title { font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem, 4vw, 2.4rem); background: transparent; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; padding: .1em 0; width: 100%; }
.toggles { display: flex; gap: 10px 22px; flex-wrap: wrap; }
.toggles label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.toggles input { width: 18px; height: 18px; accent-color: var(--gold); }
.qcard { background: var(--stage-2); border-radius: 18px; padding: 16px; display: grid; gap: 12px; }
.qcard header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qcard header .qn { font-family: var(--display); font-weight: 800; font-size: 1.2rem; margin-right: auto; }
.qcard textarea { resize: vertical; min-height: 2.9em; font-size: 1.1rem; font-weight: 500; }
.opts-ed { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.opt-ed { display: flex; align-items: center; gap: 8px; min-width: 0; }
.opt-ed input[type=radio] { width: 20px; height: 20px; accent-color: var(--ok); flex: none; }
.opt-ed .field { min-width: 0; }
.chip-l { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; color: var(--on-color); }
.k0 { background: var(--a); } .k1 { background: var(--b); } .k2 { background: var(--c); } .k3 { background: var(--d); }
.ed-foot { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; position: sticky; bottom: 0; background: linear-gradient(transparent, var(--stage) 30%); padding-block: 22px calc(12px + env(safe-area-inset-bottom, 0px)); }
.ed-foot .sp { flex: 1; }
.past { display: grid; gap: 6px; }
.past a { display: flex; gap: 12px; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: var(--stage-2); text-decoration: none; color: var(--ink); }
.past a span:last-child { color: var(--mute); }

/* lobby */
.lobby-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: stretch; }
.pinbox { background: var(--gold); color: var(--on-color); border-radius: 24px; padding: 22px 26px; display: grid; gap: 4px; align-content: center; }
.pinbox .label { color: var(--on-color); opacity: .7; }
.pinbox .pin { font-family: var(--display); font-weight: 800; font-size: clamp(3.2rem, 10vw, 6.5rem); letter-spacing: .06em; line-height: 1; }
.howto { background: var(--stage-2); border-radius: 24px; padding: 22px 26px; display: grid; gap: 10px; align-content: center; font-size: 1.15rem; }
.howto ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.howto .url { font-family: var(--display); font-weight: 800; font-size: 1.5em; color: var(--gold); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; flex: 1; }
.chip { background: var(--panel); border: 0; border-radius: 999px; padding: .4em 1em; font-weight: 700; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { background: var(--no); color: var(--on-color); text-decoration: line-through; }
.chip.off { opacity: .45; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row .sp { flex: 1; }

/* question stage */
.qhead { display: flex; align-items: center; gap: 16px; }
.qtext { font-family: var(--display); font-weight: 800; font-size: clamp(1.7rem, 4.6vw, 3.6rem); line-height: 1.08; text-wrap: balance; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.clock { flex: none; width: clamp(72px, 12vw, 132px); aspect-ratio: 1; max-width: 100%; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 5vw, 3.4rem); background: conic-gradient(var(--gold) calc(var(--p, 1) * 360deg), var(--panel) 0); position: relative; }
.clock::before { content: ""; position: absolute; inset: 9%; border-radius: 50%; background: var(--stage); }
.clock span { position: relative; }
.grid4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; flex: 1; min-height: 220px; }
.ans { border-radius: 20px; padding: 16px 18px; color: var(--on-color); display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: clamp(1.05rem, 2.4vw, 1.9rem); line-height: 1.15; position: relative; overflow: hidden; min-width: 0; }
.ans .lt { font-family: var(--display); font-weight: 800; font-size: 1.5em; flex: none; opacity: .8; }
.ans .tx { min-width: 0; overflow-wrap: anywhere; flex: 1; }
.ans .ct { font-family: var(--display); font-size: 1.3em; flex: none; }
.ans .fill { position: absolute; left: 0; bottom: 0; top: 0; background: rgba(19, 21, 47, .22); width: var(--w, 0%); transition: width .6s ease; }
.ans > :not(.fill) { position: relative; }
.ans.dim { opacity: .32; }
.ans.right { box-shadow: 0 0 0 5px var(--ink); }
.count { font-family: var(--display); font-weight: 800; font-size: 1.6rem; }

/* board + podium */
.board { display: grid; gap: 10px; width: 100%; max-width: 760px; margin: 0 auto; }
.brow { display: flex; align-items: center; gap: 14px; background: var(--stage-2); border-radius: 16px; padding: 12px 18px; font-size: clamp(1.1rem, 2.6vw, 1.7rem); font-weight: 700; }
.board.compact .brow { font-size: 1.05rem; }
.brow .rk { font-family: var(--display); width: 1.6em; color: var(--mute); flex: none; }
.brow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.brow .gain { color: var(--ok); font-size: .7em; }
.brow:first-child { background: var(--gold); color: var(--on-color); }
.brow:first-child .rk, .brow:first-child .gain { color: var(--on-color); }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; width: 100%; max-width: 760px; margin: 0 auto; text-align: center; }
.pod { display: grid; gap: 8px; min-width: 0; }
.pod .nm { font-family: var(--display); font-weight: 800; font-size: clamp(1.1rem, 3vw, 2rem); overflow-wrap: anywhere; }
.pod .blk { border-radius: 18px 18px 0 0; background: var(--panel); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 6vw, 4rem); }
.pod.p1 .blk { height: 200px; background: var(--gold); color: var(--on-color); }
.pod.p2 .blk { height: 140px; }
.pod.p3 .blk { height: 100px; }
.tablewrap { overflow-x: auto; background: var(--stage-2); border-radius: 16px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { padding: 8px 14px; text-align: left; white-space: nowrap; }
th { color: var(--mute); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
tr + tr td { border-top: 1px solid var(--line); }
td.r, th.r { text-align: right; }

/* player */
.pads { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-height: 300px; }
.pads.n2 { grid-template-columns: 1fr; }
.pad { border: 0; border-radius: 22px; cursor: pointer; color: var(--on-color); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px; min-width: 0; font-weight: 700; touch-action: manipulation; }
.pad .lt { font-family: var(--display); font-weight: 800; font-size: clamp(3rem, 16vw, 5rem); line-height: 1; }
.pad .tx { font-size: 1rem; line-height: 1.2; overflow-wrap: anywhere; text-align: center; }
.pad:active { transform: scale(.97); }
.tbar { height: 10px; border-radius: 999px; background: var(--panel); overflow: hidden; }
.tbar i { display: block; height: 100%; width: 100%; background: var(--gold); transform-origin: left; }
.ptext { font-family: var(--display); font-weight: 800; font-size: 1.35rem; overflow-wrap: anywhere; }
.verdict { font-size: clamp(2.6rem, 13vw, 4.5rem); }
.verdict.ok { color: var(--ok); } .verdict.no { color: var(--no); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.stats.one { grid-template-columns: 1fr; }
.stat { background: var(--stage-2); border-radius: 16px; padding: 12px 6px; display: grid; gap: 2px; }
.stat b { font-family: var(--display); font-size: 1.6rem; }
.bigchoice { width: 120px; height: 120px; border-radius: 28px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 4rem; color: var(--on-color); }
.join { display: grid; gap: 14px; width: 100%; }
.join .field { font-size: 1.3rem; text-align: center; font-weight: 700; }
.join .pinf { letter-spacing: .3em; font-family: var(--display); font-size: 1.8rem; }
.conn { position: fixed; left: 0; right: 0; bottom: 0; text-align: center; background: var(--no); color: var(--on-color); font-weight: 700; padding: 6px max(16px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } .ans .fill { transition: none; } .btn, .pad { transition: none; } }
@media (max-width: 560px) {
  .grid4 { grid-template-columns: 1fr; }
  .pod.p1 .blk { height: 140px; } .pod.p2 .blk { height: 100px; } .pod.p3 .blk { height: 70px; }
}

/* ---------- Kviss additions ---------- */
.small { font-size: .85rem; }
.wrap { white-space: normal !important; }
.grow { flex: 1; min-width: 0; }
.tag { background: var(--panel); color: var(--mute); border-radius: 999px; padding: .1em .6em; font-size: .75rem; font-weight: 700; }
.keys { font-size: .8rem; text-align: center; opacity: .7; }

/* library */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.libcard { background: var(--stage-2); border-radius: 18px; padding: 16px; display: grid; gap: 12px; align-content: space-between; }
.libmain { display: grid; gap: 2px; min-width: 0; }
.libmain h3 { font-size: 1.3rem; overflow-wrap: anywhere; }
.pastrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--stage-2); }
.qr { width: 100%; max-width: 260px; aspect-ratio: 1; border-radius: 16px; background: #fff; display: block; }
.qr.small { max-width: 200px; margin-top: 10px; }

/* editor */
.toggles select.field { margin-left: 6px; }
.addrow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.imgrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.thumb { max-height: 110px; max-width: 220px; border-radius: 10px; object-fit: contain; background: var(--stage); }
.numrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 700; }
.numrow .field { width: 12em; }
.qcard textarea[data-f="accept"], .qcard textarea[data-f="items"] { font-size: 1rem; font-weight: 500; }

/* lobby */
.lobby-top { grid-template-columns: minmax(240px, 1.1fr) minmax(200px, .8fr) minmax(260px, 1.2fr); }
.qrbox { background: var(--stage-2); border-radius: 24px; padding: 18px; display: grid; gap: 8px; justify-items: center; align-content: center; }
.qrbox .qr { max-width: 230px; }
.chip.open { background: var(--gold); color: var(--on-color); }
.chip:hover { text-decoration: none; }
.chipmenu { display: inline-flex; gap: 6px; align-items: center; }
.teamcards { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; }
.teamcard { background: var(--stage-2); border-radius: 16px; padding: 10px 18px; display: grid; grid-template-columns: auto auto; gap: 0 10px; align-items: center; min-width: 140px; border: 3px solid transparent; }
.teamcard .te { font-size: 1.8rem; grid-row: span 2; }
.teamcard .tn { font-weight: 700; }
.teamcard b { font-family: var(--display); font-size: 1.4rem; }
.teamcard.lead { border-color: var(--gold); }
.teamrow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tpick { border: 2px solid var(--line); background: var(--stage-2); color: var(--ink); border-radius: 14px; padding: .7em; font-weight: 700; cursor: pointer; }
.tpick.sel { border-color: var(--gold); background: var(--panel); }
.teambadge { background: var(--stage-2); border-radius: 999px; padding: .4em 1.2em; font-weight: 700; }

/* question stage */
.typebadge { background: var(--panel); border-radius: 999px; padding: .3em 1.1em; font-weight: 700; font-size: 1.2rem; }
.stage-img { max-height: 38vh; max-width: 100%; object-fit: contain; border-radius: 18px; align-self: center; }
.bigprompt { flex: 1; min-height: 200px; display: grid; place-items: center; text-align: center; font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 5vw, 3.4rem); background: var(--stage-2); border-radius: 24px; padding: 20px; }
.pausebar { background: var(--gold); color: var(--on-color); border-radius: 16px; padding: 10px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 1.6rem; }
.clock.urgent { animation: throb .5s ease-in-out infinite alternate; }
.clock.paused { opacity: .5; }
@keyframes throb { to { transform: scale(1.08); } }
.bigans { display: grid; justify-items: center; gap: 6px; text-align: center; background: var(--stage-2); border-radius: 24px; padding: 22px; }
.bigans b { font-family: var(--display); font-size: clamp(2.4rem, 8vw, 5.5rem); color: var(--ok); overflow-wrap: anywhere; }
.callouts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.callout { background: var(--panel); border-radius: 999px; padding: .4em 1em; font-weight: 700; font-size: clamp(1rem, 2vw, 1.3rem); animation: popin .4s ease-out both; }
.callout.ok { background: var(--ok); color: var(--on-color); }
.callout:nth-child(2) { animation-delay: .15s; } .callout:nth-child(3) { animation-delay: .3s; } .callout:nth-child(4) { animation-delay: .45s; }
@keyframes popin { from { transform: scale(.6); opacity: 0; } }
.listrev { display: grid; gap: 8px; }
.litem { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; background: var(--stage-2); border-radius: 14px; padding: 10px 16px; font-weight: 700; font-size: clamp(1.05rem, 2.4vw, 1.7rem); }
.litem .fill { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: rgba(69, 214, 154, .28); transition: width .6s ease; }
.litem > :not(.fill) { position: relative; }
.litem .rk { color: var(--mute); width: 1.6em; }
.litem .tx { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* board + podium */
.brow.first { background: var(--gold); color: var(--on-color); }
.brow.first .rk, .brow.first .gain { color: var(--on-color); }
.brow:first-child:not(.first) { background: var(--stage-2); color: var(--ink); }
.brow:first-child:not(.first) .rk { color: var(--mute); }
.brow:first-child:not(.first) .gain { color: var(--ok); }
.brow.slide { transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.brow .fire { font-size: .8em; }
.pod.hidden .nm, .pod.hidden .blk { opacity: .35; }
.pod.fresh { animation: rise .7s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes rise { from { transform: translateY(40px) scale(.8); opacity: 0; } }
.teamwin { color: var(--gold); }

/* results */
.stats.four { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.pctbar { position: relative; min-width: 120px; background: var(--stage); border-radius: 8px; overflow: hidden; padding: 2px 8px; }
.pctbar .fill { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: rgba(69, 214, 154, .45); }
.pctbar .num { position: relative; font-weight: 700; }
tr.hard td:first-child { box-shadow: inset 4px 0 var(--no); }
tr.easy td:first-child { box-shadow: inset 4px 0 var(--ok); }

/* remote */
#app.remote { max-width: 520px; }
.remote-panel { flex: 1; display: flex; flex-direction: column; gap: 14px; justify-content: center; text-align: center; }
.remote-panel .rq { font-family: var(--display); font-weight: 800; font-size: 1.4rem; overflow-wrap: anywhere; }
.remote-panel .row { justify-content: center; }
.btn.wide { width: 100%; padding-block: 1.2em; font-size: 1.4rem; }

/* player */
.qimg { max-width: 100%; max-height: 28vh; object-fit: contain; border-radius: 14px; align-self: center; }
.typed { display: grid; gap: 10px; }
.typed .field { font-size: 1.3rem; text-align: center; font-weight: 700; }
.bigtyped { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 10vw, 3.2rem); background: var(--stage-2); border-radius: 22px; padding: 18px 26px; overflow-wrap: anywhere; max-width: 100%; }
.mylist { text-align: left; margin: 0; padding: 14px 18px 14px 2.4em; background: var(--stage-2); border-radius: 18px; display: grid; gap: 4px; font-weight: 700; font-size: 1.15rem; max-width: 100%; overflow-wrap: anywhere; }
.mylist.small { font-size: 1rem; }
.mylist li.hit { color: var(--ok); }
.mylist li.hit::after { content: " ✓"; }
.verdict.part { color: var(--c); }
.verdict.poll { color: var(--b); }
.moves { display: grid; gap: 4px; font-weight: 700; }
.reacts { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.react { border: 0; background: var(--stage-2); border-radius: 999px; width: 52px; height: 52px; font-size: 1.6rem; cursor: pointer; touch-action: manipulation; }
.react.pop { animation: pop .35s ease-out; }
@keyframes pop { 50% { transform: scale(1.35); } }

/* effects */
.fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
.fx-float { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.fx-float span { position: absolute; bottom: -70px; left: var(--x); font-size: calc(2.6rem * var(--s, 1)); animation: floatup var(--dur, 4s) ease-out forwards; }
@keyframes floatup { 70% { opacity: 1; } to { transform: translate(var(--dx, 0), -88vh); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .brow.slide, .litem .fill { transition: none; }
  .pod.fresh, .callout, .react.pop, .clock.urgent { animation: none; }
}
@media (max-width: 900px) { .lobby-top { grid-template-columns: 1fr; } }
.errs { display: grid; gap: 4px; }
.errs:empty { display: none; }
.pinbox .pin { font-size: clamp(2.6rem, 5.2vw, 5.2rem); letter-spacing: .03em; white-space: nowrap; }
@media (max-width: 900px) { .pinbox .pin { font-size: clamp(2.6rem, 14vw, 5.2rem); } }
.streakchip { background: var(--panel); border-radius: 999px; padding: .4em 1.1em; font-weight: 700; color: var(--gold); }

/* reading time */
.readwrap { display: grid; gap: 8px; justify-items: center; }
.readbar { width: min(520px, 100%); height: 10px; border-radius: 999px; background: var(--panel); overflow: hidden; }
.readbar i { display: block; height: 100%; width: 100%; background: var(--gold); transform-origin: left; animation: readshrink var(--dur, 5000ms) linear forwards; }
@keyframes readshrink { to { transform: scaleX(0); } }

/* number spread */
.spread { display: grid; gap: 6px; width: 100%; }
.strip { position: relative; height: 150px; border-bottom: 3px solid var(--line); margin-inline: 12px; }
.strip .dot { position: absolute; left: var(--x); bottom: calc(6px + var(--y, 0px)); width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--b); opacity: .85; animation: popin .4s ease-out both; }
.strip .dot.hit { background: var(--ok); }
.strip .ansmark { position: absolute; left: var(--x); top: 0; bottom: -3px; border-left: 3px solid var(--ok); }
.strip .ansmark b { position: absolute; top: -4px; left: 6px; background: var(--ok); color: var(--on-color); border-radius: 8px; padding: 0 .5em; font-family: var(--display); white-space: nowrap; }
.axis { display: flex; justify-content: space-between; color: var(--mute); font-size: .9rem; margin-inline: 12px; }

/* awards */
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; width: 100%; }
.award { background: var(--stage-2); border-radius: 18px; padding: 14px; display: grid; gap: 2px; justify-items: center; text-align: center; animation: popin .5s ease-out both; }
.award .ae { font-size: 2rem; }
.award b { font-family: var(--display); font-size: 1.3rem; overflow-wrap: anywhere; }
.award:nth-child(2) { animation-delay: .2s; } .award:nth-child(3) { animation-delay: .4s; } .award:nth-child(4) { animation-delay: .6s; }
.youwon { background: var(--panel); border-radius: 999px; padding: .4em 1.1em; font-weight: 700; color: var(--gold); }
@media (prefers-reduced-motion: reduce) { .readbar i { animation: none; } .award, .strip .dot { animation: none; } }

/* put in order */
.orderstage { display: grid; gap: 10px; }
.oitem { background: var(--stage-2); border-radius: 16px; padding: 14px 20px; font-weight: 700; font-size: clamp(1.1rem, 2.6vw, 1.9rem); overflow-wrap: anywhere; }
.center-text { text-align: center; }
.orderpick { display: grid; gap: 10px; flex: 1; align-content: start; }
.opick { display: flex; align-items: center; gap: 12px; border: 2px solid var(--line); background: var(--stage-2); color: var(--ink); border-radius: 16px; padding: 14px; font-weight: 700; font-size: 1.1rem; text-align: left; cursor: pointer; touch-action: manipulation; }
.opick .onum { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); font-family: var(--display); }
.opick.set { border-color: var(--gold); }
.opick.set .onum { background: var(--gold); color: var(--on-color); }
.opick .tx { overflow-wrap: anywhere; }

/* pick the picture */
.pics-ed { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.pic-ed { display: grid; gap: 8px; background: var(--stage); border-radius: 14px; padding: 10px; }
.pic-ed input[type=radio] { width: 20px; height: 20px; accent-color: var(--ok); }
.picthumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--stage-2); }
.picthumb.empty { display: grid; place-items: center; color: var(--mute); }
.grid4.pics .ans.pic { flex-direction: column; align-items: stretch; padding: 10px; gap: 8px; }
.ans.pic img { width: 100%; flex: 1; min-height: 0; max-height: 30vh; object-fit: contain; border-radius: 12px; background: rgba(0, 0, 0, .15); }
.ans.pic .lt { position: absolute; top: 14px; left: 18px; background: var(--stage); color: var(--ink); border-radius: 10px; padding: 0 .35em; font-size: 1.2em; opacity: .9; }
.ans.pic .tx { text-align: center; }
.ans.pic .ct { text-align: center; }
.picpads .pad { padding: 8px; position: relative; }
.picpads .pad img { width: 100%; height: 100%; max-height: 22vh; object-fit: contain; border-radius: 14px; }
.picpads .pad .lt.sm { position: absolute; top: 10px; left: 14px; font-size: 1.6rem; background: var(--stage); color: var(--ink); border-radius: 10px; padding: 0 .35em; }

/* privacy policy / terms */
.doc { max-width: 760px; margin: 0 auto; padding: 24px 0 64px; line-height: 1.6; }
.doc h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 32px 0 6px; }
.doc h2 { font-size: 1.35rem; margin: 28px 0 8px; }
.doc p, .doc ul { margin: 0 0 12px; }
.doc ul { padding-left: 1.2em; display: grid; gap: 6px; }
.doc article + article { margin-top: 56px; padding-top: 8px; border-top: 2px solid var(--line); }
.doc-nav { font-weight: 700; }
.legal { text-align: center; font-size: .8rem; color: var(--mute); }
.legal a { color: var(--mute); }

/* range band on the guess strip */
.strip .rangeband { position: absolute; left: var(--x); width: var(--w); top: 0; bottom: 0; background: rgba(69, 214, 154, .12); border-inline: 1px dashed rgba(69, 214, 154, .5); }

/* stats sheet */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(8, 10, 28, .72); display: grid; place-items: center; padding: 16px; }
.sheet-card { background: var(--stage); border: 2px solid var(--line); border-radius: 20px; padding: 18px; width: min(900px, 100%); max-height: 90vh; overflow: auto; display: grid; gap: 10px; }
.sheet-card td.wrap { white-space: normal; min-width: 8em; }
.sheet-card .mk { font-family: var(--display); }
tr.okrow .mk { color: var(--ok); } tr.norow .mk { color: var(--no); } tr.partrow .mk { color: var(--c); }
.click { cursor: pointer; }
tr.click:hover td, .brow.click:hover { filter: brightness(1.15); }
@media (max-width: 560px) {
  .sheet-card th:nth-child(6), .sheet-card td:nth-child(6) { display: none; }
  .sheet-card td.wrap { min-width: 5.5em; }
  .sheet-card th, .sheet-card td { padding: 6px 8px; }
}
