/*
VOICE   loud, friendly arcade sticker sheet
IDEA    every map is a full-page painted backdrop; the game UI sits on it as chunky inked stickers
PICTURE the backdrop itself (sky, skyline, weather) behind glass panels
COLOUR  ink outline #0b0a14, glass night panels, one gold accent, six tier colours
TYPE    Lilita One for titles, numbers and badges; Nunito for everything else
*/
:root {
  --ink: #0b0a14; --bg: #0f0d1c; --glass: rgba(20, 17, 38, .76); --glass2: rgba(255, 255, 255, .07); --line: rgba(255, 255, 255, .14);
  --text: #fff8ec; --muted: #cfc8ea; --gold: #ffc93c; --bad: #ff7b8a; --ok: #5cf0ad; --hot: #ff5a2a;
  --t0: #a7a1c4; --t1: #57b9ff; --t2: #45e0a0; --t3: #b98bff; --t4: #ff66a8; --t5: #ffc93c;
  --disp: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --pop: 0 5px 0 var(--ink);
  color-scheme: dark;
}
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; }
html { background: var(--bg); }
body { color: var(--text); font: 600 16px/1.5 Nunito, system-ui, sans-serif; min-height: 100vh; overflow-x: clip; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--disp); font-weight: 400; letter-spacing: .2px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.err { color: var(--bad); min-height: 1.5em; margin: 4px 0 0; font-size: 15px; }
.small-text { font-size: 14px; margin: 0; min-height: 1.4em; }

