/* Coordinates are fractions of the original camera image, before viewport cropping. */
.crt-terminal .cover-camera{background-image:url('assets/shuttle-bay-model-locked.webp')}
.crt-terminal #viewportAdvice .advice-image{background-image:linear-gradient(0deg,#07110cd0,transparent 65%),url('assets/shuttle-bay-model-locked.webp')}
.crt-terminal .room{
  --camera-ratio:1.77778;
  --camera-left:.5;
  --camera-top:.5;
}
.crt-terminal .room-bay{--camera-top:.61}
.crt-terminal .room-defense{--camera-ratio:2}
.crt-terminal[data-engineering-model=baked] .room-engineering{--camera-top:.43}
.crt-terminal .camera-console .room .room-art{
  background-position:calc(var(--camera-left) * 100%) calc(var(--camera-top) * 100%);
}
#hotspots{position:absolute;inset:0;container-type:size;pointer-events:none}
.crt-terminal .room #hotspots .hotspot{
  --camera-width:max(100cqw,calc(100cqh * var(--camera-ratio)));
  --camera-height:max(100cqh,calc(100cqw / var(--camera-ratio)));
  --image-left:calc((100cqw - var(--camera-width)) * var(--camera-left));
  --image-top:calc((100cqh - var(--camera-height)) * var(--camera-top));
  --pip:#bfdfaf;
  left:clamp(18px,calc(var(--image-left) + var(--camera-width) * var(--x)),calc(100% - 18px));
  top:clamp(17px,calc(var(--image-top) + var(--camera-height) * var(--y)),calc(100% - 17px));
  right:auto;bottom:auto;
  width:max(42px,calc(var(--camera-width) * var(--w,.05)));
  height:max(42px,calc(var(--camera-height) * var(--h,.075)));
  min-height:42px;max-width:none;
  translate:-50% -50%;transform:none;pointer-events:auto;overflow:visible;
  display:grid;place-items:center;padding:0;gap:0;
  border:0;border-radius:6px;background:transparent;backdrop-filter:none;box-shadow:none;
}
.crt-terminal .room #hotspots .hotspot:hover{z-index:4}
.crt-terminal .room #hotspots .hotspot:focus-visible{outline:1px solid var(--pip);outline-offset:2px;z-index:4}
.crt-terminal .room #hotspots .hotspot:is(.hatch-ready,.gripper-match,.alert){--pip:#ffce83}
.crt-terminal .room #hotspots .hotspot.complete{--pip:#b3f4ae}
.crt-terminal .room #hotspots .hotspot-icon{display:none}
.crt-terminal .room #hotspots .hotspot::after{
  content:'';position:absolute;left:50%;top:50%;width:7px;height:7px;
  translate:-50% -50%;border:1px solid var(--pip);border-radius:50%;
  background:#07130fcd;box-shadow:0 0 0 1px #060e09aa;pointer-events:none;
}
.crt-terminal .room #hotspots .has-prop::after{left:calc(50% + 10px);right:auto;top:calc(50% - 9px)}
.crt-terminal .room #hotspots .hotspot:is(:hover,:focus-visible,.gripper-match)::after{
  background:var(--pip);box-shadow:0 0 7px var(--pip);
}
.crt-terminal .room #hotspots .scene-prop{
  width:min(95%,calc(100cqw * var(--w,.058)));min-width:23px;max-width:62px;
  pointer-events:none;
}
.crt-terminal .room #hotspots .hotspot-label{
  position:absolute;left:50%;top:calc(50% + 9px);translate:-50% 0;transform:none;
  display:none;min-width:0;width:max-content;max-width:120px;padding:3px 6px;
  background:#07150de9;color:#e0f3d7;border:1px solid #6b926593;
  font:700 10px/1.26 var(--crt-mono);text-align:center;pointer-events:none;
}
.crt-terminal .room #hotspots .has-prop .hotspot-label{top:calc(100% + 1px)}
.crt-terminal .room #hotspots .hotspot:is(:hover,:focus-visible) .hotspot-label,
.crt-terminal .room[data-labels=all] #hotspots .hotspot .hotspot-label{display:block}
.crt-terminal #hotspots .hotspot-label small{margin-top:2px}

