/* KARTCRAFT — retro pixel arcade look over a live 3D race track */
:root {
  --bg: #120a2a; --panel: rgba(20, 12, 46, 0.86); --panel2: rgba(34, 22, 72, 0.92); --line: #3b2a78; --ink: #f4efff; --mute: #a99bd6;
  --y: #ffd23f; --g: #4ade80; --pink: #ff5ca8; --b: #4cc9ff; --o: #ff9a3c; --p: #c77dff; --r: #ff4d6d;
  --px: 'Press Start 2P', monospace; --body: 'Pixelify Sans', system-ui, sans-serif;
  --shadow: 0 4px 0 #07031a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; -webkit-font-smoothing: antialiased; overflow: hidden; }
body.racing { cursor: default; }
button, input { font: inherit; color: inherit; }
a { color: var(--y); }
.hidden { display: none !important; }
.muted { color: var(--mute); }
kbd { font-family: var(--px); font-size: 9px; background: #2a1d5c; border: 2px solid #5a46a8; border-bottom-width: 4px; padding: 3px 5px; border-radius: 3px; color: #fff; display: inline-block; margin: 0 1px; line-height: 1; vertical-align: 2px; }
b.g, .g { color: var(--g); } b.b { color: var(--b); } b.o { color: var(--o); } b.p { color: var(--p); } .y { color: var(--y); }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; image-rendering: pixelated; image-rendering: crisp-edges; z-index: 0; }

/* ---------- landing ---------- */
#landing { position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden; z-index: 2; background: linear-gradient(180deg, rgba(18,10,42,0.0) 0%, rgba(18,10,42,0.15) 40vh, rgba(18,10,42,0.88) 95vh, var(--bg) 140vh); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: rgba(14, 8, 34, 0.82); backdrop-filter: blur(6px); border-bottom: 3px solid #07031a; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-family: var(--px); font-size: 15px; letter-spacing: 1px; white-space: nowrap; }
.brand img { width: 30px; height: 30px; image-rendering: pixelated; }
.brand b { color: var(--y); font-weight: 400; }
.ticker { flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); min-width: 0; }
.ticker-in { display: inline-flex; gap: 26px; white-space: nowrap; animation: tick 50s linear infinite; font-size: 15px; color: var(--mute); }
.ticker-in span b { margin-left: 6px; color: var(--y); font-weight: 600; }
@keyframes tick { to { transform: translateX(-50%); } }
.pill { display: flex; gap: 8px; align-items: center; background: #23164f; border: 2px solid var(--line); padding: 6px 10px; border-radius: 6px; font-size: 14px; white-space: nowrap; }
.pill b { font-family: var(--px); font-size: 9px; color: var(--g); font-weight: 400; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; background: #23164f; border: 2px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 16px; color: #fff; text-decoration: none; }
.icon-btn:hover { background: #2f1f66; }
.icon-btn.off { opacity: 0.55; }

.page { max-width: 1180px; margin: 0 auto; padding: 0 18px 40px; }
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; padding-top: 34vh; align-items: start; }
.intro { padding-top: 6px; }
.eyebrow { font-family: var(--px); font-size: 9px; line-height: 1.7; letter-spacing: 1px; color: var(--y); display: inline-flex; align-items: center; gap: 8px; background: rgba(14, 8, 34, 0.75); padding: 8px 10px; border-radius: 4px; margin: 0 0 16px; }
.dot { width: 8px; height: 8px; background: var(--g); box-shadow: 0 0 8px var(--g); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
h1 { font-family: var(--px); font-weight: 400; font-size: clamp(30px, 5.4vw, 60px); line-height: 1.18; margin: 0 0 18px; color: #fff; text-shadow: 4px 4px 0 #07031a, 0 0 30px rgba(120, 80, 255, 0.4); }
h1 em { font-style: normal; color: var(--y); text-shadow: 4px 4px 0 #6b3d00, 0 0 30px rgba(255, 210, 63, 0.4); }
.lede { font-size: 19px; line-height: 1.5; max-width: 600px; color: #e6defc; background: rgba(14, 8, 34, 0.72); padding: 14px 16px; border-radius: 8px; border-left: 4px solid var(--y); }
.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 14px; }
.statrow > div { background: var(--panel); border: 2px solid var(--line); border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow); }
.statrow span { display: block; font-family: var(--px); font-size: 7px; color: var(--mute); margin-bottom: 8px; letter-spacing: 1px; }
.statrow b { font-family: var(--px); font-size: 15px; font-weight: 400; }
.prizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pz { border-radius: 8px; padding: 10px 12px; border: 3px solid; text-align: center; box-shadow: var(--shadow); background: var(--panel); }
.pz i { display: block; font-style: normal; font-family: var(--px); font-size: 9px; margin-bottom: 6px; }
.pz b { font-family: var(--px); font-weight: 400; font-size: 14px; }
.pz small { display: block; color: var(--mute); font-size: 12px; margin-top: 3px; }
.pz.p1 { border-color: #ffd23f; } .pz.p1 i { color: #ffd23f; }
.pz.p2 { border-color: #cfd8e8; } .pz.p2 i { color: #cfd8e8; }
.pz.p3 { border-color: #e08a4a; } .pz.p3 i { color: #e08a4a; }
.pz.bag { border-color: var(--g); } .pz.bag i { color: var(--g); }

.play { background: var(--panel2); border: 3px solid #5a46a8; border-radius: 10px; padding: 16px; box-shadow: 0 6px 0 #07031a, 0 20px 50px rgba(0, 0, 0, 0.45); position: relative; }
.play-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.lbl { font-family: var(--px); font-size: 10px; color: #fff; }
.free { font-family: var(--px); font-size: 7px; background: var(--g); color: #052e16; padding: 5px 7px; border-radius: 3px; }
.drivers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.drv { background: #1b1240; border: 3px solid #33246e; border-radius: 8px; padding: 6px 4px 5px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; transition: transform 0.08s; }
.drv:hover { transform: translateY(-2px); border-color: #5a46a8; }
.drv.on { border-color: var(--y); background: #2a1c5c; box-shadow: 0 0 0 2px rgba(255, 210, 63, 0.25); }
.drv canvas { width: 64px; height: 64px; image-rendering: pixelated; }
.drv span { font-size: 13px; font-weight: 600; white-space: nowrap; }
.driver-info { margin: 10px 0 12px; background: #170f38; border-radius: 8px; padding: 10px 12px; font-size: 15px; }
.driver-info .nm { font-family: var(--px); font-size: 10px; color: var(--y); }
.driver-info .cls { font-size: 12px; padding: 2px 6px; border-radius: 3px; background: #33246e; margin-left: 6px; }
.driver-info em { color: var(--mute); display: block; margin: 4px 0 8px; }
.bars { display: grid; grid-template-columns: 70px 1fr; gap: 4px 8px; align-items: center; font-size: 13px; color: var(--mute); }
.bar { height: 10px; background: #2a1d5c; border-radius: 2px; display: flex; gap: 2px; padding: 2px; }
.bar i { flex: 1; background: #3e2d80; }
.bar i.on { background: var(--g); }
.who { display: flex; align-items: center; gap: 10px; background: #170f38; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.ava { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; font-weight: 700; color: #111; }
.who-t { flex: 1; font-size: 15px; }
.who-t em { font-style: normal; font-size: 12px; color: var(--mute); margin-left: 4px; }
.link { background: none; border: 0; color: var(--y); cursor: pointer; text-decoration: underline; font-size: 14px; }
.login { margin-bottom: 10px; }
.login .row { display: flex; gap: 8px; margin-bottom: 8px; }
.login input, #w-wallet { flex: 1; min-width: 0; background: #0e0826; border: 2px solid #3b2a78; border-radius: 6px; padding: 10px 12px; font-size: 16px; outline: none; }
.login input:focus, #w-wallet:focus { border-color: var(--y); }
.btn { background: #2a1d5c; border: 2px solid #5a46a8; border-radius: 6px; padding: 9px 14px; cursor: pointer; font-weight: 600; box-shadow: 0 3px 0 #07031a; }
.btn:hover { background: #352574; }
.btn.sm { padding: 6px 10px; font-size: 14px; }
.btn.phantom { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; background: #ab9ff2; border-color: #d9d1ff; color: #1c1442; }
.btn.phantom svg { width: 20px; height: 20px; }
.err { color: #ff8b9d; font-size: 14px; margin: 6px 0 0; min-height: 1px; }
.race-btn { width: 100%; border: 0; border-radius: 8px; cursor: pointer; padding: 14px 10px 12px; background: linear-gradient(180deg, #ffe066, #ffb703); color: #2b1600; box-shadow: 0 6px 0 #a35a00, 0 10px 24px rgba(255, 183, 3, 0.35); display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform 0.06s, box-shadow 0.06s; }
.race-btn span { font-family: var(--px); font-size: 22px; letter-spacing: 2px; }
.race-btn small { font-size: 14px; font-weight: 600; opacity: 0.8; }
.race-btn:hover { filter: brightness(1.06); }
.race-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #a35a00; }
.race-btn:disabled { filter: grayscale(0.6); cursor: wait; }
.race-btn.sm { padding: 12px 18px; width: auto; }
.race-btn.sm span { font-size: 13px; }
.bank { display: flex; align-items: center; gap: 12px; margin-top: 12px; background: #170f38; border-radius: 8px; padding: 8px 10px; }
.bank > div { flex: 1; }
.bank span { display: block; font-family: var(--px); font-size: 7px; color: var(--mute); margin-bottom: 4px; }
.bank b { font-family: var(--px); font-size: 12px; font-weight: 400; color: var(--g); }
.fine { font-size: 13px; color: var(--mute); margin: 10px 0 0; line-height: 1.45; }

.band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 46px; }
.col, .how, .items, .controls { background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 16px; box-shadow: var(--shadow); }
h2 { font-family: var(--px); font-weight: 400; font-size: 12px; margin: 0 0 14px; color: #fff; display: flex; align-items: center; gap: 8px; }
h2 span { background: var(--r); font-size: 7px; padding: 4px 6px; border-radius: 3px; }
.feed, .board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.feed li, .board li { display: flex; align-items: center; gap: 8px; background: #170f38; border-radius: 6px; padding: 6px 8px; font-size: 14px; }
.feed li canvas { width: 30px; height: 30px; image-rendering: pixelated; border-radius: 4px; }
.feed .t, .board .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .c, .board .c { font-family: var(--px); font-size: 9px; color: var(--g); }
.feed .ago { font-size: 12px; color: var(--mute); }
.plc { font-family: var(--px); font-size: 9px; padding: 3px 5px; border-radius: 3px; background: #33246e; }
.plc.p1 { background: #ffd23f; color: #3a2600; } .plc.p2 { background: #cfd8e8; color: #222; } .plc.p3 { background: #e08a4a; color: #2a1200; }
.board { counter-reset: n; }
.board li::before { counter-increment: n; content: counter(n); font-family: var(--px); font-size: 9px; color: var(--y); width: 16px; }
.board li.muted::before { content: ''; width: 0; }

.how, .items, .controls { margin-top: 16px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.steps > div { background: #170f38; border-radius: 8px; padding: 12px; }
.steps b { font-family: var(--px); font-size: 10px; color: var(--y); }
.steps h3 { font-family: var(--px); font-weight: 400; font-size: 10px; margin: 10px 0 8px; }
.steps p { font-size: 15px; line-height: 1.45; margin: 0; color: #ddd3fb; }
.item-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.item-grid > div { background: #170f38; border-radius: 8px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; }
.item-grid i { font-style: normal; font-size: 26px; width: 44px; height: 44px; display: grid; place-items: center; background: #2a1d5c; border: 2px solid #5a46a8; border-radius: 6px; flex: none; }
.item-grid b { font-family: var(--px); font-weight: 400; font-size: 9px; display: block; margin: 3px 0 6px; color: var(--y); }
.item-grid p { margin: 0; font-size: 14px; color: #ddd3fb; line-height: 1.35; }
.ctl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 15px; }
.ctl > div { background: #170f38; padding: 8px 10px; border-radius: 6px; }
.foot { margin-top: 26px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; text-align: center; color: #cfc4f2; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; font-family: var(--body); }
#hud button, #hud input, #hud form, .chat-log { pointer-events: auto; }
.hud-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; }
.item-slot { width: 84px; height: 84px; background: rgba(14, 8, 34, 0.78); border: 4px solid #fff; border-radius: 12px; display: grid; place-items: center; position: relative; box-shadow: 0 4px 0 #07031a, inset 0 0 0 3px #5a46a8; }
.item-slot span { font-size: 44px; line-height: 1; filter: drop-shadow(0 3px 0 #07031a); }
.item-slot small { position: absolute; right: 6px; bottom: 4px; font-family: var(--px); font-size: 11px; color: var(--y); }
.item-slot em { position: absolute; left: -4px; bottom: -14px; font-style: normal; font-family: var(--px); font-size: 8px; background: #2a1d5c; border: 2px solid #5a46a8; padding: 3px 5px; border-radius: 3px; }
.item-slot.rolling { border-color: var(--y); }
.item-slot.ready { animation: pulse 0.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 4px 0 #07031a, inset 0 0 0 3px var(--y), 0 0 18px var(--y); } }
.hud-c { text-align: center; }
.lap { font-family: var(--px); font-size: 18px; text-shadow: 3px 3px 0 #07031a; }
.lap b { color: var(--y); font-weight: 400; font-size: 24px; }
.lap.final { color: var(--r); animation: blink 0.5s steps(2) 6; }
.timer { font-family: var(--px); font-size: 13px; margin-top: 8px; text-shadow: 2px 2px 0 #07031a; }
.lap-best { font-size: 14px; color: var(--mute); margin-top: 4px; text-shadow: 1px 1px 0 #07031a; }
#minimap { width: 170px; height: 170px; background: rgba(14, 8, 34, 0.55); border-radius: 12px; border: 3px solid rgba(255, 255, 255, 0.25); }
.hud-left { position: absolute; left: 12px; top: 120px; display: flex; flex-direction: column; gap: 8px; }
.coins, .bags { background: rgba(14, 8, 34, 0.75); border-radius: 8px; padding: 6px 10px; font-family: var(--px); font-size: 13px; display: flex; align-items: center; gap: 6px; text-shadow: 2px 2px 0 #07031a; }
.coins small, .bags small { font-family: var(--body); font-size: 12px; color: var(--mute); }
.bags { color: var(--g); }
.coin-ico { width: 16px; height: 16px; background: #ffd23f; box-shadow: inset -3px -3px 0 #c98a00, inset 3px 3px 0 #fff3b0; display: inline-block; }
.place { position: absolute; right: 22px; bottom: 26px; font-family: var(--px); color: #fff; text-shadow: 5px 5px 0 #07031a; line-height: 1; }
.place b { font-size: 76px; font-weight: 400; }
.place sup { font-size: 24px; vertical-align: 38px; }
.place.p1 b, .place.p1 sup { color: #ffd23f; } .place.p2 b, .place.p2 sup { color: #dfe7f5; } .place.p3 b, .place.p3 sup { color: #f0a060; }
.speed { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); font-family: var(--px); text-align: center; text-shadow: 3px 3px 0 #07031a; }
.speed b { font-size: 26px; font-weight: 400; display: block; }
.speed small { font-size: 9px; color: var(--mute); }
.speed i { display: block; width: 160px; height: 8px; margin: 8px auto 0; background: #2a1d5c; border-radius: 2px; position: relative; overflow: hidden; }
.speed i::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 0%); background: var(--c, #4cc9ff); }
.count { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); font-family: var(--px); font-size: 120px; color: var(--y); text-shadow: 8px 8px 0 #07031a; pointer-events: none; }
.count.pop { animation: pop 0.9s ease-out; }
.count.go { color: var(--g); }
@keyframes pop { 0% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; } 20% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); } }
.bigmsg { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); font-family: var(--px); font-size: 26px; color: #fff; text-shadow: 4px 4px 0 #07031a; white-space: nowrap; opacity: 0; transition: opacity 0.2s; }
.bigmsg.on { opacity: 1; }
.bigmsg.r { color: var(--r); } .bigmsg.g { color: var(--g); } .bigmsg.y { color: var(--y); } .bigmsg.b { color: var(--b); } .bigmsg.o { color: var(--o); } .bigmsg.p { color: var(--p); }
.notes { position: absolute; left: 50%; top: 116px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; width: min(560px, 90vw); }
.note { background: rgba(14, 8, 34, 0.85); border: 2px solid #5a46a8; border-radius: 6px; padding: 6px 12px; font-size: 16px; text-align: center; transition: opacity 0.5s; }
.note.gold { border-color: var(--y); color: var(--y); } .note.red { border-color: var(--r); color: #ffb3c1; } .note.green { border-color: var(--g); color: #b9ffd2; } .note.big { border-color: var(--pink); font-family: var(--px); font-size: 12px; padding: 10px 14px; }
.note.out { opacity: 0; }
.lobby { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, 92vw); background: rgba(14, 8, 34, 0.9); border: 3px solid #5a46a8; border-radius: 10px; padding: 16px; box-shadow: 0 6px 0 #07031a; pointer-events: auto; }
.lobby-h { font-family: var(--px); font-size: 12px; text-align: center; margin-bottom: 12px; }
.lobby-h b { color: var(--y); font-weight: 400; font-size: 18px; }
.lobby ul { list-style: none; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lobby li { background: #170f38; border-radius: 6px; padding: 5px 8px; font-size: 14px; display: flex; gap: 6px; align-items: center; overflow: hidden; white-space: nowrap; }
.lobby li canvas { width: 22px; height: 22px; image-rendering: pixelated; }
.lobby li.me { outline: 2px solid var(--y); }
.lobby li.empty { color: #6d5fa3; }
.lobby p { font-size: 13px; text-align: center; margin: 0; }
.keys-hint { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); font-size: 13px; color: #e6defc; background: rgba(14, 8, 34, 0.6); padding: 6px 10px; border-radius: 6px; white-space: nowrap; transition: opacity 1s; }
.keys-hint.fade { opacity: 0; }
.chat { position: absolute; left: 12px; bottom: 16px; width: min(380px, 60vw); }
.chat-log { display: flex; flex-direction: column; gap: 3px; max-height: 180px; overflow: hidden; pointer-events: none; }
.chat.open .chat-log { pointer-events: auto; overflow-y: auto; }
.cm { background: rgba(14, 8, 34, 0.72); padding: 3px 8px; border-radius: 4px; font-size: 14px; transition: opacity 0.6s; word-break: break-word; }
.cm.old { opacity: 0; } .chat.open .cm.old { opacity: 0.85; }
.chat-form input { width: 100%; margin-top: 6px; background: rgba(14, 8, 34, 0.92); border: 2px solid var(--y); border-radius: 6px; padding: 8px 10px; outline: none; font-size: 15px; }
.talk-pill { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); background: rgba(14, 8, 34, 0.9); border: 2px solid var(--g); border-radius: 20px; padding: 6px 14px; font-size: 14px; display: flex; gap: 6px; }
.voice-btns { position: absolute; right: 12px; top: 196px; display: flex; flex-direction: column; gap: 6px; }
.voice-btns button, .hud-exit { width: 40px; height: 40px; border-radius: 8px; background: rgba(14, 8, 34, 0.8); border: 2px solid #5a46a8; cursor: pointer; font-size: 16px; }
.voice-btns button.off { opacity: 0.55; } .voice-btns button.on { border-color: var(--g); background: #134d2c; }
.hud-exit { position: absolute; right: 12px; top: 296px; pointer-events: auto; font-size: 14px; }
.touch-only { display: none !important; }
.touch { position: absolute; left: 0; right: 0; bottom: 0; height: 190px; pointer-events: none; }
.touch button { pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; background: rgba(255, 255, 255, 0.14); border: 3px solid rgba(255, 255, 255, 0.4); border-radius: 16px; font-family: var(--px); font-size: 22px; }
.touch button.on { background: rgba(255, 210, 63, 0.4); border-color: var(--y); }
.touch .steer { position: absolute; left: 14px; bottom: 18px; display: flex; gap: 12px; }
.touch .steer button { width: 84px; height: 84px; }
.touch .acts { position: absolute; right: 14px; bottom: 18px; display: grid; grid-template-columns: auto auto; gap: 10px; align-items: end; }
.touch .acts .dr { width: 96px; height: 84px; font-size: 12px; grid-column: 2; grid-row: 2; background: rgba(76, 201, 255, 0.25); }
.touch .acts .it { width: 84px; height: 70px; font-size: 11px; grid-column: 2; grid-row: 1; }
.touch .acts .sm { width: 70px; height: 54px; font-size: 8px; grid-column: 1; grid-row: 2; }

/* ---------- results ---------- */
.results { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; background: rgba(10, 5, 26, 0.55); padding: 16px; }
.res-card { width: min(520px, 100%); background: var(--panel2); border: 3px solid #5a46a8; border-radius: 12px; padding: 18px; box-shadow: 0 6px 0 #07031a, 0 30px 80px rgba(0, 0, 0, 0.5); max-height: 92vh; overflow-y: auto; }
.res-big { font-family: var(--px); font-size: 40px; text-align: center; color: var(--y); text-shadow: 5px 5px 0 #07031a; }
.res-big.dnf { color: var(--r); }
.res-sub { text-align: center; margin: 10px 0 14px; font-size: 17px; line-height: 1.4; }
.res-sub .g { font-family: var(--px); font-size: 13px; }
.res-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 4px; }
.res-list li { display: flex; align-items: center; gap: 8px; background: #170f38; border-radius: 6px; padding: 5px 8px; font-size: 15px; }
.res-list li.me { outline: 2px solid var(--y); }
.res-list li canvas { width: 26px; height: 26px; image-rendering: pixelated; }
.res-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-list .ms { font-family: var(--px); font-size: 9px; color: var(--mute); }
.res-list .pr { font-family: var(--px); font-size: 9px; color: var(--g); min-width: 52px; text-align: right; }
.res-btns { display: flex; gap: 10px; justify-content: center; }

/* ---------- modal + toasts ---------- */
.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(5, 2, 16, 0.7); padding: 16px; }
.modal-card { position: relative; width: min(460px, 100%); background: var(--panel2); border: 3px solid #5a46a8; border-radius: 12px; padding: 18px; max-height: 90vh; overflow-y: auto; }
.modal-card h3 { font-family: var(--px); font-weight: 400; font-size: 13px; margin: 0 0 14px; }
.modal-card h4 { font-family: var(--px); font-weight: 400; font-size: 10px; margin: 16px 0 8px; }
.modal-card .x { position: absolute; right: 10px; top: 10px; background: none; border: 0; cursor: pointer; font-size: 18px; }
.w-bal { background: #170f38; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.w-bal span { display: block; font-size: 13px; color: var(--mute); }
.w-bal b { font-family: var(--px); font-size: 20px; font-weight: 400; color: var(--g); }
.w-bal small { display: block; color: var(--mute); margin-top: 4px; }
#w-form { display: flex; flex-direction: column; gap: 8px; }
#w-wallet-row { display: flex; }
.wh { display: flex; justify-content: space-between; align-items: center; background: #170f38; padding: 6px 10px; border-radius: 6px; margin-bottom: 4px; font-size: 14px; }
.st { font-family: var(--px); font-size: 8px; padding: 3px 5px; border-radius: 3px; background: #33246e; }
.st.paid { background: var(--g); color: #052e16; } .st.rejected { background: var(--r); }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: rgba(14, 8, 34, 0.95); border: 2px solid var(--y); border-radius: 8px; padding: 9px 14px; font-size: 15px; transition: opacity 0.4s, transform 0.4s; max-width: 90vw; text-align: center; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- coin + X links ---------- */
.buy-btn { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border-radius: 6px; background: linear-gradient(180deg, #6bff9e, #22c55e); color: #052e16; font-family: var(--px); font-size: 8px; text-decoration: none; flex: none; box-shadow: 0 3px 0 #0b5e2a; white-space: nowrap; }
.buy-btn svg, .buy-card svg { width: 18px; height: 18px; flex: none; }
.buy-btn:hover, .buy-card:hover { filter: brightness(1.08); }
.icon-btn.x-btn svg { width: 16px; height: 16px; }
.buy-card { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: linear-gradient(180deg, #6bff9e, #22c55e); color: #052e16; text-decoration: none; font-size: 16px; font-weight: 600; box-shadow: 0 4px 0 #0b5e2a; }
.ca-copy { width: 100%; display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: #0e0826; border: 2px dashed #3b2a78; cursor: pointer; font-size: 14px; }
.ca-copy .ca-l { font-family: var(--px); font-size: 8px; color: var(--g); }
.ca-copy .ca-v { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-copy .ca-c { color: var(--mute); font-size: 12px; border: 2px solid #3b2a78; border-radius: 4px; padding: 1px 7px; }
.ca-copy:hover { border-color: var(--g); }
.x-follow { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 10px; padding: 9px 12px; border-radius: 8px; background: #000; border: 2px solid #3b2a78; color: #fff; text-decoration: none; font-size: 15px; }
.x-follow svg { width: 16px; height: 16px; flex: none; }
.x-follow:hover { border-color: #fff; }
.ca-inline { background: none; border: 0; padding: 0; cursor: pointer; color: var(--mute); font-size: 13px; text-decoration: underline dotted; word-break: break-all; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 22vh; }
  .play { order: -1; }
  .band { grid-template-columns: 1fr; }
  .steps, .item-grid { grid-template-columns: 1fr 1fr; }
  .ticker { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .topbar { padding: 8px 12px; gap: 6px; }
  .pill b { display: none; }
  .buy-btn span { display: none; } .buy-btn { padding: 0 9px; height: 34px; }
  .pill { display: none; }
  .pill { padding: 6px 8px; font-size: 13px; margin-left: auto; }
  .icon-btn { width: 34px; height: 34px; }
  .brand img { width: 26px; height: 26px; }
  .brand span { font-size: 12px; }
  .page { padding: 0 12px 30px; }
  .statrow, .prizes { grid-template-columns: 1fr 1fr; }
  .steps, .item-grid, .ctl { grid-template-columns: 1fr; }
  .drivers { gap: 5px; }
  .drv canvas { width: 52px; height: 52px; }
  .drv span { font-size: 11px; }
  #minimap { width: 110px; height: 110px; }
  .item-slot { width: 64px; height: 64px; }
  .item-slot span { font-size: 32px; }
  .lap { font-size: 12px; } .lap b { font-size: 16px; }
  .timer { font-size: 10px; }
  .hud-left { top: 96px; }
  .place { right: 14px; bottom: auto; top: 128px; }
  .place b { font-size: 46px; } .place sup { font-size: 15px; vertical-align: 24px; }
  .speed { bottom: auto; top: 76px; left: 50%; }
  .speed b { font-size: 14px; } .speed i { width: 90px; }
  .count { font-size: 80px; }
  .bigmsg { font-size: 15px; }
  .keys-hint { display: none; }
  .voice-btns { top: 210px; } .hud-exit { top: 366px; }
  .chat { bottom: 200px; width: 70vw; }
  .notes { top: 150px; }
  .res-big { font-size: 28px; }
}
@media (pointer: coarse) { .touch-only { display: initial !important; } .touch.touch-only { display: block !important; } .keys-hint { display: none; } }
