:root{color-scheme:dark;--ink:#f4f7fa;--muted:#9eabb7;--cyan:#73e2e2;--gold:#ffc77d;--glass:rgba(11,20,29,.62);--line:rgba(255,255,255,.13);--shadow:0 20px 70px rgba(0,0,0,.36)}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#101923;color:var(--ink);font-family:Manrope,system-ui,-apple-system,"Segoe UI",sans-serif;touch-action:none;-webkit-text-size-adjust:100%}button,a{font:inherit}button{color:inherit}#scene{position:fixed;inset:0;z-index:0}#scene canvas{display:block;width:100%;height:100%;outline:0}.vignette{position:fixed;inset:0;pointer-events:none;z-index:1;background:linear-gradient(180deg,rgba(4,10,16,.52),transparent 23%,transparent 67%,rgba(4,10,16,.62)),radial-gradient(ellipse at center,transparent 42%,rgba(3,8,13,.26) 100%)}
.topbar{position:fixed;top:0;left:0;right:0;z-index:5;height:78px;padding:0 34px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(255,255,255,.12);background:linear-gradient(180deg,rgba(5,12,19,.68),rgba(5,12,19,.10));backdrop-filter:blur(10px)}
.brand{display:flex;gap:11px;align-items:center;text-decoration:none;color:#fff;font-size:13px;letter-spacing:.17em;line-height:1.05}.brand b,.brand em{display:block;font-style:normal}.brand em{font-size:10px;color:#9bc4d0;letter-spacing:.31em;margin-top:5px}.brand-mark{display:grid;place-items:center;width:39px;height:39px;border-radius:12px;background:linear-gradient(135deg,#82e6df,#e9a86a);color:#14222b;font-weight:900;letter-spacing:-.04em;font-size:15px;box-shadow:0 5px 24px rgba(108,217,217,.2)}
.route-label{display:flex;align-items:center;gap:9px;font-size:10px;letter-spacing:.18em;font-weight:800;color:#edf5f8}.route-label small{margin-left:8px;color:#9caeb9;font-weight:600;font-size:9px}.live-dot{width:7px;height:7px;display:inline-block;border-radius:99px;background:#7be0c0;box-shadow:0 0 12px #7be0c0;flex:none}
.top-actions{display:flex;align-items:center;gap:8px}.glass-btn{border:1px solid var(--line);background:rgba(15,25,34,.53);border-radius:12px;min-height:39px;padding:0 12px;display:flex;align-items:center;gap:8px;font-size:11px;font-weight:700;letter-spacing:.02em;cursor:pointer;backdrop-filter:blur(14px);transition:.2s}.glass-btn:hover,.glass-btn:focus-visible{background:rgba(88,137,151,.28);border-color:rgba(140,227,225,.52);transform:translateY(-1px)}.glass-btn.icon-only{width:39px;padding:0;justify-content:center;font-size:17px}.btn-label{color:#d5e0e6}
.hud{position:fixed;inset:0;z-index:3;pointer-events:none;opacity:0;transition:opacity .4s}.hud.visible{opacity:1}.glass{background:var(--glass);border:1px solid var(--line);backdrop-filter:blur(18px);box-shadow:var(--shadow)}
.speed-card{position:absolute;left:34px;top:105px;width:220px;padding:17px 19px 15px;border-radius:17px}.eyebrow,.choice-title{font-size:9px;font-weight:800;letter-spacing:.19em;color:#afc1cc}.eyebrow{display:flex;align-items:center;gap:8px}.eyebrow .live-dot{width:6px;height:6px}.speed-line{display:flex;align-items:baseline;gap:8px;margin:7px 0 4px}.speed-line strong{font-size:59px;line-height:1;font-weight:800;letter-spacing:-.07em;font-variant-numeric:tabular-nums}.speed-line>span{font-size:10px;font-weight:800;letter-spacing:.17em;color:#9cb4bf}.rpm-label,.gear-line{display:flex;align-items:center;justify-content:space-between;font-size:9px;letter-spacing:.13em;color:#91a3af}.rpm-label b{color:#eaf2f6;letter-spacing:.04em}.rpm-track{height:4px;margin:8px 0 12px;border-radius:8px;background:rgba(255,255,255,.12);overflow:hidden}.rpm-track i{display:block;height:100%;width:0;background:linear-gradient(90deg,#5ecfc1,#ffc36d,#fb7c61);border-radius:8px;transition:width .12s}.gear-line{padding-top:10px;border-top:1px solid var(--line)}.gear-line b{font-size:17px;color:#fff;letter-spacing:0}.gear-line .gear-mode{color:#6fd9d6;font-size:8px;font-weight:800}
.map-card{position:absolute;right:34px;top:105px;width:210px;border-radius:17px;padding:13px 15px 11px}.map-head{display:flex;justify-content:space-between;font-size:9px;letter-spacing:.16em;color:#afc1cc;font-weight:800}.map-head b{color:#70d8d3;font-size:8px}.map-card canvas{width:100%;height:auto;display:block;margin:4px auto 1px;max-width:170px}.map-foot{font-size:9px;color:#9aabb7;letter-spacing:.03em}.map-foot span{color:#73dfd7;font-size:14px;margin-right:4px}
.distance-card{position:absolute;left:34px;bottom:82px;display:flex;gap:23px;padding:12px 17px;border-radius:14px}.distance-card div{display:flex;flex-direction:column;gap:4px}.distance-card small{font-size:8px;letter-spacing:.14em;color:#94a6b1;font-weight:800}.distance-card b{font-size:14px;font-weight:800;font-variant-numeric:tabular-nums}.distance-card i{font-size:9px;color:#9aabb7;font-style:normal}.condition{color:#7ee0c2!important}.condition-dot{display:inline-block;width:6px;height:6px;background:#72dcb6;border-radius:50%;margin:0 4px 1px 0}.message-pill{position:absolute;bottom:91px;left:50%;transform:translateX(-50%);background:rgba(7,15,22,.46);border:1px solid rgba(255,255,255,.12);border-radius:99px;padding:9px 16px;color:#d9e5e9;font-size:10px;letter-spacing:.04em;backdrop-filter:blur(10px);white-space:nowrap}
.bottom-bar{position:fixed;bottom:0;left:0;right:0;z-index:5;min-height:61px;padding:0 34px;display:flex;align-items:center;justify-content:space-between;background:linear-gradient(0deg,rgba(4,10,16,.65),rgba(4,10,16,.08));pointer-events:none}.keyboard-help{display:flex;gap:18px;color:#aebbc4;font-size:9px;letter-spacing:.02em}.keyboard-help span{display:flex;align-items:center;gap:4px}.keyboard-help kbd{font:700 8px Manrope,system-ui;color:#e9f0f3;border:1px solid rgba(255,255,255,.23);border-radius:5px;padding:3px 5px;background:rgba(255,255,255,.08)}.back-link{pointer-events:auto;text-decoration:none;color:#c4d2da;font-size:10px;font-weight:700}.back-link:hover{color:#fff}
.overlay{position:fixed;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;padding:95px 18px 75px;background:linear-gradient(90deg,rgba(5,11,17,.62),rgba(5,11,17,.1) 65%,rgba(5,11,17,.25));transition:opacity .45s,visibility .45s}.overlay.hidden{opacity:0;visibility:hidden;pointer-events:none}.start-card{width:min(470px,94vw);margin-left:min(38vw,470px);padding:30px 32px 24px;border:1px solid rgba(255,255,255,.19);border-radius:23px;background:linear-gradient(145deg,rgba(13,25,36,.92),rgba(7,15,23,.86));backdrop-filter:blur(24px);box-shadow:0 35px 120px rgba(0,0,0,.5);position:relative;overflow:hidden}.start-card:before{content:"";position:absolute;width:240px;height:240px;border-radius:50%;right:-130px;top:-150px;background:rgba(106,216,213,.17);filter:blur(25px);pointer-events:none}.card-topline{font-size:8px;font-weight:800;letter-spacing:.18em;color:#8fa5b3;display:flex;gap:8px;align-items:center}.card-topline .live-dot{width:6px;height:6px}.hero-title{font-weight:900;letter-spacing:-.065em;font-size:clamp(36px,5vw,56px);line-height:1;margin:20px 0 12px;color:#f4f7f8}.hero-title span{display:block;color:transparent;background:linear-gradient(95deg,#7de2dc,#f5bd83);background-clip:text;-webkit-background-clip:text}.hero-copy{color:#afbdc7;font-size:12px;line-height:1.8;margin:0 0 20px;max-width:38ch}.spec-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:13px 0;margin-bottom:17px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.spec-row div{display:flex;flex-direction:column;gap:2px}.spec-row b{font-size:20px;letter-spacing:-.04em;color:#fff}.spec-row small{font-size:7px;letter-spacing:.14em;color:#93a7b3;font-weight:800}.choice-title{margin:15px 0 8px;font-size:8px}.mode-row{display:flex;gap:7px}.mode-btn{flex:1;display:flex;align-items:center;justify-content:center;gap:7px;padding:9px 8px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.035);font-size:11px;cursor:pointer;transition:.2s}.mode-btn span{font-size:10px;color:#c5d0d8}.mode-btn.active{border-color:rgba(116,224,218,.7);background:rgba(99,202,197,.12);box-shadow:inset 0 0 0 1px rgba(116,224,218,.1)}.paint-row{display:flex;align-items:center;gap:11px;padding:3px 0 2px}.paint{width:23px;height:23px;border-radius:50%;border:2px solid rgba(255,255,255,.3);background:var(--paint);cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.4);transition:.18s}.paint.active{outline:2px solid #8ce7df;outline-offset:3px;transform:scale(1.05)}.start-btn{width:100%;margin-top:21px;border:0;border-radius:12px;padding:15px 17px;background:linear-gradient(105deg,#77e0d9,#e8b37a);color:#0d2028;display:flex;align-items:center;justify-content:space-between;font-size:10px;letter-spacing:.16em;font-weight:900;cursor:pointer;box-shadow:0 9px 28px rgba(105,210,203,.18);transition:.2s}.start-btn:hover{transform:translateY(-2px);filter:brightness(1.08);box-shadow:0 12px 35px rgba(105,210,203,.28)}.start-btn b{font-size:21px;font-weight:500}.load-status{min-height:17px;text-align:center;color:#91a7b3;font-size:9px;margin-top:10px}.fine-print{margin-top:8px;text-align:center;color:#748793;font-size:8px;line-height:1.5}
.pause-panel{position:fixed;z-index:11;top:50%;left:50%;transform:translate(-50%,-50%);width:min(370px,calc(100vw - 30px));border-radius:20px;padding:26px;text-align:center}.pause-panel.hidden{display:none}.pause-kicker{font-size:8px;letter-spacing:.2em;color:#77ded7;font-weight:900}.pause-panel h2{font-size:34px;margin:8px 0 4px;letter-spacing:-.05em}.pause-panel p{font-size:11px;color:#a5b4bf;margin:0 0 8px}.start-btn.compact{margin-top:13px}.secondary-btn{display:block;width:100%;padding:11px;margin-top:8px;background:rgba(255,255,255,.045);border:1px solid var(--line);border-radius:10px;font-size:10px;color:#d8e3e9;cursor:pointer}.secondary-btn:hover{background:rgba(255,255,255,.1)}
.toast{position:fixed;z-index:20;top:90px;left:50%;transform:translate(-50%,-8px);opacity:0;pointer-events:none;padding:10px 16px;border-radius:99px;border:1px solid rgba(255,255,255,.18);background:rgba(8,18,27,.86);color:#eef6f7;font-size:10px;backdrop-filter:blur(12px);transition:.25s}.toast.show{opacity:1;transform:translate(-50%,0)}.error-box{position:fixed;z-index:30;left:50%;top:50%;transform:translate(-50%,-50%);width:min(470px,90vw);padding:22px;border:1px solid rgba(255,160,120,.4);border-radius:15px;background:#221b1a;color:#f9d8ca;text-align:center;font-size:14px;line-height:1.65}.hidden{display:none!important}
.touch-controls{display:none;pointer-events:auto;gap:16px;align-items:flex-end}.steer-pair,.pedal-pair{display:flex;gap:8px;align-items:center}.touch-btn{touch-action:none;user-select:none;-webkit-user-select:none;border:1px solid rgba(255,255,255,.25);background:rgba(10,20,29,.62);backdrop-filter:blur(12px);box-shadow:0 4px 20px rgba(0,0,0,.24);cursor:pointer}.touch-btn:active,.touch-btn.pressed{background:rgba(106,213,209,.3);border-color:#7ae2db;transform:scale(.97)}.touch-btn.steering{width:54px;height:54px;border-radius:15px;font-size:35px;line-height:1;color:#e6f2f2}.touch-btn.brake,.touch-btn.gas{height:54px;min-width:67px;border-radius:14px;font-size:9px;font-weight:900;letter-spacing:.1em}.touch-btn.gas{min-width:84px;background:rgba(82,183,155,.24);border-color:rgba(115,226,194,.55);color:#c5f7e4}.touch-btn.gas span{font-size:13px;margin-left:3px}.touch-btn.brake{color:#ffc5b8;border-color:rgba(245,145,126,.45)}
@media(max-width:900px){.topbar{padding:0 18px}.route-label{display:none}.top-actions{margin-left:auto}.btn-label{display:none}.glass-btn{width:39px;justify-content:center;padding:0}.speed-card{left:18px;top:91px;width:170px;padding:13px 14px}.speed-line strong{font-size:47px}.map-card{right:18px;top:91px;width:155px;padding:10px}.map-card canvas{max-width:125px}.distance-card{left:18px;bottom:78px;gap:13px;padding:10px 12px}.message-pill{bottom:145px}.bottom-bar{padding:0 18px}.keyboard-help{gap:8px}.keyboard-help span{gap:3px}.keyboard-help kbd{padding:2px 4px}}
@media(max-width:650px){.topbar{height:61px;padding:0 12px}.brand-mark{width:34px;height:34px}.brand{font-size:11px}.brand em{font-size:8px}.top-actions{gap:5px}.glass-btn,.glass-btn.icon-only{width:34px;min-height:34px;border-radius:10px;font-size:14px}.speed-card{top:72px;left:10px;width:138px;padding:10px 11px;border-radius:13px}.eyebrow{font-size:7px;letter-spacing:.12em}.speed-line strong{font-size:39px}.speed-line>span{font-size:8px}.rpm-label,.gear-line{font-size:7px}.map-card{top:72px;right:10px;width:124px;padding:8px 9px;border-radius:13px}.map-head{font-size:7px}.map-card canvas{max-width:100px}.map-foot{font-size:7px}.distance-card{left:10px;bottom:84px;padding:8px 10px;gap:10px;border-radius:11px}.distance-card small{font-size:6px}.distance-card b{font-size:11px}.distance-card i{font-size:7px}.distance-card div:nth-child(3){display:none}.message-pill{bottom:151px;font-size:8px;padding:7px 11px;max-width:75vw;overflow:hidden;text-overflow:ellipsis}.bottom-bar{min-height:76px;padding:0 11px 7px;align-items:flex-end;justify-content:center}.keyboard-help{display:none}.touch-controls{display:flex}.back-link{position:absolute;right:12px;bottom:18px;font-size:8px}.overlay{padding:76px 12px 95px;align-items:flex-end;background:linear-gradient(180deg,rgba(5,11,17,.05),rgba(5,11,17,.3) 30%,rgba(5,11,17,.75))}.start-card{margin:0;width:min(440px,100%);padding:20px 20px 17px;border-radius:20px}.hero-title{font-size:39px;margin:13px 0 8px}.hero-copy{font-size:10px;line-height:1.6;margin-bottom:12px}.spec-row{padding:8px 0;margin-bottom:9px}.spec-row b{font-size:16px}.choice-title{margin:9px 0 6px}.mode-btn{padding:7px 4px;font-size:10px}.mode-btn span{font-size:9px}.paint{width:21px;height:21px}.start-btn{margin-top:13px;padding:12px 14px}.fine-print{font-size:7px;margin-top:5px}.load-status{font-size:8px}.pause-panel{padding:22px}.toast{top:69px}}
@media(max-height:650px) and (min-width:651px){.start-card{padding:18px 24px}.hero-title{font-size:40px;margin:12px 0 8px}.hero-copy{margin-bottom:10px}.spec-row{margin-bottom:8px;padding:7px 0}.choice-title{margin:8px 0 5px}.start-btn{margin-top:10px;padding:12px}.fine-print{margin-top:4px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}


.device-panel{position:fixed;z-index:25;left:50%;top:50%;transform:translate(-50%,-50%);width:min(560px,calc(100vw - 28px));max-height:min(88vh,760px);overflow:auto;padding:28px;border-radius:21px;background:rgba(9,19,28,.96);box-shadow:0 35px 120px rgba(0,0,0,.58)}
.device-panel.hidden{display:none}.device-close{position:absolute;right:15px;top:12px;width:34px;height:34px;border-radius:10px;border:1px solid var(--line);background:rgba(255,255,255,.06);color:#fff;font-size:22px;cursor:pointer}
.device-kicker{font-size:8px;letter-spacing:.2em;font-weight:900;color:#7de0d8}.device-panel h2{font-size:28px;letter-spacing:-.05em;margin:8px 0}.device-panel>p{font-size:11px;line-height:1.7;color:#a8b8c2;max-width:58ch;margin:0 0 16px}
.device-status{padding:11px 13px;border:1px solid rgba(116,224,218,.25);border-radius:10px;background:rgba(88,204,194,.08);font-size:11px;font-weight:800;color:#c7f1e9}
.device-meta{font-size:9px;color:#91a5b1;margin:7px 2px 14px;line-height:1.5}.device-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
.device-field{display:flex;flex-direction:column;gap:7px;font-size:9px;font-weight:800;letter-spacing:.06em;color:#b9c9d1;margin-top:10px}
.device-field select{width:100%;min-height:39px;padding:0 10px;border:1px solid rgba(255,255,255,.15);border-radius:9px;background:#14232e;color:#eff7f7;font:inherit;letter-spacing:0}
.device-options{display:flex;flex-wrap:wrap;gap:12px 18px;margin:17px 0 6px}.device-options label{display:flex;align-items:center;gap:7px;font-size:9px;color:#c4d2d9}.device-options input{accent-color:#78dfd8;width:14px;height:14px}
.sensitivity-field{display:grid;grid-template-columns:1fr auto;align-items:center}.sensitivity-field input{grid-column:1/-1;width:100%;accent-color:#78dfd8}.sensitivity-field span{color:#7de0d8}
.device-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:16px}.device-actions .secondary-btn,.device-actions .start-btn{margin:0;min-height:42px}.device-hint{font-size:9px;line-height:1.6;color:#8296a2;margin-top:14px}
@media(max-width:650px){.device-panel{padding:22px 17px;border-radius:18px}.device-panel h2{font-size:23px}.device-grid{gap:7px}.device-field{font-size:8px}.device-field select{font-size:10px}.device-options{gap:10px}.device-options label{font-size:8px}.device-actions{grid-template-columns:1fr}.device-actions .start-btn{margin:0}}


.device-telemetry{border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.035);border-radius:9px;padding:9px 11px;margin:9px 0 14px;color:#84ddd5;font-size:9px;font-variant-numeric:tabular-nums;line-height:1.6}


/* Garage selection */
.vehicle-picker{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:10px 0 4px}
.vehicle-card{position:relative;min-width:0;min-height:84px;display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid rgba(255,255,255,.13);border-radius:13px;background:linear-gradient(145deg,rgba(255,255,255,.065),rgba(255,255,255,.018));color:#edf5f7;text-align:left;cursor:pointer;transition:border-color .2s,background .2s,transform .2s}
.vehicle-card:hover{transform:translateY(-2px);border-color:rgba(124,224,218,.45)}
.vehicle-card.active{border-color:#79e0d8;background:linear-gradient(145deg,rgba(103,218,208,.17),rgba(255,255,255,.035));box-shadow:inset 0 0 0 1px rgba(121,224,216,.18),0 8px 25px rgba(0,0,0,.16)}
.vehicle-art{position:relative;display:block;flex:0 0 86px;width:86px;height:54px;overflow:hidden;border-radius:9px;background:radial-gradient(ellipse at 50% 100%,rgba(111,208,207,.15),transparent 70%),linear-gradient(145deg,rgba(8,16,23,.75),rgba(39,57,67,.4))}
.vehicle-art:before{content:"";position:absolute;left:8px;bottom:13px;width:72px;height:22px;background:linear-gradient(180deg,#d9e7eb,#758b98 64%,#26343f);filter:drop-shadow(0 5px 4px rgba(0,0,0,.48))}
.vehicle-art:after{content:"";position:absolute;left:19px;bottom:7px;width:12px;height:12px;border:3px solid #0a1117;border-radius:50%;background:#9eafb7;box-shadow:45px 0 0 -3px #9eafb7,45px 0 0 0 #0a1117}
.vehicle-art--spectral:before{clip-path:polygon(0 78%,7% 54%,24% 46%,38% 12%,70% 10%,82% 44%,90% 40%,95% 22%,100% 22%,97% 48%,100% 100%,0 100%);border-radius:10px 18px 6px 6px;background:linear-gradient(180deg,#d5dee4,#8b9aa6 52%,#2a333c)}
.vehicle-art--suv:before{left:10px;bottom:13px;width:68px;height:27px;clip-path:polygon(0 38%,12% 26%,20% 4%,72% 4%,86% 29%,100% 40%,100% 100%,0 100%);border-radius:5px;background:linear-gradient(180deg,#e4e9e9,#89969b 62%,#34414a)}
.vehicle-copy{display:flex;min-width:0;flex:1;flex-direction:column;gap:3px}
.vehicle-copy b{font-size:9px;font-weight:900;letter-spacing:.055em;white-space:nowrap}
.vehicle-copy small{font-size:8px;line-height:1.35;color:#aebdc6}
.vehicle-copy em{margin-top:2px;color:#77e0d8;font-size:7px;font-style:normal;font-weight:900;letter-spacing:.13em}
.vehicle-card:not(.active) .vehicle-copy em{color:#80929d}
.vehicle-check{position:absolute;right:8px;top:7px;width:16px;height:16px;display:grid;place-items:center;border-radius:50%;background:#78e0d8;color:#10242b;font-size:10px;font-weight:900;opacity:0;transform:scale(.7);transition:.18s}
.vehicle-card.active .vehicle-check{opacity:1;transform:scale(1)}
/* A scroll-safe garage panel on short phones */
.start-card{max-height:calc(100svh - 34px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:rgba(123,220,215,.4) transparent}
.overlay{overflow-y:auto}
@media(max-width:650px){
 .overlay{align-items:center;padding:70px 10px 18px}
 .start-card{max-height:calc(100svh - 86px);padding:17px 15px 14px}
 .vehicle-picker{gap:7px}
 .vehicle-card{min-height:73px;gap:7px;padding:7px}
 .vehicle-art{flex-basis:68px;width:68px;height:48px}
 .vehicle-art:before{left:5px;width:59px}
 .vehicle-art:after{left:13px;box-shadow:37px 0 0 -3px #9eafb7,37px 0 0 0 #0a1117}
 .vehicle-art--suv:before{left:7px;width:56px}
 .vehicle-copy b{font-size:8px}
 .vehicle-copy small{font-size:7px}
 .vehicle-copy em{font-size:6px}
}
@media(max-width:370px){.vehicle-card{gap:5px;padding:6px}.vehicle-art{flex-basis:58px;width:58px}.vehicle-art:before{width:52px}.vehicle-art:after{left:11px;box-shadow:32px 0 0 -3px #9eafb7,32px 0 0 0 #0a1117}.vehicle-copy b{font-size:7px}}

.score-card{position:absolute;right:34px;bottom:82px;display:flex;gap:18px;padding:12px 17px;border-radius:14px}
.score-card div{display:flex;flex-direction:column;gap:4px}
.score-card small{font-size:8px;letter-spacing:.14em;color:#94a6b1;font-weight:800}
.score-card b{font-size:14px;font-weight:800;font-variant-numeric:tabular-nums}
.start-btn:disabled{opacity:.62;cursor:wait;filter:saturate(.7);transform:none;box-shadow:none}
.util-pair{display:flex;flex-direction:column;gap:8px}
.touch-btn.horn,.touch-btn.handbrake{height:44px;min-width:72px;border-radius:12px;font-size:8px;font-weight:900;letter-spacing:.12em}
.touch-btn.horn{color:#ffe7a8;border-color:rgba(255,210,120,.5);background:rgba(120,90,30,.28)}
.touch-btn.handbrake{color:#ffd0c4;border-color:rgba(245,145,126,.4)}
.speed-lines{position:fixed;inset:0;z-index:2;pointer-events:none;opacity:0;background:repeating-linear-gradient(108deg,transparent 0 42px,rgba(255,255,255,.14) 43px,transparent 45px),repeating-linear-gradient(72deg,transparent 0 50px,rgba(255,255,255,.08) 51px,transparent 53px);-webkit-mask-image:linear-gradient(90deg,#000 0%,#000 10%,transparent 20%,transparent 80%,#000 90%,#000 100%);mask-image:linear-gradient(90deg,#000 0%,#000 10%,transparent 20%,transparent 80%,#000 90%,#000 100%);transition:opacity .2s}
.crack-overlay{position:fixed;inset:0;z-index:4;pointer-events:none;opacity:0;background:
  radial-gradient(circle at 30% 20%,rgba(255,255,255,.05),transparent 24%),
  linear-gradient(118deg,transparent 46%,rgba(255,255,255,.28) 46.3%,transparent 46.6%),
  linear-gradient(72deg,transparent 52%,rgba(255,255,255,.22) 52.4%,transparent 52.8%),
  linear-gradient(24deg,transparent 38%,rgba(220,230,240,.18) 38.3%,transparent 38.7%),
  linear-gradient(154deg,transparent 61%,rgba(255,255,255,.16) 61.35%,transparent 61.7%);
  mix-blend-mode:screen;transition:opacity .3s}

html.touch-ui .keyboard-help{display:none}
html.touch-ui .touch-controls{display:flex}
html.touch-ui .bottom-bar{min-height:84px;align-items:flex-end;padding-bottom:max(10px,env(safe-area-inset-bottom))}
.topbar{padding-left:max(18px,calc(env(safe-area-inset-left) + 12px));padding-right:max(18px,calc(env(safe-area-inset-right) + 12px))}
.overlay,.start-card,.device-panel,.pause-panel{touch-action:pan-y}

@media(max-width:900px){
  .score-card{right:18px;bottom:78px;gap:12px;padding:10px 12px}
}
@media(max-width:650px){
  .map-card{display:none}
  .score-card{top:72px;right:10px;bottom:auto;flex-direction:column;width:108px;gap:7px;padding:8px 10px;border-radius:13px}
  .score-card small{font-size:6px}
  .score-card b{font-size:12px}
  .touch-btn.steering{width:62px;height:62px}
  .touch-btn.brake,.touch-btn.gas{height:62px}
  .touch-btn.horn,.touch-btn.handbrake{height:48px;min-width:68px}
  .message-pill{max-width:62vw}
}
@media(orientation:landscape) and (max-height:520px){
  .topbar{height:52px}
  .speed-card{top:58px;transform:scale(.86);transform-origin:top left}
  .map-card{top:58px;transform:scale(.86);transform-origin:top right}
  .score-card{bottom:70px}
  .distance-card{bottom:70px}
  .message-pill{bottom:118px}
  .touch-btn.steering{width:66px;height:66px}
  .touch-btn.gas,.touch-btn.brake{height:66px;min-width:78px}
  .hero-title{font-size:32px}
  .start-card{max-height:calc(100svh - 24px)}
  .overlay{padding:18px 12px}
}

body.playing .back-link{display:none}
@media(orientation:landscape) and (max-height:520px){
  .distance-card,.map-card{display:none}
  .message-pill{bottom:78px;font-size:8px}
  .score-card{right:12px;bottom:auto;top:58px;transform:scale(.9);transform-origin:top right}
  .bottom-bar{min-height:70px;padding:0 14px max(8px,env(safe-area-inset-bottom))}
  .touch-controls{gap:10px}
}

/* === Compact HUD v2 === */
.topbar{height:56px;background:linear-gradient(180deg,rgba(5,12,19,.42),rgba(5,12,19,.06));border-bottom-color:rgba(255,255,255,.08)}
body.playing .topbar{height:52px}
.more-btn{display:none}
.hud-strip{position:absolute;left:18px;top:64px;display:flex;align-items:center;gap:14px;padding:7px 12px;border-radius:12px;background:rgba(8,16,23,.76);border:1px solid rgba(255,255,255,.14);backdrop-filter:blur(12px);box-shadow:0 8px 28px rgba(0,0,0,.18);pointer-events:none;max-width:min(640px,46vw);z-index:4;color:#eef6f8}
.strip-primary{display:flex;align-items:baseline;gap:8px;white-space:nowrap}
.strip-primary strong{font-size:28px;line-height:1;font-weight:800;letter-spacing:-.06em;font-variant-numeric:tabular-nums;color:#fff}
.strip-primary>span{font-size:9px;font-weight:800;letter-spacing:.14em;color:#9cb4bf}
.strip-primary b{font-size:18px;color:#f5c58a;margin-left:4px}
.strip-primary small{font-size:9px;color:#91a3af;letter-spacing:.04em}
.strip-rpm{width:72px;height:3px;margin:0;background:rgba(255,255,255,.12)}
.strip-stats{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.strip-stats span{display:flex;flex-direction:column;gap:1px;min-width:34px}
.strip-stats em{font-style:normal;font-size:7px;letter-spacing:.12em;color:#8ea0aa;font-weight:800}
.strip-stats b{font-size:12px;font-weight:800;font-variant-numeric:tabular-nums}
.map-card{top:64px;right:18px;width:168px;padding:8px 10px;background:rgba(8,16,23,.4)}
.message-pill{bottom:72px;padding:6px 12px;font-size:9px;background:rgba(7,15,22,.5)}
.message-pill:empty,.message-pill.hidden{opacity:0;visibility:hidden;pointer-events:none}
body.cam-cockpit .strip-primary,body.cam-cockpit .strip-rpm,body.cam-cockpit .map-card{display:none}
body.cam-cockpit .hud-strip{left:auto;right:18px;top:64px;max-width:none}
body.hud-hidden .hud,body.hud-hidden .top-actions,body.hud-hidden .more-btn,body.hud-hidden .keyboard-help,body.hud-hidden .route-label{opacity:0!important;visibility:hidden;pointer-events:none}
body.hud-hidden .topbar{background:transparent;border-color:transparent}
body.hud-hidden .touch-controls{opacity:1;visibility:visible;pointer-events:auto}

html.touch-ui .more-btn{display:grid;place-items:center}
html.touch-ui .top-actions{display:none;position:absolute;top:54px;right:10px;flex-direction:column;align-items:stretch;gap:6px;padding:8px;border-radius:14px;background:rgba(8,16,23,.92);border:1px solid rgba(255,255,255,.12);z-index:8;min-width:186px}
html.touch-ui .top-actions.open{display:flex}
html.touch-ui .top-actions .glass-btn{width:auto;justify-content:flex-start;padding:0 10px}
html.touch-ui .top-actions .btn-label{display:inline}
html.touch-ui .map-card{display:none}
html.touch-ui .hud-strip{left:10px;right:56px;top:54px;max-width:none;padding:6px 10px;gap:10px}
html.touch-ui .strip-primary strong{font-size:22px}
html.touch-ui body.cam-cockpit .hud-strip,body.cam-cockpit.touch-ui .hud-strip{left:10px;right:56px}
html.touch-ui .strip-record{display:none}
html.touch-ui .touch-controls{gap:8px}
html.touch-ui .touch-btn.steering{width:46px;height:46px;font-size:28px}
html.touch-ui .touch-btn.brake,html.touch-ui .touch-btn.gas{height:46px;min-width:62px}
html.touch-ui .touch-btn.horn,html.touch-ui .touch-btn.handbrake{height:40px;min-width:58px;font-size:8px}
html.touch-ui .util-pair{flex-direction:row}
html.touch-ui .bottom-bar{min-height:62px;padding:0 10px max(8px,env(safe-area-inset-bottom))}
html.touch-ui .message-pill{bottom:72px;max-width:58vw}

@media(max-width:650px){
  .speed-card,.score-card,.distance-card{display:none!important}
  .hud-strip{display:flex}
}
@media(orientation:landscape) and (max-height:520px){
  .topbar{height:44px}
  .hud-strip{top:48px;padding:4px 10px}
  .strip-primary strong{font-size:20px}
  .message-pill{bottom:64px}
  html.touch-ui .top-actions{top:46px}
}

@media(min-width:1100px){
  .hud-strip{left:22px;top:68px}
  .map-card{right:22px;top:68px}
}

.pause-stats{margin:8px 0 14px;font-size:12px;letter-spacing:.04em;color:#9cb8c1}
.pause-stats b{color:#eaf4f4}

html.touch-ui .hud-strip{left:10px;right:auto;width:auto;max-width:calc(100% - 66px);flex-wrap:nowrap}
html.touch-ui body.cam-cockpit .hud-strip{left:auto;right:56px;max-width:min(320px,70vw)}
@media (orientation:portrait) and (max-width:600px){
  html.touch-ui .strip-rpm,
  html.touch-ui .strip-primary small,
  html.touch-ui .strip-stats span:nth-child(2),
  html.touch-ui .strip-stats span:nth-child(3),
  html.touch-ui .strip-stats span:nth-child(4),
  html.touch-ui .strip-cond{display:none}
  html.touch-ui .hud-strip{top:52px;padding:4px 10px;gap:10px}
  html.touch-ui .strip-primary strong{font-size:20px}
  html.touch-ui .strip-stats{gap:8px}
}

.setting-check{display:flex;align-items:center;gap:10px;margin:14px 0 2px;font-size:12px;font-weight:700;letter-spacing:.04em;color:#c5d4dc;cursor:pointer}
.setting-check input{accent-color:#78dfd8;width:16px;height:16px;flex:none}
.pause-panel .setting-check{justify-content:center;margin:6px 0 14px}
#message.message-pill,.message-pill{top:58px !important;bottom:auto !important;left:50%;transform:translateX(-50%);z-index:6;max-width:min(70vw,440px)}
html.touch-ui .message-pill{top:54px !important;max-width:min(62vw,340px)}
.toast{top:58px !important}
html.touch-ui .toast{top:54px !important}
@media (max-width:650px){
  .toast{top:54px !important}
  .message-pill{top:54px !important}
}


.speed-lines:not(.active){opacity:0!important;visibility:hidden;display:none}
.speed-lines.active{display:block;visibility:visible}
.crack-overlay:not(.is-on){opacity:0!important;visibility:hidden;mix-blend-mode:normal;display:none}
.crack-overlay.is-on{display:block;visibility:visible}
.analog-hud{position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(22px,env(safe-area-inset-bottom));width:148px;height:148px;z-index:5;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .2s}
.analog-hud.is-on{opacity:.94;visibility:visible}
body.hud-hidden .analog-hud{opacity:0!important;visibility:hidden}
html.touch-ui .analog-hud{width:116px;height:116px;bottom:max(86px,calc(env(safe-area-inset-bottom) + 72px));right:max(12px,env(safe-area-inset-right))}
@media (orientation:portrait) and (max-width:600px){
  html.touch-ui .analog-hud{width:104px;height:104px;bottom:max(92px,calc(env(safe-area-inset-bottom) + 78px))}
}

.credits-line{margin-top:6px;max-width:46ch;margin-left:auto;margin-right:auto}
.credits-line a{color:#8faeb8;text-decoration:underline}
.pause-credits{margin:8px 0 0;color:#8fa3ad;font-size:11px;line-height:1.45}

/* Disable the old screen-space speed streak overlay; it rendered as white bands on some devices. */
#speedLines,.speed-lines{display:none!important;visibility:hidden!important;opacity:0!important}