.room-bay .locker{--x:.103;--y:.550;--w:.125;--h:.40}
.room-bay .engineeringReader{--x:.232;--y:.494;--w:.085;--h:.188}
.room-bay .habLog{--x:.214;--y:.686;--w:.058;--h:.092}
.room-bay .grate{--x:.798;--y:.850;--w:.275;--h:.098}
.room-bay .shuttle{--x:.812;--y:.390;--w:.284;--h:.175}
.crt-terminal .room #hotspots .shuttle .scene-prop{display:none}
.crt-terminal .room #hotspots .shuttle::after{left:50%;right:auto;top:55%;translate:-50% -50%}
.crt-terminal .room #hotspots .shuttle .hotspot-label{top:calc(55% + 9px)}

.room-engineering .operationsHatch{--x:.255;--y:.50;--w:.185;--h:.34}
.room-engineering .bayReturn{--x:.745;--y:.502;--w:.186;--h:.34}
.room-engineering .schematic{--x:.401;--y:.408;--w:.063}
.room-engineering .reactor{--x:.516;--y:.477;--w:.125;--h:.23}
.room-engineering .sweep{--x:.399;--y:.593;--w:.061}
.room-engineering .coolant{--x:.618;--y:.461;--w:.071;--h:.205}
.room-engineering .life{--x:.931;--y:.475;--w:.109;--h:.28}
[data-engineering-model=baked] .room-engineering .operationsHatch{--x:.245;--y:.544;--w:.159;--h:.365}
[data-engineering-model=baked] .room-engineering .bayReturn{--x:.754;--y:.543;--w:.159;--h:.365}
[data-engineering-model=baked] .room-engineering .schematic{--x:.367;--y:.369;--w:.055;--h:.073}
[data-engineering-model=baked] .room-engineering .reactor{--x:.438;--y:.521;--w:.097;--h:.19}
[data-engineering-model=baked] .room-engineering .sweep{--x:.422;--y:.648;--w:.057;--h:.063}
[data-engineering-model=baked] .room-engineering .transferBus{--x:.565;--y:.524;--w:.103;--h:.205}
[data-engineering-model=baked] .room-engineering .coolant{--x:.075;--y:.541;--w:.097;--h:.234}
[data-engineering-model=baked] .room-engineering .life{--x:.936;--y:.539;--w:.088;--h:.23}

.room-operations .defenseHatch{--x:.271;--y:.485;--w:.099;--h:.269}
.room-operations .engineeringReturn{--x:.765;--y:.488;--w:.127;--h:.264}
.room-operations .chart{--x:.128;--y:.476;--w:.077}
.room-operations .sensors{--x:.053;--y:.538;--w:.065}
.room-operations .beacon{--x:.345;--y:.467;--w:.057}
.room-operations .decoder{--x:.423;--y:.543;--w:.066}
.room-operations .cipherWheel{--x:.505;--y:.533;--w:.060}
.room-operations .loadMonitor{--x:.600;--y:.487;--w:.068;--h:.093}
.room-operations .comms{--x:.887;--y:.382;--w:.105;--h:.133}
.room-operations .relay{--x:.929;--y:.541;--w:.078}

.room-defense .returnHatch{--x:.799;--y:.401;--w:.135;--h:.359}
.room-defense .iffManual{--x:.081;--y:.538;--w:.052}
.room-defense .iff{--x:.192;--y:.459;--w:.086;--h:.123}
.room-defense .defense{--x:.928;--y:.500;--w:.13;--h:.145}
.room-defense .launchProtocol{--x:.893;--y:.645;--w:.057}

@media(max-width:720px){
  .crt-terminal .camera-console .room.room-bay{height:auto;aspect-ratio:16/9}
  .crt-terminal .room #hotspots .hotspot-label{font-size:9px;max-width:90px}
}

