.mobile-menu-button{position:fixed;z-index:90;top:max(8px,env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));width:42px;height:42px;border:1px solid #ffffff80;border-radius:14px;background:#14372ee8;color:#fff;font:24px system-ui;touch-action:manipulation;cursor:pointer;box-shadow:0 3px 12px #0002}
.mobile-menu-button[hidden]{display:none}.mobile-game-dialog{width:min(360px,calc(100vw - 24px));max-height:calc(100dvh - 36px);border:1px solid #ffffff90;border-radius:22px;padding:18px;background:#f7f6ec;color:#24483e;box-shadow:0 20px 80px #001c2860;overflow:auto;font:14px system-ui}.mobile-game-dialog::backdrop{background:#08272b70;backdrop-filter:blur(5px)}.mobile-game-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.mobile-game-dialog header button{width:42px;height:42px;border:0;border-radius:50%;font-size:20px}.mobile-game-dialog>a{display:block;margin-top:20px;color:inherit}.mobile-menu-content{display:grid;gap:16px}.mobile-game-dialog .mobile-menu-content>*{position:static!important;inset:auto!important;transform:none!important;width:auto!important;max-width:100%!important;margin:0!important;pointer-events:auto!important}.mobile-game-dialog .hud-actions{display:flex!important;flex-wrap:wrap}.mobile-game-dialog .mini-map-card{display:block!important;color:#e8ecd5}.mobile-game-dialog .combat-room{display:flex!important;color:#e8ecd5}.mobile-game-dialog #inventory{display:flex!important;flex-wrap:wrap;justify-content:center;background:#14718b;border-radius:16px;padding:12px}.mobile-game-dialog #chat-toggle{display:block!important;width:100%}
@media(max-width:1100px),(max-height:500px){
 .relax-return{display:none!important}
 body:has(#start-overlay:not([hidden])) .mobile-menu-button,body:has(#hud[hidden]) .mobile-menu-button{display:none}
 /* Bikini: leave a slim status strip and two thumb areas on the field. */
 #app #top{padding:8px 60px 8px 10px;gap:8px;align-items:center}#app #brand{font-size:12px;max-width:115px;line-height:1.1}#app #brand small{font-size:8px;letter-spacing:0}#app #hud{gap:4px;flex-wrap:nowrap}#app #hud>span{padding:4px 6px;font-size:12px}#app #map-btn{width:36px;height:36px;padding:4px}#app #zone,#app #help,#app #inventory,#app #chat-toggle{display:none}
 #app #mobile{display:flex;bottom:max(15px,env(safe-area-inset-bottom));left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));align-items:end}#app #joystick{width:88px;height:88px}#app #joystick-handle{left:24px;top:24px;width:36px;height:36px}#app .mobile-actions{display:grid;grid-template-columns:48px 48px;gap:8px}#app .mobile-actions button{width:48px;height:48px;font-size:23px}#app .mobile-actions button[data-action=jump]{grid-column:2;grid-row:1/3}#app #interact{bottom:max(22px,env(safe-area-inset-bottom));max-width:calc(100% - 240px)}#app #use-btn{font-size:11px;padding:9px 10px;max-width:100%}#app #toast{top:64px;font-size:12px;padding:8px 12px;max-width:76%}#app #chat-panel{inset:60px 12px auto;width:calc(100vw - 24px);height:min(280px,calc(100dvh - 160px));z-index:80}#app #map-panel{inset:58px 12px 12px;max-height:none}
 /* MISA: move map/settings/social details to the menu, keep play controls. */
 .hud .hud-top{top:8px;left:10px;right:62px;padding:0}.hud .zone-card{padding:8px 12px;max-width:185px;min-width:0;border-radius:15px}.hud .zone-card h2{font-size:14px;margin:0}.hud .zone-kicker,.hud #zone-subtitle,.hud .height-row,.hud .climb-track,.hud .hud-actions,.hud .mini-map-card,.hud .help-panel{display:none}.combat-hud .combat-room{display:none}.hud .touch-controls{bottom:max(14px,env(safe-area-inset-bottom));left:12px;right:12px}.hud .joystick{width:86px;height:86px}.hud .joystick-knob{width:34px;height:34px}.hud .touch-button{width:48px;height:48px;min-width:0;min-height:0}.hud .touch-button span{display:none}.hud .touch-button svg{width:22px;height:22px}.hud .touch-actions{gap:8px}.hud .status-area{bottom:116px;max-width:calc(100% - 28px);padding:0}.hud .status-line{display:none}.hud .interaction-button{min-height:38px;padding:8px 14px;font-size:12px}.combat-hud .combat-deck{width:min(310px,calc(100vw - 32px));bottom:112px;padding:6px 8px;border-radius:14px}.combat-hud .combat-vitals{margin-bottom:4px;gap:10px;min-height:16px}.combat-hud .combat-target{top:58px;width:min(230px,70vw);padding:6px 9px}.combat-hud .combat-target-kind,.combat-hud kbd{display:none}.combat-hud .combat-target-name{font-size:10px}
 /* Arta: the map lives in pause; the field shows only title and collection count. */
 .arta-top{inset:8px 8px auto}.arta-top>div:first-child{padding:8px 11px}.arta-top b{font-size:15px}.arta-top span{font-size:10px}.arta-top button{padding:8px 10px;min-height:38px}.arta-progress{top:66px;left:10px;padding:6px 10px;gap:0;font-size:11px}.arta-progress label{display:none}.arta-pause .arta-progress{position:static;display:grid;gap:10px;margin-bottom:6px}.arta-pause .arta-progress label{display:grid}.arta-hint{display:none}.arta-controls{display:flex;inset:auto 14px max(14px,env(safe-area-inset-bottom))}.arta-stick{width:88px;height:88px}.arta-stick i{inset:25px;width:34px;height:34px}.arta-touch-actions button{width:48px;height:48px;font-size:16px}
 /* Drawing studio: canvas first, compact controls; model details stay below. */
 .free-studio{padding:10px}.free-heading{margin-bottom:8px}.free-heading .eyebrow,.free-subtitle,.free-bottom-hint{display:none}.free-heading h1{font-size:20px}.free-workspace{grid-template-rows:auto minmax(240px,48dvh) auto auto}.free-tool{min-height:42px}.free-paper-top{min-height:34px}.free-paper-foot{min-height:32px}.free-brushbar{padding:8px 10px;gap:8px}.free-preview{height:190px}.free-side{grid-template-columns:1fr}.free-understanding{max-height:none}.free-part-list{max-height:130px}
}
@media(max-height:500px) and (min-width:600px){.combat-hud .combat-deck{bottom:12px;width:310px}.hud .status-area{bottom:95px}.combat-hud .combat-target{top:55px}.free-workspace{grid-template-columns:54px minmax(0,1fr) 220px;grid-template-rows:minmax(220px,65dvh) auto}.free-tools{grid-column:1;grid-row:1;flex-direction:column}.free-paper-shell{grid-column:2;grid-row:1}.free-side{grid-column:3;grid-row:1/3;display:block}.free-brushbar{grid-column:2;grid-row:2}.free-preview{height:160px}}
.friends-panel{margin:24px 0;padding:22px;border:1px solid #c7d5ce;border-radius:22px;background:#edf4ee}.friends-panel h2{margin:0 0 8px;font-size:22px}.friends-panel p{line-height:1.6;max-width:850px}.friends-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.friends-panel button,.friends-panel input{font:inherit;border:1px solid #bccdc4;border-radius:12px;padding:12px;min-height:44px}.friends-panel button{background:#256e63;color:white;cursor:pointer}.friends-panel button:disabled{opacity:.5}.friends-panel [data-link]{display:block;width:100%;margin-top:8px;background:white}.friends-panel [data-code]{width:170px}
@media(max-width:620px){.race-surface.race-layout-phone .race-topbar{min-height:55px;padding:10px}.race-surface.race-layout-phone .race-brand{font-size:9px;max-width:170px;white-space:normal}.race-surface.race-layout-phone .race-territory{display:none}.race-surface.race-layout-phone .race-clock{top:55px;min-width:82px;padding:5px 10px}.race-surface.race-layout-phone .race-clock strong{font-size:23px}.race-surface.race-layout-phone .race-clock small{display:none}.race-surface.race-layout-phone .race-divider{display:none}.race-surface.race-layout-phone .race-rival{top:83px;right:12px;left:auto;bottom:auto;padding:0;max-width:126px}.race-surface.race-layout-phone .race-rival .race-distance{display:none}.race-surface.race-layout-phone .race-rival .race-gap{display:none}.race-surface.race-layout-phone .race-player{top:85px;left:12px;bottom:auto;padding:0}.race-surface.race-layout-phone .race-name{font-size:10px}.race-surface.race-layout-phone .race-player .race-gap{display:none}.race-surface.race-layout-phone .race-bottom{padding:10px}.friends-panel{margin:12px 0;padding:16px}.friends-panel h2{font-size:19px}.friends-panel p{font-size:13px}}
@media(max-width:1100px),(max-height:500px){.combat-hud .combat-skill{min-height:42px;padding:4px}.combat-hud .combat-skill small,.combat-hud .combat-skill-desc{display:none}.combat-hud .combat-skills{gap:5px}.combat-hud .combat-flight{display:none}}

@media(max-width:620px){
 .race-surface.race-layout-phone .race-vs{display:none}
 .race-surface.race-layout-phone .race-view-label.race-you{top:59px;left:12px;width:130px;display:flex;flex-direction:column;gap:5px}
 .race-surface.race-layout-phone .race-view-label.race-you .race-distance{font-size:19px;margin-top:5px}
 .race-surface.race-layout-phone .race-view-label.race-you .race-gap{min-width:0;text-align:left;background:#17253285;padding:5px 7px;border-radius:9px}
 .race-surface.race-layout-phone .race-view-label.race-you .race-gap strong{display:inline;font-size:13px;margin-left:5px}
 .race-surface.race-layout-phone .race-view-label.race-you .race-gap small{font-size:8px;letter-spacing:0}
 .race-surface.race-layout-phone .race-view-label.race-you .race-gap-track{margin:4px 0 0;width:90px}
 .race-surface.race-layout-phone .race-view-label.race-rival{top:190px;left:auto;right:12px;width:118px;max-width:118px;background:#17253285;border-radius:9px;padding:5px}
 .race-surface.race-layout-phone .race-view-label.race-rival .race-name{font-size:8px;letter-spacing:0;gap:4px}
 .race-surface.race-layout-phone .race-view-label.race-rival .race-heart{font-size:18px}
 .race-surface.race-layout-phone .race-view-label.race-rival .race-gap,.race-surface.race-layout-phone .race-view-label.race-rival .race-distance{display:none}
 .race-surface.race-layout-phone .race-help span{max-width:175px;font-size:9px;line-height:1.4}
}
