/* Hunt Racers screens in the space look (body.sp-racing, set by ui/space/racelobby.js): the store,
   GP Pass, Trophy Road, profile, settings, garage, friends and every popup get the lobby's
   navy glass, thin neon rims, squared corners and the techno / narrow fonts. Their layout and
   logic are untouched: this re-points the design tokens (tokens.css) for those layers and swaps
   the chunky outlines and drop shadows for rims and glows. The race itself keeps its own look. */
body.sp-racing :is(#lobby, .ui-screen, .ui-pop, .detail) {
  --ink: #050816; --bg: #070a1f; --panel: #101a44; --panel-2: #0b1233; --panel-hi: #3b2d8f;
  --gold: #ffc84a; --gold-2: #ffa63a; --mint: #34e7ff; --text-dim: #93a6cf;
  --line: 1.5px; --radius: 4px; --radius-sm: 3px;
  --drop: 0 0 0 1px rgba(52,231,255,.45), 0 0 12px rgba(52,231,255,.18); --drop-press: 0 0 0 1px rgba(52,231,255,.8);
  --font: "Chakra Petch", "Eurostile", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Barlow Semi Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
}
/* the lobby's sky behind every screen (the phone-size image the lobby already loaded), dimmed so
   panels and text stay crisp; the gradient underneath shows until it arrives */