.tag-inspection{position:relative;height:clamp(165px,31vh,286px);margin-bottom:10px;isolation:isolate;display:grid;place-items:center;background:radial-gradient(ellipse at 50% 42%,#203528,#0a1510 75%);border:1px solid #56725180;border-radius:3px;overflow:hidden}
.tag-inspection model-viewer{position:absolute;inset:0;width:100%;height:100%;visibility:hidden;--poster-color:transparent;cursor:grab}
.tag-inspection model-viewer:active{cursor:grabbing}
.tag-inspection.loaded model-viewer{visibility:visible}
.tag-inspection.loaded .tag-fallback{visibility:hidden}
.tag-fallback{display:grid;gap:.35em;width:min(76%,330px);padding:1.1em;border:3px solid #87612d;border-radius:8px;background:#132638;color:#e6dbb4;font:700 clamp(9px,1.28vw,15px)/1.3 var(--crt-mono);box-shadow:0 5px 14px #0008}
.tag-fallback strong{font-size:1.6em}
.tag-fallback b{padding-bottom:.4em;border-bottom:1px solid #9e783c}
.tag-inspection[data-reverse=true] .tag-fallback{color:#2a2820;background:#c5af80}

.ending-image{position:relative}
#departureArtwork{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none;animation:departure-cut 1.55s linear both}
#departureArtwork[hidden]{display:none}
@keyframes departure-cut{0%,68%{opacity:1}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){#departureArtwork{display:none}}

.mission-loading{margin-top:7px;display:grid;gap:4px;font:600 10px/1.2 var(--crt-mono);color:var(--crt-bright)}
.mission-loading[hidden]{display:none}
.mission-loading progress{width:100%;height:6px;accent-color:#a5dc94}

.crt-terminal .crt-plot--drone{grid-template-rows:auto minmax(0,1fr) auto}
.crt-terminal .crt-plot--drone .crt-map{min-height:0;max-height:min(40dvh,375px)}
.briefing-drone{display:grid;grid-template-columns:minmax(76px,.65fr) minmax(0,1fr) auto;align-items:center;gap:10px;min-width:0;padding:5px 9px 5px 5px;border:1px solid var(--crt-line);background:#06140b;font-family:var(--crt-mono)}
.briefing-drone-image{position:relative;display:grid;place-items:center;height:clamp(66px,11dvh,102px);overflow:hidden;border-inline-end:1px solid #46634166;background:radial-gradient(ellipse at center,#233c25 0%,transparent 72%),repeating-linear-gradient(0deg,transparent 0 11px,#4268443b 11px 12px),repeating-linear-gradient(90deg,transparent 0 11px,#4268443b 11px 12px)}
.briefing-drone-image img{display:block;width:100%;height:100%;min-height:0;object-fit:contain;filter:grayscale(1) sepia(.8) hue-rotate(57deg) saturate(1.55) brightness(1.5) drop-shadow(0 0 4px #81cd7347)}
.briefing-drone-id{display:grid;gap:4px;line-height:1.1}
.briefing-drone-id span,.briefing-drone-status{font-size:clamp(8px,1vw,10px);letter-spacing:.07em;color:var(--crt-dim)}
.briefing-drone-id strong{font-size:clamp(13px,1.8vw,22px);color:var(--crt-bright);white-space:nowrap}
.briefing-drone-status{justify-self:end;white-space:nowrap}
.briefing-drone-status::before{content:'';display:inline-block;width:5px;height:5px;border-radius:50%;background:currentColor;box-shadow:0 0 6px #a7da8c88;margin-right:5px;vertical-align:1px}
.receive-frame--compact .receive-link{grid-template-columns:clamp(45px,9vw,118px) auto;align-items:center;gap:9px}
.receive-frame--compact .receive-audio{display:block;min-width:0}
.receive-frame--compact .receive-signal{height:11px}
.briefing-message-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 12px;margin-bottom:7px}
.receive-grid .briefing-message-header h2{margin:0}
.receive-frame--compact .briefing-actions{margin:0}
.receive-frame--compact .briefing-actions button{min-height:30px;padding:5px 7px;font-size:10px}
.receive-frame--compact .crt-command{align-content:center}
@media(min-width:1051px){
  .receive-frame--compact .crt-status-row{grid-template-columns:1fr .9fr 1.48fr}
  .receive-frame--compact .crt-command .login-form{grid-template-columns:auto minmax(68px,1fr) auto}
  .receive-frame--compact .crt-command .login-form button{grid-column:auto;white-space:nowrap}
}
@media(max-width:760px){
  .crt-terminal .crt-plot--drone .crt-map{height:auto;max-height:250px}
  .receive-frame--compact .receive-link{grid-template-columns:auto}
  .receive-frame--compact .receive-audio{display:none}
}

.crt-terminal .recovery-pulse{animation:recovery-pulse 1.8s ease-out}
@keyframes recovery-pulse{
  0%,100%{box-shadow:inset 0 0 0 1px transparent}
  14%,35%{box-shadow:inset 0 0 0 1px #9de69a,0 0 9px #8fda8f60;background-color:#214928;color:#e5ffde}
}
@media(prefers-reduced-motion:reduce){
  .crt-terminal .recovery-pulse{animation:none;outline:1px solid #9de69a;outline-offset:-1px}
}

.recovery-announcement{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.pickup-preview{position:absolute;z-index:8;pointer-events:none;right:10px;bottom:10px;max-width:calc(100% - 20px);padding:7px 9px;display:grid;gap:4px;border:1px solid #8bc786;background:#0a1a12f5;color:#e2fbdb;box-shadow:0 4px 18px #0007;font:600 11px/1.25 var(--crt-mono)}
.pickup-preview[hidden]{display:none}
#panelPickup{inset:67px 13px auto auto}
.pickup-heading{font-size:9px;color:#a0d59a;letter-spacing:.07em;text-transform:uppercase}
.pickup-items{display:flex;flex-wrap:wrap;gap:8px}
.pickup-item{width:76px;min-width:0;display:grid;align-content:start;gap:2px;text-align:center}
.pickup-item .item-thumb{width:100%;height:47px;object-fit:contain;border:0}
.inventory-model{margin:0}
.inventory-model-still{width:94%;height:94%;object-fit:contain}
.inventory-model.loaded .inventory-model-still{visibility:hidden}
.inventory-model:not(.loaded)+.inventory-model-help{display:none}

.compact-console .camera-bar{flex-wrap:wrap;gap:4px 12px;padding:6px 9px}
.camera-location,.compact-console .camera-tools{display:flex;align-items:center;flex-wrap:wrap;gap:5px 9px}
.camera-location h2{margin:0;color:var(--crt-bright);font:700 clamp(15px,1.6vw,22px)/1.2 var(--crt-mono)}
.camera-location span,.camera-index{color:var(--crt-dim);font-size:10px;white-space:nowrap}
.camera-feed-name{font-size:10px}
.compact-console #toggleLabels{min-height:30px}
.mission-tool-buttons{display:flex;flex-wrap:wrap;gap:5px}
.crt-terminal .mission-tool-buttons .secondary:not(.compact-status-button){display:inline-flex}
.crt-terminal .mission-tool-buttons .secondary{flex:1 1 auto;align-items:center;justify-content:center;margin:0;padding:5px 7px;min-height:36px;white-space:nowrap;font-size:11px;gap:5px}
.mission-tools .gripper-status{margin:6px 0 0;font-size:11px;overflow-wrap:anywhere}
.camera-event{margin:2px 4px;color:var(--crt-dim);font:500 10px/1.45 var(--crt-mono);overflow-wrap:anywhere}
.compact-console #threatStatus[data-active=false]{color:var(--crt-bright)}
@media(min-width:850px) and (min-height:600px){
  .crt-terminal .shell:has(.compact-console:not(.hidden)){height:100dvh;min-height:0;display:grid;grid-template-rows:49px minmax(0,1fr)}
  .crt-terminal .shell:has(.compact-console:not(.hidden)) .topbar{height:auto}
  .crt-terminal .shell:has(.compact-console:not(.hidden)) .footer{display:none}
  .crt-terminal .compact-console{display:grid;min-height:0;grid-template-rows:auto minmax(0,1fr)}
  .compact-console .mission-strip{margin:5px 0 0}
  .compact-console .mission-strip>div{display:flex;flex-direction:row;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:3px 9px;padding:5px 9px;text-align:left}
  .compact-console .mission-strip strong:not(.timer){font-size:clamp(10px,1.32vw,17px)}
  .compact-console .mission-strip .timer{font-size:clamp(23px,2.5vw,32px)}
  .crt-terminal .compact-console .game-grid{display:grid;grid-template-columns:minmax(0,1fr) clamp(178px,21vw,273px);grid-template-rows:minmax(0,1fr);padding:7px 0;gap:9px;min-height:0}
  .crt-terminal .compact-console .main-column{display:grid;min-height:0;grid-template-rows:minmax(160px,1fr) auto}
  .compact-console .camera-console{min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr)}
  .crt-terminal .compact-console .camera-console .room{height:auto;min-height:0;aspect-ratio:auto}
  .crt-terminal .compact-console .sidebar{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;align-content:start;min-height:0;overflow:auto}
  .compact-console .room-navigation{margin-top:5px}
}
@media(max-width:650px){
  .camera-feed-name,.camera-index{display:none}
}
@media(max-width:849px){.compact-console .sidebar :is(.mission-tools,.camera-event){grid-column:1/-1}}
