:root{color-scheme:dark;--ink:#141126;--cyan:#48e3db;--coral:#ff827a;--pink:#ed4c99;--muted:#bbb7c9;font-family:Arial,Helvetica,sans-serif;color:#fff;font-synthesis:none}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}body{background:var(--ink);touch-action:none;-webkit-user-select:none;user-select:none}button{font:700 14px Arial,Helvetica,sans-serif;letter-spacing:.06em;border:0;cursor:pointer;touch-action:none;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:3px solid var(--cyan);outline-offset:5px}button:disabled{cursor:wait;opacity:.7}button:hover{filter:brightness(1.14)}[hidden]{display:none!important}#game{position:fixed;width:100%;height:100%;display:block}.screen{position:fixed;inset:0;z-index:5}.cover{position:absolute;inset:0;background:linear-gradient(90deg,#071120cc 0%,#07112077 31%,#07112000 65%),url('./assets/henday-heat-edmonton-splash-v21.png') 64% center/cover no-repeat}.menu-content{position:absolute;left:7.5%;top:50%;transform:translateY(-53%);max-width:560px}h1{font-family:Impact,'Arial Black',sans-serif;font-size:clamp(90px,10vw,160px);line-height:.82;font-weight:900;font-style:italic;letter-spacing:-.035em;margin:0 0 30px;text-shadow:0 5px 35px #04051444}h1 span{color:var(--coral)}.tagline{font-size:clamp(21px,2vw,30px);font-weight:700;letter-spacing:-.03em;margin:0 0 26px}.intro{font-size:17px;line-height:1.65;color:#d2cedc;margin:0 0 28px}.primary{background:var(--cyan);color:#0e2630;min-height:56px;padding:16px 32px;border-radius:3px;font-size:16px;text-align:center;letter-spacing:.025em}.primary:active{transform:translateY(1px)}#start{min-width:247px}#load-status{font-size:14px;color:#bab5cc;line-height:1.6;max-width:390px;min-height:22px;margin:12px 0 27px}.menu-details{display:flex;align-items:center;gap:16px;color:#bdb6ca;font-size:12px;font-weight:700;letter-spacing:.14em}.menu-details i{width:4px;height:4px;border-radius:50%;background:#bdb6ca}.menu-footer{position:absolute;bottom:32px;left:7.5%;right:5%;display:flex;align-items:center;justify-content:space-between;color:#c7bfd1;font-size:12px;letter-spacing:.12em}.menu-footer button{background:#10102588;border:1px solid #b6b2c444;color:#fff;padding:13px 20px;border-radius:3px}.menu-footer button span{margin-left:20px;font-size:17px}#hud{position:fixed;inset:0;pointer-events:none}#hud button{pointer-events:auto}.top-left{position:absolute;top:max(28px,env(safe-area-inset-top));left:max(30px,env(safe-area-inset-left));text-shadow:0 2px 8px #111827}.district{font-size:12px;letter-spacing:.19em;font-weight:800;display:flex;align-items:center;gap:9px}.district-line{display:inline-block;width:24px;height:3px;background:var(--cyan)}.mission{margin-top:20px;border-left:3px solid var(--cyan);padding:0 0 0 15px;background:linear-gradient(90deg,#141b326f,transparent);max-width:350px}.mission>span{font-size:12px;font-weight:800;letter-spacing:.13em;color:#bcfffa}.mission h2{font-size:23px;letter-spacing:-.025em;margin:8px 0}.mission p{font-size:14px;margin:0;color:#f1e6e5;line-height:1.45}.top-right{position:absolute;top:max(24px,env(safe-area-inset-top));right:max(30px,env(safe-area-inset-right));min-width:154px;text-align:right;text-shadow:0 2px 8px #111827}#stars{display:flex;justify-content:flex-end;gap:7px;color:#ffffff55;font-size:28px}#stars .active{color:#ffd1a2;text-shadow:0 0 14px #fc557688}#cash{font-size:26px;font-weight:800;letter-spacing:.02em;margin:7px 0 14px}.health-label{display:flex;justify-content:space-between;font-size:10px;letter-spacing:.1em;color:#f0dedb;gap:30px}.health-track{margin-top:6px;height:4px;background:#18243b66}.health-track div{height:100%;width:100%;background:var(--cyan);transition:width .2s}#escape-text{font-size:12px;min-height:20px;margin-top:8px;color:#aaffeb}.tools{position:absolute;right:30px;top:185px;display:flex;gap:6px}.tools button{background:#15213999;color:#fff;border:1px solid #ffffff26;border-radius:3px;font-size:11px;padding:10px 11px}#pause{font-size:14px;min-width:36px}#toast{position:absolute;left:50%;top:27%;transform:translateX(-50%);padding:13px 20px;border-radius:4px;background:#14192de8;box-shadow:0 3px 20px #0002;border-left:3px solid var(--cyan);font-size:16px;max-width:min(520px,85%);text-align:center;opacity:0;transition:opacity .2s}#toast.visible{opacity:1}#launch-hint{position:absolute;bottom:170px;left:50%;transform:translateX(-50%);text-align:center;text-shadow:0 2px 7px #111;padding:13px 20px;background:#111e3699;border-radius:4px;max-width:600px;white-space:nowrap}#launch-hint strong{display:block;font-size:15px;font-weight:700;color:#befff6}#launch-hint span{display:block;font-size:13px;margin-top:8px}#map-button{position:absolute;bottom:70px;left:30px;width:180px;height:198px;padding:0;background:#172534c9;border:1px solid #ffffff60;box-shadow:0 8px 30px #12162b33;overflow:hidden;border-radius:4px}#minimap{width:180px;height:180px;display:block}.map-caption{height:18px;display:flex;align-items:center;justify-content:space-between;padding:0 6px;font-size:9px;letter-spacing:.1em;color:#c8d6dc}.map-caption span{color:#78e9dd}#speedo{position:absolute;right:35px;bottom:78px;display:flex;gap:20px;align-items:center;filter:drop-shadow(0 2px 10px #192030)}.gear-block{text-align:center;border-right:1px solid #ffffff50;padding-right:22px;min-width:76px}.gear-block>span{display:block;font-size:65px;font-weight:800;line-height:1;color:var(--cyan)}.gear-block label{font-size:10px;letter-spacing:.16em;color:#c8d2d7}.speed-block>div:first-child{display:flex;align-items:baseline;gap:10px}#speed{font-size:61px;line-height:1;font-weight:800;letter-spacing:-.05em;font-variant-numeric:tabular-nums}.speed-block>div span{font-size:11px;font-weight:800;color:#b8d1d6}.rev-track{margin-top:12px;width:195px;height:5px;background:#d1e1e744}.rev-track div{height:100%;width:15%;background:var(--cyan);transition:width .05s}.speed-block p{display:flex;align-items:center;gap:4px;font-size:10px;letter-spacing:.07em;color:#d3d6df;margin:9px 0 0}.speed-block p b{font-size:9px;color:var(--cyan);margin-left:auto}#touch-controls{display:none}.overlay{position:fixed;z-index:10;inset:0;background:#101127c9;backdrop-filter:blur(14px);display:flex;align-items:center;justify-content:center;padding:24px;touch-action:pan-y}.dialog{width:390px;max-width:100%;text-align:center}.dialog h2{font-family:Impact,'Arial Black',sans-serif;font-style:italic;font-size:56px;line-height:1;letter-spacing:-.02em;margin:15px 0 30px}.dialog .primary,.dialog .secondary{display:block;width:100%;margin-top:12px}.secondary{background:#ffffff0d;border:1px solid #ffffff25;color:#fff;min-height:48px;border-radius:3px;font-size:14px}.dialog-note{font-size:12px;font-weight:700;letter-spacing:.2em;color:var(--cyan)}.dialog p{font-size:16px;line-height:1.6;color:#cfcadb}.dialog .subtle{font-size:12px;color:#a6a6b7}.help-dialog{width:620px;max-height:90dvh;overflow:auto;text-align:left;padding:10px 15px;touch-action:pan-y}.help-dialog h2{font-size:45px;margin-bottom:18px}.help-dialog ol{padding-left:23px}.help-dialog li{font-size:15px;line-height:1.6;margin:12px 0;color:#dbd8e1}.help-dialog strong{color:#a0fff1}.help-dialog p{font-size:14px}.help-dialog .primary{margin-top:24px}#failure-title{font-size:82px;color:var(--coral)}
@media(pointer:coarse),(max-width:800px){.menu-content{left:7%;}.menu-details{font-size:10px;gap:10px}.top-left{left:18px;top:max(15px,env(safe-area-inset-top))}.district{font-size:10px}.mission{margin-top:12px;padding-left:10px;max-width:240px}.mission h2{font-size:18px;margin:6px 0}.mission>span{font-size:10px}.mission p{font-size:12px}.top-right{top:max(12px,env(safe-area-inset-top));right:18px;min-width:113px}#stars{font-size:21px;gap:3px}#cash{font-size:20px;margin:4px 0 8px}.health-label{font-size:9px}.tools{top:133px;right:18px}.tools button{font-size:9px;padding:8px}#touch-controls{display:block}#map-button{width:108px;height:126px;left:18px;bottom:195px}#minimap{width:108px;height:108px}.map-caption{font-size:7px}#speedo{bottom:208px;right:20px;gap:12px}.gear-block{padding-right:12px;min-width:45px}.gear-block>span{font-size:42px}#speed{font-size:39px}.rev-track{width:130px;margin-top:8px}.speed-block p{font-size:8px}.speed-block p b{font-size:8px}.speed-block>div span{font-size:9px}#launch-hint{bottom:340px;padding:10px 12px;max-width:88%;white-space:normal;width:440px}#launch-hint strong{font-size:13px}#launch-hint span{font-size:12px}#toast{top:30%;font-size:14px}.touch-left{position:absolute;left:max(18px,env(safe-area-inset-left));bottom:max(18px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:10px;align-items:flex-start}.touch-left button,.touch-right button,.touch-utility button{background:#152b44bb;border:1px solid #ffffff59;color:#fff;border-radius:10px;box-shadow:0 3px 10px #00102033;backdrop-filter:blur(5px)}.touch-left button.pressed,.touch-right button.pressed,.touch-utility button.pressed{background:#48e3dbcc;color:#113442;border-color:#9afff3;transform:translateY(2px);box-shadow:inset 0 2px 6px #09293655}.steering{display:flex;gap:12px}.steering button{width:64px;height:60px;font-size:22px}.touch-left .clutch{height:61px;width:140px;border-color:#77e8e2aa;color:#aafff3;letter-spacing:.13em;font-size:12px}.touch-right{position:absolute;right:max(18px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));display:flex;gap:10px;align-items:flex-end}.shifts{display:flex;flex-direction:column;gap:9px}.shifts button{width:64px;height:59px;font-size:10px;letter-spacing:.02em}.touch-right .pedal{width:59px;height:106px;display:flex;flex-direction:column;justify-content:flex-start;padding:15px 8px;gap:13px;font-size:10px}.touch-right .throttle{height:130px;border-color:#b3ffe588;background:#28685ab8}.pedal i{height:3px;background:#ffffff44;display:block;border-radius:2px}.touch-utility{position:absolute;bottom:167px;right:18px;display:flex;gap:6px}.touch-utility button{font-size:9px;padding:9px;min-height:32px}.menu-footer{font-size:9px;left:7%;right:7%;bottom:24px}.menu-footer button{font-size:12px;padding:11px}.health-track{height:3px}}
body.touch-forced #touch-controls{display:block}body.touch-forced #driving-legend{display:none}
@media(max-height:560px) and (min-width:601px){.menu-content{top:47%;transform:translateY(-50%)}h1{font-size:80px;margin-bottom:15px}.tagline{font-size:20px;margin:0 0 12px}.intro{font-size:14px;line-height:1.4;margin-bottom:15px}.menu-details{display:none}#load-status{margin:7px 0;min-height:16px;font-size:12px}.primary{min-height:46px;padding:12px 24px}.menu-footer{bottom:18px}.top-left .district{display:none}.mission{margin-top:0}.top-left{top:16px}.top-right{top:10px}#stars{font-size:20px}#cash{font-size:20px}.tools{top:14px;right:170px}.tools button{font-size:9px;padding:8px}#map-button{width:90px;height:108px;left:18px;bottom:172px}#minimap{width:90px;height:90px}#speedo{top:64px;bottom:auto;right:18px;gap:10px}.top-right .health-label,.top-right .health-track{display:none}.gear-block>span{font-size:36px}#speed{font-size:36px}.rev-track{width:116px}#escape-text{position:absolute;top:122px;right:0;width:160px}#launch-hint{bottom:24px;max-width:290px;width:33%;padding:7px;background:#13203699}#launch-hint strong{font-size:11px}#launch-hint span{font-size:10px;line-height:1.4;margin-top:4px}#toast{top:35%;font-size:13px;padding:9px 15px}.touch-left{bottom:16px}.steering button{height:53px;width:62px}.touch-left .clutch{height:52px;width:136px}.touch-right{bottom:16px}.touch-right .pedal{height:95px}.touch-right .throttle{height:116px}.shifts button{height:53px}.touch-utility{bottom:147px}.dialog h2{font-size:42px;margin:10px 0 18px}.dialog .secondary{min-height:38px;margin-top:8px}.dialog .primary{margin-top:8px}.dialog-note{margin:0}.dialog .subtle{margin-bottom:0}}
@media(max-width:600px){.cover{background-position:58% center}.menu-content{left:8%;top:44%}h1{font-size:108px}.tagline{font-size:22px}.intro{font-size:15px}.menu-footer>span{max-width:130px;font-size:9px;line-height:1.6}.menu-footer button span{margin-left:8px}.mission{max-width:205px}.mission h2{font-size:17px}.mission p{font-size:12px}#toast{top:29%;width:85%}.touch-left{left:12px}.touch-right{right:12px;gap:7px}.steering{gap:8px}.steering button{width:54px;height:61px}.touch-left .clutch{width:116px;height:57px}.shifts button{width:54px;font-size:9px}.touch-right .pedal{width:50px}.touch-utility{right:12px}#launch-hint{bottom:338px;font-size:12px}#speedo{right:16px;bottom:218px}#map-button{left:12px;bottom:204px}.menu-details{letter-spacing:.06em}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
@media(min-width:801px) and (pointer:fine){body.touch-forced #map-button{bottom:210px}body.touch-forced #speedo{bottom:230px}body.touch-forced #launch-hint{bottom:32px}body.touch-forced .touch-left{position:absolute;left:30px;bottom:25px;display:flex;flex-direction:column;gap:10px}body.touch-forced .steering{display:flex;gap:10px}body.touch-forced .touch-left button,body.touch-forced .touch-right button,body.touch-forced .touch-utility button{background:#152b44bb;border:1px solid #ffffff59;color:#fff;border-radius:8px;min-height:50px;padding:15px}body.touch-forced .touch-left .clutch{width:140px;color:#aafff3}body.touch-forced .steering button{width:65px;height:60px}body.touch-forced .touch-right{position:absolute;right:30px;bottom:25px;display:flex;gap:10px;align-items:flex-end}body.touch-forced .shifts{display:flex;flex-direction:column;gap:10px}body.touch-forced .touch-right .pedal{width:70px;height:100px}body.touch-forced .touch-right .throttle{height:120px;background:#28685ab8}body.touch-forced .touch-utility{position:absolute;bottom:158px;right:30px;display:flex;gap:10px}body.touch-forced .pressed{background:#48e3dbcc!important;color:#113442!important}}

/* Larger navigation and readable speed enforcement status. */
#map-button{width:230px;height:250px}#minimap{width:230px;height:230px}.map-caption{height:20px;font-size:11px;padding:0 8px}
#speed-limit{position:absolute;right:35px;bottom:192px;display:flex;gap:10px;align-items:center;text-shadow:0 2px 6px #182438}
#speed-limit b{display:grid;place-items:center;background:#f7f4f0;color:#24303c;border:4px solid #ce4b60;border-radius:50%;width:45px;height:45px;font-size:23px;line-height:1;text-shadow:none}
#radar-warning{font-size:11px;font-weight:800;letter-spacing:.08em;color:#d9efeb}.over-limit #radar-warning{color:#ffb9bd}.over-limit b{box-shadow:0 0 16px #ff647a88}

@media(pointer:coarse),(max-width:800px){#map-button{width:150px;height:170px;bottom:202px;left:12px}#minimap{width:150px;height:150px}.map-caption{font-size:10px}#speed-limit{bottom:307px;right:18px;gap:7px}#speed-limit b{width:34px;height:34px;font-size:18px;border-width:3px}#radar-warning{font-size:9px;max-width:90px}#launch-hint{bottom:390px}}
@media(max-height:560px) and (min-width:601px){#map-button{width:130px;height:150px;bottom:154px;left:18px}#minimap{width:130px;height:130px}#speed-limit{bottom:auto;top:144px;right:18px}#launch-hint{bottom:24px}#escape-text{top:114px}.map-caption{font-size:9px}}
@media(min-width:801px) and (pointer:fine){body.touch-forced #speed-limit{bottom:342px}}

@media(max-height:560px) and (min-width:601px){#map-button{width:clamp(90px,calc(100dvh - 260px),130px);height:calc(clamp(90px,calc(100dvh - 260px),130px) + 20px)}#minimap{width:clamp(90px,calc(100dvh - 260px),130px);height:clamp(90px,calc(100dvh - 260px),130px)}}
@media(max-height:350px) and (min-width:601px){#map-button{bottom:140px}.mission p{display:none}#speed-limit{top:112px;right:200px}#speed-limit b{width:28px;height:28px;font-size:16px}#radar-warning{font-size:8px;max-width:75px}}
#impact-vignette{position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 100px 35px #dc456480;opacity:0;transition:opacity .08s}#vehicle-name{position:absolute;top:-28px;right:0;font-size:13px;font-weight:800;letter-spacing:.08em;color:#d6faf1;white-space:nowrap}
.garage-dialog{width:min(880px,95vw);max-height:92dvh;overflow:auto;touch-action:pan-y;background:#151c2cec;border:1px solid #e4efee30;border-radius:8px;padding:28px}.garage-header{display:flex;justify-content:space-between;align-items:center;gap:20px}.garage-header p{color:#ffd07b;letter-spacing:.15em;font-size:12px;font-weight:800;margin:0 0 9px}.garage-header h2{font-size:32px;line-height:1.1;margin:0;letter-spacing:-.04em}.garage-wallet{text-align:right;flex-shrink:0}.garage-wallet span{display:block;font-size:10px;color:#b2bfd0;letter-spacing:.12em}.garage-wallet strong{font-size:29px;display:block;margin-top:6px;color:#8dffe5}#garage-status{font-size:14px;line-height:1.6;color:#ccd8e0;margin:20px 0 15px}#garage-location{margin:0 0 16px;padding:10px 18px}.garage-car{display:grid;grid-template-columns:1fr auto;gap:14px 18px;padding:19px 0;border-top:1px solid #e2eef32b}.car-heading{display:flex;align-items:flex-start;gap:12px}.car-swatch{width:7px;align-self:stretch;min-height:45px;border-radius:3px}.car-heading h3{font-size:21px;letter-spacing:-.02em;margin:0 0 7px}.car-heading p{font-size:13px;line-height:1.5;color:#adbccb;margin:0;max-width:510px}.car-specs{grid-row:2;display:flex;flex-wrap:wrap;gap:10px 21px;color:#a9bfcc;font-size:12px;padding-left:19px}.car-specs b{font-size:15px;color:#eef8fa}.garage-car>button{grid-column:2;grid-row:1/3;align-self:center;min-width:172px;min-height:48px;margin:0;padding:12px 18px;font-size:14px}.garage-car>button:disabled{opacity:.45;cursor:default}.garage-bottom{display:flex;gap:12px;border-top:1px solid #e2eef32b;padding-top:20px;margin-top:2px}.garage-bottom button{padding:12px 22px;min-height:48px}.garage-bottom .primary{margin-left:auto}#garage-save{font-size:12px;color:#a2b0c1;margin:16px 0 0;line-height:1.5}
@media(max-width:600px){.garage-dialog{padding:20px 18px}.garage-header{gap:12px}.garage-header h2{font-size:25px;max-width:180px}.garage-wallet strong{font-size:24px}.garage-wallet span{font-size:9px}.garage-car{grid-template-columns:1fr;gap:13px;padding:18px 0}.garage-car>button{grid-column:1;grid-row:3;width:100%;min-height:44px}.car-specs{gap:10px 15px}.car-heading h3{font-size:20px}.garage-bottom{flex-direction:column}.garage-bottom .primary{margin:0}#vehicle-name{top:-22px;font-size:10px}.tools{gap:4px}.tools button{padding:8px 7px}}
@media(max-height:560px) and (min-width:601px){.mission{max-width:198px}.mission h2{font-size:16px}.tools{gap:4px}.tools button{padding:8px 7px}.garage-dialog{padding:19px 24px}.garage-header h2{font-size:27px}#vehicle-name{top:-16px;font-size:9px}.dialog h2{margin:10px 0 13px}.dialog .secondary{min-height:32px;margin-top:7px}.dialog .primary{min-height:40px}}
#radio{position:absolute;left:30px;bottom:285px;width:180px;background:#122138c9;border:1px solid #bedbe640;border-radius:5px;padding:8px 10px}.radio-buttons{display:flex;justify-content:space-between;gap:5px}.radio-buttons button{font-size:12px;letter-spacing:.03em;color:#a6ffe6;background:none;padding:6px 0;min-height:32px}#track-name{display:block;color:#c9d7e2;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-top:3px}#gadgets{position:absolute;left:50%;bottom:87px;transform:translateX(-50%);display:flex;gap:8px}#gadgets button{display:flex;align-items:center;gap:7px;background:#122238db;color:#d8fff4;border:1px solid #80dcca66;border-radius:6px;padding:12px 10px;font-size:12px;min-height:48px;letter-spacing:.02em}#gadgets small{color:#91a9ba;font-size:12px}#gadgets b{color:#ffcc8c;font-size:16px}#gadgets .pressed{background:#438e84;color:white}#gadgets .empty{opacity:.4}#gadgets.reloading button{border-color:#ffffff20}#ram-status{position:absolute;left:50%;top:19%;transform:translateX(-50%);width:180px;background:#172438cf;padding:10px;border-radius:4px;color:#ffc2c2;text-align:center;font-size:12px;font-weight:bold}#ram-status>div{background:#100f2088;height:5px;margin-top:8px}#ram-health{display:block;background:#ff927e;height:100%;width:100%;transition:width .12s}.midi-downloads{margin-top:15px;color:#bdd3d9;font-size:14px}.midi-downloads summary{cursor:pointer}.midi-downloads a{display:block;color:#8aebdc;padding:8px}.dialog{max-height:90dvh;overflow:auto;touch-action:pan-y}
@media(pointer:coarse),(max-width:800px){#radio{left:12px;bottom:382px;width:150px;padding:6px 8px}.radio-buttons button{font-size:11px;min-height:32px}#gadgets{bottom:157px;gap:5px;left:12px;transform:none}#gadgets button{min-height:39px;padding:7px;font-size:10px;gap:5px}#gadgets small{display:none}#gadgets b{font-size:14px}#ram-status{top:24%;font-size:11px;width:150px}}
@media(max-width:600px){.touch-utility{bottom:157px;gap:4px}.touch-utility button{padding:7px 5px;font-size:8px}#gadgets{bottom:157px;gap:4px}#gadgets button{padding:7px 5px;font-size:9px;gap:3px;min-height:32px}#radio{bottom:381px}#launch-hint{bottom:455px}}
@media(max-height:560px) and (min-width:601px){#radio{bottom:auto;top:55px;left:50%;transform:translateX(-50%);width:164px;padding:3px 8px}.radio-buttons button{font-size:11px;min-height:28px}#track-name{font-size:11px;padding-top:0}#gadgets{left:50%;transform:translateX(-50%);bottom:88px;gap:6px}#gadgets button{font-size:11px;padding:9px 8px;min-height:42px}#ram-status{top:31%;width:150px}#launch-hint{bottom:17px}}
@media(max-height:560px) and (min-width:601px) and (max-width:740px){#gadgets{bottom:185px}#radio{top:92px;width:150px}#ram-status{top:45%}}
@media(min-width:801px) and (pointer:fine){body.touch-forced #radio{bottom:420px}body.touch-forced #gadgets{bottom:95px}}
@media(max-width:360px){.touch-utility button{width:45px;padding:5px 2px;min-height:34px}}
@media(max-height:560px) and (min-width:601px) and (max-width:740px){#ram-status{left:auto;right:18px;top:182px;transform:none;font-size:10px;padding:7px}}

#stream-status{position:absolute;top:42%;left:50%;transform:translateX(-50%);padding:12px 20px;background:#142c38e8;border:1px solid #55e6ce;border-radius:10px;color:#e8fff7;font-size:13px;z-index:8}.help-dialog a{color:#62dbcf}.help-dialog{max-height:90dvh;overflow:auto}

/* Errors stay readable and selectable on portrait phones and short screens. */
#error-screen{z-index:100;padding:16px;touch-action:pan-y;background:#101220ef}
.error-dialog{width:min(620px,100%);max-height:calc(100dvh - 32px);overflow:auto;padding:clamp(20px,4vw,36px);text-align:left;touch-action:pan-y}
.error-dialog h2{font-size:clamp(26px,5vw,38px);line-height:1.15;margin:8px 0 20px}
#error-stage{font-size:14px;color:#b9c4d9;margin:0 0 10px}
#error-message{font-size:16px;line-height:1.55;color:#ffd2cd;white-space:pre-wrap;overflow-wrap:anywhere;user-select:text;-webkit-user-select:text}
#error-source{font-size:14px;line-height:1.5;color:#c0cad7;overflow-wrap:anywhere;user-select:text;-webkit-user-select:text}
.error-actions{display:flex;gap:12px;flex-wrap:wrap;margin:24px 0 18px}
.error-actions button{flex:1;min-width:130px;margin:0;min-height:48px;font-size:15px}
#error-details-wrap summary{font-size:14px;cursor:pointer;padding:10px 0;touch-action:manipulation}
#error-details{display:block;width:100%;min-height:160px;height:28dvh;margin-top:10px;padding:12px;border:1px solid #566173;border-radius:4px;background:#0c1120;color:#d6e2ef;font:14px/1.5 monospace;resize:vertical;white-space:pre-wrap;overflow-wrap:anywhere;touch-action:auto;user-select:text;-webkit-user-select:text}
#stream-status{max-width:min(560px,92vw);white-space:normal;overflow-wrap:anywhere}

.menu-location{font-size:14px;font-weight:800;letter-spacing:.22em;color:#91e5e0;margin:0 0 22px}#menu h1{font-size:clamp(72px,9.2vw,146px);line-height:.9;letter-spacing:-.025em}#menu h1 span{color:#ffc17b}

@media(max-width:600px){#menu .cover{background-position:center,66% center}#menu .menu-content{left:7%;right:7%;max-width:none;top:9%;transform:none}#menu .menu-location{margin-bottom:18px}#menu h1{font-size:clamp(60px,16vw,94px);margin-bottom:23px}#menu .tagline{font-size:22px}#menu .intro{font-size:16px}#menu .menu-footer{bottom:max(20px,env(safe-area-inset-bottom));left:7%;right:7%;gap:16px}#menu .menu-footer>span{max-width:170px;font-size:12px;line-height:1.55}}
@media(max-height:560px) and (min-width:601px){#menu .menu-content{top:7%;transform:none}#menu .menu-location{margin-bottom:12px}#menu h1{font-size:clamp(52px,10vh,70px);margin-bottom:12px}#menu .tagline{font-size:20px;margin-bottom:12px}#menu .intro{font-size:15px;margin-bottom:14px}#menu #load-status{margin-bottom:10px}#menu .menu-details{display:none}}
@media(max-height:560px) and (min-width:601px){#menu .menu-content{max-width:52vw;top:max(7%,env(safe-area-inset-top))}#menu .menu-footer{left:auto;right:5%;max-width:30vw;flex-direction:column;align-items:flex-end;gap:12px;text-align:right}}
@media(max-height:380px) and (min-width:601px){#menu .intro{display:none}}
.menu-launch{display:flex;align-items:stretch;gap:10px;flex-wrap:wrap}.menu-launch .secondary{padding:12px 18px;min-width:210px;background:#112736cc;border-color:#98d8d95c;min-height:48px}.menu-launch button{flex:1 1 230px}.menu-launch #start{min-width:0}
#map-inspector{position:fixed;inset:0;z-index:6;background:#91b3c4}#inspector-canvas{width:100%;height:100%;display:block;touch-action:none}.inspect-top{position:absolute;top:max(18px,env(safe-area-inset-top));left:max(20px,env(safe-area-inset-left));right:max(20px,env(safe-area-inset-right));display:flex;align-items:start;justify-content:space-between;gap:16px;pointer-events:none}.inspect-top>div{display:flex;flex-direction:column;gap:6px;padding:11px 14px;background:#102735e6;border-left:3px solid #6ee9d6;max-width:65%;border-radius:3px}.inspect-top strong{font-size:14px;letter-spacing:.12em;color:#9cf3df}.inspect-top span{font-size:14px;line-height:1.4;max-width:45vw}.inspect-top button,.inspect-settings button{background:#122d40e6;border:1px solid #a2d5dd70;border-radius:4px;color:#fff;min-height:44px;padding:10px 14px;font-size:14px;pointer-events:auto}.inspect-tools{position:absolute;left:max(20px,env(safe-area-inset-left));top:max(98px,calc(env(safe-area-inset-top) + 88px));max-width:330px;width:calc(100% - 40px);background:#102735ef;border:1px solid #91bfd344;border-radius:4px;touch-action:pan-y;z-index:3}.inspect-tools summary{font-size:14px;font-weight:700;padding:13px 15px;cursor:pointer;color:#fcd092}.inspect-settings{padding:0 15px 15px;display:flex;flex-direction:column;gap:12px;max-height:calc(100dvh - 170px);overflow:auto;touch-action:pan-y}.inspect-settings>label{display:flex;flex-direction:column;gap:6px;font-size:14px}.inspect-settings select{width:100%;min-height:42px;padding:8px;background:#203b4a;border:1px solid #647d8c;color:#fff;border-radius:3px;font:14px Arial}.inspect-settings fieldset{border:1px solid #64839370;border-radius:4px;padding:10px;display:grid;grid-template-columns:1fr 1fr;gap:12px}.inspect-settings legend{font-size:14px;padding:0 5px}.inspect-settings fieldset label,.inspect-settings .inspect-check{display:flex;flex-direction:row;align-items:center;gap:8px;font-size:14px}.inspect-settings input{width:18px;height:18px;accent-color:#69e7d2;margin:0}.inspect-settings p{font-size:13px;line-height:1.55;color:#c4d7df;margin:2px 0}.inspect-settings textarea{min-height:120px;resize:vertical;user-select:text;-webkit-user-select:text;background:#071a26;color:#e2f4f7;padding:10px;border:1px solid #9fb6c3;font:12px monospace}.inspect-crosshair{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font:24px Arial;color:#ffffff90;text-shadow:0 1px 3px #122936;pointer-events:none}.inspect-status{position:absolute;bottom:max(22px,env(safe-area-inset-bottom));left:20px;display:flex;flex-direction:column;gap:4px;background:#102735e6;border-radius:4px;padding:10px 14px;pointer-events:none;font:13px/1.4 monospace;color:#d3f0f2;max-width:calc(100% - 40px)}#inspect-notice{color:#ffdb9a;max-width:480px}.inspect-touch{display:none;position:absolute;bottom:max(18px,env(safe-area-inset-bottom));left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));align-items:end;justify-content:space-between;gap:12px;pointer-events:none}.inspect-pad{width:122px;height:122px;flex:none;border-radius:50%;border:1px solid #d6f8ff8c;background:#0c2a40a6;touch-action:none;position:relative;pointer-events:auto}.inspect-pad i{width:44px;height:44px;display:block;position:absolute;left:calc(50% - 22px);top:calc(50% - 22px);border-radius:50%;background:#a8e8e666;box-shadow:0 0 0 1px #b9faf6aa;pointer-events:none}.inspect-pad span{position:absolute;bottom:14px;left:0;right:0;text-align:center;font-size:12px;font-weight:700;letter-spacing:.1em;pointer-events:none}.inspect-altitude{display:flex;flex-direction:column;gap:8px;align-items:center}.inspect-altitude button{min-width:86px;min-height:42px;padding:9px;color:#e7ffff;background:#11324dcc;border:1px solid #d0ecf46f;border-radius:5px;pointer-events:auto;font-size:12px;touch-action:none}.inspect-altitude button.pressed{background:#65decedd;color:#092b39}
@media(pointer:coarse),(max-width:800px){.inspect-touch{display:flex}.inspect-status{bottom:166px;font-size:12px;padding:8px 10px}.inspect-top{left:14px;right:14px;top:max(12px,env(safe-area-inset-top))}.inspect-top>div{padding:9px 11px}.inspect-tools{left:14px;top:94px;max-width:300px}.inspect-top span{font-size:13px}.inspect-top button{font-size:13px;padding:10px}.inspect-settings{max-height:calc(100dvh - 158px)}}
@media(max-width:380px){.inspect-pad{width:103px;height:103px}.inspect-altitude button{min-width:76px}.inspect-touch{left:12px;right:12px;gap:8px}.inspect-top span{font-size:12px}.inspect-status{left:12px;max-width:calc(100% - 24px)}}
@media(max-height:560px) and (min-width:601px){.menu-launch{max-width:54vw;flex-wrap:nowrap}.menu-launch button{font-size:13px;padding:10px;min-width:0;flex:1}.menu-launch .secondary{min-width:0}.inspect-status{left:50%;bottom:82px;transform:translateX(-50%);max-width:45%;font-size:12px}.inspect-pad{width:110px;height:110px}.inspect-touch{gap:12px;justify-content:space-between}.inspect-altitude{flex-direction:row;position:absolute;right:124px;bottom:0}.inspect-altitude button{min-width:53px;min-height:42px;font-size:11px}.inspect-tools{top:90px}.inspect-settings{max-height:calc(100dvh - 148px)}}

#pause-screen>.dialog{max-height:calc(100dvh - 40px);overflow-y:auto;overscroll-behavior:contain;padding:6px 14px 18px;touch-action:pan-y}
.graphics-settings{margin:18px 0;text-align:left;border:1px solid #ffffff30;border-radius:5px;padding:12px 14px;background:#10253770;touch-action:pan-y}
.graphics-settings summary{font-size:16px;font-weight:700;cursor:pointer;color:#c8fff5;min-height:24px}
.graphics-range{display:block;margin-top:18px;font-size:15px}.graphics-range>span{display:flex;justify-content:space-between;gap:14px}.graphics-range output{font-variant-numeric:tabular-nums;color:#9af6e7}
.graphics-range input{display:block;width:100%;min-height:36px;margin:5px 0 0;accent-color:#48e3db;touch-action:pan-y}
.graphics-check{display:flex;align-items:center;gap:10px;min-height:42px;font-size:15px}.graphics-check input{width:20px;height:20px;accent-color:#48e3db}
.graphics-settings p{font-size:13px;line-height:1.5;margin:8px 0;color:#c2cddd}.graphics-settings .graphics-status{font-size:13px;color:#94e5d9;font-variant-numeric:tabular-nums}
.graphics-settings #graphics-reset{font-size:14px;min-height:42px;margin-top:12px}

/* A local cell failure leaves the playfield and existing menus available. */
#cell-recovery{position:fixed;z-index:9;left:50%;top:44%;transform:translate(-50%,-50%);width:min(430px,calc(100vw - 32px));max-height:48dvh;overflow:auto;padding:18px;background:#142c38f5;border:1px solid #ffce84;border-radius:8px;box-shadow:0 8px 30px #07182355;touch-action:pan-y}
#cell-recovery h2{margin:0 0 8px;font-size:20px;color:#fff}#cell-recovery p{margin:8px 0;font-size:14px;line-height:1.45;color:#e0eced}#cell-recovery #cell-summary{font-size:12px;color:#ffda9f;overflow-wrap:anywhere}.cell-actions{display:flex;gap:10px;margin:14px 0}.cell-actions button{flex:1;min-height:44px;padding:10px 12px;font-size:14px}#cell-recovery summary{font-size:12px;cursor:pointer}#cell-details{display:block;width:100%;height:150px;margin-top:8px;padding:10px;background:#071a26;color:#e2f4f7;border:1px solid #9fb6c3;font:12px monospace;user-select:text;-webkit-user-select:text;touch-action:pan-y}

#map-backdrop{position:fixed;inset:0;background:#101326ed;pointer-events:auto;z-index:3}
#map-tools{position:fixed;bottom:max(8px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(96vw,850px);z-index:5;pointer-events:auto;text-align:center}
#map-tools p{font-size:14px;line-height:1.25;margin:5px 0;color:#f2f4f6}
#map-tools>div{display:flex;justify-content:center;gap:5px;flex-wrap:wrap}
#map-tools button{min-height:42px;min-width:42px;padding:8px 10px;background:#253e49;color:#fff;border:1px solid #7b999e;border-radius:4px;font-size:14px;letter-spacing:0}
#map-tools #map-close{background:#bd252e;border-color:#ff6b72}
body.map-open #map-button.expanded{z-index:4;--map-size:min(calc(100dvh - 205px),94vw);width:var(--map-size);height:calc(var(--map-size) + 22px);top:8px;left:50%;bottom:auto;transform:translateX(-50%);box-shadow:none}
body.map-open #map-button.expanded #minimap{width:var(--map-size);height:var(--map-size);touch-action:none}
body.map-open #map-button:hover{filter:none}
body.map-open .touch-left,body.map-open .touch-right,body.map-open .touch-utility{visibility:hidden}

.driving-setting{display:flex;gap:12px;align-items:center;font-size:16px;margin:12px 0}
.driving-setting select{font:inherit;color:#fff;background:#203441;border:1px solid #76969d;border-radius:4px;padding:10px;min-height:44px}
.driving-description{font-size:14px!important;line-height:1.4!important;margin:8px 0!important;color:#d6e7e8!important}
#driving-legend{position:absolute;bottom:22px;left:50%;transform:translateX(-50%);font-size:14px;background:#152239bb;padding:10px 16px;white-space:nowrap}
.direction-controls{position:absolute;bottom:270px;right:35px;display:flex;gap:6px;pointer-events:auto}
.direction-controls button{width:44px;height:40px;border:1px solid #91aeb5;border-radius:4px;background:#152b44;color:white;font-size:16px}
.direction-controls button[aria-pressed=true]{background:#48e3db;color:#102733}
body.map-open .direction-controls{visibility:hidden}
@media(pointer:coarse),(max-width:800px){#driving-legend{display:none}.direction-controls{bottom:195px;right:18px}body:not([data-driving-mode=manual]) .touch-utility{bottom:155px}body:not([data-driving-mode=manual]) #speed-limit{bottom:334px}body[data-driving-mode=automatic] #speedo,body[data-driving-mode=semi] #speedo{bottom:245px}.menu-content .driving-description{max-width:330px}}
@media(max-height:560px) and (min-width:601px){.direction-controls{bottom:187px;right:18px}body[data-driving-mode=automatic] #speedo,body[data-driving-mode=semi] #speedo{bottom:auto}body:not([data-driving-mode=manual]) #speed-limit{right:180px;bottom:auto}body:not([data-driving-mode=manual]) .touch-utility{bottom:147px}.menu-content .driving-description{display:none}.driving-setting{font-size:14px;margin:6px 0}.driving-setting select{padding:5px;min-height:36px}}

#map-tools .map-development{margin-top:6px}
#map-tools #map-teleport{background:#842832;border-color:#ff838a;min-height:44px}
#map-tools button:disabled{cursor:default;opacity:.55}
#failure-screen{animation:crash-screen-in .8s ease-out both}
@keyframes crash-screen-in{from{opacity:0}to{opacity:1}}
