/* The room and monitor are rendered in the same 3D pipeline as Mars. */
#earth-station {display:none;position:fixed;inset:0;z-index:1;pointer-events:none;}
body[data-perspective="earth"]:is([data-screen="game"],[data-screen="passage"]) {
 --earth-screen-left:20vw;--earth-screen-top:12svh;--earth-screen-width:60vw;--earth-screen-height:48svh;
 --earth-screen-bottom:calc(var(--earth-screen-top) + var(--earth-screen-height));
 --earth-console-top:calc(var(--earth-screen-bottom) + 64px);
}
body[data-perspective="earth"]:is([data-screen="game"],[data-screen="passage"]) #earth-station {display:block;}
body[data-perspective="earth"]:is([data-screen="game"],[data-screen="passage"]) #atmosphere {
 position:absolute;inset:0;width:100%;height:100%;border-radius:0;transform:none;pointer-events:none;
}
body[data-perspective="earth"]:is([data-screen="game"],[data-screen="passage"]) .vignette,
body[data-perspective="earth"]:is([data-screen="game"],[data-screen="passage"]) .world::after {display:none;}
.earth-station__label {position:absolute;left:calc(var(--earth-screen-left) + 12px);top:calc(var(--earth-screen-bottom) - 26px);color:#c2c9c8;font:9px/1.3 var(--mono);letter-spacing:.08em;text-transform:uppercase;text-shadow:0 1px 3px #000;}
.earth-station__label small {margin-left:14px;font-size:8px;opacity:.7;}
/* One reading flow for every phase and input device. The signal itself lives
   on the monitor; controls and receipts must never reserve a second column. */
body[data-perspective="earth"][data-screen="game"] .play-screen,
body[data-perspective="earth"][data-screen="passage"] .mission-briefing {background:none;}
body[data-perspective="earth"][data-screen="passage"] .handover-link {display:none;}
body[data-perspective="earth"][data-screen="game"] .interaction-dock,
body[data-perspective="earth"][data-screen="game"][data-upload="true"] .interaction-dock {
 position:fixed;inset:auto!important;left:50%!important;bottom:20px!important;
 transform:translateX(-50%)!important;width:min(860px,calc(100vw - 64px));
 height:auto;max-width:860px!important;max-height:38svh!important;overflow:auto;
 padding:10px 20px;border:0;border-radius:0;background:none;box-shadow:none;
 backdrop-filter:none;pointer-events:auto;scrollbar-width:thin;
 scrollbar-color:#768a8a66 transparent;text-shadow:0 2px 5px #000,0 0 20px #0009;
}
body[data-perspective="earth"][data-screen="game"] .upload-terminal[data-presentation="story"] {
 display:block;padding:0;min-width:0;
}
body[data-perspective="earth"][data-screen="game"] .upload-terminal__body {position:static;}
body[data-perspective="earth"][data-screen="game"] .upload-terminal__apparatus {
 position:static;transform:none;width:100%;height:auto;padding:0;
}
body[data-perspective="earth"][data-screen="game"] .signal-controls {
 position:static;transform:none;width:100%;margin:0 0 12px;
}
body[data-perspective="earth"][data-screen="game"] .upload-terminal > .story-shell,
body[data-perspective="earth"][data-screen="game"] .story-shell {
 position:static;transform:none;width:100%;max-height:none;overflow:visible;padding:0;min-width:0;
}
body[data-perspective="earth"][data-screen="game"] .signal-map {height:100px;}
body[data-perspective="earth"][data-screen="game"] :is(.recovery-trace,.journey-rail,#input-hint) {display:none;}
body[data-perspective="earth"][data-screen="passage"] .mission-briefing .briefing-console {
 top:auto;bottom:24px;width:min(850px,calc(100vw - 60px));max-height:38svh;overflow:auto;
}
.earth-station__label {left:28vw;top:14svh;}
@media(max-width:650px) {
 .earth-station__label {left:12vw;top:20svh;font-size:8px;}
 .earth-station__label small {font-size:7px;margin-left:8px;}
 body[data-perspective="earth"][data-screen="game"] .interaction-dock,
 body[data-perspective="earth"][data-screen="game"][data-upload="true"] .interaction-dock {
  width:calc(100vw - 28px);padding:8px 12px;max-height:41svh!important;bottom:72px!important;
 }
 body[data-perspective="earth"][data-screen="game"] #world-controls {bottom:12px;}
}
@media(max-height:650px) and (min-width:651px) {
 body[data-perspective="earth"][data-screen="game"] .interaction-dock,
 body[data-perspective="earth"][data-screen="game"][data-upload="true"] .interaction-dock {
  max-height:38svh!important;bottom:12px!important;
 }
}

/* Signal graphics live on the physical monitor. Keep their semantic description
   available to assistive technology and retain the DOM fallback without WebGL. */
body[data-earth-monitor="true"] #app :is(.signal-map,.signal-dialogue) {
 position:absolute!important;width:1px!important;height:1px!important;padding:0!important;
 margin:-1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap;
}
body[data-earth-monitor="true"] .upload-terminal[data-input="pointer"] .upload-terminal__body {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
body[data-earth-monitor="true"] .upload-terminal[data-input="pointer"] {display:block!important;}
body[data-earth-monitor="true"] .upload-terminal__apparatus {padding-top:0!important;}

/* This is the same DOM instrument used on Mars, projected onto the 3D monitor. */
#earth-station .earth-monitor-signal {
 position:absolute;left:0;top:0;width:580px;height:160px;transform-origin:0 0;
 box-sizing:border-box;padding:0 14px!important;overflow:hidden;clip-path:inset(0);pointer-events:none;
 background:linear-gradient(transparent,#071014db 27%,#071014ed);
 text-align:center;color:#fff0d5;border:0;box-shadow:none;
}
#earth-station .earth-monitor-signal[hidden] {display:none;}
#earth-station .earth-monitor-signal .signal-map {width:100%;height:112px;}
#earth-station .earth-monitor-signal .signal-dialogue {margin:2px auto 0;}

/* Projection uses a fixed logical canvas: viewport media queries must not shrink
   its planets or labels when the real monitor is already being scaled in 3D. */
#earth-station .earth-monitor-signal .signal-world {width:96px;gap:9px;}
#earth-station .earth-monitor-signal .planet {width:48px;height:48px;transform:none;}
#earth-station .earth-monitor-signal .planet--earth {width:40px;height:40px;}
#earth-station .earth-monitor-signal[data-mode="archive"] .planet--earth {width:85px;height:85px;}
#earth-station .earth-monitor-signal .signal-phrase {gap:7px;}
#earth-station .earth-monitor-signal .signal-phrase span {min-width:58px;font-size:8px;}