/* ---------- backdrop ---------- */
#backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.bd { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.bd.on { opacity: 1; }
.bd svg { width: 100%; height: 100%; display: block; }
.bd-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 10, 20, .5) 0%, rgba(11, 10, 20, .34) 30%, rgba(11, 10, 20, .58) 70%, rgba(11, 10, 20, .82) 100%); }
.fx { position: absolute; inset: 0; pointer-events: none; }
.fx i { position: absolute; left: var(--x); top: var(--y); width: var(--z); height: var(--z); border-radius: 50%; background: #fff; opacity: 0; animation: twinkle var(--d) linear var(--dl) infinite; }
.fx-snow i { top: -3%; animation-name: fall; opacity: .9; }
.fx-rain i { top: -5%; width: 2px; height: 22px; border-radius: 2px; background: #a9cdfb; animation-name: fall; animation-duration: calc(var(--d) / 9); opacity: .55; }
.fx-petals i { top: -3%; width: calc(var(--z) * 1.8); height: calc(var(--z) * 1.2); border-radius: 70% 0 70% 0; background: #fff4d6; animation-name: flutter; animation-duration: calc(var(--d) * 1.6); }
.fx-embers i { top: 102%; background: #ffb347; box-shadow: 0 0 8px 2px #ff7a2a; animation-name: rise; }
.fx-fireflies i { background: #eaff8a; box-shadow: 0 0 10px 3px #c8ff5a99; animation-name: wander; }
.fx-dust i { background: #ffe9c4; animation-name: drift; animation-duration: calc(var(--d) * 1.5); }
.fx-twinkle i { animation-name: twinkle; animation-duration: calc(var(--d) / 2); }
@keyframes fall { from { transform: translate(0, 0); opacity: .9; } to { transform: translate(-6vw, 108vh); opacity: .9; } }
@keyframes flutter { 0% { transform: translate(0, 0) rotate(0); opacity: .85; } 50% { transform: translate(8vw, 55vh) rotate(200deg); opacity: .85; } 100% { transform: translate(-4vw, 110vh) rotate(420deg); opacity: .85; } }
@keyframes rise { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(5vw, -80vh); opacity: 0; } }
@keyframes wander { 0%, 100% { transform: translate(0, 0); opacity: 0; } 30% { opacity: 1; } 50% { transform: translate(40px, -30px); opacity: .3; } 70% { opacity: 1; } }
@keyframes drift { 0% { transform: translate(-10vw, 0); opacity: 0; } 30% { opacity: .5; } 100% { transform: translate(40vw, -6vh); opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.3); } }

/* ---------- controls ---------- */
button { cursor: pointer; border: 3px solid var(--ink); border-radius: 14px; min-height: 46px; padding: 0 18px; font-weight: 900; transition: transform .08s, box-shadow .08s, filter .15s; box-shadow: var(--pop); }
button:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.primary { background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #241800; font-family: var(--disp); font-weight: 400; letter-spacing: .3px; }
.secondary { background: #3a3463; color: var(--text); }
.ghost { background: rgba(20, 17, 38, .6); color: var(--text); backdrop-filter: blur(8px); }
.big { min-height: 58px; font-size: 22px; width: 100%; border-radius: 16px; }
.small { min-height: 38px; padding: 0 12px; font-size: 14px; box-shadow: 0 3px 0 var(--ink); }
input, select { background: rgba(8, 7, 16, .75); border: 3px solid var(--ink); border-radius: 14px; min-height: 50px; padding: 0 14px; font-size: 17px; font-weight: 700; width: 100%; box-shadow: inset 0 3px 0 rgba(0, 0, 0, .35); }
input::placeholder { color: #8f88b3; font-weight: 600; }
select { width: auto; min-width: 84px; }

.card { background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); border: 3px solid var(--ink); border-radius: 22px; padding: 20px; box-shadow: 0 6px 0 var(--ink), 0 26px 50px -22px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .14); }
.label { color: var(--muted); font-size: 14px; font-weight: 800; margin-bottom: 10px; }
.screen:not([hidden]) { animation: enter .35s ease-out both; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } }

/* ---------- top ---------- */
.top { display: flex; justify-content: space-between; align-items: center; padding: 16px max(4vw, 16px); }
.logo { font-family: var(--disp); font-size: 30px; line-height: 1; color: var(--text); text-decoration: none; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); transform: rotate(-2deg); display: inline-block; }
.logo b { color: var(--gold); font-weight: 400; margin-left: 6px; }
.top-right { display: flex; gap: 12px; align-items: center; }
.conn { color: var(--bad); font-size: 14px; font-weight: 800; }
main { max-width: 1100px; margin: 0 auto; padding: 8px max(4vw, 16px) 72px; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; padding-top: clamp(8px, 3vw, 36px); }
h1 { font-size: clamp(38px, 6vw, 64px); line-height: 1; margin: 0 0 16px; text-wrap: balance; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); }
.lede { font-size: 17px; max-width: 34em; margin: 0 0 24px; text-shadow: 0 2px 6px rgba(0, 0, 0, .8); }
.form { display: grid; gap: 10px; }
.form label { font-weight: 800; font-size: 15px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin: 8px 0 2px; }
.or::before, .or::after { content: ""; flex: 1; height: 2px; background: var(--line); border-radius: 2px; }
.join-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
#codeInput { text-transform: uppercase; font-family: var(--disp); font-weight: 400; font-size: 22px; letter-spacing: 6px; }

.ladder { background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 3px solid var(--ink); border-radius: 24px; padding: 22px; box-shadow: 0 6px 0 var(--ink), 0 30px 60px -30px #000; transform: rotate(1deg); }
.ladder-title { font-family: var(--disp); font-size: 22px; margin-bottom: 12px; }
.ladder-cols, .ladder li { display: grid; grid-template-columns: minmax(0, 1fr) 3.6em 3.2em; gap: 12px; align-items: center; }
.ladder-cols { color: var(--muted); font-size: 12px; font-weight: 800; margin: 0 0 8px; text-align: right; }
.ladder-cols span:first-child { text-align: left; }
.ladder ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column-reverse; gap: 9px; }
.ladder li { animation: enter .4s ease-out both; }
.ladder li:nth-child(2) { animation-delay: .05s; } .ladder li:nth-child(3) { animation-delay: .1s; } .ladder li:nth-child(4) { animation-delay: .15s; } .ladder li:nth-child(5) { animation-delay: .2s; } .ladder li:nth-child(6) { animation-delay: .25s; }
.rung { height: 44px; border-radius: 12px; display: flex; align-items: center; padding: 0 14px; font-family: var(--disp); font-size: 17px; color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, .45); white-space: nowrap; }
.rung-pts { font-family: var(--disp); font-size: 22px; text-align: right; }
.rung-meter { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 800; }
.ladder li:last-child .rung { animation: glow 2.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 4px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, .45), 0 0 34px #ffc93cbb; } }
.ladder-note { color: var(--muted); font-size: 14px; margin: 16px 0 0; }

.t0 { --tc: var(--t0); } .t1 { --tc: var(--t1); } .t2 { --tc: var(--t2); } .t3 { --tc: var(--t3); } .t4 { --tc: var(--t4); } .t5 { --tc: var(--t5); }
.rung, .badge { background: var(--tc); }
.badge { font-family: var(--disp); font-size: 13px; color: var(--ink); padding: 4px 9px; border-radius: 9px; white-space: nowrap; border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }

.showcase { margin-top: clamp(28px, 4vw, 48px); }
.showcase .label { color: var(--text); text-shadow: 0 2px 6px #000; }
.map-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.map-cards li { position: relative; aspect-ratio: 16 / 11; border-radius: 18px; overflow: hidden; border: 3px solid var(--ink); box-shadow: var(--pop); transition: transform .2s; }
.map-cards li:nth-child(odd) { transform: rotate(-1.5deg); } .map-cards li:nth-child(even) { transform: rotate(1.2deg); }
.map-cards li:hover { transform: rotate(0) scale(1.04); }
.map-cards li::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(11, 10, 20, .88)); }
.scene { position: absolute; inset: 0; }
.scene svg, .recap .thumb svg { width: 100%; height: 100%; display: block; }
.map-cards .cap { position: absolute; left: 12px; bottom: 10px; right: 12px; z-index: 1; }
.map-cards b { display: block; font-family: var(--disp); font-weight: 400; font-size: 19px; line-height: 1.1; }
.map-cards small { color: #e6e0fb; font-size: 13px; }

/* ---------- lobby ---------- */
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; padding-top: 12px; }
.code-card { display: grid; gap: 16px; text-align: center; }
.room-code { font-family: var(--disp); font-size: clamp(56px, 11vw, 96px); line-height: 1; color: var(--gold); letter-spacing: 10px; padding-left: 10px; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; text-shadow: 0 7px 0 var(--ink); }
.invite { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.invite input { font-size: 14px; min-height: 38px; color: var(--muted); }
.host-controls { display: grid; gap: 14px; }
.settings { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.settings label { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 15px; font-weight: 800; }
.mode-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; text-align: left; }
.mode { display: grid; gap: 4px; align-content: start; padding: 12px 14px; min-height: 92px; background: #2a2549; font-weight: 600; }
.mode b { font-family: var(--disp); font-weight: 400; font-size: 20px; }
.mode span { font-size: 13px; color: var(--muted); line-height: 1.35; }
.mode[aria-checked="true"] { background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #241800; }
.mode[aria-checked="true"] span { color: #4a3600; }
.mode:disabled { opacity: 1; }
.mode:disabled:not([aria-checked="true"]) { opacity: .45; }
.plist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.plist li { display: flex; align-items: center; gap: 10px; background: var(--glass2); border-radius: 14px; padding: 9px 12px; animation: enter .3s ease-out both; }
.av { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-family: var(--disp); font-size: 18px; color: var(--ink); flex: none; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.plist .tag { margin-left: auto; font-size: 13px; color: var(--muted); }
.off { opacity: .45; }

/* ---------- map title plate ---------- */
.stage { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 10px 0 0; padding: clamp(8px, 2vw, 20px) 0 4px; }
.stage .scene { display: none; }
.stage-label { display: grid; gap: 4px; }
.map-no { font-family: var(--disp); font-size: 15px; color: var(--ink); background: var(--gold); justify-self: start; padding: 2px 10px; border-radius: 9px; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); transform: rotate(-2deg); }
.map-name { margin: 6px 0 0; font-size: clamp(40px, 7vw, 76px); line-height: .95; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); overflow-wrap: anywhere; }
.oh-stage .map-name, .small-stage .map-name { font-size: clamp(32px, 5vw, 54px); }
.map-game { font-weight: 800; font-size: 16px; text-shadow: 0 2px 6px #000; }
.time { font-family: var(--disp); font-size: 34px; color: var(--ink); background: var(--gold); min-width: 2.2em; text-align: center; padding: 4px 10px; border-radius: 14px; border: 3px solid var(--ink); box-shadow: var(--pop); font-variant-numeric: tabular-nums; flex: none; }
.time.low { background: var(--bad); animation: thump .5s infinite; }
@keyframes thump { 50% { transform: scale(1.1); } }
.auto { background: var(--glass); padding: 6px 12px; border-radius: 10px; font-size: 14px; border: 2px solid var(--ink); flex: none; }

.route { margin: 6px 0 0; overflow-x: auto; scrollbar-width: none; }
.route ol { list-style: none; display: flex; align-items: center; margin: 0; padding: 6px 2px 10px; min-width: max-content; }
.route li { display: flex; align-items: center; font-size: 13px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.route li + li::before { content: ""; width: 20px; height: 4px; background: var(--ink); margin: 0 4px; border-radius: 2px; }
.route li.done + li::before { background: var(--gold); }
.route .node { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 3px solid var(--ink); background: var(--glass); box-shadow: 0 3px 0 var(--ink); }
.route .dot { width: 9px; height: 9px; border-radius: 50%; background: #5a5480; }
.route li.done .dot { background: var(--gold); }
.route li.cur .node { background: var(--gold); color: var(--ink); }
.route li.cur .dot { background: var(--ink); }

/* ---------- question ---------- */
.timer { height: 16px; background: rgba(8, 7, 16, .7); border: 3px solid var(--ink); border-radius: 99px; margin: 12px 0 22px; overflow: hidden; }
#timerBar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--t4), var(--gold)); transform-origin: left; }
.q-text { font-size: clamp(28px, 4.6vw, 46px); line-height: 1.08; margin: 0 0 8px; text-wrap: balance; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); }
.q-hint { margin: 0 0 20px; min-height: 1.5em; color: var(--text); text-shadow: 0 2px 6px #000; }
.answer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; max-width: 720px; }
.answer input { min-height: 62px; font-size: 21px; background: rgba(8, 7, 16, .85); }
.answer button { min-height: 62px; padding: 0 28px; font-size: 22px; }
.answer input:disabled, .answer button:disabled { opacity: .5; }
.feedback { min-height: 1.6em; font-size: 17px; font-weight: 800; margin: 12px 0; text-shadow: 0 2px 6px #000; }
.feedback.bad { color: var(--bad); } .feedback.good { color: var(--ok); }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.locked-in { font-family: var(--disp); font-size: 26px; background: var(--ok); color: var(--ink); border: 3px solid var(--ink); border-radius: 18px; padding: 14px 20px; max-width: 720px; box-shadow: var(--pop); animation: popin .3s cubic-bezier(.3, 1.6, .5, 1) both; }
.locked-in small { display: block; font-family: Nunito, sans-serif; font-size: 14px; font-weight: 800; opacity: .75; }
.chips { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--glass); border: 3px solid var(--ink); border-radius: 99px; padding: 4px 12px; font-size: 14px; font-weight: 800; color: var(--muted); }
.chips li.done { background: var(--ok); color: var(--ink); }
.chips li.done::before { content: "✓ "; }

/* ---------- reveal ---------- */
.r-text { font-size: clamp(22px, 3.2vw, 32px); line-height: 1.15; margin: 10px 0 16px; text-wrap: balance; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; }
.my-result { margin-bottom: 20px; }
.my-card { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; border-radius: 22px; padding: 18px 22px; background: var(--tc); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink), inset 0 4px 0 rgba(255, 255, 255, .4); animation: popin .4s cubic-bezier(.3, 1.6, .5, 1) both; }
.my-card .tier-name { font-family: var(--disp); font-size: clamp(18px, 2.6vw, 24px); background: var(--ink); color: var(--tc); padding: 2px 12px; border-radius: 10px; }
.my-card .ans { font-family: var(--disp); font-size: 26px; }
.my-card .pts { margin-left: auto; font-family: var(--disp); font-size: 48px; line-height: 1; }
.my-card .note { flex-basis: 100%; font-size: 15px; font-weight: 800; opacity: .8; }
.my-card.none { --tc: #5a5480; color: var(--text); }
.reveal-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.side { display: grid; gap: 18px; align-content: start; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.results li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; background: var(--glass2); border-radius: 14px; padding: 10px 12px; }
.results .who { color: var(--muted); font-size: 13px; }
.results .what { font-weight: 900; font-size: 17px; overflow-wrap: anywhere; }
.results .p { font-family: var(--disp); font-size: 20px; width: 3em; text-align: right; }
.results .clash { color: var(--bad); font-size: 12px; font-weight: 800; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { background: var(--glass2); border-radius: 10px; padding: 5px 11px; font-size: 15px; font-weight: 800; }
.tags.rare li { background: var(--gold); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.tags.used li { background: var(--tc, var(--glass2)); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); animation: popin .3s cubic-bezier(.3, 1.6, .5, 1) both; }
.tags .muted-li { color: var(--muted); background: transparent; padding-left: 0; border: 0 !important; box-shadow: none !important; animation: none !important; }
.board { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; counter-reset: b; }
.board li { display: flex; gap: 10px; align-items: center; padding: 7px 4px; border-bottom: 2px solid var(--line); counter-increment: b; font-weight: 800; }
.board li::before { content: counter(b); font-family: var(--disp); color: var(--muted); width: 1.6em; }
.board .s { margin-left: auto; font-family: var(--disp); font-size: 19px; }
.board .me { color: var(--gold); }
.actions { margin: 26px auto 0; max-width: 420px; display: grid; gap: 10px; }

/* ---------- overheat ---------- */
.oh-q { font-size: clamp(24px, 3.6vw, 38px); margin: 8px 0 16px; }
.oh-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.table-wrap { width: 100%; max-width: 520px; margin: 0 auto; }
.table { position: relative; width: 100%; aspect-ratio: 1; }
.felt { position: absolute; inset: 15%; border-radius: 50%; background: radial-gradient(circle at 50% 35%, rgba(70, 58, 130, .9), rgba(20, 17, 38, .92) 72%); border: 4px solid var(--ink); box-shadow: 0 8px 0 var(--ink), inset 0 0 0 6px rgba(255, 255, 255, .07), 0 30px 60px -20px #000; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cart { --heat: 0; --s: 1; position: absolute; left: 50%; top: 50%; width: 20%; aspect-ratio: 100 / 110; transform: translate(-50%, -50%) translate(var(--cx, 0px), var(--cy, 0px)) scale(var(--s)); transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); z-index: 2; filter: drop-shadow(0 6px 0 rgba(11, 10, 20, .6)); }
.cart svg { width: 100%; height: 100%; overflow: visible; display: block; }
.cart .heat-glow { opacity: calc(var(--heat) * .95); }
.cart-body { fill: color-mix(in srgb, #ff3b2f calc(var(--heat) * 88%), #b9b4d6); stroke: var(--ink); stroke-width: 5; stroke-linejoin: round; }
.cart-ridge { stroke: rgba(11, 10, 20, .35); stroke-width: 3; stroke-linecap: round; }
.cart-label { fill: var(--gold); stroke: var(--ink); stroke-width: 4; }
.cart-label-art { fill: var(--ink); }
.cart-pins { fill: #e7c04a; stroke: var(--ink); stroke-width: 4; }
.cart.shake1 svg { animation: jitter .32s infinite; }
.cart.shake2 svg { animation: jitter .13s infinite; }
@keyframes jitter { 25% { transform: translate(-2%, 1%) rotate(-4deg); } 50% { transform: translate(2%, -1%) rotate(3deg); } 75% { transform: translate(-1%, -2%) rotate(-2deg); } }
.cart.gone { transform: translate(-50%, -50%) scale(0); transition: transform .15s; }
.seats { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.seat { position: absolute; transform: translate(-50%, -50%); width: 27%; display: grid; justify-items: center; gap: 4px; text-align: center; transition: opacity .3s; }
.seat .av { width: 50px; height: 50px; border-radius: 16px; font-size: 24px; transition: transform .2s; }
.seat.hold .av { transform: scale(1.18) rotate(-4deg); box-shadow: 0 3px 0 var(--ink), 0 0 0 4px var(--hot), 0 0 26px 6px #ff5a2aaa; }
.seat .nm { font-weight: 900; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--ink); padding: 1px 9px; border-radius: 9px; }
.seat.me .nm { background: var(--gold); color: var(--ink); }
.seat .hearts { display: flex; gap: 2px; justify-content: center; min-height: 15px; filter: drop-shadow(0 2px 0 var(--ink)); }
.heart { width: 16px; height: 14px; display: block; }
.seat .meter { width: 72%; max-width: 84px; height: 8px; border-radius: 9px; background: var(--ink); border: 2px solid var(--ink); overflow: hidden; }
.seat .meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--t4), var(--t5)); border-radius: 9px; transition: width .4s; }
.seat.out { opacity: .4; filter: grayscale(1); }
.seat.out .nm::after { content: " · out"; color: var(--bad); }
.seat.off .nm::after { content: " · away"; color: var(--muted); }
.bubbles { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.bubble { position: absolute; transform: translate(-50%, -50%); background: var(--tc); color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; padding: 5px 12px; font-family: var(--disp); font-size: 18px; white-space: nowrap; max-width: 54%; overflow: hidden; text-overflow: ellipsis; animation: riseup 1.8s ease-out forwards; box-shadow: var(--pop); }
.bubble small { display: block; font-family: Nunito, sans-serif; font-size: 11px; font-weight: 900; opacity: .75; }
.bubble.heart-up { background: #ff7b9a; }
@keyframes riseup { 0% { opacity: 0; margin-top: 12px; scale: .7; } 12% { opacity: 1; margin-top: 0; scale: 1.08; } 20% { scale: 1; } 75% { opacity: 1; } 100% { opacity: 0; margin-top: -44px; } }
.oh-side { display: grid; gap: 14px; align-content: start; }
.turn { border-radius: 18px; padding: 14px 18px; background: var(--glass); border: 3px solid var(--ink); box-shadow: var(--pop); font-family: var(--disp); font-size: 21px; line-height: 1.2; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.turn small { display: block; font-family: Nunito, sans-serif; font-weight: 700; font-size: 14px; color: var(--muted); margin-top: 4px; }
.turn.mine { background: linear-gradient(120deg, var(--hot), var(--gold)); color: var(--ink); animation: pulse .9s ease-in-out infinite; }
.turn.mine small { color: #3a1d00; }
@keyframes pulse { 50% { transform: scale(1.025); box-shadow: var(--pop), 0 0 0 7px #ff5a2a55; } }
.pop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(11, 10, 20, .8); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.burst { position: absolute; width: 70vmin; height: 70vmin; border-radius: 50%; background: radial-gradient(circle, #fff6c0 0 10%, #ffc93c 22%, #ff5a2a 42%, #ff2a5a00 70%); animation: blast .6s ease-out forwards; }
@keyframes blast { from { transform: scale(.1); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
.pop-card { position: relative; text-align: center; padding: 28px; max-width: 560px; animation: popin .4s .12s both cubic-bezier(.3, 1.6, .5, 1); }
@keyframes popin { from { transform: scale(.6); opacity: 0; } }
.pop-kicker { font-family: var(--disp); font-size: clamp(48px, 11vw, 96px); line-height: 1; color: var(--gold); -webkit-text-stroke: 10px var(--ink); paint-order: stroke fill; text-shadow: 0 8px 0 var(--ink); transform: rotate(-4deg); margin-bottom: 18px; }
.pop-text { font-family: var(--disp); font-size: clamp(26px, 4.4vw, 38px); line-height: 1.1; }
.pop-sub { color: var(--muted); margin-top: 10px; font-size: 16px; }

/* ---------- final ---------- */
.final-title { text-align: center; font-size: clamp(34px, 5.4vw, 54px); line-height: 1; margin: 18px 0 20px; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; max-width: 620px; margin: 0 auto 24px; }
.step { text-align: center; }
.step .nm { font-weight: 900; margin-bottom: 8px; overflow-wrap: anywhere; text-shadow: 0 2px 6px #000; }
.step .blk { border-radius: 18px 18px 0 0; display: grid; place-content: center; font-family: var(--disp); color: var(--ink); font-size: 18px; padding: 10px; border: 3px solid var(--ink); border-bottom: 0; box-shadow: inset 0 4px 0 rgba(255, 255, 255, .4); }
.step.p1 .blk { height: 170px; background: var(--t5); } .step.p2 .blk { height: 120px; background: var(--t1); } .step.p3 .blk { height: 86px; background: var(--t4); }
.step .sc { display: block; font-size: 30px; }
.winner { text-align: center; margin: 0 auto 22px; max-width: 620px; animation: popin .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.winner .crown { display: inline-block; font-family: var(--disp); font-size: 18px; color: var(--ink); background: var(--gold); padding: 2px 14px; border-radius: 10px; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); transform: rotate(-3deg); }
.winner .wn { font-family: var(--disp); font-size: clamp(48px, 9vw, 92px); line-height: 1; margin: 10px 0; color: var(--gold); -webkit-text-stroke: 10px var(--ink); paint-order: stroke fill; text-shadow: 0 8px 0 var(--ink); overflow-wrap: anywhere; }
.winner .muted { color: var(--text); text-shadow: 0 2px 6px #000; }
.big-board, .recap { max-width: 620px; margin: 0 auto; }
.big-board { background: var(--glass); border: 3px solid var(--ink); border-radius: 20px; padding: 10px 18px; box-shadow: 0 6px 0 var(--ink); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.big-board li { padding: 10px 4px; font-size: 18px; }
.big-board li:last-child { border-bottom: 0; }
.recap-title { max-width: 620px; margin: 30px auto 12px; font-size: 26px; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; }
.recap { list-style: none; padding: 0; display: grid; gap: 10px; }
.recap li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; background: var(--glass); border: 3px solid var(--ink); border-radius: 16px; padding: 8px 14px 8px 8px; box-shadow: 0 4px 0 var(--ink); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.recap .thumb { position: relative; height: 58px; border-radius: 10px; overflow: hidden; border: 2px solid var(--ink); }
.recap .m { font-family: var(--disp); font-size: 19px; line-height: 1.15; }
.recap .a { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.recap .p { font-family: var(--disp); font-size: 19px; }
.recap .victim { color: var(--bad); }

/* ---------- characters ---------- */
.av.sprite { background: none; border: 0; box-shadow: none; border-radius: 0; width: 40px; height: 40px; filter: drop-shadow(0 3px 0 rgba(11, 10, 20, .7)); }
.av.sprite svg { width: 100%; height: 100%; display: block; animation: bob 1s steps(2, jump-none) infinite; }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-8%); } }
.seat .av.sprite { width: 64px; height: 64px; }
.seat.hold .av.sprite { transform: scale(1.2); box-shadow: none; filter: drop-shadow(0 0 10px var(--hot)) drop-shadow(0 3px 0 rgba(11, 10, 20, .7)); }
.seat.hold .av.sprite svg { animation: jitter .18s infinite; }
.seat.out .av.sprite svg { animation: none; transform: rotate(90deg); }
.av.sprite.custom { position: relative; overflow: hidden; }
.strip { position: absolute; left: 0; display: block; background-size: 100% 100%; background-repeat: no-repeat; image-rendering: pixelated; }
@keyframes strip { to { transform: translateX(var(--tx)); } }
.win-sprite { display: block; }
.pick-label { margin-top: 18px; }
.char-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.char { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 6px; min-height: 0; background: #2a2549; }
.char .av.sprite { width: 48px; height: 48px; }
.char .av.sprite svg { animation: none; }
.char .cn { font-size: 13px; font-weight: 900; }
.char[aria-pressed="true"] { background: linear-gradient(180deg, #ffe07a, var(--gold)); color: var(--ink); }
.char[aria-pressed="true"] .av.sprite svg, .char:hover .av.sprite svg { animation: bob .5s steps(2, jump-none) infinite; }
.win-sprite { width: 128px !important; height: 128px !important; margin: 0 auto 6px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--gold); color: var(--ink); font-weight: 900; border: 3px solid var(--ink); box-shadow: var(--pop); padding: 10px 18px; border-radius: 14px; transition: transform .25s cubic-bezier(.3, 1.5, .5, 1), visibility .25s; max-width: calc(100vw - 32px); z-index: 30; visibility: hidden; }
.toast.show { transform: translate(-50%, 0); visibility: visible; }

@media (max-width: 860px) {
  .oh-grid { grid-template-columns: minmax(0, 1fr); }
  .oh-side { order: -1; }
  .table-wrap { max-width: min(420px, 88vw); }
}
@media (max-width: 760px) {
  .hero, .lobby-grid, .reveal-grid { grid-template-columns: minmax(0, 1fr); }
  .ladder { transform: none; padding: 16px; }
  .rung { height: 38px; font-size: 15px; }
  .map-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .my-card .pts { font-size: 38px; }
  h1, .map-name, .final-title, .room-code, .winner .wn, .pop-kicker { -webkit-text-stroke-width: 6px; }
}
@media (max-width: 480px) {
  .answer { grid-template-columns: minmax(0, 1fr); }
  .podium { gap: 6px; }
  .seat .av.sprite { width: 48px; height: 48px; }
  .seat .nm { font-size: 12px; }
  .mode-pick { grid-template-columns: minmax(0, 1fr); }
  .mode { min-height: 0; }
  .recap li { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .recap .badge { display: none; }
  .logo { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fx { display: none; }
}
