/* =========================================================================
   LANE RUSH design system (2004 console-racer language, portrait-first)
   Layout concept: the live globe stays central and clear; UI lives on the
   top and bottom edges as layered technical plates with hairline linework.
   ========================================================================= */
:root {
  --carbon: #0b0d10; --gun: #171b21; --gun2: #232831; --steel: #8a93a2; --silver: #cfd5de; --ink: #f4f5f7;
  --yellow: #ffc21a; --amber: #ff9a1a; --red: #ff4d1a; --blue: #3a9cff; --line: rgba(207, 213, 222, 0.22);
  --f-head: "Russo One", "Arial Black", Impact, sans-serif;
  --f-body: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Share Tech Mono", ui-monospace, Menlo, monospace;
  --notch: 12px; --fast: 0.16s; --snap: cubic-bezier(0.2, 0.9, 0.1, 1);
  --carbon-weave: repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 4px), repeating-linear-gradient(-45deg, rgba(0,0,0,0.25) 0 2px, transparent 2px 4px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; color: var(--ink); font-family: var(--f-body); overflow: hidden; overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
#app { position: fixed; inset: 0; display: flex; justify-content: center; background: #000; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#touch { position: absolute; inset: 0; touch-action: none; display: none; }
#touch.on { display: block; }
#flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; mix-blend-mode: screen; }
#popups, #toasts { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
button { font: inherit; color: inherit; }

/* ---------- motion primitives */
@keyframes slideL { from { transform: translateX(-28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideR { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideU { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes glintSweep { 0%, 62% { transform: skewX(-18deg) translateX(0); } 100% { transform: skewX(-18deg) translateX(1100px); } }
@keyframes lanes { from { background-position: 0 0; } to { background-position: -96px 0; } }
#wipe { position: absolute; inset: 0; pointer-events: none; z-index: 40; transform: translateX(-110%); background: linear-gradient(100deg, transparent 0 8%, var(--yellow) 8% 11%, var(--carbon) 11% 89%, var(--yellow) 89% 92%, transparent 92%); }
#wipe.go { animation: wipe 0.42s var(--snap); }
@keyframes wipe { 0% { transform: translateX(-110%); } 45%, 55% { transform: translateX(0); } 100% { transform: translateX(110%); } }

/* ---------- screens */
.screen { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.screen.show { display: flex; }
.screen.dim { background: rgba(4, 5, 7, 0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); justify-content: center; }
.hud { pointer-events: none; }
.hud button { pointer-events: auto; }

/* ---------- brand mark */
.brand-mark { width: min(86vw, 420px); }
.brand-mark svg { width: 100%; height: auto; display: block; overflow: visible; }
.brand-mark .mk-glint { animation: glintSweep 5s cubic-bezier(0.5, 0, 0.3, 1) infinite; }
.brand-mark.small { width: min(44vw, 210px); }

/* ---------- boot */
#boot { justify-content: center; background: #000; gap: 0; overflow: hidden; padding: 0; }
@keyframes fadeIn { to { opacity: 1; } }
/* backgrounds: 4 stills, 4.5 s each, crossfade + slow push-in */
.ld-bg, .ld-bg i, .ld-shade, .ld-speed { position: absolute; inset: 0; pointer-events: none; }
.ld-bg i { background: #000 center 58% / cover no-repeat; opacity: 0; transform: scale(1.12); animation: ldShow 18s linear infinite; }
.ld-bg .l1 { background-image: url(img/load/l1.jpg); animation-delay: 0s; }
.ld-bg .l2 { background-image: url(img/load/l2.jpg); animation-delay: 4.5s; }
.ld-bg .l3 { background-image: url(img/load/l3.jpg); animation-delay: 9s; }
.ld-bg .l4 { background-image: url(img/load/l4.jpg); animation-delay: 13.5s; }
@keyframes ldShow { 0% { opacity: 0; transform: scale(1.12); } 4% { opacity: 1; } 25% { opacity: 1; } 30% { opacity: 0; transform: scale(1.0); } 100% { opacity: 0; transform: scale(1.0); } }
.ld-shade { background:
    linear-gradient(180deg, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.35) 22%, rgba(0,0,0,0) 38%, rgba(0,0,0,0) 56%, rgba(0,0,0,0.7) 76%, rgba(0,0,0,0.96) 100%),
    radial-gradient(ellipse at 50% 55%, transparent 55%, rgba(0,0,0,0.55) 100%); }
.ld-shade::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px); }
/* speed streaks */
.ld-speed i { position: absolute; left: -40%; height: 1px; width: 38%; background: linear-gradient(90deg, transparent, rgba(255,214,120,0.75), transparent); opacity: 0; animation: ldStreak 2.6s linear infinite; }
.ld-speed i:nth-child(1) { top: 31%; animation-delay: 0.2s; } .ld-speed i:nth-child(2) { top: 47%; animation-delay: 1.1s; width: 24%; }
.ld-speed i:nth-child(3) { top: 63%; animation-delay: 1.7s; } .ld-speed i:nth-child(4) { top: 72%; animation-delay: 0.6s; width: 30%; background: linear-gradient(90deg, transparent, rgba(255,60,60,0.7), transparent); }
.ld-speed i:nth-child(5) { top: 39%; animation-delay: 2.2s; width: 18%; background: linear-gradient(90deg, transparent, rgba(90,150,255,0.7), transparent); }
@keyframes ldStreak { 0% { transform: translateX(0); opacity: 0; } 10% { opacity: 1; } 60% { opacity: 1; } 100% { transform: translateX(380%); opacity: 0; } }
/* chrome 3D logo with a light sweep clipped to its shape */
.ld-top { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 9vh); display: flex; justify-content: center; }
.ld-logo { position: relative; width: min(88vw, 560px); aspect-ratio: 900 / 181; background: url(brand/lanerush-pursuit-logo3d.webp) center / contain no-repeat;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.9)) drop-shadow(0 0 28px rgba(255,255,255,0.12)); animation: ldLogo 0.9s var(--snap) both; }
.ld-logo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,0.85) 50%, transparent 58%) 0 0 / 300% 100% no-repeat;
  -webkit-mask: url(brand/lanerush-pursuit-logo3d.webp) center / contain no-repeat; mask: url(brand/lanerush-pursuit-logo3d.webp) center / contain no-repeat;
  mix-blend-mode: screen; animation: ldGlint 3.4s 0.9s ease-in-out infinite; }
@keyframes ldLogo { from { opacity: 0; transform: scale(1.18); filter: blur(8px); } to { opacity: 1; transform: none; } }
@keyframes ldGlint { 0% { background-position: 120% 0; } 45%, 100% { background-position: -20% 0; } }
/* NFS-style caption for whichever still is showing */
.ld-cap { position: absolute; left: 20px; right: 20px; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 7vh + 44px + 118px); height: 52px; pointer-events: none; z-index: 1; }
.ld-cap p { position: absolute; left: 0; bottom: 0; margin: 0; opacity: 0; animation: ldCap 18s linear infinite; }
.ld-cap .c2 { animation-delay: 4.5s; } .ld-cap .c3 { animation-delay: 9s; } .ld-cap .c4 { animation-delay: 13.5s; }
.ld-cap small { display: block; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.42em; color: var(--yellow); }
.ld-cap b { display: block; margin-top: 3px; font-family: var(--f-head); font-style: italic; font-weight: 400; font-size: 24px; letter-spacing: 0.04em; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,0.7); }
.ld-cap b::after { content: ""; display: block; width: 56px; height: 3px; margin-top: 6px; background: linear-gradient(90deg, var(--yellow), transparent); }
@keyframes ldCap { 0%, 2% { opacity: 0; transform: translateX(-16px); } 6% { opacity: 1; transform: none; } 24% { opacity: 1; transform: none; } 28%, 100% { opacity: 0; transform: translateX(10px); } }
/* loader: tip, thin glowing bar, status */
.boot-load { position: absolute; left: 20px; right: 20px; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 7vh + 44px); width: auto; max-width: 560px; margin: 0 auto; opacity: 0; animation: fadeIn 0.4s 0.5s forwards; z-index: 1; }
.ld-tip { display: flex; gap: 10px; align-items: baseline; min-height: 36px; margin-bottom: 14px; }
.ld-tip span { flex: none; padding: 2px 6px; font-family: var(--f-head); font-size: 10px; letter-spacing: 0.18em; color: #120c00; background: var(--yellow); transform: skewX(-12deg); }
.ld-tip em { font-style: normal; font-family: var(--f-body, var(--f-mono)); font-size: 13px; line-height: 1.4; color: rgba(236,239,244,0.86); transition: opacity 0.3s; }
.ld-tip em.out { opacity: 0; }
.ld-bar { position: relative; height: 3px; background: rgba(255,255,255,0.12); overflow: visible; }
.ld-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(255,194,26,0.2), var(--yellow)); box-shadow: 0 0 10px rgba(255,194,26,0.7); transition: width 0.35s var(--snap); }
.ld-bar i::after { content: ""; position: absolute; right: -2px; top: -4px; width: 4px; height: 11px; background: #fff; box-shadow: 0 0 10px #fff, 0 0 22px var(--yellow); }
.boot-meta { display: flex; justify-content: space-between; margin-top: 10px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.22em; color: rgba(210,216,226,0.75); }
.boot-skip { position: absolute; left: 0; right: 0; text-align: center; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 3vh); font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.3em; color: rgba(255,255,255,0.45); animation: blink 1.1s steps(2) infinite; z-index: 2; }
.a2hs { position: absolute; left: 0; right: 0; text-align: center; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 2.4vh + 58px); padding: 0 24px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.16em; line-height: 1.6; color: rgba(255,255,255,0.55); z-index: 2; }
.boot-skip.ready { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 2.4vh); padding: 12px 26px 12px 32px; white-space: nowrap; font-family: var(--f-head); font-size: 15px; letter-spacing: 0.4em; color: #120c00;
  background: linear-gradient(180deg, #ffe066, var(--yellow) 48%, #f0a200); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); animation: ldPulse 1.2s ease-in-out infinite; }
@keyframes ldPulse { 50% { filter: brightness(1.25); box-shadow: 0 0 30px rgba(255,194,26,0.7); } }
@keyframes blink { 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .ld-bg i { animation-duration: 36s; transform: none; } .ld-speed { display: none; } .ld-logo::after { animation: none; } }

/* ---------- shared plates & buttons */
.plate { background: linear-gradient(180deg, rgba(35, 40, 49, 0.92), rgba(15, 18, 22, 0.92)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), inset 0 0 0 1px var(--line); clip-path: polygon(var(--notch) 0, 100% 0, 100% calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, 0 100%, 0 var(--notch)); }
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--f-head); font-size: 16px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); padding: 13px 18px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #2b313b, #161a20); box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), inset 0 0 0 1px var(--line);
  clip-path: polygon(var(--notch) 0, 100% 0, 100% calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, 0 100%, 0 var(--notch)); transition: transform var(--fast) var(--snap), filter var(--fast); }
