:root {
  --bg: #0b0b0f;
  --panel: #15151c;
  --panel-2: #1d1d27;
  --line: #2a2a36;
  --text: #f4f4f6;
  --muted: #9a9aa8;
  --red: #e10600;
  --red-dark: #5b050d;
  --green: #22c55e;
  --yellow: #ffd12e;
  --purple: #a855f7;
  --font: 'Titillium Web', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #2a0508 0%, transparent 60%), var(--bg);
  color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.red { color: var(--red); }
.italic { font-style: italic; }
.demo-badge {
  position: fixed; right: 10px; bottom: 10px; z-index: 50; font-size: 12px; font-weight: 700;
  background: var(--yellow); color: #111; padding: 4px 10px; border-radius: 999px; letter-spacing: .04em;
}
.stripe { height: 6px; background: repeating-linear-gradient(90deg, var(--red) 0 60px, transparent 60px 70px); }
.checker { height: 24px; background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0 / 24px 24px; }

/* ---------- Start lights ---------- */
.gantry { display: flex; gap: 10px; justify-content: center; padding: 12px 16px; background: #0f0f12; border-radius: 16px; border: 2px solid #26262e; width: max-content; margin: 0 auto; }
.gantry .pod { display: flex; flex-direction: column; gap: 8px; background: #050505; padding: 8px; border-radius: 10px; }
.gantry i { width: 34px; height: 34px; border-radius: 50%; background: #2a0b0b; box-shadow: inset 0 0 8px #000; transition: background .05s; }
.gantry i.on { background: radial-gradient(circle at 35% 35%, #ff6b5e, var(--red) 55%, #8a0400); box-shadow: 0 0 22px 6px rgba(225, 6, 0, .7); }
.gantry.big { gap: 22px; padding: 22px 28px; border-radius: 24px; }
.gantry.big .pod { gap: 14px; padding: 14px; border-radius: 16px; }
.gantry.big i { width: 92px; height: 92px; }

/* ---------- PLAYER (phone) ---------- */
.phone { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding: 16px; }
.phone header { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 14px; }
.brand { font-weight: 900; font-style: italic; letter-spacing: .02em; font-size: 20px; }
.brand b { color: var(--red); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.field { width: 100%; font: inherit; font-size: 20px; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--line); background: #0d0d12; color: var(--text); outline: none; }
.field:focus { border-color: var(--red); }
.code-edit { display: flex; gap: 10px; justify-content: center; margin: 14px 0 6px; }
.code-edit input { width: 64px; height: 76px; padding: 0; text-align: center; font: 900 italic 30px var(--font); text-transform: uppercase; border-radius: 12px; border: 2px solid var(--line); background: #0d0d12; color: var(--text); outline: none; }
.code-edit input:focus { border-color: var(--red); }
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 16px; font-size: 20px; font-weight: 800; background: var(--red); color: #fff; letter-spacing: .03em; }
.btn:disabled { opacity: .45; }
.btn.ghost { background: transparent; border: 2px solid var(--line); color: var(--text); }
.error { color: #ff7a72; min-height: 22px; margin-top: 8px; font-size: 15px; }
.driver-card { border-radius: 20px; padding: 22px; background: linear-gradient(135deg, var(--team, var(--red)) 0 8px, var(--panel) 8px); border: 1px solid var(--line); }
.driver-card .code { font: 900 italic 88px/0.9 var(--font); letter-spacing: .02em; }
.driver-card .name { font-size: 18px; color: var(--muted); margin-top: 6px; }
.big-msg { text-align: center; margin: auto 0; padding: 20px 0; }
.big-msg h1 { font: 900 italic 44px/1 var(--font); margin: 0 0 10px; }
.big-msg p { font-size: 18px; color: var(--muted); margin: 0; }
.q-text { font-size: 22px; font-weight: 700; line-height: 1.25; margin: 6px 0 14px; }
.choices { display: grid; gap: 12px; }
.choice { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 0; border-radius: 16px; padding: 18px 16px; font-size: 19px; font-weight: 700; color: #fff; background: var(--panel-2); border-left: 10px solid var(--c); min-height: 72px; }
.choice .l { font: 900 italic 26px var(--font); color: var(--c); width: 24px; }
.choice:active { transform: scale(.98); }
.choice.picked { background: var(--c); color: #111; }
.choice.picked .l { color: #111; }
.choice:disabled:not(.picked) { opacity: .35; }
.timer { height: 10px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin: 6px 0 14px; }
.timer > div { height: 100%; background: linear-gradient(90deg, var(--yellow), var(--red)); width: 100%; transform-origin: left; }
.tap-zone { flex: 1; min-height: 55vh; border-radius: 24px; border: 0; width: 100%; font: 900 italic 42px var(--font); color: #fff; background: #1b1b22; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; touch-action: manipulation; user-select: none; }
.tap-zone.go { background: var(--green); color: #052e12; }
.result-pill { display: inline-block; font: 900 italic 30px var(--font); padding: 8px 18px; border-radius: 12px; }
.result-pill.ok { background: var(--green); color: #052e12; }
.result-pill.bad { background: #3a1214; color: #ff8d86; }
.result-pill.jump { background: var(--yellow); color: #2b2100; }
.pos-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; font-size: 18px; }
.pos-row b { font: 900 italic 48px var(--font); }

/* ---------- SCREEN (projector, 16:9) ---------- */
.screen { width: 100vw; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.screen .top { display: flex; align-items: center; justify-content: space-between; padding: 1.6vh 2.4vw; }
.screen .top .brand { font-size: 2.6vh; }
.screen .top .round { font-weight: 800; font-size: 2.2vh; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.view { flex: 1; display: flex; min-height: 0; padding: 0 2.4vw 2.4vh; }
.lobby { gap: 3vw; align-items: stretch; }
.lobby .left { width: 34vw; display: flex; flex-direction: column; justify-content: center; gap: 2.4vh; }
.lobby h1 { font: 900 italic 9vh/0.9 var(--font); margin: 0; }
.lobby h1 span { color: var(--red); }
.qr-box { background: #fff; padding: 1.6vh; border-radius: 16px; width: max-content; }
.qr-box svg { display: block; width: 30vh; height: 30vh; }
.grid-wrap { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 2.4vh; display: flex; flex-direction: column; min-height: 0; }
.grid-wrap h2 { margin: 0 0 1.6vh; font-size: 2.6vh; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.2vh; align-content: start; overflow: hidden; }
.tile { background: var(--panel-2); border-radius: 10px; padding: 1.1vh 1vw; border-left: 6px solid var(--team); font: 900 italic 3.6vh var(--font); animation: pop .35s ease-out; }
.tile small { display: block; font: 600 normal 1.5vh var(--font); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.qview { flex-direction: column; align-items: center; justify-content: center; gap: 3vh; }
.qview .qnum { font-weight: 800; letter-spacing: .2em; color: var(--red); font-size: 2.4vh; text-transform: uppercase; }
.qview .qtext { font: 800 5.4vh/1.15 var(--font); text-align: center; max-width: 80vw; }
.qview .schoices { display: grid; grid-template-columns: 1fr 1fr; gap: 2vh 2vw; width: 82vw; }
.schoice { display: flex; align-items: center; gap: 1.6vw; background: var(--panel); border-radius: 16px; padding: 2.4vh 2vw; border-left: 12px solid var(--c); font-size: 3.6vh; font-weight: 700; position: relative; overflow: hidden; }
.schoice .l { font: 900 italic 5vh var(--font); color: var(--c); }
.schoice.correct { background: #0f3a20; box-shadow: 0 0 0 4px var(--green); }
.schoice.dim { opacity: .35; }
.schoice .count { margin-left: auto; font: 900 italic 4.2vh var(--font); color: var(--muted); }
.sbar { width: 82vw; height: 1.4vh; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.sbar > div { height: 100%; background: linear-gradient(90deg, var(--yellow), var(--red)); }
.status-line { display: flex; gap: 3vw; font-size: 2.8vh; font-weight: 700; color: var(--muted); }
.status-line b { color: var(--text); font-size: 3.6vh; }
.go-text { font: 900 italic 20vh/1 var(--font); color: var(--green); letter-spacing: .02em; }
.lights-caption { font: 800 3vh var(--font); letter-spacing: .3em; color: var(--muted); text-transform: uppercase; }

.reveal { gap: 2.4vw; align-items: stretch; }
.reveal .main { flex: 1.3; display: flex; flex-direction: column; gap: 1.8vh; justify-content: center; }
.reveal .main .qtext { font: 800 3.6vh/1.2 var(--font); }
.reveal .side { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 2.4vh; display: flex; flex-direction: column; gap: 1.2vh; }
.reveal .side h2 { margin: 0 0 .6vh; font-size: 2.4vh; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.fast-row { display: grid; grid-template-columns: 5vh 1fr auto auto; gap: 1.2vw; align-items: center; background: var(--panel-2); border-radius: 10px; padding: 1.2vh 1.2vw; font-size: 3vh; animation: slidein .4s ease-out both; }
.fast-row .p { font: 900 italic 3.4vh var(--font); color: var(--muted); }
.fast-row .c { font: 900 italic 3.6vh var(--font); border-left: 5px solid var(--team); padding-left: .8vw; }
.fast-row .t { font-variant-numeric: tabular-nums; color: var(--muted); }
.fast-row .pts { font: 900 italic 3.2vh var(--font); color: var(--green); min-width: 7vh; text-align: right; }
.fast-row.purple .t { color: var(--purple); font-weight: 800; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.standings { gap: 2vw; align-items: stretch; }
.tower { width: 30vw; background: rgba(10, 10, 14, .92); border: 1px solid var(--line); border-radius: 16px; padding: 1.2vh; display: flex; flex-direction: column; min-height: 0; }
.tower h2 { margin: .4vh .6vw 1vh; font-size: 2vh; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; display: flex; justify-content: space-between; }
.tower-rows { position: relative; flex: 1; min-height: 0; }
.trow { position: absolute; left: 0; right: 0; display: grid; grid-template-columns: 4vh 1fr auto auto; align-items: center; gap: .8vw; padding: 0 .8vw; border-radius: 6px; transition: top .9s cubic-bezier(.3, .8, .3, 1), background .3s; font-size: 2.3vh; }
.trow:nth-child(odd) { background: rgba(255, 255, 255, .03); }
.trow .p { font-weight: 800; text-align: center; }
.trow .c { font-weight: 900; font-style: italic; border-left: 4px solid var(--team); padding-left: .6vw; letter-spacing: .04em; }
.trow .pts { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.trow .pts small { display: inline-block; min-width: 4.6vh; margin-left: .5vw; font-size: .72em; font-weight: 600; color: var(--muted); text-align: left; }
.trow .gain { font-size: 1.8vh; font-weight: 800; color: var(--green); min-width: 4.5vh; text-align: right; }
.trow .gain.neg { color: #ff7a72; }
.trow .mv { font-size: 1.5vh; margin-left: .4vw; }
.trow .mv.up { color: var(--green); } .trow .mv.down { color: #ff7a72; }
.trow.p1 .p { color: var(--yellow); }
.track-wrap { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.track-wrap .lapline { position: absolute; top: 2vh; left: 2vw; font: 800 2.4vh var(--font); letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.track-wrap svg { width: 100%; height: 100%; }
.car-label { font: 900 italic 22px var(--font); fill: #fff; paint-order: stroke; stroke: #000; stroke-width: 4px; }

.finish { flex-direction: column; align-items: center; justify-content: flex-end; gap: 2vh; }
.podium { display: flex; align-items: flex-end; gap: 1.4vw; }
.step { width: 20vw; text-align: center; }
.step .who { font: 900 italic 7vh/1 var(--font); }
.step .nm { font-size: 2.2vh; color: var(--muted); margin: .6vh 0 1.2vh; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step .block { border-radius: 14px 14px 0 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 2vh; font: 900 italic 9vh var(--font); }
.step.p1 .block { height: 34vh; background: var(--red); }
.step.p2 .block { height: 25vh; background: #3a3a44; }
.step.p3 .block { height: 18vh; background: #2a2a32; }
.step .pts { font-size: 2.4vh; font-weight: 800; margin-top: -1vh; margin-bottom: 1vh; }
.classif { display: flex; flex-wrap: wrap; gap: 1vh 1.4vw; justify-content: center; max-width: 90vw; font-size: 2.2vh; color: var(--muted); }
.classif b { color: var(--text); font-style: italic; }
.confetti { position: fixed; inset: 0; pointer-events: none; }

.sound-gate { position: fixed; inset: 0; background: rgba(0, 0, 0, .85); display: flex; align-items: center; justify-content: center; z-index: 40; }
.sound-gate button { font-size: 3vh; padding: 2vh 4vw; border-radius: 16px; border: 0; background: var(--red); color: #fff; font-weight: 800; }

/* ---------- HOST ---------- */
.host { max-width: 1100px; margin: 0 auto; padding: 20px; display: grid; gap: 16px; }
.host h1 { margin: 0; font: 900 italic 30px var(--font); }
.host .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.host .card h2 { margin: 0 0 12px; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hbtn { border: 0; border-radius: 10px; padding: 12px 16px; font-size: 16px; font-weight: 800; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.hbtn.primary { background: var(--red); border-color: var(--red); }
.hbtn.go { background: var(--green); border-color: var(--green); color: #052e12; }
.hbtn.warn { background: transparent; color: #ff8d86; border-color: #5a2226; }
.hbtn:disabled { opacity: .4; cursor: not-allowed; }
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { background: var(--panel-2); border-radius: 12px; padding: 12px; }
.stat .k { font-size: 12px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.stat .v { font-size: 26px; font-weight: 800; }
.qlist { display: grid; gap: 14px; }
.stint h3 { margin: 0 0 8px; font-size: 15px; color: var(--red); letter-spacing: .06em; }
.qitem { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); margin-bottom: 6px; }
.qitem.done { opacity: .5; }
.qitem .qt { font-weight: 700; }
.qitem .qa { font-size: 13px; color: var(--muted); }
.qitem .qa b { color: var(--green); }
.plist { display: flex; flex-wrap: wrap; gap: 8px; }
.ptag { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border-left: 4px solid var(--team); border-radius: 8px; padding: 6px 8px 6px 10px; font-weight: 700; }
.ptag button { border: 0; background: transparent; color: #ff8d86; font-size: 16px; padding: 0 4px; }
.links a { color: var(--text); }
@media (max-width: 760px) { .status-grid { grid-template-columns: repeat(2, 1fr); } }

/* embedded in the slide deck: the deck draws its own header */
body.embedded .screen > .stripe { display: none; }
body.embedded .screen .top .brand { visibility: hidden; }
