*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;overflow:hidden}body{background:#a7bfc1;color:#f3f2e9;font:16px/1.5 system-ui,-apple-system,sans-serif}canvas{width:100%;height:100%;display:block;touch-action:none;outline:none;cursor:grab}canvas:active{cursor:grabbing}[hidden]{display:none!important}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}button:focus-visible,a:focus-visible{outline:2px solid #ffd383;outline-offset:5px}kbd{font:500 12px/1 system-ui;letter-spacing:.02em}#game-ui{position:absolute;inset:0;pointer-events:none}#game-ui button,#game-ui a{pointer-events:auto}.topbar{position:absolute;top:25px;left:32px;right:32px;display:flex;justify-content:space-between;align-items:center;text-shadow:0 1px 6px #1a272b70}.brand{font-weight:850;letter-spacing:.13em;font-size:23px;line-height:1.1}.brand span{display:block;font-size:11px;font-weight:500;letter-spacing:.2em;margin-top:8px;color:#edf0e3}nav{display:flex;align-items:center;gap:9px}nav a,nav button{border:1px solid #ffffff35;background:#1c2b30ba;color:#f5f3e9;border-radius:4px;padding:9px 14px;text-decoration:none;font-size:14px;line-height:1.4}nav button:hover,nav a:hover{background:#243c43}nav kbd{color:#c9d0c7;margin-left:8px}.road-notice{position:absolute;top:108px;left:34px;display:flex;gap:12px;text-shadow:0 2px 8px #1a272b99}.road-rule{width:3px;background:#edb961;border-radius:2px}.road-notice strong{font-size:13px;letter-spacing:.13em;font-weight:650}.road-notice p{font-size:14px;margin:3px 0 0;color:#f0efdf}.run-progress{position:absolute;top:34px;left:50%;transform:translateX(-50%);width:230px;display:flex;gap:12px;align-items:center;font-size:12px;letter-spacing:.05em;text-shadow:0 2px 4px #162b37}.progress-track{flex:1;height:3px;background:#ffffff40;border-radius:2px}#progress{background:#f8cf7c;height:100%;width:0}.speed-panel{position:absolute;bottom:47px;left:35px;min-width:140px;text-shadow:0 2px 9px #0e242966}.drive-label{display:flex;align-items:center;justify-content:space-between;font-size:12px;font-weight:650;letter-spacing:.14em;border-bottom:1px solid #ffffff50;padding-bottom:7px}.drive-label span{width:23px;height:22px;display:grid;place-items:center;background:#efbb60;color:#283335;border-radius:2px;font-size:13px}.speed-row{display:flex;gap:11px;align-items:baseline}.speed-row strong{font-size:65px;line-height:1.2;font-weight:650;letter-spacing:-.06em;font-variant-numeric:tabular-nums}.speed-row span{font-size:13px;color:#ecede3}.speed-caption{font-size:10px;letter-spacing:.17em;color:#efeee0}.contact-panel{position:absolute;bottom:65px;right:34px;display:flex;gap:14px;align-items:center;text-shadow:0 2px 9px #173033}.contact-panel strong{font-size:25px;font-weight:500;display:block;line-height:1.2}.contact-panel span{display:block;font-size:10px;letter-spacing:.12em;margin-top:7px}#stability[data-warning=yes]{color:#ffe192}.wheel-diagram{width:36px;display:grid;grid-template-columns:8px 8px;grid-template-rows:15px 15px;column-gap:20px;row-gap:12px;position:relative}.wheel-diagram>span{position:absolute;width:17px;height:31px;border:1px solid #f5f4e86e;left:10px;top:0}.wheel{height:15px;width:8px;border-radius:2px;background:#f3ddb0}.wheel[data-contact=no]{background:#ef6b42;box-shadow:0 0 10px #ef6b4250}.controls{position:absolute;bottom:22px;left:50%;transform:translateX(-50%);display:flex;gap:19px;white-space:nowrap;font-size:12px;text-shadow:0 1px 6px #18323d}.controls span{display:flex;gap:6px;align-items:center;color:#f6f2e6}.controls kbd{padding:4px 5px;background:#24333890;border:1px solid #ffffff35;border-radius:3px;font-size:10px}#loading{position:absolute;inset:0;display:grid;place-items:center;background:#182a31;color:#f1d9af;font-size:17px;z-index:10;padding:40px}#overlay{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;background:linear-gradient(90deg,#10222b32,transparent 70%);pointer-events:none}.run-card{pointer-events:auto;width:420px;background:#192a30ed;border:1px solid #e5d6b430;border-radius:5px;padding:30px;box-shadow:0 20px 70px #15232935;max-height:calc(100dvh - 170px);overflow:auto}.eyebrow{color:#eabf75;font-size:11px;font-weight:600;letter-spacing:.22em}h1{font-size:33px;font-weight:600;line-height:1.15;letter-spacing:-.025em;margin:13px 0 8px}#route-info{font-size:12px;color:#b9c2b9;margin:0 0 24px}#overlay-text{font-size:15px;color:#e0e5db;line-height:1.65;margin:0 0 22px}.key-guide{display:grid;grid-template-columns:1fr 1fr;gap:13px 14px;margin:22px 0 27px}.key-guide span{font-size:12px;color:#bdc9c3;display:flex;flex-direction:column;gap:7px}.key-guide kbd{color:#f3e6cd}.primary{display:flex;align-items:center;justify-content:space-between;width:100%;border:0;padding:13px 17px;border-radius:3px;background:#eab763;color:#233139;font-size:16px;font-weight:650}.primary:hover{background:#f6c984}.primary span{font-size:19px;font-weight:400}.card-foot{font-size:11px;color:#abb9b6;text-align:center;margin:16px 0 0}#overlay:not([data-state=ready]) .key-guide{display:none}#overlay:not([data-state=ready]) #route-info{display:none}#overlay[data-state=failed] .eyebrow{color:#f59673}@media(max-width:950px){.run-progress{top:82px;width:190px}.road-notice{top:124px}.controls{gap:10px}.controls span:nth-child(4){display:none}}@media(max-width:650px){.topbar{top:17px;left:17px;right:17px}.brand{font-size:18px}.brand span{font-size:9px}nav{gap:5px}nav a,nav button{padding:7px 9px;font-size:12px}nav kbd{display:none}.run-progress{top:78px}.road-notice{left:18px;top:106px}.road-notice p{font-size:12px}.speed-panel{left:18px;bottom:50px;min-width:105px}.speed-row strong{font-size:48px}.contact-panel{right:18px;bottom:58px;gap:10px}.contact-panel strong{font-size:21px}.contact-panel span{font-size:9px}.controls{gap:8px;font-size:10px}.controls span:nth-child(2),.controls span:nth-child(4){display:none}.run-card{width:min(380px,calc(100vw - 36px));padding:23px;max-height:calc(100dvh - 170px)}h1{font-size:29px}#overlay-text{font-size:14px}.key-guide{margin:15px 0 20px;gap:11px}.road-notice strong{font-size:11px}}@media(max-height:690px){.run-card{padding:22px;max-height:calc(100dvh - 115px)}.key-guide{display:none}#overlay-text{margin-bottom:18px}h1{font-size:29px}.card-foot{margin-top:10px}}
.game-selects{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:15px 0}.game-selects label{font-size:13px;color:#c8d2c9}.game-selects select{display:block;width:100%;margin-top:5px;background:#283e46;border:1px solid #63726e;border-radius:3px;color:#fff;padding:9px 6px;font-size:14px}#overlay:not([data-state=ready]) .game-selects{display:none}#loading a{color:#f1ca78;display:block}#editor{position:absolute;inset:0;display:flex;flex-direction:column;background:#102029;color:#e7eeeb;overflow:hidden;z-index:20;font-size:14px}#editor button,#editor select,#editor input,#editor a{font:inherit;border-radius:4px}#editor button,#editor a{background:#263e48;border:1px solid #4c626d;color:#f2eee2;padding:9px 12px;cursor:pointer;text-decoration:none}#editor button:disabled{opacity:.45;cursor:wait}#editor button.primary{background:#eab763;color:#233139;border-color:#eab763;width:auto}#editor input,#editor select{width:100%;border:1px solid #465e6a;background:#1b323d;color:#edf2ef;padding:8px 9px;margin-top:5px;min-width:0}#editor label{display:block;font-size:13px;color:#b8cbd0}#editor input:focus,#editor select:focus{outline:2px solid #ddb56a;outline-offset:1px}.editor-header{padding:17px 25px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #334a54}.editor-header strong{font-size:20px;letter-spacing:.13em}.editor-header span{margin-left:20px;color:#d4b47c;font-size:12px;letter-spacing:.12em}.editor-toolbar{display:flex;gap:12px;padding:12px 25px;align-items:center;border-bottom:1px solid #334a54}#editor .editor-toolbar select{max-width:290px;margin:0}.editor-body{display:grid;grid-template-columns:320px 1fr;min-height:0;flex:1}.editor-settings{padding:20px;overflow:auto;background:#162933;border-right:1px solid #334a54}.field-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:14px 0;align-items:end}.coordinate-fields{display:grid;grid-template-columns:1fr 1fr 1fr;gap:7px;margin:12px 0}.editor-buttons{display:flex;gap:8px}#editor hr{border:0;border-top:1px solid #40545e;margin:20px 0}#editor h2{font-size:15px;font-weight:600;margin:0}#hazards>div{display:flex;gap:8px;align-items:center;justify-content:space-between;font-size:12px;border-bottom:1px solid #354b57;padding:9px 0}#editor #hazards button{padding:4px 6px;font-size:12px}.editor-map{min-height:0;position:relative;display:flex;flex-direction:column;padding:14px 18px}.editor-map p{margin:0 0 12px;color:#b8cbd0;font-size:14px}#map{flex:1;min-height:100px;width:100%;height:100%;border:1px solid #3f5662;border-radius:5px;cursor:crosshair}#map-summary{position:absolute;right:35px;top:57px;font-size:12px;background:#162a33d9;padding:6px 10px;color:#d1c4a7}.editor-footer{padding:14px 20px;border-top:1px solid #334a54;display:flex;align-items:center;justify-content:space-between;gap:20px;background:#192e39}.editor-footer p{margin:0 0 4px;color:#ebcd92;font-size:14px}.editor-footer span{font-size:12px;color:#aac0c9}.editor-actions{display:flex;gap:9px;align-items:end}.test-vehicle-label{width:150px}#editor-status[data-error=yes]{color:#ffab87}.editor-actions button{white-space:nowrap}@media(max-width:1150px){.editor-footer{align-items:flex-start;flex-direction:column;gap:8px}.editor-actions{width:100%;flex-wrap:wrap}.topbar{left:20px;right:20px}nav{gap:5px}nav a,nav button{font-size:12px;padding:8px}.run-progress{top:80px}.road-notice{top:118px}.run-card{max-height:calc(100dvh - 155px)}}@media(max-width:700px){.editor-header span{display:block;margin-left:0}.editor-toolbar{padding:10px;flex-wrap:wrap}.editor-body{grid-template-columns:1fr;overflow:auto}.editor-settings{overflow:visible;border-right:0}.editor-map{min-height:440px;grid-row:1}.editor-footer{padding:10px}#editor .editor-toolbar select{max-width:45%}.editor-actions{gap:5px}#editor .editor-actions button{padding:7px}.editor-actions label{width:130px}.editor-map p{font-size:12px}.brand span{display:none}.topbar nav{max-width:75%;flex-wrap:wrap;justify-content:flex-end}.road-notice{top:132px}.game-selects{grid-template-columns:1fr}.run-card{max-height:calc(100dvh - 150px)}}
/* Touch driving surface: thumb controls remain clear of the road ahead. */
.drive-preferences{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0}.drive-preferences label{font-size:13px;color:#c8d2c9}.drive-preferences label:last-child{grid-column:1/-1}.drive-preferences select{width:100%;display:block;margin-top:5px;padding:9px 6px;background:#283e46;border:1px solid #63726e;border-radius:4px;color:#fff;font-size:14px}.touch-help{display:none;font-size:14px;color:#d5d9cc;margin:12px 0}#touch-controls{position:absolute;inset:auto 0 0;display:flex;align-items:end;justify-content:space-between;padding:14px max(16px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));gap:14px;z-index:2;pointer-events:none;user-select:none;-webkit-user-select:none}#touch-controls button,#steering-wheel{pointer-events:auto;touch-action:none;-webkit-touch-callout:none}#touch-controls button{border:1px solid #ebdcb66e;color:#fff9e7;background:#15262cdc;border-radius:15px;box-shadow:0 4px 18px #09171c50;min-width:66px;min-height:70px;font-size:25px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}#touch-controls button[data-pressed=yes]{background:#f0bc69;color:#182831;transform:translateY(2px)}.touch-steer-buttons,.touch-pedals{display:flex;gap:12px}.touch-pedals button{width:86px;height:95px}.touch-pedals strong{font-size:17px;font-weight:750}.touch-pedals span{font-size:11px}.touch-pedals .gas-pedal{border-color:#e2ba79!important;background:#725630df!important}.touch-pedals .gas-pedal[data-pressed=yes]{background:#f1c26f!important}#steering-wheel{width:140px;height:140px;position:relative;cursor:grab}#wheel-rim{width:100%;height:100%;filter:drop-shadow(0 5px 8px #08151a80)}#wheel-rim circle{fill:#152b32e6;stroke:#e1c28b;stroke-width:9}#wheel-rim path{stroke:#b9b7a3;stroke-width:11;fill:none;stroke-linecap:round}#wheel-rim .wheel-hub{fill:#273e48;stroke:#65747a;stroke-width:4}#steering-wheel>span{position:absolute;inset:0;display:grid;place-items:center;font-size:10px;letter-spacing:.05em;pointer-events:none}#touch-controls[data-steering=buttons] #steering-wheel,#touch-controls[data-steering=wheel] .touch-steer-buttons{display:none}body:not([data-run=running]) #touch-controls{visibility:hidden}body[data-touch=yes] .controls,body[data-touch=yes] .key-guide{display:none}body[data-touch=yes] .touch-help{display:block}body[data-touch=yes] .speed-panel{bottom:175px;min-width:95px}body[data-touch=yes] .speed-row strong{font-size:43px}body[data-touch=yes] .contact-panel{bottom:175px}body[data-touch=yes] .speed-caption{display:none}#overlay{z-index:3}.run-card{max-height:calc(100dvh - 145px)}
@media(max-width:700px){.topbar{top:max(10px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));align-items:start}.brand{font-size:17px}.topbar nav{max-width:none;gap:5px}.topbar nav a,.topbar nav button{font-size:12px;padding:9px;min-height:38px}#course-link{display:none}.run-progress{top:65px;width:180px}.road-notice{top:92px;left:16px;right:16px}.road-notice strong{font-size:12px}.road-notice p{font-size:12px}.game-selects{grid-template-columns:1fr 1fr;gap:8px}.game-selects select,.drive-preferences select{font-size:16px;min-height:44px}.run-card{width:min(410px,calc(100vw - 24px));padding:18px;max-height:calc(100dvh - 140px)}#overlay-text{font-size:14px;margin-bottom:12px}#route-info{margin-bottom:14px}.drive-preferences{gap:8px;margin:10px 0}.speed-panel{left:16px}.contact-panel{right:16px}.contact-panel span{font-size:10px}.touch-steer-buttons,.touch-pedals{gap:8px}.touch-pedals button{width:76px;height:90px}#touch-controls button{min-width:61px}#steering-wheel{width:130px;height:130px}}
@media(max-height:520px) and (min-width:600px){.topbar{top:max(8px,env(safe-area-inset-top))}.brand span{display:none}.run-progress{top:23px;width:170px;left:40%}.road-notice{top:60px}.road-notice p{margin:0}.run-card{max-height:calc(100dvh - 28px);width:470px;padding:16px}#overlay{background:#10222b85}.run-card h1{font-size:24px;margin:6px 0}.run-card .eyebrow,.run-card #route-info,.run-card .card-foot{display:none}.run-card .game-selects{margin:8px 0}.drive-preferences{grid-template-columns:1fr 1fr 1fr;gap:8px}.drive-preferences label:last-child{grid-column:auto}.drive-preferences select{font-size:14px}.touch-help{font-size:12px;margin:7px 0}body[data-touch=yes] .speed-panel{bottom:136px;left:18px}body[data-touch=yes] .contact-panel{bottom:136px}body[data-touch=yes] .speed-row strong{font-size:33px}#steering-wheel{width:118px;height:118px}.touch-pedals button{height:77px}#touch-controls{padding-bottom:max(10px,env(safe-area-inset-bottom))}body[data-touch=yes] .road-notice{left:50%;transform:translateX(-50%);width:320px}.wheel-diagram{display:none}}
/* The editor keeps its canvas visible and gives phone users separate tool panels. */
.editor-mobile-tabs{display:none}.editor-body{min-height:0}.editor-map{padding:12px;gap:10px;overflow:hidden}.canvas-toolbar{display:flex;gap:8px;justify-content:space-between;align-items:center;flex-wrap:wrap}.canvas-toolbar>div{display:flex;gap:6px;align-items:center;flex-wrap:wrap}#editor .canvas-toolbar button{padding:7px 10px;font-size:13px}#editor #edit-tool{width:auto;margin:0;padding:7px;font-size:13px}.canvas-toolbar button[aria-pressed=true],#editor #palette button[aria-pressed=true],#editor .editor-mobile-tabs button[aria-pressed=true]{background:#d9b775;color:#182d37;border-color:#efd092}#palette{display:flex;gap:5px;flex-wrap:wrap}#editor #palette button{padding:6px 9px;font-size:13px;min-height:34px}#map-help{font-size:13px;margin:0;line-height:1.4}#map-stage{position:relative;flex:1;min-height:130px;border:1px solid #3f5662;border-radius:5px;overflow:hidden;background:#14232c}#map{position:absolute;inset:0;width:100%;height:100%;border:0;border-radius:0;min-height:0}#editor3d{position:absolute;inset:0}#editor3d canvas{width:100%;height:100%;touch-action:none}#map-summary{right:10px;top:10px;pointer-events:none;font-size:12px;background:#12252ce0;border-radius:3px;max-width:calc(100% - 20px)}#dimension-readout{position:absolute;left:10px;right:10px;bottom:10px;padding:8px 10px;color:#f4d594;background:#142630e8;font-size:12px;pointer-events:none;border-radius:3px}.editor-settings label{font-size:14px}#editor button,#editor a{min-height:40px}#editor #hazards button{min-height:36px}#editor .editor-toolbar select{font-size:14px}.editor-footer{padding:10px 16px}.editor-footer span{font-size:12px}#editor .test-vehicle-label{font-size:12px}.editor-actions{flex-wrap:wrap}
@media(max-width:760px){.editor-header{padding:10px 12px;padding-top:max(10px,env(safe-area-inset-top));gap:10px}.editor-header strong{font-size:17px}.editor-header span{font-size:11px;margin-top:3px}#editor .editor-header a{font-size:14px;padding:8px 10px}.editor-toolbar{padding:8px 10px;display:grid;grid-template-columns:1fr 1fr;gap:6px}#editor .editor-toolbar select{max-width:none;font-size:14px;min-height:42px}#editor #drafts{grid-column:1/-1}#editor #new-level{padding:7px 10px;min-height:42px}.editor-mobile-tabs{display:flex;padding:0 10px 8px;gap:6px}.editor-mobile-tabs button{flex:1;font-size:13px!important;padding:8px 4px!important}.editor-body{display:block;overflow:hidden;position:relative}.editor-settings{display:none;height:100%;overflow:auto;padding:14px}.editor-map{height:100%;min-height:0;padding:8px 10px;gap:7px}.editor-body[data-panel=settings] .editor-map,.editor-body[data-panel=hazards] .editor-map{display:none}.editor-body[data-panel=settings] .editor-settings,.editor-body[data-panel=hazards] .editor-settings{display:block}.editor-body[data-panel=settings] #hazard-settings,.editor-body[data-panel=hazards] #road-settings{display:none}.editor-body[data-panel=hazards] #hazard-settings>hr{display:none}#editor input,#editor select{font-size:16px;min-height:44px}#editor #palette{flex-wrap:nowrap;overflow-x:auto;flex-shrink:0;padding-bottom:3px}#editor #palette button{white-space:nowrap;min-height:40px;font-size:13px;flex-shrink:0}.canvas-toolbar{flex-shrink:0}#editor .canvas-toolbar button{min-height:40px}#editor #edit-tool{min-height:40px;font-size:14px;max-width:145px}#map-help{font-size:12px;flex-shrink:0}#map-stage{min-height:90px}.editor-footer{padding:8px 10px max(8px,env(safe-area-inset-bottom));gap:7px;flex-shrink:0}.editor-footer>div:first-child{width:100%}.editor-footer p{font-size:13px;line-height:1.3;margin:0}.editor-footer>div>span{display:none}.editor-actions{display:grid;grid-template-columns:1fr 1fr 1fr;width:100%;gap:6px;align-items:end}.editor-actions .test-vehicle-label{grid-column:1;width:auto!important}.editor-actions #test-level{grid-column:2/4}#editor .editor-actions button{min-height:41px;padding:8px 5px;font-size:14px}.editor-actions #test-car{margin-top:2px;min-height:38px;padding:5px;font-size:14px}.editor-actions #unpublish-level{display:none}#editor .editor-actions #unpublish-level:not(:disabled){display:block;grid-column:1/-1;min-height:30px;padding:4px;font-size:12px}.editor-actions #save-level{grid-column:1/3}.editor-actions #publish-level{grid-column:3}.test-vehicle-label{font-size:11px!important}#map-summary{font-size:11px;padding:4px 7px}#dimension-readout{font-size:11px;padding:5px 7px}.editor-header{flex-shrink:0}}
@media(max-height:520px) and (min-width:600px) and (max-width:1000px){.editor-header{padding:6px 12px}.editor-header span{display:none}.editor-toolbar{padding:5px 10px;display:flex;flex-wrap:nowrap}.editor-toolbar select{max-width:36%!important}.editor-mobile-tabs{display:flex;position:absolute;right:12px;top:6px;z-index:1;background:#102029}.editor-header>a{margin-right:310px}#editor .editor-mobile-tabs button{min-height:34px;font-size:12px;padding:5px 8px}.editor-body{display:block;position:relative;overflow:hidden}.editor-settings{display:none;overflow:auto;height:100%}.editor-body[data-panel=settings] .editor-settings,.editor-body[data-panel=hazards] .editor-settings{display:block}.editor-body[data-panel=settings] #hazard-settings,.editor-body[data-panel=hazards] #road-settings,.editor-body[data-panel=settings] .editor-map,.editor-body[data-panel=hazards] .editor-map{display:none}.editor-map{height:100%;min-height:0;padding:6px 10px;gap:4px}.canvas-toolbar{flex-wrap:nowrap}.canvas-toolbar>div{flex-wrap:nowrap}#editor .canvas-toolbar button,#editor #edit-tool,#editor #palette button{min-height:30px;padding:4px 7px;font-size:12px}#palette{position:absolute;top:45px;left:18px;right:18px;z-index:1}#map-help{display:none}#map-stage{min-height:80px}#map-summary{top:auto;bottom:8px}.editor-footer{display:flex;flex-direction:row;align-items:center;padding:6px 10px;gap:8px}.editor-footer>div:first-child{width:22%;font-size:12px}.editor-footer p{font-size:12px}.editor-footer span{display:none}.editor-actions{display:flex;flex:1;flex-wrap:nowrap;width:auto;gap:6px}#editor .editor-actions button{min-height:38px;padding:6px 8px;font-size:12px}#editor .test-vehicle-label{width:125px!important;font-size:11px}#editor #test-car{font-size:12px;min-height:32px;padding:4px}#editor #unpublish-level{display:none}.editor-header strong{font-size:15px}}
@media(max-width:360px){#touch-controls{gap:8px;padding-left:10px;padding-right:10px}#touch-controls button{min-width:56px}.touch-pedals button{width:68px;height:84px}#steering-wheel{width:116px;height:116px}.topbar{left:9px;right:9px}.topbar nav a,.topbar nav button{font-size:11px;padding:8px 6px}.brand{font-size:15px}}
#palette{scrollbar-width:thin;scrollbar-color:#6a828b #172b34}.map-navigation{position:absolute;right:8px;bottom:8px;display:flex;gap:4px;background:#142630dd;border-radius:5px;padding:3px}#editor .map-navigation button{min-height:34px;padding:5px 9px;font-size:13px}#dimension-readout{bottom:57px}@media(max-width:760px){#editor .map-navigation button{min-height:38px;padding:6px 10px}}@media(max-height:520px){#editor .map-navigation button{min-height:30px;padding:3px 8px}}
@media(max-height:520px) and (min-width:600px) and (max-width:1000px){#palette{top:6px;left:180px;right:12px;flex-wrap:nowrap;overflow-x:auto}#editor[data-view=3d] #palette{position:static}#map-summary{top:7px;bottom:auto;right:7px}}

@media(max-height:520px) and (min-width:600px) and (max-width:1000px){#editor .editor-actions #unpublish-level:not(:disabled){display:block;min-height:38px;padding:6px 8px}.topbar{left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right))}}
/* Main, pause and settings screens share one navigation layer. */
#menu-root{position:fixed;inset:0;z-index:12;display:grid;place-items:center;padding:max(20px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));background:#102029ad;overflow:auto;overscroll-behavior:contain}body[data-menu=main] #menu-root{background:radial-gradient(ellipse at 75% 20%,#36535b 0,transparent 58%),linear-gradient(150deg,#1e333b,#101e25 75%)}body:not([data-menu=none]) #game-ui{visibility:hidden}.menu-card{width:min(850px,100%);background:#182c35;border:1px solid #76929b40;border-radius:12px;box-shadow:0 25px 100px #05101870;overflow:hidden}.menu-header{display:flex;align-items:center;justify-content:space-between;padding:25px 30px;border-bottom:1px solid #8297962a}.menu-brand{font-weight:850;letter-spacing:.15em;font-size:23px;line-height:1.2}.menu-brand span{display:block;font-size:9px;color:#a1b7bb;font-weight:500;letter-spacing:.21em;margin-top:7px}.menu-marker{font-size:10px;letter-spacing:.16em;color:#afc0bc}.menu-body{display:grid;grid-template-columns:1.1fr 1fr}.drive-picker{padding:28px 30px}.main-menu h1{font-size:32px;margin:10px 0 12px}.menu-intro{font-size:14px;color:#b9ccca;margin:0 0 23px}.menu-selects{display:grid;gap:16px}.menu-selects label{display:block;color:#d6ded6;font-size:12px;letter-spacing:.03em}#menu-root select{width:100%;display:block;font:inherit;font-size:15px;color:#f8f7ef;background:#223d47;border:1px solid #526d76;border-radius:5px;padding:11px 10px;margin-top:6px;min-height:44px}#menu-root select:focus-visible,#menu-root input:focus-visible{outline:2px solid #f0c77c;outline-offset:3px}#vehicle-description{font-size:12px;color:#b0c5c5;min-height:36px;margin:10px 0 15px}.menu-help{font-size:12px;color:#abc0c3;line-height:1.5;margin:12px 0 0}.secondary,#menu-root .pause-actions button,#menu-root .menu-footer button,#menu-root .menu-footer a,#reset-settings{border:1px solid #546c72;border-radius:5px;background:#263f49;color:#edf0e9;padding:10px 14px;min-height:44px;font:inherit;font-size:14px;text-decoration:none;cursor:pointer}.secondary:hover,#menu-root .pause-actions button:hover,#menu-root .menu-footer button:hover,#menu-root .menu-footer a:hover,#reset-settings:hover{background:#36545d}#main-resume{width:100%;margin-top:10px;font-size:14px}#menu-error{padding:12px;border:1px solid #b98362;border-radius:5px;background:#4b332d;color:#ffdbc5;font-size:14px}.route-preview{background:#132730;padding:22px 25px;border-left:1px solid #879e9d20;display:flex;flex-direction:column;justify-content:center}.route-map{position:relative;background:linear-gradient(110deg,transparent,#28414a70),repeating-linear-gradient(0deg,transparent,transparent 29px,#7395960b 30px),repeating-linear-gradient(90deg,transparent,transparent 29px,#7395960b 30px);border:1px solid #607b7e25;border-radius:8px;margin-bottom:21px}.route-map svg{display:block;width:100%;height:200px}.route-map>span{position:absolute;left:13px;bottom:10px;font-size:8px;letter-spacing:.2em;color:#a8bcb8}.route-line{fill:none;stroke:#e8bb71;stroke-width:2.5;stroke-linejoin:round}.route-shadow{fill:none;stroke:#b4906060;stroke-width:13;stroke-linejoin:round}.route-start{fill:#edcd91;stroke:#12252e;stroke-width:2}.route-end{fill:#77ada9;stroke:#12252e;stroke-width:2}.route-preview h2{font-size:18px;line-height:1.3;margin:0 0 7px;font-weight:600}#preview-description{font-size:13px;line-height:1.6;color:#b7cdcd;margin:0 0 18px;min-height:42px}#route-stats{display:flex;justify-content:space-between;gap:12px;padding:15px 0;border-block:1px solid #6a83882e}#route-stats span{display:block;font-size:10px;color:#9eb6ba;margin-bottom:4px;text-transform:uppercase;letter-spacing:.1em}#route-stats strong{font-size:15px;font-weight:550;color:#ead8b7}.menu-footer{display:flex;align-items:center;gap:10px;padding:18px 30px;border-top:1px solid #879e9d25}.menu-footer span{margin-left:12px;color:#d2b88c}.menu-footer .menu-shortcuts{margin-left:auto;font-size:11px;color:#9db4b8}.menu-footer a,.menu-footer button{display:flex;align-items:center;justify-content:space-between}.menu-footer a{white-space:nowrap}.pause-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}.pause-actions .wide{grid-column:1/-1}#menu-root #overlay{position:static;background:none;pointer-events:auto;display:grid;place-items:center;width:100%}#menu-root .run-card{width:min(430px,100%);max-height:none;padding:30px;border-radius:10px;background:#192e38f5;box-shadow:0 25px 80px #05101865}#menu-root #overlay-text{margin:0 0 22px}#menu-root .run-card .card-foot{display:block}#menu-root .run-card .eyebrow{display:inline}#loading{z-index:15}body[data-menu=loading] #loading{background:#10232eee}#menu-root .primary{border-radius:5px;min-height:48px}.settings-menu{width:min(800px,100%);height:min(720px,calc(100dvh - 40px));display:flex;flex-direction:column}.settings-header{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:22px 28px;border-bottom:1px solid #82979630}.settings-header h1{font-size:27px;margin:5px 0 0}.settings-header .secondary{min-width:90px;display:flex;justify-content:space-between;gap:15px}.settings-layout{display:grid;grid-template-columns:148px 1fr;min-height:0;flex:1}#settings-tabs{display:flex;flex-direction:column;gap:7px;padding:20px 12px;background:#132830;border-right:1px solid #6f898a20}#settings-tabs button{color:#b9cdcc;background:none;border:1px solid transparent;border-radius:5px;font-size:14px;padding:11px 14px;text-align:left;min-height:44px}#settings-tabs button[aria-selected=true]{color:#f5d296;background:#3c4b47;border-color:#bd9f6250}#settings-panels{overflow-y:auto;overscroll-behavior:contain;padding:23px 28px;scrollbar-width:thin;scrollbar-color:#6b8589 #182c35}#settings-panels h2{margin:0 0 8px;font-size:19px;font-weight:600}.settings-help{font-size:13px;color:#b8cbcb;line-height:1.65;margin:0 0 12px}.setting-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:8px 16px;padding:15px 0;border-bottom:1px solid #75919526}.setting-row label{font-size:14px;color:#e2e7df}.setting-row output{font:500 12px system-ui;color:#edc581;font-variant-numeric:tabular-nums;min-width:60px;text-align:right}.setting-row input[type=range]{grid-column:1/-1;width:100%;margin:5px 0 0;height:24px;accent-color:#eab763;cursor:pointer}.setting-row select{grid-column:1/-1;margin:0!important}.setting-row input[type=checkbox]{width:22px;height:22px;accent-color:#eab763;cursor:pointer;margin:0}.settings-footer{padding:15px 25px;border-top:1px solid #80989b2c;display:flex;justify-content:space-between;gap:15px;align-items:center}.settings-footer>span{font-size:11px;color:#adc3c3}#reset-settings{font-size:12px;min-height:40px;white-space:nowrap}.look-tools{position:absolute;bottom:54px;left:50%;transform:translateX(-50%);display:flex;gap:5px;align-items:center;pointer-events:auto;flex-wrap:wrap;justify-content:center;width:max-content;max-width:60%}.look-tools button{background:#182e36d9;border:1px solid #d4ddc750;border-radius:4px;padding:7px 10px;color:#f7efd9;font-size:12px;min-height:36px}.look-tools button[aria-pressed=true]{border-color:#f3c982;background:#715735da}#look-status{width:100%;font-size:10px;color:#f5e4c1;text-align:center;text-shadow:0 1px 5px #14282d}.look-tools:has(button[aria-pressed=true]) #look-status{color:#ffe1a1}body[data-show-guide=no] .controls,body[data-show-contacts=no] .contact-panel,body[data-show-hazards=no] .road-notice,body[data-show-progress=no] .run-progress,body[data-show-look-tools=no] .look-tools{display:none}body[data-touch=yes] .look-tools{bottom:175px}.topbar nav{flex-wrap:nowrap}
@media(max-width:700px){#menu-root{padding:12px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));align-items:safe center}.menu-card{border-radius:9px}.menu-header{padding:18px 20px}.menu-brand{font-size:20px}.menu-marker{display:none}.menu-body{grid-template-columns:1fr}.drive-picker{padding:20px}.main-menu h1{font-size:28px}.menu-intro{margin-bottom:17px}.menu-selects{gap:12px;grid-template-columns:1fr 1fr}#menu-root select{font-size:16px;min-width:0}#vehicle-description{min-height:0;margin:10px 0 16px}.route-preview{padding:15px 20px;border-left:0;border-top:1px solid #82979625;display:block}.route-map{display:none}.route-preview h2{font-size:16px}.route-preview .menu-help{display:none}#preview-description{min-height:0;margin-bottom:10px;font-size:12px}#route-stats{padding:10px 0 0;border:0}.menu-footer{padding:15px 20px;flex-wrap:wrap}.menu-footer>*:not(.menu-shortcuts){flex:1}.menu-footer .menu-shortcuts{width:100%;margin:0;text-align:center;font-size:10px}#menu-root .run-card{padding:25px}.settings-menu{height:calc(100dvh - 24px)}.settings-header{padding:15px 18px}.settings-header h1{font-size:25px}.settings-layout{display:flex;flex-direction:column}#settings-tabs{flex-direction:row;gap:5px;overflow-x:auto;padding:10px;border-right:0;border-bottom:1px solid #6f898a20;flex-shrink:0}#settings-tabs button{font-size:13px;padding:9px 12px;white-space:nowrap;text-align:center;flex:1}#settings-panels{padding:18px;flex:1}.settings-footer{padding:10px 14px;gap:10px}.settings-footer>span{max-width:200px;line-height:1.5}.setting-row{padding:14px 0}.look-tools{bottom:90px;max-width:90%;gap:4px}.look-tools button{font-size:11px;padding:8px;min-height:38px}body[data-touch=yes] .look-tools{bottom:120px}body[data-touch=yes] .speed-panel,body[data-touch=yes] .contact-panel{bottom:183px}.topbar #editor-link,.topbar #course-link,.topbar #restart{display:none}.topbar nav{max-width:none}.topbar #pause{padding-inline:14px;font-size:13px;min-height:42px}}
@media(max-height:550px) and (min-width:600px){#menu-root{padding:12px}.main-menu{width:min(840px,100%)}.menu-header{padding:12px 22px}.menu-brand{font-size:18px}.menu-brand span{display:none}.menu-body{grid-template-columns:1.15fr 1fr}.drive-picker{padding:16px 22px}.main-menu h1{font-size:25px;margin:5px 0 8px}.menu-intro{display:none}.menu-selects{grid-template-columns:1fr 1fr;gap:10px}.menu-selects select{font-size:14px!important;padding:8px!important}#vehicle-description{min-height:0;font-size:11px;margin:8px 0 12px}.route-preview{padding:15px 22px}.route-map{display:none}.menu-footer{padding:10px 22px}.menu-footer .menu-shortcuts{width:auto;margin-left:auto}.settings-menu{height:calc(100dvh - 24px)}.settings-header{padding:10px 22px}.settings-header h1{font-size:23px}.settings-header .eyebrow{display:none}.settings-layout{display:grid;grid-template-columns:130px 1fr}#settings-tabs{flex-direction:column;padding:10px}#settings-tabs button{min-height:35px;padding:8px 12px}.settings-footer{padding:8px 18px}#settings-panels{padding:14px 22px}.look-tools,body[data-touch=yes] .look-tools{bottom:16px}.look-tools button{min-height:32px}body[data-touch=yes] .speed-panel,body[data-touch=yes] .contact-panel{bottom:124px}.controls{display:none}}
@media(max-width:360px){.menu-header,.drive-picker,.route-preview,.menu-footer{padding-left:15px;padding-right:15px}.menu-selects{grid-template-columns:1fr}.menu-brand{font-size:18px}.setting-row label{font-size:13px}.settings-header{padding-inline:15px}#settings-panels{padding:15px}}
@media(max-width:700px) and (min-height:551px){.look-tools,body[data-touch=yes] .look-tools{top:146px;bottom:auto}}

#menu-root{align-items:safe center}#settings-tabs{scrollbar-width:thin;scrollbar-color:#6b8589 #132830}@media(max-width:700px){#settings-tabs button{font-size:12px;padding:9px 8px}}
.wheel-diagram.many-wheels{grid-template-rows:none;grid-auto-rows:8px;row-gap:4px}.wheel-diagram.many-wheels .wheel{height:8px;border-radius:2px}
.touch-pedals .brake-pedal{background:#713d36ed!important;border:2px solid #edaaa0!important}.touch-pedals .brake-pedal[data-pressed=yes]{background:#f5beb1!important;color:#301e1a!important}.pedal-icon{width:30px;height:20px;fill:none;stroke:currentColor;stroke-width:2;pointer-events:none}
body[data-touch=yes] .look-tools button{min-height:44px;padding:8px 12px}
#editor-nav-help{font-size:13px;line-height:1.5;color:#a9c8d1;margin:0 0 8px}#selected-hazard{border:1px solid #c49c5e;border-radius:6px;padding:12px;margin:18px 0}#selected-hazard legend{color:#e5bd7b;padding:0 5px;font-size:14px}#hazards .hazard-select{text-align:left;flex:1;border:0;background:transparent;padding:7px;color:inherit;font-size:13px}#hazards .hazard-select[aria-pressed=true]{background:#344b50;color:#ffcf80}.inline-check{display:flex!important;align-items:center;gap:10px}.inline-check input{width:20px!important;height:20px!important}#editor3d canvas:focus-visible{outline:2px solid #e4bc73;outline-offset:-3px}@media(max-width:700px){#editor-nav-help{font-size:12px;margin-bottom:5px}}

/* Suppress native touch flashes while preserving the game's focus styles. */
:root{-webkit-tap-highlight-color:transparent}
