/* Dedicated game surface. Existing management views live in native in-game dialogs. */
html:has(body.game-shell), body.game-shell { width:100%; height:100%; overflow:hidden; overscroll-behavior:none; background:#09151b; }
body.game-shell { --game-paper:#e6ede3; --game-line:#839d8666; color:var(--game-paper); }
body.game-shell .app-shell { position:fixed; inset:0; width:100%; max-width:none; height:100dvh; min-height:0; margin:0; padding:0; border:0; border-radius:0; background:#0a171f; box-shadow:none; }
body.game-shell .app-main, body.game-shell #main, body.game-shell .workspace, body.game-shell .primary-column { position:static; display:block; width:100%; height:100%; min-height:0; margin:0; padding:0; background:none; }
body.game-shell .rail, body.game-shell .page-heading, body.game-shell .footer { display:none; }
body.game-shell .topbar { position:absolute; inset:14px 18px auto; z-index:5; display:flex; flex-wrap:nowrap; gap:22px; width:auto; height:54px; min-height:54px; margin:0; padding:8px 14px; border:1px solid var(--game-line); border-radius:6px; background:#102128ed; box-shadow:0 8px 24px #0003; backdrop-filter:blur(10px); }
body.game-shell .topbar::before, body.game-shell .topbar::after { display:none; }
body.game-shell .topbar .wordmark { flex:0 0 auto; min-height:0; padding:0; margin:0; }
body.game-shell .wordmark strong { font-size:13px; letter-spacing:1px; }
body.game-shell .wordmark-sub { display:none; }
body.game-shell .topbar .resources { display:flex; flex:1; width:auto; gap:26px; margin:0; }
body.game-shell .resource { min-width:0; gap:7px; }
body.game-shell .resource svg { width:22px; height:22px; }
body.game-shell .resource div { display:flex; flex-direction:row; align-items:baseline; gap:8px; }
body.game-shell .resource small { font-size:10px; color:#a9bdb6; }
body.game-shell .resource strong { font-size:17px; }
body.game-shell .resource strong em { font-size:10px; }
body.game-shell .resource-plus { width:24px; height:28px; min-width:24px; }
body.game-shell .topbar-end { position:static; display:flex; align-items:center; width:auto; max-width:none; padding:0; gap:8px; }
body.game-shell .prototype-tag { font-size:9px; padding:4px; }
body.game-shell .arena-global-inbox { width:32px; min-width:32px; padding:4px; }
body.game-shell .arena-inbox-label { display:none; }
body.game-shell #save-button { min-width:32px; width:32px; height:32px; }
.game-shell-controls { display:flex; gap:6px; }
body.game-shell .game-shell-controls button { min-height:34px; padding:5px 10px; border:1px solid #78958266; border-radius:3px; background:#1c333b; color:#dce9df; font-size:11px; white-space:nowrap; }
body.game-shell .authority-status:not(:empty) { position:absolute; z-index:8; top:120px; left:18px; max-width:min(440px,calc(100% - 36px)); max-height:30dvh; overflow:auto; margin:0; padding:10px 12px; background:#14262eed; border:1px solid #d8b97c80; }
body.game-shell .authority-status:empty { display:none; }
body.game-shell #colony-view, body.game-shell #colony-view>.world-panel { position:absolute; inset:0; display:block; width:100%; height:100%; margin:0; padding:0; border:0; border-radius:0; overflow:hidden; background:none; box-shadow:none; }
body.game-shell #colony-view .panel-toolbar { position:absolute; z-index:4; bottom:112px; right:18px; display:block; min-height:0; padding:0; border:0; background:none; }
body.game-shell #colony-view .panel-toolbar h2 { display:none; }
body.game-shell #colony-view .world-toolbar-actions { display:flex; gap:5px; }
body.game-shell #colony-view .world-toolbar-actions>button, body.game-shell .simulation-controls button { min-width:34px; min-height:34px; margin:0; padding:4px 9px; font-size:11px; border:1px solid #77988077; border-radius:3px; background:#142a32eb; color:#e0e9dc; }
body.game-shell [data-map-zoom], body.game-shell [data-scene-management] { display:none; }
body.game-shell #colony-view .sector-switcher { position:absolute; z-index:4; top:80px; left:50%; transform:translateX(-50%); display:flex; width:max-content; max-width:calc(100% - 36px); min-height:34px; gap:0; padding:0; margin:0; border:1px solid #6c8d7777; border-radius:4px; background:#10242ceb; overflow-x:auto; }
body.game-shell #colony-view .sector-switcher button { flex:0 0 auto; min-height:34px; padding:6px 18px; border:0; border-right:1px solid #68837544; font-size:11px; color:#b9cac4; background:none; white-space:nowrap; }
body.game-shell #colony-view .sector-switcher button.active { background:#36533e; color:#e5efd8; box-shadow:inset 0 -2px #b9d284; }
body.game-shell #colony-view #world-viewport { position:absolute; inset:0; display:block; width:100%; height:100%; max-height:none; margin:0; padding:0; overflow:hidden; border:0; background:radial-gradient(ellipse at center,#1b363d,#09161e); }
body.game-shell #colony-view #world-viewport:not(.is-zoomed) #world, body.game-shell #colony-view #world-viewport.is-zoomed #world { position:absolute; inset:0; display:block; width:100%; height:100%; max-width:none; max-height:none; min-width:0; aspect-ratio:auto; transform:none; border-radius:0; }
body.game-shell .world-corner, body.game-shell .world-status { display:none; }
body.game-shell #world-hint { position:absolute; top:auto; bottom:112px; left:18px; max-width:calc(100% - 380px); padding:7px 11px; background:#12272bca; color:#c6d4c9; border:1px solid #6c8d7744; font-size:11px; }
body.game-shell #world-zoom-help { display:none; }
.game-dock { position:absolute; z-index:5; bottom:16px; left:18px; right:18px; display:flex; align-items:center; gap:18px; min-height:80px; padding:10px 14px; border:1px solid var(--game-line); border-radius:6px; background:#102128ed; box-shadow:0 -8px 24px #0003; backdrop-filter:blur(10px); }
.game-dock-crew { display:flex; gap:7px; max-width:40%; overflow:auto; padding:2px; }
body.game-shell .game-dock-crew button { position:relative; display:flex; flex:0 0 55px; flex-direction:column; align-items:center; gap:1px; width:55px; min-height:58px; padding:2px; overflow:hidden; border:1px solid #6a8b7866; border-radius:3px; color:#ccd9d1; background:#20373b; font-size:9px; }
body.game-shell .game-dock-crew button[aria-pressed=true] { border-color:#c8d998; background:#405441; box-shadow:0 0 0 1px #c8d99855; }
.game-dock-crew .portrait { width:36px; height:36px; min-width:36px; margin:0; }
.game-dock-crew .robot-portrait { width:36px; height:36px; }
.game-dock-status { flex:1; display:flex; flex-direction:column; gap:5px; min-width:130px; font-size:11px; color:#abc2b7; }
.game-dock-status strong { font-size:14px; color:#e6edde; }
.game-dock-status strong span { font-size:10px; color:#c3d899; margin-left:6px; }
.game-dock-actions { display:flex; gap:7px; }
body.game-shell .game-dock-actions button { min-height:40px; padding:7px 14px; border:1px solid #7a987966; border-radius:3px; color:#dae6d5; background:#28413f; font-size:12px; white-space:nowrap; }
body.game-shell .game-dock-actions button:first-child { background:#4a5e3e; border-color:#b1c78b77; }
body.game-shell dialog.game-workspace { position:fixed; inset:0; width:min(1160px,calc(100vw - 72px)); max-width:none; height:min(800px,calc(100dvh - 100px)); max-height:calc(100dvh - 40px); margin:auto; padding:0; overflow:hidden; border:1px solid #829b75; border-radius:7px; color:#e3eadc; background:#12232b; box-shadow:0 30px 100px #0009; }
body.game-shell dialog.game-workspace[open] { display:flex; flex-direction:column; }
.game-workspace::backdrop { background:#020a10a8; backdrop-filter:blur(3px); }
.game-workspace-heading { display:flex; align-items:center; justify-content:space-between; flex:0 0 auto; min-height:70px; gap:16px; padding:12px 22px; border-bottom:1px solid #74917766; background:#1b3038; }
.game-workspace-heading small { font:9px monospace; letter-spacing:2px; color:#a9bc94; }
.game-workspace-heading h2 { margin:4px 0 0; font-size:19px; }
.game-workspace-heading button { min-height:40px; padding:6px 14px; border:1px solid #93aa7d80; border-radius:3px; color:#e1ead8; background:#32483e; font-size:12px; }
.game-workspace-heading button span { font-size:20px; margin-left:14px; }
.game-workspace-content { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:20px; }
body.game-shell .game-workspace .view { position:relative; width:100%; min-width:0; margin:0; }
body.game-shell .game-workspace :is(.view,.game-management,#scene-hud,.game-menu)[hidden] { display:none!important; }
body.game-shell .game-workspace .right-column { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; margin-top:20px; }
body.game-shell .game-workspace details.scene-management { display:block; margin:0; padding:0; border:0; }
body.game-shell .game-workspace details.scene-management>summary { display:none; }
body.game-shell .game-workspace #scene-hud { width:100%; max-width:none; max-height:none; padding:0; border:0; background:none; }
body.game-shell .game-workspace[data-mode=crew] { width:min(480px,calc(100vw - 32px)); }
body.game-shell .game-workspace[data-mode=menu] { width:min(780px,calc(100vw - 32px)); height:auto; }
.game-menu { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
body.game-shell .game-menu button { display:grid; grid-template-columns:1fr auto; gap:6px; align-content:center; min-height:82px; padding:14px; text-align:left; border:1px solid #73927866; border-radius:4px; background:#213a3e; color:#dce6d5; }
.game-menu strong { font-size:14px; }
.game-menu small { grid-column:1; font-size:10px; color:#a9beb4; }
.game-menu span { grid-column:2; grid-row:1/3; align-self:center; color:#b8ce91; }
.game-menu a { grid-column:1/-1; color:#b6c7b8; padding:10px 0; font-size:12px; }
body.game-shell button:focus-visible, body.game-shell a:focus-visible { outline:2px solid #d4e7a7; outline-offset:3px; }
@media(max-width:1000px) { body.game-shell .topbar .wordmark, body.game-shell .prototype-tag { display:none; } body.game-shell .topbar { gap:10px; } body.game-shell .topbar .resources { gap:16px; } .game-dock { gap:12px; } .game-dock-actions { display:grid; grid-template-columns:repeat(2,1fr); gap:4px; } body.game-shell .game-dock-actions button { min-height:30px; padding:4px 10px; font-size:11px; } .game-dock-status { min-width:100px; } }
@media(max-width:640px) { body.game-shell .topbar { inset:8px 8px auto; height:48px; min-height:48px; padding:5px 8px; } body.game-shell .topbar .resources { gap:12px; } body.game-shell .resource div { flex-direction:column; gap:0; } body.game-shell .resource small { font-size:8px; } body.game-shell .resource strong { font-size:13px; } body.game-shell .resource>svg, body.game-shell .resource-plus, body.game-shell .people-resource, body.game-shell #save-button, body.game-shell .arena-global-inbox, body.game-shell [data-shell-fullscreen], body.game-shell [data-shell-menu] span { display:none; } body.game-shell .game-shell-controls button { padding:4px 7px; } body.game-shell #colony-view .sector-switcher { top:65px; max-width:calc(100% - 16px); } body.game-shell #colony-view .sector-switcher button { padding:6px 10px; font-size:10px; } .game-dock { bottom:8px; left:8px; right:8px; gap:8px; padding:7px; min-height:76px; } .game-dock-status { display:none; } .game-dock-crew { flex:1; max-width:none; gap:4px; } body.game-shell .game-dock-crew button { flex-basis:44px; width:44px; min-height:52px; font-size:8px; } .game-dock-crew .portrait,.game-dock-crew .robot-portrait { width:30px; height:30px; min-width:30px; } body.game-shell .game-dock-actions button { padding:4px 7px; font-size:10px; } body.game-shell #colony-view .panel-toolbar { right:8px; bottom:94px; } body.game-shell #world-hint { left:8px; bottom:136px; max-width:calc(100% - 16px); font-size:10px; } body.game-shell dialog.game-workspace { width:calc(100vw - 16px); height:calc(100dvh - 32px); max-height:calc(100dvh - 16px); } .game-workspace-content { padding:12px; } .game-workspace-heading { min-height:62px; padding:10px 12px; } .game-menu { grid-template-columns:repeat(2,minmax(0,1fr)); } body.game-shell .game-workspace .right-column { grid-template-columns:1fr; } body.game-shell .authority-status:not(:empty) { top:106px; left:8px; max-width:calc(100% - 16px); } }
@media(prefers-reduced-motion:reduce) { body.game-shell *,body.game-shell *::before,body.game-shell *::after { scroll-behavior:auto!important; } }

/* Connected guidance stays compact; connection errors and pending commands retain full controls. */
body.game-shell .authority-status[data-compact="true"] { width:auto; padding:7px 10px; border-color:#7d9d6866; background:#14282bd9; }
body.game-shell .authority-status[data-compact="true"] p, body.game-shell .authority-status[data-compact="true"] .authority-actions { display:none; }
body.game-shell .authority-status[data-compact="true"] strong { font-size:11px; font-weight:500; }

body.game-shell #scene-hud .scene-meter { display:block; width:100%; height:4px; margin:6px 0 10px; background:#52646066; }
body.game-shell #scene-hud .scene-meter>span { display:block; height:100%; background:#a9cc90; }
body.game-shell #scene-hud .scene-meter.shield>span { background:#88bfc9; }
body.game-shell #scene-hud .scene-meter.enemy>span { background:#d8a37d; }
@media(max-width:640px) and (orientation:portrait) { body.game-shell .game-dock::before { content:'横屏视野更开阔 · 可开启近景跟随查看队员'; position:absolute; bottom:calc(100% + 64px); left:0; right:0; text-align:center; font-size:10px; color:#a9bcb2; pointer-events:none; } }
/* Edge HUD follows the approved game frame, with separate resource/command groups. */
body.game-shell .topbar { justify-content:space-between; border:0; background:none; box-shadow:none; backdrop-filter:none; padding:0; pointer-events:none; }
body.game-shell .topbar .wordmark { display:none; }
body.game-shell .topbar .resources { flex:0 1 auto; width:auto; padding:8px 13px; border:1px solid var(--game-line); border-radius:5px; background:#102128ed; pointer-events:auto; }
body.game-shell .topbar-end { flex:0 0 auto; pointer-events:auto; }
body.game-shell .topbar .resource-plus { min-height:25px; height:25px; width:25px; min-width:25px; padding:0; }
body.game-shell .topbar .arena-global-inbox:not(.has-unread) { display:none; }
body.game-shell .topbar .prototype-tag { display:none; }
body.game-shell .game-dock { border:0; border-radius:0; background:none; box-shadow:none; backdrop-filter:none; padding:0; pointer-events:none; }
body.game-shell .game-dock-crew, body.game-shell .game-dock-status { padding:8px 12px; border:1px solid var(--game-line); border-radius:5px; background:#102128ed; pointer-events:auto; }
body.game-shell .game-dock-status { flex:0 1 320px; margin-right:auto; min-height:64px; justify-content:center; }
body.game-shell .game-dock-actions { pointer-events:auto; }
body.game-shell .authority-status[data-compact="true"] { top:80px; }
@media(min-width:1100px) { body.game-shell #colony-view .sector-switcher { top:22px; } }
@media(max-width:640px) { body.game-shell .topbar .resources { padding:5px 8px; } body.game-shell .game-dock-crew { padding:5px; } body.game-shell .game-dock-status { display:none; } body.game-shell .authority-status[data-compact="true"] { top:106px; } }
/* The map fills the viewport. Camera controls move the equal-scale scene crop. */
body.game-shell #world { touch-action:none; cursor:grab; }
body.game-shell #colony-view .world-toolbar-actions { flex-wrap:wrap; justify-content:flex-end; max-width:min(560px,calc(100vw - 24px)); }
.game-camera-controls { display:flex; align-items:center; gap:2px; padding:2px; border:1px solid #77988066; border-radius:3px; background:#142a32eb; }
body.game-shell .game-camera-controls button { min-width:32px; min-height:32px; padding:4px 8px; border:0; border-radius:2px; background:#29413f; color:#e0e9dc; font-size:11px; }
body.game-shell .game-camera-controls button:disabled { opacity:.4; cursor:default; }
.game-camera-controls output { min-width:43px; text-align:center; color:#d1dfcc; font:11px monospace; }
.game-camera-help { position:absolute; z-index:4; bottom:113px; left:18px; margin:0; padding:7px 10px; border:1px solid #77988044; border-radius:3px; background:#142a32d9; color:#b5c9bc; font-size:10px; pointer-events:none; }
body.game-shell #world:focus-visible { outline:2px solid #bed3a2; outline-offset:-3px; }
@media(max-width:640px) { .game-camera-help { left:8px; bottom:170px; max-width:calc(100vw - 16px); font-size:9px; } body.game-shell [data-shell-fullscreen] { display:inline-flex; } body.game-shell .game-shell-controls button { font-size:10px; padding:4px 6px; } body.game-shell .topbar .resources { gap:7px; padding:5px 6px; } body.game-shell .resource svg { display:none; } }
.game-camera-touch { display:none; }
@media(max-width:640px) { .game-camera-desktop { display:none; } .game-camera-touch { display:inline; } body.game-shell .game-dock::before { display:none; } }
@media(max-width:640px) { .game-camera-help { bottom:210px; } }
