/* Existing readout nodes retain their data and interaction owners. */
.combat-readouts{display:contents;pointer-events:none}
@media(min-width:701px){
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen){position:relative;width:100%;height:calc(100svh - 24px);min-height:320px;margin:0;scroll-margin-top:0;border:0;display:flex;flex-direction:column;background:#09100d;box-shadow:none}
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .stage{flex:1 1 auto;min-height:0;height:auto;width:100%;max-height:none;aspect-ratio:auto;margin:0}
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .game-top{position:absolute;top:0;left:0;right:0;z-index:3;padding:16px 24px;border:0;background:linear-gradient(#07100dcc,transparent);color:#aebe9e;pointer-events:none}
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .rescue-objective{position:absolute;top:52px;left:24px;z-index:3;max-width:min(310px,45%);display:grid;justify-content:start;gap:5px;padding:0;border:0;background:none;color:#c7c4ac;text-shadow:0 2px 3px #000;pointer-events:none}
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .rescue-objective strong{color:#c0cabd;font:11px/1.5 monospace}
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .dungeon-status{position:absolute;top:52px;right:24px;z-index:3;max-width:min(330px,45%);display:grid;justify-content:end;text-align:right;gap:5px;padding:0;border:0;background:none;color:#b9c2b8;text-shadow:0 2px 3px #000;pointer-events:none}
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .dungeon-status strong{color:#dbd2ad}
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .weapon-strip{position:absolute;bottom:58px;left:clamp(160px,20%,250px);right:clamp(176px,22%,266px);z-index:3;justify-content:center;flex-wrap:wrap;padding:0;border:0;background:none;color:#b7beb2;text-shadow:0 2px 3px #000;pointer-events:none}
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .game-bottom{position:relative;bottom:auto;left:auto;transform:none;flex:0 0 48px;z-index:4;min-height:48px;padding:4px 10px;border:0;background:#09100dc0;justify-content:center}
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) #state,body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .controls{display:none}
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .game-bottom button{font-size:9px;min-height:40px;padding:8px;color:#c5cbbd}
}
#play:has(#gate[hidden]) #dungeon-status[data-priority="idle"] #dungeon-hint{display:none}
#play:has(#gate[hidden]) #dungeon-status[data-priority="danger"] #dungeon-hint{color:#ffd7a0;background:#24170ee8;border-inline-start:2px solid #f1b76c;padding:6px 10px}
#play:has(#gate[hidden]) #dungeon-status[data-priority="prompt"] #dungeon-hint{color:#d5eda7;background:#101c13e8;border-inline-start:2px solid #c5f448;padding:6px 10px}
#play:has(#game-loading:not([hidden])) .combat-readouts,#play:has(#result:not([hidden])) .combat-readouts,#play:has(#sector-gate:not([hidden])) .combat-readouts{visibility:hidden}

/* Display overrides must never revive unavailable mission or equipment nodes. */
#play #rescue-objective[hidden],#play #weapon-strip[hidden],#play #dungeon-status[hidden],#play .mobile-hud[hidden],#play .mobile-hud>[hidden]{display:none!important}

/* Bounded local mobilegrid candidate, reviewed for actual contract and browser acceptance. */
.mobile-play #play:has(#gate[hidden]) .combat-readouts{position:absolute;inset:0 0 calc(48px + env(safe-area-inset-bottom));z-index:3;pointer-events:none;display:grid;gap:4px 8px;text-shadow:0 1px 4px #000e;background:linear-gradient(#07100dc7,transparent 170px);grid-template-areas:"stats stats" "mission weapon" "place place" "progress progress";grid-template-columns:minmax(0,1.3fr)minmax(0,.7fr);align-content:start;padding-top:calc(env(safe-area-inset-top) + 8px);padding-left:calc(env(safe-area-inset-left) + 10px);padding-right:calc(env(safe-area-inset-right) + 10px)}.mobile-play #play:has(#gate[hidden]) #rescue-objective{grid-area:mission;position:static;display:grid;justify-content:start;background:none;border:0;padding:0;min-height:0;gap:3px}.mobile-play #play:has(#gate[hidden]) #rescue-task{font:11px/1.35 monospace;width:auto;order:0}.mobile-play #play:has(#gate[hidden]) #rescue-phase,.mobile-play #play:has(#gate[hidden]) #rescue-seals{font-size:9px;margin-inline:0}.mobile-play #play:has(#gate[hidden]) #weapon-strip{grid-area:weapon;position:static;width:auto;min-width:0;max-width:100%;overflow-wrap:anywhere;line-height:1.35;display:grid;gap:3px;align-content:start;justify-items:end;text-align:right;padding:0;background:none;border:0;font-size:9px}.mobile-play #play:has(#gate[hidden]) .mobile-hud{grid-area:stats;position:static;display:flex;justify-content:space-between;min-height:28px;padding:4px 6px;font-size:12px;background:rgba(0,0,0,.2);border:1px solid rgba(255,255,255,.1)}.mobile-play #play:has(#gate[hidden]) #dungeon-status{display:contents;position:static}.mobile-play #play:has(#gate[hidden]) #dungeon-place{grid-area:place;font:700 10px/1.35 monospace}.mobile-play #play:has(#gate[hidden]) #dungeon-progress{grid-area:progress;font-size:9px;color:#c1cbbd;text-shadow:0 0 2px #000}.mobile-play #play:has(#gate[hidden]) #dungeon-hint{position:absolute;bottom:210px;left:50%;transform:translateX(-50%);max-width:min(520px,calc(100% - 24px));width:max-content;white-space:normal;overflow-wrap:anywhere;text-align:center;font-size:11px;padding:6px 10px;color:#d5decd;background:#101a14e8;border-inline-start:2px solid #8fa57c;pointer-events:none}.mobile-play #play:has(#gate[hidden]) #dungeon-status[data-priority=idle] #dungeon-hint{display:none}.mobile-play #play:has(#gate[hidden]) #loot-toast{position:absolute;bottom:250px;left:50%;transform:translateX(-50%);max-width:min(520px,calc(100% - 32px));width:max-content;white-space:normal;overflow-wrap:anywhere;text-align:center;padding:4px 8px;pointer-events:none}@media (orientation:landscape) and (max-height:500px){.mobile-play #play:has(#gate[hidden]) .combat-readouts{grid-template-columns:minmax(0,1.25fr)1fr;grid-template-areas:"stats stats" "mission weapon" "place progress"}.mobile-play #play:has(#gate[hidden]) #rescue-phase{display:none}.mobile-play #play:has(#gate[hidden]) .mobile-hud{font-size:12px}.mobile-play #play:has(#gate[hidden]) #dungeon-hint{bottom:150px}.mobile-play #play:has(#gate[hidden]) #loot-toast{bottom:190px}}
.mobile-play #play:has(#gate[hidden]) #loot-toast:empty{display:none}
.mobile-play #play:has(#gate[hidden]) #dungeon-status[data-priority="danger"] #dungeon-hint{color:#ffd7a0;border-inline-start-color:#f1b76c;background:#24170ee8}
.mobile-play #play:has(#gate[hidden]) #dungeon-status[data-priority="prompt"] #dungeon-hint{color:#d5eda7;border-inline-start-color:#c5f448}


/* Small intrinsic backplates keep location/progress readable over light architecture. */
.mobile-play #play:has(#gate[hidden]) #dungeon-place,.mobile-play #play:has(#gate[hidden]) #dungeon-progress{justify-self:start;max-width:100%;padding:2px 5px;background:#08110de0;border-inline-start:1px solid #9bb07b55;text-shadow:none}
.mobile-play #play:has(#gate[hidden]) #dungeon-progress{font-size:10px}
@media(orientation:landscape) and (max-height:500px){.mobile-play #play:has(#gate[hidden]) #dungeon-progress{justify-self:end;text-align:right}}

/* Goals introduce the next step, then leave the combat view clear. */
#play #rescue-objective{opacity:1;visibility:visible;transition:none}
#play #rescue-objective[data-visibility="quiet"]{opacity:0;visibility:hidden;transition:opacity .55s ease,visibility 0s .55s}
@media(prefers-reduced-motion:reduce){#play #rescue-objective,#play #rescue-objective[data-visibility="quiet"]{transition:none}}

/* The desktop task condenses after its introduction, keeping phase and seals in view. */
@media(min-width:701px){
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) #rescue-objective[data-visibility="quiet"]{
  opacity:1;visibility:visible;max-width:min(210px,40%);gap:2px;padding:5px 8px;
 }
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) #rescue-objective[data-visibility="quiet"] #rescue-task{display:none}
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) #rescue-objective[data-visibility="quiet"] #rescue-phase{color:#e6efd3;font:700 10px/1.25 monospace}
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) #rescue-objective[data-visibility="quiet"] #rescue-seals{color:#c9d5b9;font:9px/1.2 monospace}
}

/* Keep the current rescue phase legible on touch after the detailed prompt fades. */
.mobile-play #play:has(#gate[hidden]) #rescue-objective[data-visibility="quiet"]{
 opacity:1;visibility:visible;justify-self:start;padding:4px 7px;
 background:#08110ddc;border-inline-start:2px solid #b4d484;text-shadow:none;
}
.mobile-play #play:has(#gate[hidden]) #rescue-objective[data-visibility="quiet"] #rescue-task{display:none}
.mobile-play #play:has(#gate[hidden]) #rescue-objective[data-visibility="quiet"] #rescue-phase{display:block;font:700 10px/1.25 monospace;color:#e6efd3}
.mobile-play #play:has(#gate[hidden]) #rescue-objective[data-visibility="quiet"] #rescue-seals{font:9px/1.2 monospace;color:#c9d5b9}

.mobile-play #play:has(#mobile-pause:not([hidden])) .combat-readouts{z-index:4}

/* The active desktop raid keeps room, objective and controls legible against
   both bright service lamps and the dark catwalks without filling the view. */
@media(min-width:701px){
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .rescue-objective,
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .dungeon-status{
  gap:4px;padding:7px 10px;background:#07110cdb;border-inline-start:2px solid #b4d484;
  text-shadow:none;box-shadow:0 4px 16px #0008;font:11px/1.4 monospace;
 }
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .rescue-objective strong,
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .dungeon-status strong{
  color:#eef5dd;font:700 12px/1.35 monospace;
 }
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .dungeon-status{
  border-inline-start:0;border-inline-end:2px solid #bdcc91;
 }
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .weapon-strip{
  font:700 11px/1.45 monospace;color:#e3e6d8;
 }
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .game-bottom{
  gap:4px;border-top:1px solid #617a5670;background:#07110df0;
 }
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .game-bottom button{
  font:700 11px/1.3 monospace;letter-spacing:.02em;min-height:42px;padding:8px 12px;
  color:#e0e8d7;
 }
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .game-bottom button:hover,
 body:not(.mobile-play) #play:has(#gate[hidden]):not(:fullscreen) .game-bottom button:focus-visible{
  color:#f1ffc5;background:#29402b;outline-offset:-2px;
 }
}

/* A brief edge cue acknowledges real HP loss without covering the reticle or controls. */
#play .stage[data-player-hit]::after{content:"";position:absolute;inset:0;z-index:2;pointer-events:none;box-shadow:inset 0 0 clamp(22px,5vw,62px) 10px #a73b2e80;background:radial-gradient(ellipse at center,transparent 42%,#8f2e2638 100%)}