.btn::before { content: ""; width: 0; height: 0; border-left: 7px solid var(--yellow); border-top: 5px solid transparent; border-bottom: 5px solid transparent; opacity: 0; transform: translateX(-6px); transition: all var(--fast) var(--snap); }
.btn:hover::before, .btn:focus-visible::before { opacity: 1; transform: none; }
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--yellow); }
.btn.primary { color: #120c00; background: linear-gradient(180deg, #ffe066, var(--yellow) 48%, #f0a200); box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), inset 0 -3px 0 rgba(0,0,0,0.2); }
.btn.primary::before { border-left-color: #120c00; opacity: 1; transform: none; }
.btn.ghost { background: rgba(10, 12, 15, 0.5); box-shadow: inset 0 0 0 1px var(--line); }
.btn.big { font-size: 24px; padding: 16px 22px; }
.btn.small { font-size: 12px; padding: 8px 12px; --notch: 8px; }
.btn small { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.2em; opacity: 0.6; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.cr-glyph { display: inline-grid; place-items: center; width: 22px; height: 16px; font-family: var(--f-head); font-size: 9px; color: #120c00; background: var(--yellow); clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }

/* ---------- title screen (PRESS START) */
.title { justify-content: center; background: radial-gradient(ellipse at 50% 46%, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.55) 60%, rgba(0,0,0,0.9) 100%); }
.title::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 3px); }
.t-glow { position: absolute; left: -10%; right: -10%; top: 38%; height: 22%; background: radial-gradient(ellipse at center, rgba(255,194,26,0.18), transparent 70%); filter: blur(10px); }
.t-logo { width: min(92vw, 640px); margin-top: -10vh; animation: tIn 0.6s var(--snap) both; filter: drop-shadow(0 0 24px rgba(255,255,255,0.18)); }
@keyframes tIn { from { opacity: 0; transform: scale(1.25); filter: blur(6px); } to { opacity: 1; transform: none; } }
.t-press { margin-top: 8vh; font-family: var(--f-head); font-size: 20px; letter-spacing: 0.5em; padding-left: 0.5em; color: #fff; text-shadow: 0 0 12px rgba(255,194,26,0.8), 0 2px 0 #000; animation: press 1.2s steps(1) 0.6s infinite both; }
@keyframes press { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0; } }
.t-foot { position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.2em; color: rgba(255,255,255,0.45); }

/* ---------- main menu: console front end */
.ps2 { justify-content: flex-start; background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.15) 24%, rgba(0,0,0,0.05) 40%, rgba(0,0,0,0.7) 62%, rgba(0,0,0,0.95) 100%); }
.ps2::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px); }
.ps-head { width: 100%; max-width: 640px; display: flex; align-items: center; justify-content: space-between; gap: 12px; animation: slideL 0.3s var(--snap); }
.ps-logo { width: min(52vw, 280px); }
.ps-profile { display: grid; grid-template-columns: auto auto; gap: 2px 10px; align-items: center; padding: 6px 10px; background: rgba(8,10,13,0.75); box-shadow: inset 0 0 0 1px var(--line); }
.ps-profile div { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.ps-profile small { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.2em; color: var(--steel); }
.ps-profile b { font-family: var(--f-head); font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ps-profile div:first-child b { color: var(--yellow); }
.ps-xp { grid-column: 1 / -1; height: 3px; background: rgba(255,255,255,0.12); }
.ps-xp i { display: block; height: 100%; width: 0; background: var(--yellow); transition: width 0.6s var(--snap); }
.ps-spacer { flex: 1; }
.ps2.leaving .ps-list, .ps2.leaving .ps-info, .ps2.leaving .ps-prompts { transform: translateX(-110%); opacity: 0; transition: transform 0.14s ease-in, opacity 0.14s; }
.ps2.leaving .ps-head { transform: translateY(-120%); opacity: 0; transition: all 0.14s ease-in; }
.ps-list { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }
.ps-item { position: relative; display: flex; align-items: center; gap: 14px; height: 50px; padding: 0 18px; border: 0; cursor: pointer; text-align: left; color: rgba(244,245,247,0.78);
  background: linear-gradient(90deg, rgba(10,12,16,0.85), rgba(10,12,16,0.35) 70%, transparent); transform: skewX(-12deg); transform-origin: left; animation: slideL 0.3s var(--snap) both; transition: color 0.12s, padding 0.16s var(--snap); }
.ps-item:nth-child(1) { margin-left: 0; animation-delay: 0.04s; } .ps-item:nth-child(2) { margin-left: 12px; animation-delay: 0.08s; } .ps-item:nth-child(3) { margin-left: 24px; animation-delay: 0.12s; }
.ps-item:nth-child(4) { margin-left: 36px; animation-delay: 0.16s; } .ps-item:nth-child(5) { margin-left: 48px; animation-delay: 0.2s; }
.ps-item > * { transform: skewX(12deg); }
.ps-item i { font-style: normal; font-family: var(--f-mono); font-size: 12px; color: var(--steel); }
.ps-item span { font-family: var(--f-head); font-size: 26px; font-style: italic; letter-spacing: 0.06em; text-shadow: 0 2px 0 rgba(0,0,0,0.8); }
.ps-item::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #fff3a8, var(--yellow) 35%, #f0a200 80%, rgba(240,162,0,0)); transform: scaleX(0); transform-origin: left; transition: transform 0.18s var(--snap); }
.ps-item::after { content: ""; position: absolute; right: 22%; top: 50%; width: 0; height: 0; margin-top: -9px; border-left: 14px solid #120c00; border-top: 9px solid transparent; border-bottom: 9px solid transparent; opacity: 0; transform: translateX(-12px) skewX(12deg); transition: all 0.18s var(--snap); }
.ps-item > * { position: relative; }
.ps-item.sel { color: #120c00; padding-left: 26px; }
.ps-item.sel::before { transform: scaleX(1); }
.ps-item.sel::after { opacity: 1; transform: skewX(12deg); animation: nudge 0.7s ease-in-out infinite; }
.ps-item.sel i { color: rgba(18,12,0,0.6); }
.ps-item.sel span { text-shadow: none; }
.ps-item.go::before { animation: flashbar 0.14s steps(2) 2; }
@keyframes nudge { 50% { transform: translateX(6px) skewX(12deg); } }
@keyframes flashbar { 50% { filter: brightness(1.8); } }
.ps-info { width: 100%; max-width: 640px; margin-top: 12px; padding: 10px 14px; background: rgba(8,10,13,0.78); box-shadow: inset 3px 0 0 var(--yellow), inset 0 0 0 1px var(--line); animation: slideU 0.3s 0.2s var(--snap) both; }
.ps-desc { min-height: 2.6em; font-size: 16px; line-height: 1.3; color: var(--ink); letter-spacing: 0.02em; }
.ps-desc.swap { animation: slideR 0.18s var(--snap); }
.ps-car { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.1em; color: var(--silver); }
.ps-car small { color: var(--steel); margin-right: 4px; }
.ps-car b { color: var(--ink); font-family: var(--f-head); font-weight: 400; letter-spacing: 0.04em; }
.ps-prompts { width: 100%; max-width: 640px; display: flex; justify-content: flex-end; gap: 16px; margin-top: 10px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.16em; color: var(--silver); }
.ps-prompts span { display: flex; align-items: center; gap: 6px; }
.key { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; font-family: var(--f-mono); font-size: 10px; color: #120c00; background: linear-gradient(180deg, #fff, #c9cfd8); box-shadow: 0 2px 0 #000; }
@media (pointer: coarse) { .ps-prompts span:nth-child(n+2) { display: none; } }

/* ---------- gameplay feed: compact call-outs at the side, never over the car */
.hud-feed { position: absolute; left: max(10px, env(safe-area-inset-left)); top: calc(max(14px, env(safe-area-inset-top)) + 62px); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; pointer-events: none; }
.feed-item { display: flex; align-items: baseline; gap: 6px; padding: 3px 9px 3px 7px; background: rgba(6, 8, 11, 0.78); box-shadow: inset 3px 0 0 var(--pc, var(--yellow)); animation: slideL 0.18s var(--snap); transition: opacity 0.3s, transform 0.3s; }
.feed-item b { font-family: var(--f-head); font-weight: 400; font-size: 12px; letter-spacing: 0.08em; color: var(--pc, var(--yellow)); }
.feed-item small { font-family: var(--f-mono); font-size: 11px; color: #fff; }
.feed-item.big b { font-size: 14px; }
.feed-item.out { opacity: 0; transform: translateX(-12px); }

/* ---------- HUD */
.hud-top { width: 100%; max-width: 640px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; }
.hud-dist { display: flex; align-items: baseline; gap: 5px; padding-top: 6px; text-shadow: 0 2px 4px #000; }
.hud-dist small { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--steel); }
.hud-dist b { font-family: var(--f-mono); font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.hud-score { text-align: center; }
#h-score { font-family: var(--f-head); font-size: 34px; font-style: italic; letter-spacing: 0.02em; line-height: 1; color: #fff; text-shadow: 0 2px 0 #000, 0 0 14px rgba(0,0,0,0.6); font-variant-numeric: tabular-nums; }
.hud-combo { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 4px; opacity: 0; transform: translateY(-4px); transition: opacity 0.15s, transform 0.15s var(--snap); }
.hud-combo.on { opacity: 1; transform: none; }
.hud-combo.bump b { animation: bump 0.22s var(--snap); }
@keyframes bump { 40% { transform: scale(1.45) skewX(-10deg); } }
.hud-combo b { display: inline-block; font-family: var(--f-head); font-size: 26px; line-height: 1; padding: 2px 8px; color: #120c00; background: var(--yellow); transform: skewX(-10deg); box-shadow: 3px 3px 0 #000; }
.hc-side { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.hc-side span { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--ink); text-shadow: 0 1px 3px #000; }
.hc-timer { width: 64px; height: 4px; background: rgba(0,0,0,0.5); transform: skewX(-30deg); overflow: hidden; }
.hc-timer em { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--yellow)); width: 100%; }
.hud-pause { justify-self: end; width: 42px; height: 38px; border: 0; cursor: pointer; display: grid; place-items: center; background: rgba(10,12,15,0.65); box-shadow: inset 0 0 0 1px var(--line); clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); }
.hud-pause svg { width: 16px; height: 16px; fill: var(--ink); }
.hud-cluster { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); width: 148px; height: 148px; }
.hud-cluster::before { content: ""; position: absolute; inset: -8%; border-radius: 50%; background: radial-gradient(circle, rgba(6,8,11,0.82) 0 52%, rgba(6,8,11,0.45) 66%, transparent 72%); }
.gauge { position: relative; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.8)); }
.g-bezel { fill: none; stroke: rgba(207, 213, 222, 0.5); stroke-width: 2; }
.g-inner { fill: none; stroke: rgba(207, 213, 222, 0.18); stroke-width: 1; stroke-dasharray: 2 4; }
.g-seg { fill: rgba(255, 255, 255, 0.1); transition: fill 0.08s; }
.g-seg.on.w { fill: var(--ink); } .g-seg.on.a { fill: var(--yellow); } .g-seg.on.r { fill: var(--red); }
.g-num { font-family: var(--f-mono); font-size: 9px; fill: var(--steel); text-anchor: middle; }
.g-needle path { fill: var(--red); } .g-needle circle { fill: #111; stroke: var(--silver); stroke-width: 1.5; }
.g-read { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-2px); text-align: center; }
.g-read b { display: block; font-family: var(--f-head); font-size: 30px; font-style: italic; line-height: 1; color: #fff; text-shadow: 0 2px 0 #000; font-variant-numeric: tabular-nums; transition: color 0.15s; }
.g-read b.boost { color: var(--yellow); } .g-read b.brake { color: var(--red); }
.g-read span { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.25em; color: var(--steel); }
.g-mult { position: absolute; left: -54px; bottom: 6px; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.g-mult small { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.2em; color: var(--steel); }
.g-mult em { font-style: normal; font-family: var(--f-head); font-size: 15px; padding: 1px 6px; color: #120c00; background: var(--yellow); transform: skewX(-10deg); }
.hud-hint { position: absolute; bottom: 28%; left: 0; right: 0; text-align: center; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.16em; color: #fff; text-shadow: 0 2px 6px #000; transition: opacity 0.6s; }
.hud-pursuit { position: absolute; top: calc(max(14px, env(safe-area-inset-top)) + 150px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 4px 14px; font-family: var(--f-head); font-size: 16px; letter-spacing: 0.32em; color: #fff; background: rgba(8, 10, 14, 0.75); box-shadow: inset 0 0 0 1px var(--line); opacity: 0; transition: opacity 0.25s; }
.hud-pursuit.on { opacity: 1; }
.hud-pursuit i { width: 22px; height: 8px; animation: lightbar 0.5s steps(1) infinite; }
.hud-pursuit i:last-child { animation-delay: 0.25s; }
@keyframes lightbar { 0% { background: var(--red); box-shadow: 0 0 12px var(--red); } 50% { background: var(--blue); box-shadow: 0 0 12px var(--blue); } }

/* arcade call-outs */
.pop { position: absolute; transform: translate(-50%, -50%); text-align: center; white-space: nowrap; animation: pop 1.1s var(--snap) forwards; }
.pop b { display: inline-block; font-family: var(--f-head); font-size: 22px; letter-spacing: 0.06em; padding: 3px 12px; color: #0b0d10; background: var(--pc, var(--yellow)); transform: skewX(-12deg); box-shadow: 4px 4px 0 #000; }
.pop b span { color: #0b0d10; }
.pop small { display: block; margin-top: 4px; font-family: var(--f-mono); font-size: 14px; color: #fff; letter-spacing: 0.08em; text-shadow: 0 2px 4px #000; }
@keyframes pop { 0% { opacity: 0; transform: translate(-120%, -50%); } 10% { opacity: 1; transform: translate(-46%, -50%); } 18% { transform: translate(-50%, -50%) scale(1.06); } 80% { opacity: 1; transform: translate(-50%, -80%); } 100% { opacity: 0; transform: translate(10%, -90%); } }

/* toasts */
#toasts { z-index: 30; }
.toast { position: absolute; right: max(12px, env(safe-area-inset-right)); top: calc(max(14px, env(safe-area-inset-top)) + 60px); min-width: 200px; padding: 10px 14px 10px 18px; background: rgba(12, 14, 18, 0.94); box-shadow: inset 4px 0 0 var(--yellow), inset 0 0 0 1px var(--line); animation: slideR 0.25s var(--snap); }
.toast b { display: block; font-family: var(--f-head); font-size: 14px; letter-spacing: 0.1em; }
.toast small { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--steel); }
.toast.out { opacity: 0; transform: translateX(30px); transition: all 0.3s var(--snap); }

/* ---------- panels (pause, challenges, leaderboards, settings) */
.panel { position: relative; width: 100%; max-width: 500px; max-height: 100%; display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; overflow: hidden; background: linear-gradient(180deg, rgba(28, 32, 39, 0.96), rgba(11, 13, 16, 0.96)), var(--carbon-weave); box-shadow: inset 0 0 0 1px var(--line); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px)); animation: slideU 0.25s var(--snap); }
.panel.narrow { max-width: 380px; }
.panel::after { content: ""; position: absolute; right: 10px; bottom: 10px; width: 26px; height: 26px; border-right: 2px solid var(--yellow); border-bottom: 2px solid var(--yellow); opacity: 0.8; pointer-events: none; }
.p-head { display: flex; align-items: stretch; gap: 12px; margin: 0 -16px; padding-right: 12px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(255,194,26,0.12), transparent 60%); }
.p-idx { display: grid; place-items: center; min-width: 52px; font-family: var(--f-head); font-size: 18px; color: #120c00; background: var(--yellow); clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.p-head h2 { flex: 1; margin: 0; padding: 12px 0; font-family: var(--f-head); font-weight: 400; font-size: 22px; letter-spacing: 0.14em; font-style: italic; }
.p-head .btn { align-self: center; }
.p-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.p-actions .btn { width: 100%; justify-content: flex-start; }
.list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; -webkit-overflow-scrolling: touch; }
.item { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: rgba(255,255,255,0.03); box-shadow: inset 0 -1px 0 var(--line); animation: slideL 0.25s var(--snap) both; }
.item:nth-child(2) { animation-delay: 0.03s; } .item:nth-child(3) { animation-delay: 0.06s; } .item:nth-child(4) { animation-delay: 0.09s; } .item:nth-child(5) { animation-delay: 0.12s; } .item:nth-child(n+6) { animation-delay: 0.15s; }
.item .grow { flex: 1; min-width: 0; }
.item b { display: block; font-family: var(--f-head); font-weight: 400; font-size: 14px; letter-spacing: 0.1em; }
.item small { color: var(--steel); font-size: 14px; letter-spacing: 0.02em; }
.item .bar { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; height: 5px; margin-top: 7px; transform: skewX(-30deg); }
.item .bar i { background: rgba(255,255,255,0.08); }
.item .bar i.on { background: var(--silver); }
.item.done .bar i.on { background: var(--yellow); }
.item.done { box-shadow: inset 3px 0 0 var(--yellow), inset 0 -1px 0 var(--line); }
.item .rank { width: 34px; font-family: var(--f-head); font-size: 20px; font-style: italic; color: var(--steel); }
.item:first-child .rank { color: var(--yellow); }
.item .val { font-family: var(--f-mono); font-size: 18px; font-variant-numeric: tabular-nums; }
.item .tagdone { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.2em; color: var(--yellow); }
.empty { padding: 26px 12px; text-align: center; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.18em; color: var(--steel); }
.empty::before { content: ""; display: block; height: 4px; width: 120px; margin: 0 auto 14px; background: repeating-linear-gradient(90deg, var(--yellow) 0 18px, transparent 18px 28px); transform: skewX(-30deg); }
.note { color: var(--steel); font-size: 13px; line-height: 1.4; margin: 4px 0 0; letter-spacing: 0.02em; }
.tabs { display: flex; gap: 2px; }
.tabs.sub .tab { font-size: 11px; padding: 6px; }
.tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--f-head); font-size: 12px; letter-spacing: 0.12em; padding: 9px 6px; background: rgba(255,255,255,0.04); color: var(--steel); border: 0; cursor: pointer; box-shadow: inset 0 -2px 0 transparent; transition: all var(--fast); }
.tab small { font-family: var(--f-mono); font-size: 10px; opacity: 0.7; }
.tab.on { color: var(--ink); background: rgba(255, 194, 26, 0.1); box-shadow: inset 0 -3px 0 var(--yellow); }

/* ---------- results */
.res-screen { background: linear-gradient(180deg, rgba(4,5,7,0.55), rgba(4,5,7,0.9)); }
.res { width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.res-band { position: relative; width: 120%; display: flex; justify-content: center; padding: 10px 0; background: repeating-linear-gradient(-45deg, rgba(255,194,26,0.9) 0 14px, rgba(11,13,16,0.9) 14px 28px); transform: rotate(-4deg); animation: slideL 0.3s var(--snap); }
.r-title { padding: 2px 22px; font-family: var(--f-head); font-size: 46px; font-style: italic; letter-spacing: 0.08em; line-height: 1; color: #fff; background: var(--carbon); box-shadow: 0 0 0 3px var(--carbon); }
.r-title.busted { animation: busted 0.5s steps(1) infinite; }
@keyframes busted { 0% { color: #ff5a5a; text-shadow: 0 0 18px #ff2020; } 50% { color: #8cc4ff; text-shadow: 0 0 18px #2060ff; } }
.r-best { display: none; margin-top: 16px; padding: 4px 14px; font-family: var(--f-head); font-size: 14px; letter-spacing: 0.24em; color: #120c00; background: var(--yellow); transform: rotate(-3deg) skewX(-10deg); box-shadow: 4px 4px 0 #000; }
.r-best.on { display: block; animation: stamp 0.45s 0.5s var(--snap) both; }
@keyframes stamp { 0% { opacity: 0; transform: rotate(-3deg) skewX(-10deg) scale(2.4); } 70% { transform: rotate(-3deg) skewX(-10deg) scale(0.92); } 100% { opacity: 1; transform: rotate(-3deg) skewX(-10deg) scale(1); } }
.r-label { margin-top: 14px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.4em; color: var(--steel); }
.r-score { font-family: var(--f-head); font-size: clamp(48px, 15vw, 72px); font-style: italic; line-height: 1; color: var(--ink); text-shadow: 0 3px 0 #000, 0 0 30px rgba(255, 194, 26, 0.25); font-variant-numeric: tabular-nums; }
.r-grid { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin: 10px 0 4px; }
.r-grid div { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 2px; border-bottom: 1px solid var(--line); opacity: 0; transform: translateX(-14px); transition: opacity 0.2s, transform 0.2s var(--snap); }
.r-grid div.in { opacity: 1; transform: none; }
.r-grid span { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.16em; color: var(--steel); }
.r-grid b { font-family: var(--f-head); font-weight: 400; font-size: 17px; font-variant-numeric: tabular-nums; }
.r-grid .cr-row { grid-column: 1 / -1; border-bottom-color: rgba(255,194,26,0.4); }
.r-grid b.cr { color: var(--yellow); font-size: 20px; }
.r-unlocks { width: 100%; font-family: var(--f-mono); font-size: 12px; color: var(--yellow); letter-spacing: 0.06em; min-height: 4px; }
.btn.retry { width: 100%; margin-top: 8px; justify-content: space-between; }
.r-sec { display: flex; gap: 8px; width: 100%; }
.r-sec .btn { flex: 1; }

/* ---------- garage (tuning-catalog layout) */
.garage { justify-content: space-between; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0.7), rgba(0,0,0,0) 26%, rgba(0,0,0,0) 48%, rgba(0,0,0,0.92)); }
.garage > * { pointer-events: auto; }
.g-top { width: 100%; max-width: 640px; display: flex; justify-content: space-between; align-items: center; }
.g-top .m-cr { padding: 6px 10px; background: rgba(10,12,15,0.7); box-shadow: inset 0 0 0 1px var(--line); }
.g-title { width: 100%; max-width: 640px; margin-top: 8px; pointer-events: none; }
.g-title small { display: block; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.5em; color: var(--yellow); }
.g-title b { display: block; font-family: var(--f-head); font-weight: 400; font-size: clamp(30px, 10vw, 46px); font-style: italic; letter-spacing: 0.02em; line-height: 1; text-shadow: 0 3px 0 #000; }
.g-title.swap small, .g-title.swap b, .g-title.swap .g-cls { animation: slideR 0.28s var(--snap) both; }
.g-title.swap b { animation-delay: 0.04s; } .g-title.swap .g-cls { animation-delay: 0.08s; }
.g-cls { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; }
.g-cls i { display: grid; place-items: center; width: 26px; height: 22px; font-style: normal; font-family: var(--f-head); font-size: 14px; color: #120c00; background: var(--yellow); clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.g-cls em { font-style: normal; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.18em; color: var(--silver); }
.g-nav { width: 100%; max-width: 640px; display: flex; justify-content: space-between; margin-top: auto; margin-bottom: 8px; }
.g-arrow { width: 46px; height: 46px; border: 0; cursor: pointer; color: var(--yellow); font-size: 18px; background: rgba(10,12,15,0.75); box-shadow: inset 0 0 0 1px var(--line); clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); }
.g-panel { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 12px; background: linear-gradient(180deg, rgba(28,32,39,0.95), rgba(11,13,16,0.97)); box-shadow: inset 0 0 0 1px var(--line); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%); }
.g-body { min-height: 112px; max-height: 26vh; overflow-y: auto; }
.spec { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; animation: slideU 0.22s var(--snap); }
.pg { width: 100%; height: auto; overflow: visible; }
.pg-grid { fill: none; stroke: rgba(207, 213, 222, 0.16); stroke-width: 0.8; }
.pg-axis { stroke: rgba(207, 213, 222, 0.16); stroke-width: 0.8; }
.pg-prev { fill: rgba(255, 255, 255, 0.06); stroke: rgba(255,255,255,0.3); stroke-width: 1; stroke-dasharray: 3 3; }
.pg-val { fill: rgba(255, 194, 26, 0.28); stroke: var(--yellow); stroke-width: 1.8; stroke-linejoin: round; }
.pg-lab { font-family: var(--f-mono); font-size: 7.5px; fill: var(--steel); letter-spacing: 0.06em; }
.spec-list { display: flex; flex-direction: column; gap: 5px; }
.spec-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 6px; padding-bottom: 4px; border-bottom: 1px dashed var(--line); }
.spec-row span { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.16em; color: var(--steel); }
.spec-row b { font-family: var(--f-head); font-weight: 400; font-size: 15px; font-variant-numeric: tabular-nums; }
.spec-row b small { font-family: var(--f-mono); font-size: 10px; color: var(--steel); margin-left: 3px; }
.spec-row.price b { color: var(--yellow); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.sw { position: relative; border: 0; padding: 0 0 6px; background: rgba(255,255,255,0.03); cursor: pointer; text-align: left; color: var(--ink); font-family: var(--f-body); font-size: 12px; letter-spacing: 0.04em; box-shadow: inset 0 0 0 1px var(--line); transition: transform var(--fast) var(--snap); animation: slideU 0.2s var(--snap) both; }
.sw .chip { height: 30px; margin-bottom: 5px; }
.sw span { display: block; padding: 0 7px; line-height: 1.1; }
.sw .code { font-family: var(--f-mono); font-size: 9px; color: var(--steel); letter-spacing: 0.12em; }
.sw .price { color: var(--yellow); font-family: var(--f-mono); font-size: 10px; }
.sw .lock { position: absolute; top: 6px; right: 6px; width: 14px; height: 16px; }
.sw.on { box-shadow: inset 0 0 0 2px var(--yellow); transform: translateY(-2px); }

/* ---------- settings form */
.form .item label { flex: 1; font-family: var(--f-head); font-size: 12px; letter-spacing: 0.12em; }
.form input[type=range] { width: 46%; accent-color: var(--yellow); }
.form select { background: #10141a; color: var(--ink); border: 0; box-shadow: inset 0 0 0 1px var(--line); padding: 7px; font-family: var(--f-mono); font-size: 13px; }
.form input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--yellow); }

/* ---------- developer camera panel */
.dbg { position: absolute; left: 6px; top: calc(env(safe-area-inset-top, 0px) + 64px); width: 270px; max-height: 44vh; overflow-y: auto; background: rgba(8,10,13,0.92); box-shadow: inset 0 0 0 1px var(--line), inset 3px 0 0 var(--yellow); padding: 10px; font: 11px/1.3 var(--f-mono); z-index: 10; }
.dbg.hidden, .fps.hidden { display: none; }
.dbg.mini { max-height: 34px; overflow: hidden; width: auto; }
.dbg .dbg-fold { display: block; margin: 0 0 6px; width: 100%; text-align: left; color: var(--yellow); }
.dbg > b { display: block; margin-bottom: 6px; color: var(--yellow); letter-spacing: 0.2em; }
.dbg label { display: grid; grid-template-columns: 74px 1fr 42px; gap: 6px; align-items: center; margin: 3px 0; color: var(--silver); }
.dbg input { accent-color: var(--yellow); }
.dbg button { font: 11px var(--f-mono); margin: 6px 4px 0 0; padding: 5px 8px; background: #1b2028; color: var(--ink); border: 0; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.fps { position: absolute; left: 6px; bottom: 6px; font: 11px var(--f-mono); color: #9f9; background: rgba(0,0,0,0.6); padding: 3px 6px; z-index: 11; pointer-events: none; }
.boot-error { color: var(--red); font-family: var(--f-mono); letter-spacing: 0.08em; }

/* ---------- responsive */
@media (min-aspect-ratio: 1/1) {                 /* landscape phones & desktop */
  .m-nav { max-width: 760px; }
  .hud-cluster { width: 170px; height: 170px; }
  .g-panel { max-width: 760px; }
  .spec { grid-template-columns: 180px 1fr; }
}
@media (max-height: 560px) and (min-aspect-ratio: 1/1) { .m-car { display: none; } .hud-hint { bottom: 18%; } }
@media (max-width: 360px) { .m-item { width: 180px; font-size: 15px; } .hud-cluster { width: 126px; height: 126px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01s !important; animation-iteration-count: 1 !important; transition-duration: 0.01s !important; } }

/* genuine 3D chrome logo canvas (logo3d.js) replaces the flat SVG mark */
.brand-mark { position: relative; }
.brand-mark canvas.logo3d { display: none; }
.brand-mark.has3d canvas.logo3d { display: block; width: 100%; pointer-events: none; }
.brand-mark.has3d svg { display: none; }
.t-logo.has3d { animation: none; filter: drop-shadow(0 10px 18px rgba(0,0,0,0.75)); }
.ps-logo.has3d { filter: drop-shadow(0 6px 10px rgba(0,0,0,0.7)); }
.dbg select { width: 100%; margin-top: 4px; font: 11px var(--f-mono); background: #1b2028; color: var(--ink); border: 0; box-shadow: inset 0 0 0 1px var(--line); padding: 4px; }
.dbg > b { margin-top: 10px; }

/* LANE RUSH PURSUIT rebrand */
.brand-mark .mk-sub { opacity: 0.92; }
.t-tag { margin-top: 1.2vh; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.55em; padding-left: 0.55em; color: rgba(220,226,234,0.7); }
.p-mark, .r-mark { width: min(40vw, 190px); margin: 0 auto 10px; opacity: 0.9; }
.t-logo.has3d + .t-tag { margin-top: 0.6vh; }

/* HEAT indicator: motorsport warning-light cluster, bottom-left (opposite the gauge) */
.hud-heat { position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); width: 132px; padding: 7px 9px 6px; background: linear-gradient(180deg, rgba(10,12,16,0.82), rgba(6,8,11,0.7)); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255,255,255,0.06); clip-path: polygon(0 0, 100% 0, 100% 78%, 90% 100%, 0 100%); pointer-events: none; --hc: #d9dde3; }
.hud-heat[data-level="2"] { --hc: #ffc21a; } .hud-heat[data-level="3"] { --hc: #ff8a1a; } .hud-heat[data-level="4"] { --hc: #ff3d2e; } .hud-heat[data-level="5"] { --hc: #ff2a4a; }
.hh-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.32em; color: var(--silver); }
.hh-head b { font-family: var(--f-head); font-size: 17px; letter-spacing: 0.02em; color: var(--hc); text-shadow: 0 0 10px color-mix(in srgb, var(--hc) 45%, transparent); }
.hh-bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; align-items: end; height: 26px; margin: 3px 0 4px; }
.hh-seg { position: relative; display: block; transform: skewX(-18deg); background: rgba(255,255,255,0.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); overflow: hidden; --fill: 0; }
.hh-seg:nth-child(1) { height: 40%; } .hh-seg:nth-child(2) { height: 55%; } .hh-seg:nth-child(3) { height: 70%; } .hh-seg:nth-child(4) { height: 85%; } .hh-seg:nth-child(5) { height: 100%; }
.hh-seg::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--fill) * 100%); background: linear-gradient(0deg, var(--hc), color-mix(in srgb, var(--hc) 60%, #fff)); transition: height 0.25s; }
.hh-seg.on { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hc) 55%, transparent), 0 0 8px color-mix(in srgb, var(--hc) 30%, transparent); }
.hud-heat[data-level="5"] .hh-seg.on::after { animation: heatMax 0.9s ease-in-out infinite alternate; }
@keyframes heatMax { from { filter: brightness(1); } to { filter: brightness(1.45); } }
.hh-name { font-family: var(--f-head); font-size: 10px; letter-spacing: 0.22em; color: var(--hc); white-space: nowrap; }
.r-grid .heat-row b { color: #ff9a3d; }

/* ---- cinematics (cinema.js) */
.cine { position: absolute; inset: 0; z-index: 30; pointer-events: none; display: none; --bar: 0.11; }
.cine.on { display: block; pointer-events: auto; }
.cine-bars i { position: absolute; left: 0; right: 0; height: calc(var(--bar) * 100%); background: #000; }
.cine-bars i:first-child { top: 0; } .cine-bars i:last-child { bottom: 0; }
.cine-fade { position: absolute; inset: 0; background: #000; opacity: 0; }
.cine-title { position: absolute; left: 0; right: 0; top: 34%; display: flex; justify-content: center; pointer-events: none; }
.cine-logo { width: min(92vw, 640px); }
.cine-logo:not(.has3d) { visibility: hidden; }
.cine-text { position: absolute; left: 0; right: 0; top: calc(34% + min(46vw, 320px)); text-align: center; }
.cine-line { opacity: 0; animation: cineIn 0.9s ease-out var(--in) forwards; }
.cine-line.tag { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.6em; padding-left: 0.6em; color: rgba(225,230,238,0.85); }
@keyframes cineIn { from { opacity: 0; transform: translateY(6px); letter-spacing: 0.9em; } to { opacity: 1; transform: none; } }
.cine-skip { position: absolute; right: 14px; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 4px); font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.3em; color: rgba(255,255,255,0.45); opacity: 0; transition: opacity 0.4s 1s; }
.cine.skippable .cine-skip { opacity: 1; }
/* studio ident */
.ident { position: absolute; inset: 0; z-index: 31; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; transition: opacity 0.6s; }
.ident.on { opacity: 1; }
.id-mark { position: relative; text-align: center; overflow: hidden; padding: 6px 4px; }
.id-mark b { display: block; font-family: var(--f-display, 'Russo One'), sans-serif; font-size: 30px; letter-spacing: 0.42em; padding-left: 0.42em; color: transparent; background: linear-gradient(180deg, #f4f6f9 0%, #c9ced6 46%, #6d737c 52%, #b7bdc6 100%); -webkit-background-clip: text; background-clip: text; }
.id-mark span { display: block; margin-top: 8px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.8em; padding-left: 0.8em; color: #8d949e; }
.id-mark::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent); transform: skewX(-20deg); mix-blend-mode: overlay; }
.ident.on .id-mark::after { animation: idSweep 1.6s 0.5s cubic-bezier(0.5, 0, 0.3, 1) forwards; }
.ident.on .id-mark b { animation: idIn 1.2s 0.15s ease-out both; }
@keyframes idSweep { to { left: 120%; } }
@keyframes idIn { from { opacity: 0; letter-spacing: 0.7em; } to { opacity: 1; } }
/* HUD arrives as the camera settles into the globe */
.hud.hud-in .hud-top, .hud.hud-in .hud-cluster, .hud.hud-in .hud-heat { animation: hudIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hud.hud-in .hud-cluster { animation-delay: 0.08s; } .hud.hud-in .hud-heat { animation-delay: 0.14s; }
@keyframes hudIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- interactive tutorial */
.tut { position: absolute; inset: 0; z-index: 12; pointer-events: none; display: none; }
.tut.on { display: block; }
.tut-card { position: absolute; left: 50%; top: calc(max(14px, env(safe-area-inset-top)) + 96px); transform: translateX(-50%); width: min(86vw, 360px); text-align: center; padding: 10px 14px 9px; background: linear-gradient(180deg, rgba(10,12,16,0.86), rgba(10,12,16,0.7)); box-shadow: inset 0 0 0 1px var(--line), inset 0 2px 0 var(--yellow); clip-path: polygon(0 0, 100% 0, 100% 80%, 94% 100%, 0 100%); }
.tut.tpop .tut-card { animation: tutPop 0.45s cubic-bezier(0.2, 0.9, 0.2, 1) both; }
@keyframes tutPop { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.tut-title { font-family: var(--f-head); font-size: 22px; letter-spacing: 0.12em; color: #fff; }
.tut-sub { margin-top: 3px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--silver); line-height: 1.45; }
.tut-steer { position: absolute; left: 50%; bottom: 30%; transform: translateX(-50%); display: none; align-items: center; gap: 14px; color: var(--yellow); font-size: 22px; }
.tut[data-step="steer"] .tut-steer { display: flex; }
.tut-steer b { width: 46px; height: 46px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,194,26,0.8); animation: tutDrag 1.4s ease-in-out infinite; }
@keyframes tutDrag { 0%, 100% { transform: translateX(-34px); } 50% { transform: translateX(34px); } }
.tut-skip { position: absolute; right: 12px; top: calc(max(14px, env(safe-area-inset-top)) + 60px); pointer-events: auto; font: 10px var(--f-mono); letter-spacing: 0.2em; padding: 6px 9px; color: var(--silver); background: rgba(10,12,16,0.7); border: 0; box-shadow: inset 0 0 0 1px var(--line); }
#app[data-tut="heat"] .hud-heat, #app[data-tut="cops"] .hud-heat { animation: tutRing 0.9s ease-in-out infinite alternate; }
#app[data-tut="combo"] .hud-combo { animation: tutRing 0.9s ease-in-out infinite alternate; }
@keyframes tutRing { from { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 0 rgba(255,194,26,0); } to { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 3px rgba(255,194,26,0.75); } }

/* ---- garage (aftermarket catalogue over the live 3D workshop) */
.gx { pointer-events: none; }
.gx > * { pointer-events: auto; }
.gx-top { position: absolute; left: 0; right: 0; top: 0; padding: calc(max(10px, env(safe-area-inset-top)) + 2px) 12px 10px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; background: linear-gradient(180deg, rgba(5,6,8,0.9), rgba(5,6,8,0)); }
.gx-title { text-align: center; line-height: 1.05; }
.gx-title small { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.4em; color: var(--silver); }
.gx-title b { display: block; font-family: var(--f-head); font-size: 22px; letter-spacing: 0.06em; color: #fff; text-transform: uppercase; }
.gx-title span { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.2em; color: var(--silver); }
.gx-title em { font-style: normal; }
.gx-cam { position: absolute; right: 10px; top: calc(max(10px, env(safe-area-inset-top)) + 62px); display: flex; flex-direction: column; gap: 6px; }
.gx-cam button { min-width: 38px; height: 34px; padding: 0 8px; font: 13px var(--f-mono); color: var(--ink); background: rgba(10,12,16,0.75); border: 0; box-shadow: inset 0 0 0 1px var(--line); }
.gx-stats { position: absolute; left: 10px; top: calc(max(10px, env(safe-area-inset-top)) + 62px); width: min(56vw, 230px); padding: 8px 9px; background: rgba(8,10,13,0.78); box-shadow: inset 0 0 0 1px var(--line); display: none; }
.gx-stats.show { display: block; }
.gs-figs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; margin-bottom: 6px; text-align: center; }
.gs-figs small { display: block; font: 7.5px var(--f-mono); letter-spacing: 0.12em; color: var(--silver); }
.gs-figs b { font-family: var(--f-head); font-size: 14px; color: #fff; } .gs-figs i { display: block; font: 7px var(--f-mono); color: var(--silver); font-style: normal; }
.gs-row { display: grid; grid-template-columns: 58px 1fr 24px; gap: 6px; align-items: center; font: 8.5px var(--f-mono); letter-spacing: 0.1em; color: var(--silver); margin: 3px 0; }
.gs-row i { position: relative; height: 5px; background: rgba(255,255,255,0.08); }
.gs-row em { position: absolute; left: 0; top: 0; bottom: 0; background: #d9dde3; }
.gs-row u { position: absolute; top: 0; bottom: 0; background: #5dff9d; }
.gs-row s { position: absolute; top: 0; bottom: 0; background: #ff4a4a; }
.gs-row b { font-family: var(--f-head); font-size: 11px; color: #fff; text-align: right; } .gs-row b.up { color: #5dff9d; } .gs-row b.dn { color: #ff6a5a; }
.gx-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 46vh; display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(10,12,16,0.92), rgba(6,7,9,0.97)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 -10px 30px rgba(0,0,0,0.5); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.gx-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 6px 8px 0; scrollbar-width: none; flex-shrink: 0; }
.gx-tabs::-webkit-scrollbar { display: none; }
.gx-tab { flex-shrink: 0; padding: 8px 10px 7px; font-family: var(--f-head); font-size: 12px; letter-spacing: 0.14em; color: var(--silver); background: transparent; border: 0; box-shadow: inset 0 -2px 0 rgba(255,255,255,0.06); }
.gx-tab.on { color: #fff; box-shadow: inset 0 -2px 0 var(--yellow); }
.gx-body { overflow-y: auto; padding: 4px 10px 6px; flex: 1; min-height: 120px; }
.gx-head { margin: 10px 0 4px; font: 9px var(--f-mono); letter-spacing: 0.3em; color: var(--yellow); }
.gx-item { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; margin: 2px 0; text-align: left; background: rgba(255,255,255,0.03); border: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); color: var(--ink); }
.gx-item.on { box-shadow: inset 0 0 0 1px rgba(255,194,26,0.7), inset 3px 0 0 var(--yellow); background: rgba(255,194,26,0.06); }
.gx-item.locked { opacity: 0.55; }
.gi-t { font-family: var(--f-head); font-size: 14px; letter-spacing: 0.04em; }
.gi-t small { display: block; font: 9px var(--f-mono); letter-spacing: 0.1em; color: var(--silver); margin-top: 1px; }
.gi-t em { font-style: normal; }
.gi-p { font: 10px var(--f-mono); letter-spacing: 0.1em; color: #ffd24a; white-space: nowrap; }
.gx-item.on .gi-p { color: #5dff9d; }
.gx-slider { display: grid; grid-template-columns: 88px 1fr 70px; gap: 8px; align-items: center; margin: 6px 0; font: 9.5px var(--f-mono); letter-spacing: 0.12em; color: var(--silver); }
.gx-slider input { accent-color: var(--yellow); }
.gx-slider b { font-family: var(--f-head); font-size: 12px; color: #fff; text-align: right; font-weight: 400; }
.gx-colors { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 7px 0; }
.gx-colors span { width: 100%; font: 9px var(--f-mono); letter-spacing: 0.2em; color: var(--silver); }
.gx-colors button { width: 24px; height: 24px; border: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25); }
.gx-colors button.on { box-shadow: 0 0 0 2px var(--yellow); }
.gx-colors input[type=color] { width: 34px; height: 26px; border: 0; padding: 0; background: none; }
.gx-toggle { display: flex; justify-content: space-between; align-items: center; padding: 8px 2px; font: 10px var(--f-mono); letter-spacing: 0.14em; color: var(--ink); }
.gx-toggle input { width: 20px; height: 20px; accent-color: var(--yellow); }
.gx-select, .gx-text { width: 100%; margin: 5px 0; padding: 8px; font: 12px var(--f-mono); color: var(--ink); background: #12151a; border: 0; box-shadow: inset 0 0 0 1px var(--line); }
.gx-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.gx-note { font: 10px/1.5 var(--f-mono); color: var(--silver); margin: 6px 0; }
.gx-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.gx-info small { display: block; font: 8px var(--f-mono); letter-spacing: 0.15em; color: var(--silver); } .gx-info b { font-family: var(--f-head); font-size: 13px; color: #fff; font-weight: 400; }
.gx-perf { padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.gx-perf > span { font-family: var(--f-head); font-size: 13px; } .gx-perf small { display: block; font: 8.5px var(--f-mono); color: var(--silver); letter-spacing: 0.08em; }
.gp-pips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 5px; }
.gp-pips button { padding: 5px 2px; font: 10px var(--f-head); letter-spacing: 0.1em; color: var(--silver); background: rgba(255,255,255,0.04); border: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07); }
.gp-pips button small { display: block; font: 7.5px var(--f-mono); letter-spacing: 0.04em; }
.gp-pips button.on { color: #111; background: linear-gradient(180deg, #ffd24a, #e0a812); }
.gp-pips button.cur { box-shadow: 0 0 0 1px #fff; }
.gx-bar { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px; align-items: center; padding: 7px 10px 2px; border-top: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.gx-cost b { display: block; font-family: var(--f-head); font-size: 16px; color: #ffd24a; } .gx-cost small { font: 8.5px var(--f-mono); letter-spacing: 0.14em; color: var(--silver); }
.gx-bar button:disabled { opacity: 0.35; }
.gx-dyno svg { width: 100%; height: auto; background: #07090c; box-shadow: inset 0 0 0 1px var(--line); }
.gx-dyno .dg { stroke: rgba(255,255,255,0.07); } .gx-dyno .dp { fill: none; stroke: #ffc21a; stroke-width: 2; } .gx-dyno .dq { fill: none; stroke: #7fe3ff; stroke-width: 1.5; } .gx-dyno .dt { fill: #9aa3ad; font: 8px monospace; }
.gd-read { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin: 6px 0; }
.gd-read small { display: block; font: 8px var(--f-mono); color: var(--silver); letter-spacing: 0.2em; } .gd-read b { font-family: var(--f-head); font-size: 20px; color: #fff; font-weight: 400; } .gd-read i { font: 8px var(--f-mono); color: var(--silver); font-style: normal; margin-left: 2px; }

/* ---- photo mode */
.photo { position: absolute; inset: 0; z-index: 25; pointer-events: none; display: none; }
.photo.on { display: block; }
.photo > * { pointer-events: auto; }
.ph-top { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; gap: 8px; padding: calc(max(10px, env(safe-area-inset-top)) + 2px) 10px 8px; background: linear-gradient(180deg, rgba(0,0,0,0.6), transparent); }
.ph-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 40vh; overflow-y: auto; padding: 8px 12px max(10px, env(safe-area-inset-bottom)); background: rgba(6,8,10,0.86); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08); }
.photo.hidden .ph-panel, .photo.hidden .ph-top button:not([data-ph="hide"]) { display: none; }
.photo.hidden .ph-top { background: none; }
.ph-presets { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; }
.ph-presets button { flex-shrink: 0; padding: 6px 9px; font: 10px var(--f-mono); letter-spacing: 0.08em; color: var(--ink); background: rgba(255,255,255,0.05); border: 0; box-shadow: inset 0 0 0 1px var(--line); }
.ph-sl { display: grid; grid-template-columns: 86px 1fr 96px; gap: 8px; align-items: center; margin: 5px 0; font: 9.5px var(--f-mono); letter-spacing: 0.12em; color: var(--silver); }
.ph-sl input { accent-color: var(--yellow); } .ph-sl b { font-family: var(--f-head); font-weight: 400; font-size: 12px; color: #fff; text-align: right; }
.ph-tg { display: inline-flex; align-items: center; gap: 6px; margin: 5px 10px 5px 0; font: 9.5px var(--f-mono); letter-spacing: 0.12em; color: var(--ink); }
.ph-tg input { accent-color: var(--yellow); }
/* driver profile */
.pf-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pf-grid div { padding: 8px; background: rgba(255,255,255,0.03); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); }
.pf-grid small { display: block; font: 8.5px var(--f-mono); letter-spacing: 0.18em; color: var(--silver); }
.pf-grid b { font-family: var(--f-head); font-size: 17px; color: #fff; font-weight: 400; }
.pf-title { text-align: center; margin: 4px 0 10px; } .pf-title b { font-family: var(--f-head); font-size: 24px; letter-spacing: 0.1em; color: var(--yellow); }

.ps-item span { white-space: nowrap; }
#m-track .ps-item span { font-size: clamp(18px, 6.2vw, 26px); }

.c-sec { margin: 12px 0 4px; font-size: 9px; letter-spacing: 0.3em; color: var(--yellow); }

.gx-bar .btn { padding: 8px 10px; font-size: 12px; }
.gx-bar .btn.primary { padding: 9px 14px; font-size: 14px; }
.gx-bar { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.gx-cost b { font-size: 14px; }

/* main-menu music toggle + tap-to-start */
.ps-music { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: calc(max(12px, env(safe-area-inset-bottom)) + 40px); display: flex; align-items: center; gap: 7px; padding: 7px 11px; font: 10px var(--f-mono); letter-spacing: 0.2em; color: var(--ink); background: rgba(10,12,16,0.78); border: 0; box-shadow: inset 0 0 0 1px var(--line); z-index: 3; }
.ps-music i { font-style: normal; font-size: 14px; color: var(--yellow); }
.ps-music.off { color: var(--silver); } .ps-music.off i { color: var(--silver); text-decoration: line-through; }
/* opening name card (lower third, NFS/PS2 style) */
.cine-line.card { position: fixed; left: 20px; text-align: left; transform: translateX(-14px); animation: cardIn 0.45s var(--snap) var(--in) forwards; }
.cine-line.card.k1 { bottom: calc(14% + 66px); font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.45em; color: var(--yellow); }
.cine-line.card.k2 { bottom: calc(14% + 30px); font-family: var(--f-head); font-style: italic; font-size: 30px; letter-spacing: 0.04em; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,0.7), 0 0 18px rgba(0,0,0,0.6); }
.cine-line.card.k2::after { content: ""; display: block; height: 3px; width: 64px; margin-top: 6px; background: linear-gradient(90deg, var(--yellow), transparent); }
.cine-line.card.k3 { bottom: 14%; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.32em; color: rgba(230,234,240,0.75); }
@keyframes cardIn { to { opacity: 1; transform: none; } }

/* ---------- settings: tabbed console page */
.st-panel { max-width: 560px; height: min(100%, 860px); }
.st-tabs { display: flex; gap: 4px; margin: 2px -16px 0; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.st-tabs::-webkit-scrollbar { display: none; }
.st-tab { flex: none; border: 0; cursor: pointer; padding: 9px 13px; font-family: var(--f-head); font-size: 12px; letter-spacing: 0.12em; color: rgba(236,239,244,0.62);
  background: rgba(255,255,255,0.05); transform: skewX(-12deg); transition: background 0.15s, color 0.15s; }
.st-tab.on { color: #120c00; background: linear-gradient(180deg, #ffe066, var(--yellow) 50%, #f0a200); box-shadow: 0 0 14px rgba(255,194,26,0.35); }
.st-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 6px; padding: 4px 2px 10px; animation: slideL 0.2s var(--snap); }
.st-head { margin: 10px 0 2px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.4em; color: var(--yellow); display: flex; align-items: center; gap: 10px; }
.st-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255,194,26,0.4), transparent); }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; background: linear-gradient(90deg, rgba(255,255,255,0.055), rgba(255,255,255,0.02)); box-shadow: inset 2px 0 0 rgba(255,194,26,0.0); transition: box-shadow 0.15s; }
.st-row:active, .st-row:focus-within { box-shadow: inset 3px 0 0 var(--yellow); }
.st-lbl { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.st-lbl b { font-family: var(--f-head); font-weight: 400; font-size: 14px; letter-spacing: 0.08em; color: var(--ink); }
.st-lbl small { font-size: 12px; line-height: 1.3; color: rgba(190,198,210,0.7); }
.st-switch { flex: none; position: relative; width: 74px; height: 30px; border: 0; cursor: pointer; background: rgba(255,255,255,0.08); box-shadow: inset 0 0 0 1px var(--line); transform: skewX(-12deg); transition: background 0.18s; }
.st-switch i { position: absolute; top: 3px; left: 3px; width: 30px; height: 24px; background: #5d6672; transition: left 0.18s var(--snap), background 0.18s; }
.st-switch span { position: absolute; right: 8px; top: 50%; transform: translateY(-50%) skewX(12deg); font-family: var(--f-head); font-size: 11px; letter-spacing: 0.1em; color: rgba(236,239,244,0.55); }
.st-switch.on { background: rgba(255,194,26,0.18); box-shadow: inset 0 0 0 1px rgba(255,194,26,0.6); }
.st-switch.on i { left: 41px; background: var(--yellow); box-shadow: 0 0 10px rgba(255,194,26,0.7); }
.st-switch.on span { right: auto; left: 9px; color: var(--yellow); }
.st-seg { flex: none; display: flex; gap: 3px; }
.st-seg button { border: 0; cursor: pointer; padding: 8px 10px; min-width: 44px; font-family: var(--f-head); font-size: 11px; letter-spacing: 0.08em; color: rgba(236,239,244,0.62); background: rgba(255,255,255,0.07); transform: skewX(-12deg); }
.st-seg button.on { color: #120c00; background: var(--yellow); box-shadow: 0 0 10px rgba(255,194,26,0.45); }
.st-slider { --v: 50%; flex: none; display: flex; align-items: center; gap: 10px; width: 46%; max-width: 230px; }
.st-slider input { -webkit-appearance: none; appearance: none; flex: 1; height: 26px; margin: 0; background: transparent; cursor: pointer; }
.st-slider input::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(90deg, var(--yellow) var(--v), rgba(255,255,255,0.12) var(--v)); transform: skewX(-20deg); }
.st-slider input::-moz-range-track { height: 6px; background: linear-gradient(90deg, var(--yellow) var(--v), rgba(255,255,255,0.12) var(--v)); }
.st-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 22px; margin-top: -8px; background: #fff; box-shadow: 0 0 10px rgba(255,194,26,0.8); transform: skewX(-12deg); }
.st-slider input::-moz-range-thumb { width: 12px; height: 22px; border: 0; border-radius: 0; background: #fff; box-shadow: 0 0 10px rgba(255,194,26,0.8); }
.st-slider output { width: 46px; text-align: right; font-family: var(--f-mono); font-size: 12px; color: var(--yellow); }
.st-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.st-stats div { padding: 10px 12px; background: rgba(255,255,255,0.05); }
.st-stats small { display: block; font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.3em; color: var(--steel); }
.st-stats b { display: block; margin-top: 4px; font-family: var(--f-head); font-weight: 400; font-size: 18px; color: var(--ink); }
.st-credit { padding: 10px 14px; background: rgba(255,255,255,0.04); border-left: 2px solid rgba(255,194,26,0.5); }
.st-credit b { display: block; font-family: var(--f-head); font-weight: 400; font-size: 13px; letter-spacing: 0.06em; color: var(--ink); }
.st-credit small { display: block; margin-top: 3px; font-size: 12px; line-height: 1.35; color: rgba(190,198,210,0.72); }
.st-foot { flex: none; padding: 10px 2px 2px; border-top: 1px solid var(--line); font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.08em; line-height: 1.5; color: rgba(190,198,210,0.6); }
.st-foot:empty { display: none; }
.btn.danger { color: #fff; background: linear-gradient(180deg, #d8323a, #8e1218); }
@media (max-width: 380px) { .st-row { flex-wrap: wrap; } .st-slider { width: 100%; max-width: none; } }

/* ---------- main menu, compact: a slim column on the left so the car stays in view */
.ps2 .ps-list { width: auto; max-width: min(66vw, 300px); align-self: flex-start; gap: 3px; }
.ps2 .ps-item { height: 33px; padding: 0 12px; gap: 10px; }
.ps2 .ps-item:nth-child(n) { margin-left: 0; }
.ps2 .ps-item:nth-child(2) { margin-left: 5px; } .ps2 .ps-item:nth-child(3) { margin-left: 10px; } .ps2 .ps-item:nth-child(4) { margin-left: 15px; }
.ps2 .ps-item:nth-child(5) { margin-left: 20px; } .ps2 .ps-item:nth-child(6) { margin-left: 25px; } .ps2 .ps-item:nth-child(7) { margin-left: 30px; animation-delay: 0.24s; }
.ps2 .ps-item:nth-child(6) { animation-delay: 0.22s; }
.ps2 .ps-item span { font-size: 16px; }
.ps2 .ps-item i { font-size: 10px; }
.ps2 .ps-item.sel { padding-left: 18px; }
.ps2 .ps-item::after { right: 12px; margin-top: -6px; border-left-width: 9px; border-top-width: 6px; border-bottom-width: 6px; }
.ps2 .ps-info { max-width: min(66vw, 300px); align-self: flex-start; margin-top: 8px; padding: 7px 10px; }
.ps2 .ps-desc { font-size: 13px; line-height: 1.3; }
.ps2 .ps-car { font-size: 10px; margin-top: 6px; padding-top: 6px; flex-direction: column; gap: 2px; }
.ps2 .ps-prompts { margin-top: 6px; }
/* tutorial not done yet: a slow, subtle pulse + NEW tag */
.ps-item.flash span { animation: tutFlash 2.2s ease-in-out infinite; }
.ps-item.flash span::after { content: "NEW"; margin-left: 8px; padding: 1px 4px; font-family: var(--f-mono); font-style: normal; font-size: 9px; letter-spacing: 0.15em; vertical-align: 3px; color: #120c00; background: var(--yellow); }
.ps-item.flash.sel span { animation: none; }
@keyframes tutFlash { 0%, 100% { color: rgba(244,245,247,0.78); text-shadow: 0 2px 0 rgba(0,0,0,0.8); } 50% { color: #ffe9a0; text-shadow: 0 0 12px rgba(255,194,26,0.75), 0 2px 0 rgba(0,0,0,0.8); } }

/* ---------- tutorial: mission card, slow-motion lesson panel */
.tut .tut-card { top: calc(max(14px, env(safe-area-inset-top)) + 92px); width: min(90vw, 380px); padding: 10px 16px 11px; }
.tut-step { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.32em; color: var(--yellow); }
.tut .tut-title { margin-top: 3px; font-size: 24px; font-style: italic; }
.tut .tut-sub { font-family: var(--f-body); font-size: 14px; letter-spacing: 0.02em; line-height: 1.35; color: rgba(236,239,244,0.9); margin-top: 5px; }
.tut-dots { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
.tut-dots i { width: 16px; height: 3px; background: rgba(255,255,255,0.18); }
.tut-dots i.done { background: rgba(255,194,26,0.55); } .tut-dots i.on { background: var(--yellow); box-shadow: 0 0 8px rgba(255,194,26,0.8); }
.tut::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.25s;
  background: radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(20,40,90,0.55) 100%); box-shadow: inset 0 0 0 2px rgba(255,194,26,0.35); }
.tut.slow::before { opacity: 1; }
.tut-slowtag { position: absolute; left: 50%; top: calc(max(14px, env(safe-area-inset-top)) + 64px); transform: translateX(-50%); padding: 3px 9px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.4em; color: #0b1a33; background: #9cc4ff; opacity: 0; transition: opacity 0.2s; }
.tut.slow .tut-slowtag { opacity: 1; animation: blink 0.9s steps(2) infinite; }
.tut-lesson { position: absolute; left: 50%; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 196px); width: min(90vw, 380px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 16px 12px; text-align: center; background: linear-gradient(180deg, rgba(8,10,14,0.9), rgba(8,10,14,0.78)); box-shadow: inset 0 0 0 1px var(--line), inset 0 -3px 0 var(--yellow);
  transition: opacity 0.18s, transform 0.25s var(--snap); }
.tut-lesson.on { opacity: 1; transform: translate(-50%, 0); }
.tut-lesson > small { display: block; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.42em; color: var(--silver); }
.tl-word { display: block; font-family: var(--f-head); font-style: italic; font-weight: 400; font-size: 46px; line-height: 1; letter-spacing: 0.04em; color: var(--yellow); text-shadow: 0 0 22px rgba(255,194,26,0.45), 0 3px 0 rgba(0,0,0,0.8); margin: 2px 0 6px; }
.tl-why { margin: 0 0 8px; font-size: 14px; line-height: 1.35; color: rgba(236,239,244,0.92); }
.tl-meter { display: flex; justify-content: center; align-items: baseline; gap: 8px; }
.tl-meter small { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.3em; color: var(--steel); }
.tl-gap { font-family: var(--f-head); font-size: 24px; font-variant-numeric: tabular-nums; }
.tl-tiers { display: flex; justify-content: center; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.tl-tiers span { padding: 2px 6px; font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.08em; color: rgba(236,239,244,0.45); background: rgba(255,255,255,0.05); }
.tl-tiers span.on { color: #120c00; background: var(--yellow); }
/* pursuit alert: a tag on top of the HEAT box (bottom-left), never over the road ahead */
.hud-pursuit { top: auto; left: max(12px, env(safe-area-inset-left)); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 80px); transform: none; width: 132px; box-sizing: border-box; justify-content: center; gap: 7px; padding: 4px 8px; font-size: 11px; letter-spacing: 0.24em; background: rgba(60, 8, 12, 0.82); box-shadow: inset 0 0 0 1px rgba(255, 60, 70, 0.55); }
.hud-pursuit i { width: 14px; height: 6px; }
/* lane-split call-out in the opening */
.cine-line.split { position: fixed; left: 0; right: 0; top: 40%; text-align: center; font-family: var(--f-head); font-style: italic; font-size: 34px; letter-spacing: 0.05em; color: #fff;
  text-shadow: 0 0 18px rgba(255,138,61,0.9), 0 3px 0 rgba(0,0,0,0.85); transform: scale(1.6) skewX(-8deg); animation: splitIn 0.35s cubic-bezier(0.2,1.4,0.4,1) var(--in) forwards; }
.cine-line.split2 { position: fixed; left: 0; right: 0; top: calc(40% + 46px); text-align: center; font-family: var(--f-head); font-size: 22px; color: #ff8a3d; text-shadow: 0 2px 0 #000; animation: cineIn 0.4s ease-out var(--in) forwards; }
@keyframes splitIn { from { opacity: 0; transform: scale(1.6) skewX(-8deg); } to { opacity: 1; transform: scale(1) skewX(-8deg); } }
/* opening title card at the needle thread: trailer-style tracked type, chrome fill, anamorphic streak */
.cine-line.needle { position: fixed; left: 0; right: 0; text-align: center; font-family: var(--f-body); font-weight: 700; text-transform: uppercase; opacity: 0;
  animation: needleIn 1.15s cubic-bezier(0.16, 0.8, 0.12, 1) var(--in) forwards, needleOut 0.3s ease-in calc(var(--out) - 0.3s) forwards; }
.cine-line.needle.n1 { top: 18.5%; font-size: clamp(13px, 3.6vw, 18px); font-weight: 600; letter-spacing: 0.86em; padding-left: 0.86em; color: rgba(236, 226, 206, 0.92);
  text-shadow: 0 0 12px rgba(255, 170, 70, 0.45); }
.cine-line.needle.n1::before, .cine-line.needle.n1::after { content: ""; display: inline-block; vertical-align: middle; width: clamp(28px, 10vw, 64px); height: 1px; margin: 0 1.1em 0 0; background: linear-gradient(90deg, transparent, rgba(255, 196, 110, 0.9)); transform-origin: right; animation: needleRule 1.2s var(--snap) var(--in) both; }
.cine-line.needle.n1::after { margin: 0 0 0 0.2em; background: linear-gradient(270deg, transparent, rgba(255, 196, 110, 0.9)); transform-origin: left; }
.cine-line.needle.n2 { top: calc(18.5% + clamp(22px, 6vw, 32px)); font-size: clamp(44px, 15vw, 92px); line-height: 1; letter-spacing: 0.1em; padding-left: 0.1em;
  background: linear-gradient(180deg, #ffffff 0%, #f4efe6 38%, #c9b48e 56%, #fff4dc 64%, #b08348 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 150, 50, 0.38)) drop-shadow(0 4px 2px rgba(0, 0, 0, 0.75)); }
.cine-line.needle.n2::before { content: ""; position: absolute; left: 50%; top: 52%; width: 120vw; height: 2px; margin-left: -60vw; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 170, 80, 0) 12%, rgba(255, 214, 160, 0.95) 50%, rgba(255, 170, 80, 0) 88%, transparent 100%);
  box-shadow: 0 0 14px 2px rgba(255, 150, 60, 0.55); mix-blend-mode: screen; animation: needleStreak 1.6s cubic-bezier(0.2, 0.7, 0.1, 1) var(--in) both; }
@keyframes needleIn { 0% { opacity: 0; filter: blur(14px); letter-spacing: 0.5em; transform: scale(1.12); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes needleOut { to { opacity: 0; filter: blur(8px); transform: scale(1.04); } }
@keyframes needleRule { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes needleStreak { 0% { transform: scaleX(0.05); opacity: 0; } 25% { opacity: 1; } 100% { transform: scaleX(1); opacity: 0.0; } }
.cine-line.needle.n2 { animation: needleIn2 1.2s cubic-bezier(0.16, 0.8, 0.12, 1) var(--in) forwards, needleOut2 0.3s ease-in calc(var(--out) - 0.3s) forwards; }
@keyframes needleIn2 { 0% { opacity: 0; letter-spacing: 0.42em; transform: scale(1.14); filter: blur(16px) drop-shadow(0 0 18px rgba(255, 150, 50, 0)) drop-shadow(0 4px 2px rgba(0, 0, 0, 0)); }
  55% { opacity: 1; } 100% { opacity: 1; transform: none; filter: blur(0) drop-shadow(0 0 18px rgba(255, 150, 50, 0.38)) drop-shadow(0 4px 2px rgba(0, 0, 0, 0.75)); } }
@keyframes needleOut2 { from { opacity: 1; filter: blur(0) drop-shadow(0 0 18px rgba(255, 150, 50, 0.38)) drop-shadow(0 4px 2px rgba(0, 0, 0, 0.75)); } to { opacity: 0; transform: scale(1.05); filter: blur(10px) drop-shadow(0 0 30px rgba(255, 150, 50, 0.6)) drop-shadow(0 4px 2px rgba(0, 0, 0, 0)); } }
