:root{color-scheme:dark;--ink:#edf6f3;--soft:#adbdbe;--hot:#ffc273;--deep:#080e12;font-family:"Arial", "PingFang SC","Microsoft YaHei",sans-serif}
*{box-sizing:border-box} [hidden]{display:none!important}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--deep);color:var(--ink);overscroll-behavior:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
button,input,select{font:inherit} button{border:1px solid var(--hot);background:var(--hot);color:#19110a;padding:12px 20px;font-weight:800;cursor:pointer;letter-spacing:.07em;min-height:44px}button:hover{filter:brightness(1.12)}button:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid #acf7ff;outline-offset:4px}button:disabled{opacity:.55;cursor:wait}
button.outline{background:#0a1017a8;border-color:#d3e3df50;color:var(--ink)}
#game,canvas,.optics,#hurt,.overlay,#hud{position:absolute;inset:0;width:100%;height:100%;display:block}
.optics,#hurt,#hud{pointer-events:none}
.optics{background:radial-gradient(ellipse at 50% 46%,transparent 38%,#02050890 100%);box-shadow:inset 0 0 85px #05070b55}
#hurt{background:radial-gradient(ellipse,transparent 26%,#9c130600 49%,#d13c21c9 100%);opacity:0}
.overlay{background:linear-gradient(90deg,#060b10ee 0%,#070c11c4 27%,#09101742 63%,transparent 100%),linear-gradient(0deg,#070c11bb,transparent 24%);display:grid;align-items:center;padding:0 6.4vw}
header,footer{position:absolute;left:6.4vw;right:6.4vw;display:flex;align-items:center;gap:12px;min-height:42px;font-size:11px;letter-spacing:.17em;color:#d6e2e0;font-weight:700}
header{top:max(env(safe-area-inset-top),4.7%);border-bottom:1px solid #adc6cc35;padding-bottom:12px}
footer{bottom:max(env(safe-area-inset-bottom),4%);justify-content:space-between;border-top:1px solid #adc6cc35;padding-top:12px}
.header-right{margin-left:auto}.mark{display:inline-block;width:17px;height:17px;background:linear-gradient(135deg,var(--hot) 40%,transparent 42%,transparent 57%,var(--hot) 59%);transform:skew(-9deg);flex:none}
.brief{justify-self:start;max-width:min(520px,100%);margin-top:1vh}.case{display:flex;align-items:center;gap:10px;color:var(--hot);font-size:12px;font-weight:700;letter-spacing:.23em}.case span{width:25px;height:1px;background:var(--hot)}
h1{display:flex;flex-direction:column;font-family:Impact,"Arial Black",sans-serif;font-style:italic;line-height:.80;letter-spacing:-.055em;font-size:clamp(85px,min(15vw,19vh),170px);margin:.17em 0 .14em;text-shadow:0 8px 55px #02040666}h1>span:nth-child(2){margin-left:-.026em}.period{color:var(--hot)}
h2{margin:0;font-size:23px;font-weight:800}.brief h2{font-size:clamp(15px,2.3vw,24px);letter-spacing:.30em;margin-left:3px}
p{line-height:1.75;color:#cad7d6;margin:16px 0 23px;max-width:33em;font-size:14px}.actions{display:flex;gap:10px}#start{min-width:145px;text-align:left}#loaderror{margin-top:12px;color:var(--hot);font-size:12px}
.dialog{position:absolute;left:50%;top:50%;translate:-50% -50%;width:min(390px,calc(100% - 28px));max-height:90%;overflow:auto;background:#0a131aed;border:1px solid #b4cdc34a;padding:27px;box-shadow:0 20px 75px #0009;z-index:4}.dialog h2{margin:12px 0 18px}.dialog label{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 0 14px;font-size:13px}.dialog button{margin:8px 7px 0 0}input{accent-color:var(--hot)}select{padding:7px;border:1px solid #b4cdc34a;background:#131e25}
.objective{position:absolute;display:flex;align-items:center;gap:12px;left:max(24px,env(safe-area-inset-left));top:max(21px,env(safe-area-inset-top));text-shadow:0 2px 8px #000}.objective small,.objective b{display:block}.objective b{font-size:14px;margin-top:5px}
#hud small{font-size:10px;font-weight:800;letter-spacing:.16em;color:#d5e2de} .controls{position:absolute;right:max(24px,env(safe-area-inset-right));top:max(15px,env(safe-area-inset-top));text-align:right}
#city-phone-open{pointer-events:auto;touch-action:manipulation;padding:5px 9px;min-height:35px}
#hud[data-city-life] .controls{z-index:4}
#pause{pointer-events:auto;padding:5px 10px;min-width:35px;min-height:35px}#bearing{display:block;margin-top:8px}
#reticle{position:absolute;top:50%;left:50%;height:24px;width:24px;translate:-50% -50%;filter:drop-shadow(0 1px 1px #000)}
#reticle i{display:block;position:absolute;background:#f4fff1} #reticle i:nth-child(1),#reticle i:nth-child(2){left:11px;width:2px;height:5px}#reticle i:nth-child(2){bottom:0}#reticle i:nth-child(3),#reticle i:nth-child(4){top:11px;width:5px;height:2px}#reticle i:nth-child(4){right:0}
#reticle.hit i{background:var(--hot);box-shadow:0 0 4px #ff8c34}#reticle.hit{rotate:45deg}#reticle.ads{scale:.7}
#target{position:absolute;translate:-50% -50%;display:flex;gap:8px;align-items:center;color:var(--hot);filter:drop-shadow(0 1px 2px black)}#target i{width:10px;height:10px;outline:1px solid currentColor;rotate:45deg;background:#64471a44}
#target small{color:var(--hot)}#prompt,#notice{position:absolute;left:50%;translate:-50%;text-align:center;width:max-content;max-width:80%;text-shadow:0 2px 6px #000}
#prompt{top:60%;padding:9px 14px;border:1px solid #accac772;background:#061017ce;font-size:13px}#notice{top:21%;color:var(--hot);font-size:13px;font-weight:800;letter-spacing:.07em}
.vitals,.ammo{position:absolute;bottom:max(24px,env(safe-area-inset-bottom));filter:drop-shadow(0 2px 3px #000)}.vitals{left:max(24px,env(safe-area-inset-left))}.ammo{right:max(24px,env(safe-area-inset-right));text-align:right}
.vitals b,.ammo b{font-size:34px;font-variant-numeric:tabular-nums;line-height:1.12}.vitals span,.ammo span{color:var(--soft);font-size:13px}progress{display:block;appearance:none;width:96px;height:3px;margin-top:5px;border:0;background:#a9bcab40}progress::-webkit-progress-bar{background:#a9bcab40}progress::-webkit-progress-value{background:#c0e4d0}progress::-moz-progress-bar{background:#c0e4d0}
#touch{position:absolute;inset:0;pointer-events:none}#look{position:absolute;inset:0;pointer-events:auto;touch-action:none}
#stick{position:absolute;display:grid;place-items:center;left:max(23px,env(safe-area-inset-left));bottom:80px;width:104px;height:104px;border:1px solid #c1e0de57;background:#0917225c;border-radius:50%;pointer-events:auto;touch-action:none}#stick i{width:38px;height:38px;border-radius:50%;border:1px solid #c1e0de86;background:#b6e2e030}
#touch button{position:absolute;display:grid;place-items:center;width:48px;height:48px;padding:0;border-radius:50%;pointer-events:auto;touch-action:none;background:#0c1b23a8;color:white;border-color:#c1e0de66;font-size:21px}#touch #fire{right:25px;bottom:105px;width:62px;height:62px;border-color:#ffc273aa;color:var(--hot)}#aim{right:98px;bottom:89px}#reload{right:101px;bottom:143px}#act{right:26px;bottom:180px}
#look{z-index:0}#stick,#touch button{z-index:3}.controls,.objective,.vitals,.ammo,#prompt,#notice,#target,#reticle{z-index:1}
@media(max-width:650px){.overlay{padding:0 7vw;background:linear-gradient(90deg,#060b10ee,#080e1290 64%,#080e1220)}header,footer{left:7vw;right:7vw}footer span:last-child{display:none}.brief p{max-width:24em}}
@media(max-height:520px){h1{font-size:clamp(58px,16vh,95px);flex-direction:row;gap:.12em}.brief p{margin:8px 0 10px}.brief h2{font-size:14px}header,footer{min-height:24px}.objective,.controls{top:10px}.vitals,.ammo{bottom:12px}#stick{bottom:55px;width:85px;height:85px}#touch #fire{bottom:67px}#aim{bottom:59px}#reload{bottom:115px}#act{bottom:138px}}

#touch,#touch *{touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;-webkit-user-drag:none}
#touch button.held,#touch button[aria-pressed="true"]{background:#263a42;border-color:#ffca82;color:#ffca82} #stick i{pointer-events:none}
.slider{display:flex;align-items:center;gap:7px}.slider output{min-width:4ch;text-align:right;font-variant-numeric:tabular-nums;color:var(--hot)}

.actions{flex-wrap:wrap}.dialog input:not([type=range]):not([type=checkbox]){min-width:0;width:min(57%,200px);padding:9px;background:#131e25;border:1px solid #a9c3be66;color:white;font-size:16px;-webkit-user-select:text;user-select:text;touch-action:auto}.dialog a{color:var(--hot)}.dialog form,.join-input{margin-top:14px!important}.copy-code{display:block;margin-top:9px;font-family:monospace;font-size:18px;color:var(--hot);-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}.dialog [role=status]{margin:8px 0}#team-link{display:block;margin-top:5px}

#metro-status{position:absolute;top:11%;left:50%;translate:-50% 0;white-space:nowrap;padding:7px 11px;border:1px solid #75d5dc66;background:#14282de8;color:#bcfbfa;font-size:12px;z-index:1}

#hud[data-mode="explore"]:not([data-random-roam]) .vitals{display:none}
#hud[data-mode="explore"] :is(.objective,.ammo,#reticle,#aim,#fire,#reload,#team-link){display:none}
#photo{pointer-events:auto;min-height:35px;padding:5px 9px;margin-right:7px}

#lift-status{position:absolute;inset:0;display:grid;place-items:center;background:radial-gradient(ellipse,#223842,#08141b);color:#ddf8f9;letter-spacing:.1em;z-index:1;pointer-events:none}

#broadcast{position:absolute;z-index:2;bottom:22%;left:50%;translate:-50% 0;width:min(570px,68vw);color:white;background:#10222ce8;border-left:2px solid #80dfec;padding:7px 10px;text-align:center;font-size:13px;pointer-events:none}

#minimap{position:absolute;top:max(80px,calc(env(safe-area-inset-top) + 65px));right:max(16px,env(safe-area-inset-right));width:126px;height:126px;padding:0;min-height:0;border:1px solid #80c3ca80;border-radius:7px;overflow:hidden;pointer-events:auto;z-index:2;background:#101d25}
#minimap canvas{width:100%;height:100%;display:block}
#map-dialog{width:min(630px,calc(100% - 26px));max-height:92%;padding:14px;overflow:auto}
.map-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}
#map-dialog .map-heading h2{margin:0}.map-content{display:flex;align-items:flex-start;gap:14px;margin-top:10px}.map-content canvas{position:static;width:min(58%,340px);height:auto;max-height:72vh;object-fit:contain;background:#112029}
.map-key{font-size:11px;color:#8cd5d9;line-height:1.65}#map-legend{font-size:12px;color:#dbe8e8;margin:8px 0 0;padding-left:23px;line-height:1.55}
@media(max-width:650px){#minimap{width:103px;height:103px}}
@media(max-height:520px){#minimap{top:65px;width:83px;height:83px}}

.map-tools{display:grid;gap:.4rem;margin:.7rem 0}
.map-tools label{display:grid;gap:.2rem;font-size:.73rem;color:#c7e3e5}
.map-tools select{width:100%;min-width:0;padding:.35rem}
.map-tools small{display:block;line-height:1.5;color:#9effdf;max-width:19rem}
#grid-status{position:absolute;bottom:4rem;left:50%;transform:translateX(-50%);background:#231622e8;border:1px solid #d7a0ad;color:#ffe1d5;padding:.4rem .7rem;font-size:.72rem;border-radius:.3rem;text-align:center;pointer-events:none;max-width:65vw}
#map-legend button{border:0;background:none;color:inherit;text-align:left;padding:.14rem .22rem;font:inherit;cursor:pointer}
#map-legend button:hover,#map-legend button:focus-visible{color:#adffec;text-decoration:underline}


#spawn-dialog{width:min(650px,calc(100% - 2 * max(16px,env(safe-area-inset-left),env(safe-area-inset-right))));padding:clamp(12px,3vw,24px);touch-action:pan-y}
.spawn-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
#spawn-dialog .spawn-heading h2,#spawn-dialog button{margin:0}
#spawn-dialog button{touch-action:manipulation}
#spawn-points{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#spawn-points button{text-align:left;min-width:0;padding:10px 12px;letter-spacing:normal}
#spawn-points button small{display:block;margin-top:4px;color:var(--soft);font-size:11px;line-height:1.35;font-weight:400}
@media (orientation:landscape) and (max-height:440px){#spawn-points{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:360px){#spawn-dialog .spawn-heading h2{font-size:18px}}

#weather{pointer-events:auto;min-height:35px;padding:5px 9px;margin-right:7px}

:root{
  --safe-top:max(10px,env(safe-area-inset-top));
  --safe-right:max(12px,env(safe-area-inset-right));
  --safe-bottom:max(10px,env(safe-area-inset-bottom));
  --safe-left:max(12px,env(safe-area-inset-left));
}
.dialog{touch-action:pan-y;overscroll-behavior:contain}
body:has(:is(#result,#settings,#ticket-dialog,#map-dialog,#shop-dialog,#city-phone):not([hidden])) #touch{visibility:hidden}
#hud[data-mode="explore"] #act{right:calc(var(--safe-right) + 8px);bottom:calc(var(--safe-bottom) + 12px);width:54px;height:54px}
@media (orientation:landscape) and (max-height:560px){
  #menu{
    display:grid;grid-template-rows:auto minmax(min-content,1fr) auto;align-items:stretch;
    padding:var(--safe-top) calc(var(--safe-right) + 10px) var(--safe-bottom) calc(var(--safe-left) + 10px);
    gap:8px;overflow:auto;touch-action:pan-y;
  }
  #menu :is(header,footer){position:static;min-height:0;padding:5px 0;font-size:9px;letter-spacing:.1em}
  #menu .brief{max-width:none;width:100%;margin:0;display:grid;align-content:center;align-items:center;gap:8px clamp(14px,4vw,45px);grid-template-columns:minmax(0,1fr) minmax(0,1.12fr)}
  #menu h1{font-size:clamp(34px,min(9vw,15vh),78px);gap:.12em;margin:.18em 0;white-space:nowrap}
  #menu .brief p{font-size:clamp(10px,3.1vh,13px);line-height:1.5;margin:8px 0 0}
  #menu .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  #menu .actions button{min-width:0;text-align:center;font-size:clamp(11px,2vw,14px);letter-spacing:0;padding:5px 7px;min-height:44px}
  #menu #start{grid-column:1/-1}
  #menu #loaderror{grid-column:1/-1;margin:0}
  #menu #loaderror:empty{display:none}
  .dialog{
    max-height:calc(100% - var(--safe-top) - var(--safe-bottom) - 4px);
    padding:clamp(10px,3.6vh,20px);
    top:var(--safe-top);bottom:auto;translate:-50% 0;
    width:min(500px,calc(100% - 2 * max(var(--safe-left),var(--safe-right))));
  }
  #map-dialog{max-height:calc(100% - var(--safe-top) - var(--safe-bottom) - 4px);width:min(700px,calc(100% - 2 * max(var(--safe-left),var(--safe-right))))}
  #map-dialog .map-content canvas{width:44%;max-height:calc(100dvh - var(--safe-bottom) - var(--safe-top) - 75px)}
  .map-heading,.spawn-heading{position:sticky;top:0;background:#0a131a;z-index:1;padding-bottom:5px}
  #map-dialog .map-heading button{margin:0}
  #spawn-dialog{padding:12px}
  #spawn-points{grid-template-columns:repeat(4,minmax(0,1fr))}
  #hud{--control-edge:calc(var(--safe-right) + 6px);--control-base:calc(var(--safe-bottom) + 8px)}
  #hud .controls{top:var(--safe-top);right:var(--control-edge);max-width:48%}
  #hud #bearing{margin-top:4px;letter-spacing:0}
  #hud .objective{top:var(--safe-top);left:calc(var(--safe-left) + 6px);max-width:42%}
  #hud #minimap{right:var(--control-edge);top:calc(var(--safe-top) + 56px);width:clamp(52px,21vh,79px);height:clamp(52px,21vh,79px)}
  #hud #stick{left:calc(var(--safe-left) + 10px);bottom:var(--control-base);width:85px;height:85px}
  #hud #act{right:var(--control-edge);bottom:var(--control-base);width:54px;height:54px;background:#102b38;border-color:#a0e8ee}
  #hud #touch #fire{right:calc(var(--control-edge) + 64px);bottom:var(--control-base);width:56px;height:56px}
  #hud #reload{right:var(--control-edge);bottom:calc(var(--control-base) + 61px)}
  #hud #aim{right:calc(var(--control-edge) + 68px);bottom:calc(var(--control-base) + 61px)}
  #hud .vitals{left:calc(var(--safe-left) + 106px);bottom:var(--control-base)}
  #hud .ammo{right:calc(var(--safe-right) + 135px);bottom:var(--control-base)}
  #hud :is(.vitals,.ammo) b{font-size:clamp(16px,6vh,25px)}
  #hud #prompt{top:60%;max-width:min(54%,460px);padding:6px 10px}
  #hud #broadcast{bottom:calc(var(--safe-bottom) + 12px);width:min(47vw,500px);font-size:11px;padding:4px 7px}
  #hud #metro-status{top:calc(var(--safe-top) + 38px);max-width:59vw;white-space:normal;text-align:center}
}
@media (orientation:landscape) and (max-height:290px){
  #menu .brief p{font-size:10px}
  #menu :is(header,footer){padding:2px 0}
  #spawn-points button{padding:5px 7px}
}

#wallet-balance{display:inline-block;margin:0 7px 0 0;color:#ffc273;letter-spacing:0;vertical-align:middle}
#shop-items{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:6px}
#shop-items button{margin:0;text-align:left;padding:8px}

#drive-view{pointer-events:auto;min-height:35px;padding:5px 9px;margin-right:7px}

#load-recovery{grid-column:1/-1;display:flex;gap:12px;margin-top:6px}
#load-recovery a{color:var(--ink);padding:8px 10px;border:1px solid #b4cdc34a}

#drive-pedals{display:none}
#hud[data-driving] #drive-pedals{display:block}
#hud[data-driving] :is(#fire,#aim,#reload){display:none}
#hud[data-driving] #touch #drive-pedals button{
  right:calc(var(--safe-right) + 76px);height:48px;width:64px;border-radius:9px;font-size:14px;
}
#hud[data-driving] #throttle{bottom:calc(var(--safe-bottom) + 70px);border-color:#86dfba}
#hud[data-driving] #reverse{bottom:calc(var(--safe-bottom) + 12px)}
#hud[data-driving] #act{right:calc(var(--safe-right) + 8px);bottom:calc(var(--safe-bottom) + 12px)}

#update-notice{position:relative;z-index:3;letter-spacing:0}
#update-notice summary{
  color:#ffe3b7;border:1px solid #ffc27370;border-radius:4px;
  padding:6px 9px;font-size:clamp(10px,1.7vw,12px);cursor:pointer;white-space:nowrap;
}
#update-notice summary:focus-visible{outline:2px solid #acf7ff;outline-offset:3px}
#update-notice article{
  position:absolute;top:calc(100% + 8px);right:0;
  width:min(340px,76vw);max-height:min(64dvh,280px);overflow:auto;
  background:#0b171f;border:1px solid #ffc27385;border-radius:5px;box-shadow:0 12px 30px #0008;
  padding:13px;touch-action:pan-y;overscroll-behavior:contain;
}
#update-notice time{font-size:10px;color:var(--soft)}
#update-notice h2{font-size:15px;line-height:1.45;margin:5px 0 8px}
#update-notice p{font-size:12px;line-height:1.6;margin:0 0 8px;font-weight:400}
#update-notice p:last-child{margin-bottom:0}

#armory-items{display:grid;gap:8px}
#armory-items button{margin:0;padding:10px;text-align:left}
#armory-items small{display:block;margin-top:4px}

#city-phone{width:min(680px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:clamp(12px,3vw,26px);z-index:10}
#city-phone .map-heading h2{margin:4px 0}
#city-phone-tabs,#city-backgrounds{display:flex;gap:6px;flex-wrap:wrap}
#city-phone-tabs button,#city-phone-content button,#city-backgrounds button{margin:2px;min-height:38px;padding:6px 11px}
#city-phone-tabs button[aria-current=true]{border-color:#8be5c3;color:#a9ffdf;background:#223d3a}
#city-phone-content h4{margin:15px 0 4px}
#city-phone-status:not(:empty){color:#a9ffdf;margin:8px 0}
#hud[data-city-life] #minimap{top:calc(var(--safe-top) + 88px)}
@media (orientation:landscape) and (max-height:500px){#city-phone{max-height:calc(100dvh - 16px)}}
#city-phone{width:min(370px,calc(100% - 26px));border:5px solid #283038;border-radius:27px;background:linear-gradient(155deg,#263847,#111a25 48%,#161e28);padding:13px 15px 18px;color:#f4f8fb;overscroll-behavior:contain}
.phone-status,.phone-header{display:flex;align-items:center;justify-content:space-between;gap:8px}
.phone-status{padding:2px 4px 8px;font-size:11px}
.phone-header{position:sticky;top:0;z-index:1;background:#15212d;border-radius:12px;padding:4px}
#city-phone .phone-header h2{font-size:17px;margin:0 auto 0 7px}
#city-phone .phone-header button{min-height:36px;margin:0;padding:5px 8px;letter-spacing:0}
#city-phone-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px 4px;padding:13px 0 4px}
#city-phone-tabs button{margin:0;padding:0;border:0;background:transparent;display:grid;justify-items:center;gap:5px;color:#f4f8fb;letter-spacing:0;font-size:11px}
.phone-icon{width:43px;height:43px;border-radius:13px;display:grid;place-items:center;background:linear-gradient(145deg,#2a658a,#22435b);color:white;font-size:23px;box-shadow:0 3px 8px #07111b60}
#city-phone-tabs button:nth-child(3n+2) .phone-icon{background:linear-gradient(145deg,#398269,#225345)}
#city-phone-tabs button:nth-child(3n+3) .phone-icon{background:linear-gradient(145deg,#8065ab,#473861)}
#city-phone-content{font-size:14px}
@media (orientation:landscape) and (max-height:500px){#city-phone{width:min(420px,calc(100% - 26px));padding:8px 13px 11px}#city-phone-tabs{gap:6px 4px;padding-top:8px}.phone-icon{width:38px;height:38px;border-radius:11px}}
.road-directory{margin:.55rem 0;color:#d6edf3}
.road-directory summary{cursor:pointer}
#road-filter{display:block;width:100%;padding:.42rem;margin:.5rem 0;color:inherit;background:#132532;border:1px solid #507584;border-radius:.35rem}
#road-atlas-list{max-height:9.5rem;overflow:auto;padding:0;margin:.3rem 0 .6rem;list-style:none}
#road-atlas-list li{padding:.29rem .15rem;border-bottom:1px solid #57738240;font-size:.8rem}
#map-dialog{width:min(910px,calc(100% - 26px))}
.map-content{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:12px}
.map-viewport{min-width:0;border:1px solid #4b6e83;border-radius:10px;background:#111f2a;overflow:hidden}
#map-dialog .map-content #map-canvas{position:static;display:block;width:100%;height:auto;max-height:none;touch-action:none;cursor:grab;object-fit:fill}
#map-canvas:active{cursor:grabbing}
.map-zoom,.map-layers,.traffic-key{display:flex;gap:.55rem;flex-wrap:wrap;align-items:center}
.map-zoom{justify-content:center;padding:.35rem;background:#142634}
.map-zoom button{margin:0;padding:.25rem .55rem;min-width:2rem;min-height:2rem;font-size:.85rem}
.map-zoom output{min-width:2.7rem;text-align:center;font-size:.76rem}
.map-panel{min-width:0}
.map-layers{font-size:.83rem;margin:.4rem 0}
.traffic-key{gap:.3rem .6rem;font-size:.69rem;margin:.3rem 0;color:#d4e7ee}
.traffic-key span:before{content:"";display:inline-block;width:.6rem;height:.6rem;margin-right:.25rem;border-radius:2px;background:var(--sw)}
.map-places summary{cursor:pointer;font-size:.8rem}
#map-legend{max-height:10rem;overflow:auto}
@media(max-width:540px) and (orientation:portrait){.map-content{grid-template-columns:minmax(0,1fr)}}


/* The lobby is its own lightweight layer; no imagery or new scene assets are needed. */
#menu{--lobby-edge:clamp(18px,6vw,86px);display:grid;grid-template-rows:auto minmax(min-content,1fr) auto;
  gap:clamp(12px,3vh,32px);align-items:stretch;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;
  padding:calc(var(--safe-top) + 14px) max(var(--lobby-edge),var(--safe-right)) calc(var(--safe-bottom) + 14px) max(var(--lobby-edge),var(--safe-left));
  background:radial-gradient(ellipse at 26% 65%,#193b39 0%,#0d1c20 41%,#080e12 78%);}
#menu :is(header,footer){position:relative;inset:auto;min-height:0;max-width:1050px;width:100%;margin-inline:auto;
  flex-wrap:wrap;gap:6px 11px;font-size:11px;line-height:1.45;}
#menu header{padding:0 0 6px;z-index:2}
#menu footer{padding:8px 0 0}
#menu .lobby-layout{justify-self:center;align-self:center;max-width:1050px;width:100%;margin:0;display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,.88fr);align-items:center;gap:clamp(24px,7vw,100px);}
#menu h1{font:800 clamp(2.8rem,7.8vw,6.3rem)/.9 Arial,sans-serif;letter-spacing:-.075em;margin:.28em 0 .22em;
  flex-direction:column;gap:0;font-style:normal;white-space:nowrap;text-shadow:none;}
#menu .brief p{font-size:clamp(.88rem,1.6vw,1.06rem);margin:.5rem 0;line-height:1.65;}
#menu .lobby-skyline{display:block;width:min(100%,490px);height:auto;margin-top:10px;stroke:#95bfb0;stroke-opacity:.42;stroke-width:1.05}
#menu .lobby-water{stroke:#f4bc80;stroke-opacity:.60}
#menu .lobby-controls{min-width:0}
#menu .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
#menu .actions button,#menu .lobby-more summary{border-radius:8px;min-height:44px;padding:10px 12px;font-size:14px;
  font-weight:650;letter-spacing:0;text-align:left;white-space:normal;min-width:0;}
#menu .actions button small{display:block;font-size:12px;line-height:1.4;margin-top:2px;font-weight:500;}
#menu .actions button small:empty{display:none}
#menu .actions .lobby-primary,#menu #resume-roam[hidden]+#explore{grid-column:1/-1;background:#cbe4d6;border-color:#cbe4d6;color:#112b27;font-size:17px;}
#menu .actions .lobby-explore{grid-column:1/-1}
#menu .outline{background:#101d22;border-color:#a9cec44b}
#menu .lobby-more{grid-column:1/-1;border-block:1px solid #aacbc33b}
#menu .lobby-more summary{padding-inline:4px;cursor:pointer;touch-action:manipulation;}
#menu .lobby-more summary:focus-visible{outline:2px solid #acf7ff;outline-offset:2px;}
#menu .lobby-more-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding-bottom:7px;}
#menu .lobby-utils{display:flex;gap:6px;grid-column:1/-1;}
#menu .lobby-utils button{background:transparent;text-align:center;}
#menu #start{grid-column:auto;}
#menu #load-recovery{flex-wrap:wrap;gap:6px;}
#menu #loaderror:empty{display:none;}
@media (max-width:640px) and (orientation:portrait){
  #menu .lobby-layout{grid-template-columns:minmax(0,1fr);gap:14px;}
  #menu h1{flex-direction:row;gap:.14em;font-size:clamp(1.9rem,8.2vw,3.25rem);}
  #menu .lobby-skyline{max-height:67px;margin-top:2px;object-fit:contain;object-position:left;}
  #menu .brief p{margin:.4rem 0;}
}
@media (orientation:landscape) and (max-height:560px){
  #menu{gap:8px;--lobby-edge:16px;}
  #menu .lobby-layout{gap:clamp(14px,4vw,35px);}
  #menu h1{font-size:clamp(2.1rem,12vh,3.9rem);}
  #menu .lobby-skyline{max-height:66px;object-fit:contain;object-position:left;margin-top:2px;}
  #menu .actions{gap:6px;}
}

/* Local SVG lens: filter only the decorative image, never controls or text. */
#menu .lobby-controls{
  --lens-x:21%;--lens-y:22%;position:relative;isolation:isolate;overflow:hidden;
  border:1px solid #d5f7e658;border-radius:22px;padding:clamp(14px,3vw,25px);
  background:linear-gradient(138deg,#badace1b,#76c0b00b 50%,#060e11c7);
  box-shadow:inset 0 1px 0 #edfcef44,inset 0 -1px 0 #84c8c027,0 16px 42px #03080bb0;
}
#menu .lobby-optics-defs{position:absolute;top:0;left:0;overflow:hidden;pointer-events:none}
#menu .lobby-optics{
  position:absolute;z-index:-1;inset:0;pointer-events:none;overflow:hidden;border-radius:inherit;
  background:linear-gradient(115deg,#bfded314,#88b3a409 38%,#79c6b71e 100%);
}
#menu .lobby-optics::before{
  content:"";position:absolute;inset:-7%;opacity:.68;filter:url(#lobby-refraction);
  background:radial-gradient(ellipse at var(--lens-x) var(--lens-y),#a9f5dd68,transparent 53%),
    repeating-linear-gradient(117deg,transparent 0 44px,#d1ece82b 45px,#d1ece801 47px,transparent 48px 61px),
    linear-gradient(140deg,transparent 31%,#9aeee14f 52%,transparent 79%);
}
#menu .lobby-optics::after{
  content:"";position:absolute;inset:2px;border-radius:20px;
  border:1px solid #d1fff919;background:radial-gradient(ellipse at var(--lens-x) var(--lens-y),#ebfff827,transparent 46%);
}
#menu .lobby-controls .outline{background:#08151bd4;border-color:#b3dace55}
#menu .lobby-controls .lobby-utils .outline{background:#10232aad}
@media (prefers-reduced-motion:reduce){
  #menu .lobby-optics::before{filter:none}
}
