:root{color-scheme:dark;--ink:#101713;--panel:#17201b;--paper:#ece8d7;--muted:#a4b0a6;--accent:#fa6738;--cyan:#78bcba;--line:rgba(227,235,215,.2);font-family:Arial,Helvetica,sans-serif;font-synthesis:none}*{box-sizing:border-box}html,body,#app{margin:0;width:100%;height:100%;overflow:hidden}body{background:var(--ink);color:var(--paper)}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer;color:inherit;border:0}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--cyan);outline-offset:4px}button:disabled{opacity:.45;cursor:wait}button{transition:background .15s,color .15s,transform .15s}button:active{transform:translateY(1px)}a{color:inherit;text-decoration:none}#world{position:absolute;width:100%;height:100%;display:block;inset:0;touch-action:none}.hidden{display:none!important}.vignette{position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse at 57% 43%,transparent 30%,rgba(4,12,8,.16) 75%,rgba(4,12,8,.4))}.grain{position:absolute;inset:0;opacity:.024;pointer-events:none;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' d='M0 0h180v180H0z'/%3E%3C/svg%3E")}#damageFlash{position:absolute;inset:0;pointer-events:none;opacity:0;box-shadow:inset 0 0 110px #b43a13;transition:opacity .15s}#masthead{position:absolute;left:40px;right:40px;top:max(26px,env(safe-area-inset-top));display:flex;justify-content:space-between;align-items:center;z-index:12}#brand{display:flex;gap:12px;align-items:center;font-weight:900;font-size:13px;letter-spacing:.08em}.brand-symbol{color:var(--accent);font-size:23px;font-style:italic;letter-spacing:-.08em;border:2px solid var(--accent);padding:3px 6px}#brand small{display:block;color:var(--muted);font-size:8px;letter-spacing:.25em;margin-top:4px}.top-actions{display:flex;align-items:center;gap:20px}.quiet,.icon-button{background:transparent;font:700 10px/1.2 'Courier New',monospace;letter-spacing:.08em;padding:10px 0;color:var(--paper)}.quiet:hover{color:var(--accent)}.icon-button{border:1px solid var(--line);padding:11px 14px;font-size:9px}#menu{position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,rgba(6,15,11,.9),rgba(6,15,11,.5) 39%,transparent 72%)}.menu-copy{position:absolute;left:7vw;top:20%;width:min(530px,43vw)}.overline{font:700 10px/1.3 'Courier New',monospace;letter-spacing:.2em;color:var(--muted);display:flex;gap:10px;align-items:center}.orange-line{height:2px;width:30px;background:var(--accent)}h1{font-family:Impact,'Arial Narrow',Arial,sans-serif;font-size:clamp(68px,8.6vw,132px);line-height:.84;letter-spacing:-.035em;margin:24px 0 24px;font-weight:900;position:relative}h1>span:not(.title-dot){color:var(--accent)}.title-dot{color:var(--accent)}.tagline{font-size:clamp(19px,2vw,28px);line-height:1.16;letter-spacing:-.02em;margin:0 0 12px;font-weight:700}.intro{font-size:12px;color:var(--muted);margin:0 0 28px}.menu-actions{display:flex;flex-direction:column;gap:10px;max-width:315px;pointer-events:auto}.primary,.secondary{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;text-align:left;font-size:11px;letter-spacing:.045em;font-weight:800;padding:19px 22px;min-height:52px}.primary{background:var(--accent);color:#141a14}.primary:hover{background:#ff8957}.primary>span,.secondary>span{font-size:20px;line-height:.7;font-weight:400}.secondary{background:rgba(16,24,19,.8);border:1px solid var(--line);color:var(--paper)}.secondary:hover{background:#303d32;border-color:#7b9584}.preset-row{display:flex;gap:18px;margin-top:25px;pointer-events:auto}.preset-row button{background:transparent;padding:8px 0;border-bottom:2px solid transparent;font:700 9px 'Courier New',monospace;letter-spacing:.05em;color:var(--muted)}.preset-row button.active{color:var(--paper);border-bottom-color:var(--accent)}.scene-caption{position:absolute;right:6vw;bottom:14%;text-align:right}.scene-caption>span{font-size:22px;font-weight:800;letter-spacing:-.04em}.scene-caption p{font:9px 'Courier New',monospace;letter-spacing:.18em;color:var(--muted);margin-top:8px}.menu-footer{position:absolute;left:40px;right:40px;bottom:max(22px,env(safe-area-inset-bottom));display:flex;justify-content:space-between;gap:20px;border-top:1px solid var(--line);padding-top:17px;font:8px 'Courier New',monospace;letter-spacing:.06em;color:var(--muted)}kbd{font:inherit;color:var(--paper)}i{font-style:normal;color:var(--accent);padding:0 7px}#hud{position:absolute;inset:0;pointer-events:none}.hud-top{display:flex;justify-content:space-between;align-items:flex-start;position:absolute;left:35px;right:35px;top:28px;text-shadow:0 2px 12px #000}.run-title span,.objective span,.score span{font:9px 'Courier New',monospace;letter-spacing:.15em;color:#c3cbbb;display:block}.run-title strong{font-size:20px;letter-spacing:-.04em;display:block;margin-top:5px}.objective{text-align:center}.objective strong{display:block;font-family:Impact,'Arial Narrow',sans-serif;font-size:32px;letter-spacing:.03em;margin-top:3px}.score{text-align:right}.score strong{font-size:29px;display:block;font-variant-numeric:tabular-nums;letter-spacing:-.055em;line-height:1.25}.score small{font:10px 'Courier New',monospace;color:var(--accent);font-weight:700}.hud-bottom{position:absolute;bottom:64px;left:30px;right:35px;display:flex;align-items:flex-end;justify-content:space-between}.map-wrap{width:168px;position:relative;border:1px solid rgba(216,228,206,.2);background:rgba(9,19,13,.74)}#minimap{width:166px;height:166px;display:block}#location{position:absolute;bottom:7px;left:8px;font:8px 'Courier New',monospace;color:#9cb0a0;letter-spacing:.1em}.telemetry{width:162px}.speed{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-bottom:14px;text-shadow:0 2px 10px #000}.speed strong{font-size:68px;font-weight:800;line-height:.8;letter-spacing:-.07em;font-variant-numeric:tabular-nums}.speed span{font:9px 'Courier New',monospace;color:#c4d2c4}.speed small{display:block;margin-top:7px;color:var(--accent);font-size:20px;font-weight:800}.meter{margin-top:11px}.meter>span{font:8px 'Courier New',monospace;letter-spacing:.12em;display:flex;justify-content:space-between;margin-bottom:4px}.meter>i{display:block;height:4px;padding:0;background:rgba(219,232,204,.22)}.meter em{display:block;height:100%;width:100%;background:var(--accent);transition:width .1s}.meter.boost em{background:var(--cyan)}.hud-tools{position:absolute;bottom:24px;left:30px;right:35px;display:flex;gap:25px;justify-content:center;pointer-events:auto}.hud-tools button{font:9px 'Courier New',monospace;color:#d8e1d4;padding:8px 4px;background:rgba(8,17,11,.65)}.hud-tools kbd{border:1px solid #607366;padding:2px 4px;font-size:8px;margin-left:7px}.hud-tools button:hover{color:var(--accent)}#drivingHint{position:absolute;left:50%;bottom:120px;transform:translateX(-50%);font:10px 'Courier New',monospace;white-space:nowrap;color:#d5dbcd;text-shadow:0 2px 8px #000;transition:opacity 1s}#callout{position:absolute;top:22%;left:50%;transform:translate(-50%,8px);text-align:center;opacity:0;transition:opacity .15s,transform .2s;text-shadow:0 3px 12px #132116;white-space:nowrap}#callout.show{opacity:1;transform:translate(-50%,0)}#callout strong{display:block;font:800 28px Arial,sans-serif;letter-spacing:-.03em}#callout span{font:700 13px 'Courier New',monospace;color:#ffad70;display:block;margin-top:5px}#slowIndicator{position:absolute;left:50%;top:110px;transform:translateX(-50%);font:10px 'Courier New',monospace;letter-spacing:.2em;color:var(--accent)}.modal{position:absolute;inset:0;background:rgba(5,13,8,.73);backdrop-filter:blur(9px);z-index:25;display:flex;align-items:center;justify-content:center;padding:24px}.dialog{position:relative;background:#18221b;width:420px;max-width:100%;max-height:calc(100dvh - 48px);overflow:auto;padding:38px 38px 25px;border:1px solid #3a4a3b;box-shadow:0 30px 100px rgba(0,0,0,.3)}.dialog h2{font:800 clamp(38px,4vw,58px)/.93 Impact,'Arial Narrow',Arial,sans-serif;letter-spacing:-.03em;margin:20px 0}.dialog p{font-size:13px;color:#bac7b9;line-height:1.65;margin-bottom:24px}.dialog>.primary,.dialog>.secondary{margin-top:12px}.button-pair{display:flex;gap:10px;margin-top:12px}.button-pair button{padding:15px 12px;font-size:10px;min-height:46px}.full{width:100%;margin-top:16px}.close{position:absolute;right:16px;top:12px;background:none;font-size:27px;color:var(--muted)}.help-dialog{width:560px}.key-grid{display:grid;grid-template-columns:155px 1fr;gap:13px 15px;font-size:12px;border-top:1px solid var(--line);padding-top:20px;margin:20px 0}.key-grid dt{font:700 11px 'Courier New',monospace;color:var(--accent)}.key-grid dd{margin:0;color:#d4dacb}.dialog .fine{font-size:10px;line-height:1.7;color:#9bab9d}.setting{display:flex;flex-direction:column;gap:10px;margin:20px 0;font-size:12px;font-weight:700}.setting select{width:100%;padding:12px;background:#101910;color:var(--paper);border:1px solid #536352}.setting.toggle{flex-direction:row;justify-content:space-between;align-items:center}.setting small{display:block;font-size:10px;font-weight:400;color:#95aa99;margin-top:5px}.setting input[type=checkbox]{width:20px;height:20px;accent-color:var(--accent)}.result-score{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:18px 0}.result-score span{font:9px 'Courier New',monospace;letter-spacing:.15em;color:var(--muted)}.result-score strong{display:block;font-size:56px;font-weight:900;letter-spacing:-.06em;color:var(--accent)}.result-stats{display:flex;gap:14px;justify-content:space-between;margin:20px 0;font:8px 'Courier New',monospace;color:var(--muted)}.result-stats b{display:block;font-size:20px;color:var(--paper);margin-bottom:5px}#editorScreen{position:absolute;inset:0;z-index:15;pointer-events:none;background:linear-gradient(90deg,rgba(5,13,8,.7),transparent 65%)}#editorMount{pointer-events:auto;height:100%}.preview-caption{position:absolute;right:40px;bottom:35px;text-align:right}.preview-caption span{font-size:17px;font-weight:800}.preview-caption p{font-size:10px;color:var(--muted)}#replayScreen{position:absolute;inset:0;z-index:14;pointer-events:none;border-top:35px solid rgba(4,10,6,.8);border-bottom:35px solid rgba(4,10,6,.8)}.replay-header{position:absolute;left:38px;right:38px;top:10px;display:flex;align-items:center;justify-content:space-between}.replay-header h2{font-size:26px;letter-spacing:-.04em;margin:6px 0}.replay-header button{width:auto;pointer-events:auto}.replay-controls{position:absolute;left:10%;right:10%;bottom:25px;background:rgba(9,18,11,.91);border:1px solid var(--line);display:grid;grid-template-columns:85px 1fr 100px 100px;gap:14px;align-items:center;padding:18px;pointer-events:auto}.replay-controls button{padding:12px;font-size:9px;min-height:38px}.replay-controls input{accent-color:var(--accent);width:100%}.replay-controls select{background:#16221a;border:1px solid var(--line);font:9px 'Courier New',monospace;padding:10px}.replay-controls span{font:10px 'Courier New',monospace;text-align:center}.replay-controls p{grid-column:1/-1;text-align:center;font:9px 'Courier New',monospace;color:var(--muted);margin:0}#toast{position:absolute;left:50%;bottom:85px;transform:translate(-50%,10px);background:#e6e3d2;color:#152019;font:700 11px 'Courier New',monospace;padding:13px 20px;max-width:80vw;text-align:center;z-index:50;opacity:0;pointer-events:none;transition:opacity .15s,transform .15s}#toast.show{opacity:1;transform:translate(-50%,0)}.loading{position:absolute;inset:0;background:#111a14;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:45}.loader-mark{font:900 48px Impact,sans-serif;font-style:italic;letter-spacing:-.07em;color:var(--accent);position:relative;padding-bottom:20px}.loader-mark span{position:absolute;bottom:0;left:0;width:100%;height:2px;background:#345340;overflow:hidden}.loader-mark span:after{content:'';position:absolute;width:50%;height:100%;background:var(--accent);animation:loading 1s ease-in-out infinite}.loading h2{font-size:13px;letter-spacing:.1em;margin-top:25px}.loading p{font:10px 'Courier New',monospace;color:var(--muted)}@keyframes loading{0%{transform:translateX(-100%)}100%{transform:translateX(200%)}}#touchControls{position:absolute;left:15px;right:15px;bottom:max(15px,env(safe-area-inset-bottom));z-index:10;display:none;justify-content:space-between;align-items:flex-end;pointer-events:none}body.touch.playing #touchControls{display:flex}#touchControls button{pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;min-width:60px;height:58px;padding:12px;background:rgba(20,35,24,.78);border:1px solid rgba(209,228,204,.38);color:#e8eddf;font:800 11px Arial}.touch-steer,.touch-pedals,.touch-extras{display:flex;gap:8px}.touch-steer button{font-size:21px;width:65px}.touch-pedals [data-control=gas]{background:rgba(235,95,45,.83);color:#141c13;height:85px;width:65px}.touch-pedals{align-items:flex-end}.touch-extras button{min-width:45px;height:44px;font-size:9px;padding:8px}.held{background:#eea86a!important;color:#152117!important}body.touch.playing .hud-tools{bottom:115px;gap:14px}body.touch.playing .hud-bottom{bottom:185px}body.touch.playing #drivingHint{display:none}body.touch.playing .map-wrap{width:118px}body.touch.playing #minimap{width:116px;height:116px}body.playing #masthead{display:none}body.editor #masthead{display:none}body.replay #masthead{display:none}
@media(min-width:1500px){.menu-copy{top:22%;left:8vw}.intro{margin-bottom:35px}.menu-actions{max-width:350px}}
@media(max-height:750px){.menu-copy{top:18%;left:6vw}h1{font-size:clamp(70px,8vw,110px);margin:20px 0}.tagline{font-size:22px}.intro{margin-bottom:18px}.primary,.secondary{padding:15px 18px;min-height:46px}.preset-row{margin-top:15px}.menu-footer{bottom:15px;padding-top:11px}}
@media(max-width:760px){#masthead{left:20px;right:20px;top:20px}.top-actions{gap:12px}.quiet{font-size:8px}#brand{font-size:10px}.brand-symbol{font-size:19px}#brand small{font-size:6px}.icon-button{padding:9px;font-size:8px}#helpButton{display:none}.menu-copy{left:25px;top:20%;width:80vw}h1{font-size:86px}.tagline{font-size:23px}.intro{font-size:10px}.menu-actions{max-width:280px}.scene-caption{display:none}.menu-footer{left:20px;right:20px;font-size:7px}.menu-footer span:last-child{display:none}#menu{background:linear-gradient(90deg,rgba(6,15,11,.83),rgba(6,15,11,.3))}.hud-top{left:16px;right:16px;top:20px}.run-title strong{font-size:13px}.run-title span{font-size:7px}.objective span{font-size:7px}.objective strong{font-size:23px}.score strong{font-size:23px}.score span{font-size:7px}.score small{font-size:8px}.hud-bottom{left:16px;right:18px}.telemetry{width:123px}.speed strong{font-size:51px}.map-wrap{width:130px}#minimap{width:128px;height:128px}.hud-tools{left:12px;right:12px;gap:18px}.hud-tools button{font-size:8px}.hud-tools kbd{display:none}#callout strong{font-size:20px}#callout span{font-size:11px}.dialog{padding:30px 25px 22px}.key-grid{grid-template-columns:130px 1fr;font-size:11px}.key-grid dt{font-size:10px}.preview-caption{display:none}.replay-header{left:18px;right:18px}.replay-header h2{font-size:20px}.replay-header .overline{font-size:7px}.replay-header button{padding:12px;font-size:9px;min-height:40px}.replay-controls{left:15px;right:15px;grid-template-columns:65px 1fr 68px;gap:10px;padding:12px}.replay-controls select{grid-column:1/2}.replay-controls p{grid-column:2/-1;font-size:8px;text-align:left}#drivingHint{font-size:8px;bottom:110px}.touch-steer button{min-width:48px;width:48px;height:58px}.touch-pedals button{min-width:48px;width:48px;font-size:9px}.touch-pedals [data-control=gas]{width:52px}.touch-extras{gap:5px;position:absolute;right:0;bottom:100px}.touch-extras button{min-width:40px;height:35px}.touch-steer{gap:6px}.touch-pedals{gap:6px}body.touch.playing .hud-tools{left:12px;right:12px;bottom:151px}body.touch.playing .hud-bottom{bottom:197px}#toast{bottom:170px;font-size:10px;max-width:92vw}}
@media(max-height:520px) and (min-width:650px){#masthead{top:12px;left:22px;right:22px}.menu-copy{top:17%;left:35px;width:48vw}h1{font-size:68px;margin:12px 0}.overline{font-size:8px}.tagline{font-size:17px}.intro{font-size:9px;margin:10px 0 15px}.menu-actions{flex-direction:row;max-width:400px;gap:8px}.menu-actions button{font-size:8px;min-height:42px;padding:12px;gap:8px}.preset-row{margin-top:8px;gap:14px}.preset-row button{font-size:8px}.menu-footer{font-size:7px;padding-top:8px;bottom:10px}.dialog{max-height:94dvh;padding:24px;width:460px}.dialog h2{font-size:35px;margin:12px 0}.dialog p{font-size:11px;margin-bottom:12px}.key-grid{gap:8px;margin:13px 0;padding-top:12px}.setting{margin:14px 0}.hud-top{top:12px}.hud-bottom{bottom:65px}.map-wrap{width:110px}#minimap{width:108px;height:108px}.speed strong{font-size:48px}.telemetry{width:120px}.hud-tools{bottom:15px}body.touch.playing .hud-bottom{bottom:100px}.touch-extras{position:static}body.touch.playing .hud-tools{left:25%;right:25%;bottom:75px}body.touch.playing .map-wrap{width:90px}body.touch.playing #minimap{width:88px;height:88px}#callout{top:26%}#drivingHint{bottom:95px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition-duration:.01ms!important}}
/* Keep touch actions, arcade pedals and status in separate physical bands. */
@media(max-width:760px){
  #touchControls .touch-extras button{height:40px;min-width:44px}
  body.touch.playing .hud-tools{bottom:167px;gap:8px;justify-content:space-between}
  body.touch.playing .hud-tools button{min-height:44px;padding:10px 12px}
  body.touch.playing .hud-bottom{bottom:230px}
}
@media(max-height:520px) and (min-width:650px){
  body.touch.playing .hud-tools{left:25%;right:25%;bottom:85px;gap:8px}
  body.touch.playing .hud-tools button{min-height:38px;padding:8px}
  body.touch.playing .hud-bottom{bottom:100px}
}

#generatorScreen{position:absolute;inset:0;z-index:26;display:flex;align-items:center;justify-content:flex-end;padding:24px;background:linear-gradient(90deg,transparent,rgba(3,10,6,.65))}#generatorMount{width:min(480px,100%)}body.generator #masthead{display:none}@media(max-width:720px){#generatorScreen{align-items:flex-end;padding:12px}#generatorMount{width:100%}}

.top-actions{padding:5px 12px;background:rgba(9,17,12,.62);border:1px solid rgba(236,232,215,.14);backdrop-filter:blur(8px)}
@media(max-width:760px){#brand>span:last-child{display:none}#helpButton{display:block}.top-actions{gap:10px;padding:4px 8px}.top-actions .quiet{font-size:8px}#masthead{left:16px;right:16px}}

#hud{z-index:10}
