:root {
  --ink: #160d2e; --night: #1f1440; --plum: #2a1b5e; --violet: #4b379a;
  --cream: #fff3d6; --wood: #e9a558; --orange: #ff6b2c; --gold: #ffd23f; --teal: #2ec4b6; --pink: #f25f8b; --led: #ffb000;
  --display: 'Bungee', Impact, 'Arial Black', sans-serif; --body: 'Rubik', system-ui, -apple-system, sans-serif;
  --shadow: 0 5px 0 #0b0620;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ink); color: var(--cream); font-family: var(--body); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(circle at 50% -20%, #3a2380 0, transparent 55%); min-height: 100dvh; display: flex; flex-direction: column; }
button, input { font: inherit; color: inherit; }
a { color: var(--gold); }
[hidden] { display: none !important; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); }
.logo { font-family: var(--display); font-size: clamp(15px, 4.4vw, 22px); color: var(--cream); text-decoration: none; display: flex; align-items: center; gap: 8px; white-space: nowrap; letter-spacing: .5px; }
.logo b { color: var(--orange); font-weight: 400; }
.logo .ball { width: 22px; height: 22px; border-radius: 50%; background: var(--orange); border: 2px solid var(--ink); box-shadow: inset -3px -3px 0 rgba(0,0,0,.2), 0 0 0 2px var(--cream); flex: none; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.chip { font-family: var(--display); font-size: 11px; padding: 5px 9px; border-radius: 999px; background: var(--plum); color: var(--cream); white-space: nowrap; }
.chip.hot { background: var(--orange); color: var(--ink); }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--violet); background: var(--night); cursor: pointer; font-size: 16px; line-height: 1; }
.icon-btn:hover { border-color: var(--gold); }
@media (max-width: 420px) { #chip-day { display: none; } }

#app { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 10px; }
#app { position: relative; }
#stage { position: relative; height: calc(var(--vh, 100dvh) - 66px); min-height: 300px; border-radius: 16px; overflow: hidden; border: 3px solid #0b0620; box-shadow: var(--shadow); background: #120a2c; }
body.shooting #panel { opacity: 0; pointer-events: none; }
body.results #stage { height: 30dvh; min-height: 180px; }
#scene { width: 100%; height: 100%; display: block; }
.hud { position: absolute; inset: 8px 8px auto 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; }
.led { background: rgba(8,4,20,.86); border: 2px solid #3a2a7a; border-radius: 10px; padding: 5px 10px 4px; display: flex; align-items: baseline; gap: 6px; font-family: var(--display); }
.led.right { flex-direction: column; align-items: flex-end; gap: 0; max-width: 58%; }
.led-label { font-size: 10px; color: var(--teal); letter-spacing: 1px; text-align: right; }
.led-num { font-size: clamp(22px, 6vw, 32px); color: var(--led); text-shadow: 0 0 12px rgba(255,176,0,.55); line-height: 1; font-variant-numeric: tabular-nums; }
.led-num.small { font-size: clamp(14px, 4vw, 20px); }
.led-max { font-size: 11px; color: #8d7fc7; }
.pips { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); display: flex; gap: 5px; }
.pip { width: 22px; height: 8px; border-radius: 4px; background: rgba(8,4,20,.7); border: 1.5px solid #3a2a7a; }
.pip.now { border-color: var(--cream); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .45; } }
.t0 { background: #3b3352; } .t1 { background: #e9e2ff; } .t2 { background: var(--gold); } .t3 { background: var(--orange); } .t4 { background: var(--pink); } .t5 { background: #a37bff; }

/* during play the panel floats over the lower part of the stage; on the results page it flows below it */
#panel { position: absolute; left: 10px; right: 10px; bottom: 14px; padding: 0 10px 6px; max-height: calc(100% - 96px); overflow-y: auto; transition: opacity .3s; z-index: 2; }
#panel .card { max-width: 540px; margin-bottom: 0; padding: 14px 16px; background: rgba(255,243,214,.97); box-shadow: 0 5px 0 #0b0620, 0 12px 30px rgba(8,4,20,.45); }
body.results #panel { position: static; padding: 14px 0 24px; max-height: none; overflow: visible; }
body.results #panel .card { max-width: 720px; margin-bottom: 14px; padding: 18px; box-shadow: none; border-width: 2px; }
body.results #panel .card.dark { background: var(--night); border-color: #33246b; }
body.results #panel .card.final { background: var(--cream); border-color: #0b0620; box-shadow: var(--shadow); }
.lead { margin: 0 0 12px; font-size: 14.5px; }
.card { background: var(--cream); color: var(--ink); border: 3px solid #0b0620; border-radius: 18px; box-shadow: var(--shadow); padding: 18px; margin: 0 auto 16px; max-width: 720px; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.card.dark { background: var(--night); color: var(--cream); border-color: var(--violet); }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0 0 8px; line-height: 1.1; letter-spacing: .3px; }
h1 { font-size: clamp(24px, 6.4vw, 38px); } h2 { font-size: clamp(17px, 4.4vw, 22px); } h3 { font-size: 14px; }
.eyebrow { font-family: var(--display); font-size: 12px; color: var(--orange); letter-spacing: 1.5px; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 8px; }
.muted { color: #6b5f86; font-size: 13.5px; } .dark .muted { color: #a99be0; }
.center { text-align: center; }

.btn { font-family: var(--display); font-size: 17px; letter-spacing: .5px; border: 3px solid #0b0620; border-radius: 14px; padding: 13px 20px; background: var(--orange); color: var(--ink); cursor: pointer; box-shadow: 0 5px 0 #0b0620; transition: transform .08s, box-shadow .08s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #0b0620; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.big { width: 100%; font-size: 22px; padding: 17px; }
.btn.gold { background: var(--gold); } .btn.teal { background: var(--teal); } .btn.ghost { background: transparent; color: inherit; box-shadow: none; border-width: 2px; font-size: 13px; padding: 9px 12px; }
.dark .btn.ghost { border-color: var(--violet); }
.btn.small { font-size: 13px; padding: 9px 12px; border-radius: 10px; box-shadow: 0 3px 0 #0b0620; }
.link { background: none; border: 0; padding: 0; color: #7a4a1c; text-decoration: underline; cursor: pointer; font-size: 13.5px; } .dark .link { color: var(--gold); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }

.rules { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 8px; }
.rules li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.rules b { font-family: var(--display); font-weight: 400; background: var(--ink); color: var(--gold); width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: 13px; }
.vs { background: var(--ink); color: var(--cream); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 14.5px; border: 2px dashed var(--gold); }

.q-text { font-size: clamp(16.5px, 4.2vw, 20px); font-weight: 700; line-height: 1.25; margin: 2px 0 4px; }
.timer { font-size: 22px; line-height: .8; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.tbar { height: 6px; border-radius: 3px; background: #eadcbb; overflow: hidden; margin-bottom: 8px; } .tbar i { display: block; height: 100%; width: 100%; background: var(--teal); transition: width .1s linear; }
.q-card.warn .timer { color: #c8321f; animation: blink 1s infinite; } .q-card.warn .tbar i { background: #e2523a; }
.answer-row { display: flex; gap: 8px; margin-top: 10px; }
.answer-row .btn { font-size: 15px; padding: 10px 14px; }
.answer-row input, .field { flex: 1; min-width: 0; font-size: 18px; padding: 13px 14px; border-radius: 12px; border: 3px solid #0b0620; background: #fff; color: var(--ink); outline: none; }
.answer-row input:focus, .field:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,107,44,.25); }
.under { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; align-items: center; } .under .muted { font-size: 12.5px; }
.msg { margin-top: 8px; padding: 7px 10px; animation: pop .2s; border-radius: 10px; background: #ffe2bd; border: 2px solid var(--orange); font-size: 14.5px; }
.options { display: grid; gap: 8px; margin: 10px 0; }
.options .btn { justify-content: flex-start; font-family: var(--body); font-weight: 700; font-size: 16px; background: #fff; }

.rv-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.reveal .name { font-family: var(--display); font-size: clamp(18px, 5vw, 24px); line-height: 1.1; margin-top: 6px; }
.reveal .pts { font-family: var(--display); font-size: clamp(38px, 10vw, 52px); line-height: 1; color: var(--orange); text-shadow: 3px 3px 0 var(--ink); }
#panel .reveal.moving { max-width: 400px; } .reveal.moving .rv-more { display: none; }
.rv-more .btn.big { font-size: 18px; padding: 13px; }
.reveal.miss .pts { color: #6b5f86; text-shadow: none; }
.tier { display: inline-block; font-family: var(--display); font-size: 13px; padding: 5px 12px; border-radius: 999px; background: var(--ink); color: var(--gold); letter-spacing: 1px; }
.moved { margin: 8px 0 10px; font-size: 14.5px; }
.shoot-btn { font-size: 28px !important; padding: 18px !important; background: var(--gold) !important; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.03); box-shadow: 0 5px 0 #0b0620, 0 0 0 8px rgba(255,210,63,.25); } }

/* results */
.final { text-align: center; }
.final .score { font-family: var(--display); font-size: clamp(60px, 19vw, 110px); line-height: .95; color: var(--orange); text-shadow: 4px 4px 0 var(--ink); }
.final .score small { font-size: .28em; color: var(--ink); text-shadow: none; }
.final .from { font-family: var(--display); font-size: clamp(15px, 4.2vw, 20px); margin-top: 6px; }
.stats { display: flex; justify-content: center; margin: 16px 0; }
.stat { flex: 1; max-width: 220px; padding: 2px 10px; text-align: center; } .stat + .stat { border-left: 2px solid #e4cf9f; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.1; }
.stat span { font-size: 11.5px; color: #6b5f86; text-transform: uppercase; letter-spacing: .6px; }
.note { font-size: 12.5px; color: #6b5f86; margin: 8px 0 0; } .dark .note { color: #a99be0; }
.sub-actions { margin: 12px 0 0; color: #6b5f86; }
.dark h3 { color: #a99be0; letter-spacing: 1.2px; font-size: 12.5px; margin-bottom: 10px; }
.bd-item { border-bottom: 1px solid rgba(255,255,255,.08); } .bd-item:last-child { border: 0; }
.bd-item summary { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; list-style: none; } .bd-item summary::-webkit-details-marker { display: none; }
.bd-n { color: #8d7fc7; font-size: 12.5px; width: 14px; } .bd-a { flex: 1; font-weight: 500; font-size: 15.5px; }
.bd-item .p { font-family: var(--display); font-size: 16px; color: var(--cream); }
.bd-x { font-size: 12.5px; color: #a99be0; padding: 0 0 10px 24px; }
.fold { margin-top: 12px; } .fold summary { cursor: pointer; font-size: 13.5px; color: #a99be0; }
.hist { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; align-items: end; height: 120px; margin-top: 10px; }
.hist div { background: var(--violet); border-radius: 4px 4px 0 0; min-height: 3px; position: relative; }
.hist div.me { background: var(--orange); }
.hist div.me::after { content: 'YOU'; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-family: var(--display); font-size: 10px; color: var(--orange); }
.hist-x { display: flex; justify-content: space-between; font-size: 11px; color: #a99be0; margin-top: 4px; }
.tabs { display: flex; gap: 6px; margin: 4px 0 10px; }
.tabs button { font-family: var(--display); font-size: 11.5px; padding: 7px 10px; border-radius: 999px; border: 2px solid var(--violet); background: transparent; color: var(--cream); cursor: pointer; }
.tabs button.on { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.lb { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.lb td { padding: 7px 6px; border-bottom: 1px solid rgba(255,255,255,.08); } .lb td:first-child { width: 34px; font-family: var(--display); color: var(--gold); } .lb td:last-child { text-align: right; font-family: var(--display); }
.lb tr.me td { background: rgba(255,107,44,.2); }
.checks { display: grid; gap: 6px; margin: 10px 0; font-size: 14.5px; }
.checks label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; } .checks input { margin-top: 3px; accent-color: var(--orange); width: 17px; height: 17px; flex: none; }
.perks { margin: 8px 0 12px; padding-left: 18px; font-size: 14.5px; }
.ad-slot { max-width: 720px; margin: 0 auto 16px; min-height: 100px; text-align: center; } .ad-slot:empty { display: none; }
.countdown { font-family: var(--display); font-size: 26px; color: var(--gold); }

dialog { border: 3px solid #0b0620; border-radius: 18px; background: var(--night); color: var(--cream); padding: 0; width: min(92vw, 480px); max-height: 86dvh; box-shadow: 0 10px 0 #0b0620; }
dialog::backdrop { background: rgba(8,4,20,.75); }
.dlg-body { padding: 18px; position: relative; }
.dlg-close { position: absolute; top: 10px; right: 10px; }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 80px); background: var(--gold); color: var(--ink); font-weight: 700; padding: 10px 16px; border-radius: 12px; border: 3px solid #0b0620; transition: transform .25s; z-index: 50; max-width: 90vw; text-align: center; }
#toast.on { transform: translate(-50%, 0); }
.foot { padding: 14px; font-size: 12px; color: #8d7fc7; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 1100px; margin: 0 auto; width: 100%; }
@media (prefers-reduced-motion: reduce) { .card, .shoot-btn, .pip.now { animation: none; } }
.note .countdown { font-size: 13px; }
.note .countdown { color: inherit; }
@media (max-width: 480px) { .under .muted { display: none; } .under { justify-content: flex-end; } }

/* nav labels */
.top-actions .icon-btn { width: auto; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; color: var(--cream); }
.icon-btn .lbl { font-family: var(--display); font-size: 11px; letter-spacing: .5px; }
@media (max-width: 720px) { .top-actions .chip { display: none; } .top-actions { gap: 4px; }
  .top-actions .icon-btn { flex-direction: column; gap: 1px; padding: 3px 5px; height: 42px; font-size: 14px; } .icon-btn .lbl { font-family: var(--body); font-weight: 700; font-size: 8.5px; letter-spacing: 0; } .logo { font-size: 13px; gap: 5px; } .logo .ball { width: 16px; height: 16px; } }
/* results: countdown + two columns */
.next-bar { max-width: 1000px; margin: 0 auto 12px; display: flex; justify-content: center; align-items: baseline; gap: 12px; flex-wrap: wrap; font-family: var(--display); font-size: 13px; letter-spacing: 1.2px; color: var(--cream); background: var(--night); border: 2px solid var(--gold); border-radius: 12px; padding: 8px 14px; }
.next-bar .countdown { font-size: 22px; font-variant-numeric: tabular-nums; }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 1000px; margin: 0 auto 14px; }
body.results #panel .res-grid .card { max-width: none; margin: 0; }
.res-side h3.gap { margin-top: 18px; } .curve { display: block; width: 100%; height: auto; max-height: 170px; }
.cv-you { font-family: var(--display); font-size: 20px; fill: var(--gold); } .cv-tick { font-size: 17px; fill: #a99be0; }
.gap-row td { text-align: center !important; color: #8d7fc7 !important; padding: 0 !important; border: 0 !important; font-family: var(--body) !important; }
@media (max-width: 760px) { .res-grid { grid-template-columns: 1fr; } }
/* stats */
dialog.wide { width: min(94vw, 820px); } dialog h3 { color: #a99be0; letter-spacing: 1.2px; font-size: 12.5px; margin: 14px 0 10px; } dialog .btn.ghost { border-color: var(--violet); }
dialog .muted, dialog .note { color: #a99be0; } dialog .link { color: var(--gold); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.tile { background: var(--ink); border-radius: 10px; padding: 10px 8px; text-align: center; } .tile b { display: block; font-family: var(--display); font-weight: 400; color: var(--gold); font-size: 19px; } .tile span { font-size: 11px; color: #a99be0; text-transform: uppercase; letter-spacing: .5px; }
.tabs.wrap { flex-wrap: wrap; } .guest-cta { background: var(--ink); border-radius: 12px; padding: 14px; } .guest-cta p { margin: 0 0 10px; }