body.sp-racing :is(.ui-screen, .store-screen, .ui-screen.neon) { background: linear-gradient(rgba(3,5,14,.42), rgba(3,5,14,.42)), url(sky/sky-l-s.webp) center / cover no-repeat, radial-gradient(ellipse at 25% 15%, rgba(122,44,255,.2), transparent 55%), linear-gradient(#0b1030, #050816 70%); backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (orientation: portrait) { body.sp-racing :is(.ui-screen, .store-screen, .ui-screen.neon) { background-image: linear-gradient(rgba(3,5,14,.42), rgba(3,5,14,.42)), url(sky/sky-p-s.webp), radial-gradient(ellipse at 25% 15%, rgba(122,44,255,.2), transparent 55%), linear-gradient(#0b1030, #050816 70%); } }
body.sp-racing .ui-pop { background: rgba(3,5,14,.68); }
/* same spot and look as the lobby's own credit line (#lobby.sp #credit), so it sits exactly over it */
body.sp-racing .ov-credit { left: calc(env(safe-area-inset-left, 0px) + 8px); bottom: calc(env(safe-area-inset-bottom, 0px) + 3px); font: 600 11px/1 "Barlow Semi Condensed", "Roboto Condensed", "Arial Narrow", "Segoe UI", system-ui, sans-serif; letter-spacing: .06em; color: #ffc84a; text-shadow: 0 0 4px #000, 0 1px 0 #000; }
body.sp-racing .detail { background: rgba(3,5,14,.75); }
/* titles: neon, no outline */
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .title { font-family: var(--font); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #fff; -webkit-text-stroke: 0; text-shadow: 0 0 10px rgba(52,231,255,.75), 0 0 2px #34e7ff; }
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .outlined { -webkit-text-stroke: 0; text-shadow: 0 0 6px rgba(0,0,0,.8); }
/* buttons: glass with a cyan rim; the gold one is the main action */
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .btn { font-weight: 700; letter-spacing: .08em; border: 0; border-radius: 3px; box-shadow: var(--drop); color: #04101c; background: linear-gradient(100deg, #7ff3ff, #34e7ff 50%, #8f7bff); }
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .btn.alt { color: #e9f6ff; background: rgba(16,26,68,.85); }
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .btn.gold { color: #10081e; background: linear-gradient(100deg, #ffe08a, #ffc84a 55%, #ff9f43); }
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .btn.red { color: #fff; background: linear-gradient(100deg, #ff6aa8, #ff3fb8); }
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .btn.pressed, body.sp-racing :is(.ui-screen, .ui-pop, .detail) .btn:active { transform: scale(.97); }
/* panels and cards: translucent navy glass, thin rims, square corners */
body.sp-racing :is(.ui-screen, .ui-pop, .detail) :is(.card-a, .card-b) { border: 1px solid rgba(52,231,255,.45); border-radius: 4px; box-shadow: 0 0 14px rgba(52,231,255,.12), inset 0 0 24px rgba(167,123,255,.08); }
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .card-a { background: linear-gradient(160deg, rgba(16,26,68,.95), rgba(14,12,48,.95)); }
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .chipbtn { border: 1px solid rgba(52,231,255,.4); border-radius: 3px; background: rgba(11,18,51,.85); }
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .chipbtn.on { background: #34e7ff; color: #04101c; }
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .field { border: 1px solid rgba(52,231,255,.55); border-radius: 3px; background: #0b1233; color: #e9f6ff; }
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .slider { accent-color: #34e7ff; }
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .cur { border: 1px solid rgba(255,200,74,.6); border-radius: 3px; background: rgba(11,18,51,.85); }
/* store: the neon panels become glass with cut corners */
body.sp-racing :is(.st-stage, .st-shop) { border: 1px solid rgba(52,231,255,.5); border-radius: 0; clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); background: linear-gradient(160deg, rgba(12,20,52,.92), rgba(22,16,58,.88)); box-shadow: none; }
body.sp-racing .st-arrow, body.sp-racing .st-tab { border-radius: 3px; }
/* GP Pass / Trophy Road tiers */
body.sp-racing .ui-screen .tier { border-radius: 3px; }
body.sp-racing .ui-screen .rw { border-radius: 3px; }
/* the profile page inside the lobby */
body.sp-racing #lobby .pg-profile { color: var(--sp-text, #e9f6ff); font-family: var(--font-ui); }
/* lobby notices (new version / progress not saved): under the ticker, over the car pad, clear of
   the top bar, the controls, the dock and the credit */
body.sp-racing #notes { left: calc(env(safe-area-inset-left, 0px) + 8px); right: auto; top: calc(env(safe-area-inset-top, 0px) + 96px); align-items: flex-start; }
@media (orientation: portrait) { body.sp-racing #notes { top: calc(env(safe-area-inset-top, 0px) + 152px); max-width: calc(100vw - 16px); } }
body.sp-racing .note { font-family: var(--sp-display, "Chakra Petch", system-ui, sans-serif); font-weight: 700; letter-spacing: .04em; border: 1px solid rgba(52,231,255,.6); border-radius: 3px; box-shadow: 0 0 12px rgba(52,231,255,.25); background: rgba(12,20,52,.92); }
body.sp-racing .note.warn { background: rgba(255,63,184,.92); border-color: #ffd0ea; }
body.sp-racing .note button { border: 0; border-radius: 3px; background: #ffc84a; }

/* ---- polish to match the lobby (no cartoon yellow): the picked card, currency chips, the main
   buy action, the credit line, the GP Pass tiers and the store's daily heading ---- */
body.sp-racing :is(#lobby, .ui-screen, .ui-pop, .detail) { --gold: #7ff3ff; --gold-2: #34e7ff; }
body.sp-racing .ov-credit { color: #cfe3ff; text-shadow: 0 0 6px rgba(52,231,255,.45), 0 1px 2px #050816; }
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .btn.gold { color: #fff; background: linear-gradient(100deg, #ff8fdc, #ff3fb8 50%, #a77bff); box-shadow: 0 0 16px rgba(255,63,184,.45); text-shadow: 0 1px 2px rgba(40,0,30,.5); }
body.sp-racing .note button { background: #34e7ff; color: #04101c; }
body.sp-racing :is(.ui-screen, .ui-pop, .detail) .cur { border-color: rgba(52,231,255,.5); box-shadow: inset 0 0 10px rgba(52,231,255,.12); }
/* the picked car / mode / track: a cyan neon rim, not a gold outline */
body.sp-racing :is(.ui-screen, .ui-pop, .detail) :is(.bcard, .mcard, .tcard).sel { outline: 2px solid #34e7ff; outline-offset: 3px; box-shadow: 0 0 0 1px #b9fbff, 0 0 22px rgba(52,231,255,.55); }
/* garage cards: dark glass with the car's own colour as a soft top light */
body.sp-racing .ui-screen .dcard.card-b { background: linear-gradient(180deg, color-mix(in srgb, var(--card-col) 26%, rgba(10,16,44,.92)) 0%, rgba(8,12,36,.94) 55%); border: 1px solid color-mix(in srgb, var(--card-col) 60%, transparent); border-radius: 2px; }
body.sp-racing .ui-screen .dcard .dc-stats { font-family: var(--font-ui); letter-spacing: .06em; }
body.sp-racing .ui-screen .dcard .dc-stats i { height: 4px; border-radius: 0; background: rgba(147,166,207,.18); transform: skewX(-20deg); }
body.sp-racing .ui-screen .dcard .dc-stats b { border-radius: 0; box-shadow: 0 0 6px currentColor; }
body.sp-racing .ui-screen .dcard .dc-wpn { font-family: var(--font-ui); font-weight: 700; letter-spacing: .06em; -webkit-text-stroke: 0; color: #cfe3ff; }
/* GP Pass: glass reward tiles (premium violet on top, free cyan below), reached tiers lit */
body.sp-racing .ui-screen .rw.card-b { border-radius: 0; border: 1px solid color-mix(in srgb, var(--card-col) 70%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--card-col) 30%, rgba(10,16,44,.9)), rgba(8,12,36,.92)); box-shadow: inset 0 0 16px color-mix(in srgb, var(--card-col) 18%, transparent);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); font-family: var(--font-ui); font-weight: 700; letter-spacing: .04em; }
body.sp-racing .ui-screen .rw.premium { --card-col: #a77bff; }
body.sp-racing .ui-screen .rw.free { --card-col: #34e7ff; }
body.sp-racing .ui-screen .rw.locked { filter: saturate(.5) brightness(.75); }
body.sp-racing .ui-screen .tier .num { font-family: var(--font); font-weight: 700; color: var(--text-dim); }
body.sp-racing .ui-screen .tier.reached .num { color: #7ff3ff; text-shadow: 0 0 8px rgba(52,231,255,.7); }
body.sp-racing .ui-screen .tier.reached .rw:not(.locked):not(.got) { box-shadow: inset 0 0 16px color-mix(in srgb, var(--card-col) 30%, transparent), 0 0 12px color-mix(in srgb, var(--card-col) 40%, transparent); }
/* store: the daily heading and timer in the lobby's magenta / cyan */
body.sp-racing .st-dhead b { font-family: var(--font); font-weight: 700; letter-spacing: .14em; color: #ff8fdc; text-shadow: 0 0 10px rgba(255,63,184,.6); }
body.sp-racing .st-card { border-width: 1px; border-radius: 0; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
body.sp-racing .st-card.sel { outline: 0; box-shadow: inset 0 0 0 2px #fff, 0 0 18px var(--rc); }
body.sp-racing .ui-screen.neon .ui-head .title { text-shadow: 0 0 10px rgba(52,231,255,.75), 0 0 2px #34e7ff; }
