/* Step 1: survival only. Keep the battlefield separate from persistent HUD. */
#survival-screen:not([hidden]){grid-template-rows:auto minmax(0,1fr) auto;isolation:isolate}
#survival-screen .masthead{min-height:48px;padding:4px 12px;gap:8px 12px}
#survival-screen .brand{gap:8px}
#survival-screen .brand .crest{width:31px;height:31px}
#survival-screen .brand h1{font-size:clamp(15px,1.22vw,21px);letter-spacing:.045em}
#survival-screen .brand .kicker{font-size:9px}
#survival-screen .top-actions{gap:5px}
#survival-screen .top-actions :is(button,select,summary){min-height:29px;font-size:11px;padding:0 8px}
#survival-screen .masthead .threat{width:min(100%,400px);padding:3px 9px}
#survival-screen .threat-line{font-size:12px}
#survival-screen .threat-meter{height:3px;margin-top:3px}
#survival-screen .threat-caption{margin-top:2px}
#survival-screen .threat-caption{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#survival-screen .battle-warning{position:static;transform:none;padding:0;border:0;background:none;font-size:10px;text-overflow:ellipsis;overflow:hidden;line-height:1.2}
#survival-screen .battle-warning::after{display:none}
#survival-screen .threat:has(.battle-warning:not([hidden])) .threat-caption{display:none}
#survival-screen .rts-dock{grid-template-columns:minmax(270px,1.05fr) minmax(450px,2.4fr) minmax(160px,.6fr);gap:7px;padding:5px 8px;border-top:1px solid var(--hud-metal)}
#survival-screen .rts-roster-panel,#survival-screen .rts-orders{padding:4px 6px}
#survival-screen .section-line{min-height:15px;margin-bottom:3px}
#survival-screen .control-strip{display:flex;gap:5px;align-items:center;flex-wrap:wrap;margin-bottom:4px}
#survival-screen .control-options,#survival-screen .camera-tools{display:flex;align-items:center;gap:3px}
#survival-screen .camera-tools{margin-left:auto}
#survival-screen .control-strip button{min-height:25px;padding:0 7px;font-size:10px}
#survival-screen #camera-mode{font-size:10px;color:#b5c7cc;min-width:60px;white-space:nowrap;text-align:right}
#survival-screen .roster{grid-template-columns:repeat(4,minmax(0,1fr));gap:3px}
#survival-screen .unit-card{min-height:32px;height:32px;padding:2px 4px;gap:1px 4px;cursor:pointer}
#survival-screen .unit-card b{line-height:12px}
#survival-screen .unit-card small{line-height:9px}
#survival-screen .unit-card .unit-health-number{font-size:9px}
#survival-screen .field-bottom{position:static;display:flex;gap:5px;padding:3px 0 2px;pointer-events:auto;background:none;align-items:center;min-width:0}
#survival-screen .field-status{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:none;border:0;padding:0;font-size:10px;line-height:17px}
#survival-screen .field-status i{display:none}
#survival-screen .field-actions button{min-height:24px;padding:0 7px;font-size:10px}
#survival-screen .command-prompt{position:static;transform:none;white-space:normal;text-align:left;border:0;background:none;padding:2px 0;color:#ffe0a7;font-size:10px}
#survival-screen .command-deck{margin-top:2px;gap:3px}
#survival-screen .command-deck button,#survival-screen .command-deck summary{min-height:24px;font-size:10px}
#survival-screen .deployment-guide{margin-top:2px;gap:3px}
#survival-screen .deployment-steps{display:none}
#survival-screen .rts-radar{padding:3px 4px;gap:3px}
#survival-screen .field-top{position:static;display:flex;width:100%;gap:4px;justify-content:space-between;padding:0;background:none;pointer-events:none;align-items:center}
#survival-screen .location,#survival-screen .survivors{display:flex;align-items:center;background:none;border:0;padding:0;gap:3px}
#survival-screen .location .kicker,#survival-screen .survivors .kicker{display:none}
#survival-screen .location strong{font-size:10px;margin:0;font-weight:500;color:#c5d1db}
#survival-screen .survivors strong{font-size:11px;color:#e9c994;line-height:1;white-space:nowrap}
#survival-screen .survivors strong::before{content:'생존 ';font-size:10px;font-weight:400}
#survival-screen .survivors span{font-size:10px}
#survival-screen .rts-radar canvas{height:82px;width:auto;max-width:100%;background:#08121c}
#survival-screen .zoom-controls{display:flex;justify-content:center;gap:3px;width:100%}
#survival-screen .zoom-controls button{min-height:24px;padding:0 8px;font-size:12px;min-width:32px}
#survival-screen #camera-default{font-size:10px;min-width:58px;font-variant-numeric:tabular-nums}
#survival-screen footer{display:none}
@media(max-height:800px){
 #survival-screen .rts-radar canvas{height:64px}
 #survival-screen .unit-card{min-height:30px}
}
@media(max-width:1350px){
 #survival-screen .rts-dock{grid-template-columns:minmax(230px,1.1fr) minmax(365px,2.2fr) minmax(140px,.65fr)}
 #survival-screen #camera-mode{display:none}
 #survival-screen .brand h1{font-size:15px}
 #survival-screen .top-actions :is(button,select,summary){padding:0 5px;font-size:10px}
 #survival-screen .camera-tools{margin-left:0}
}
@media(max-width:1000px){
 #survival-screen .masthead{grid-template-columns:auto 1fr;padding:4px 8px}
 #survival-screen .masthead .threat{grid-column:2;grid-row:1;width:100%}
 #survival-screen .top-actions{grid-column:1/-1;justify-content:flex-end}
 #survival-screen .rts-dock{grid-template-columns:minmax(190px,1fr) minmax(300px,1.8fr) 130px}
 #survival-screen .camera-tools button{padding:0 4px}
 #survival-screen .control-strip{gap:3px}
}
@media(max-width:700px){
 #survival-screen .rts-dock{grid-template-columns:minmax(0,1fr) 115px;grid-template-areas:'roster radar' 'orders orders'}
 #survival-screen .rts-orders{display:flex;flex-wrap:wrap;align-items:center;gap:5px}
 #survival-screen .rts-orders h2{display:none}
 #survival-screen .command-deck{display:flex;flex-wrap:wrap}
 #survival-screen .field-bottom{flex:1;min-width:120px}
 #survival-screen .control-strip button{font-size:9px;padding:0 4px}
}

/* Warning text must not resize the battlefield backing store during attacks. */
@media(min-width:1001px){
 #survival-screen .masthead{height:52px;min-height:52px}
 #survival-screen .threat-line{line-height:14px}
 #survival-screen .threat-caption,#survival-screen .battle-warning{line-height:11.5px;height:11.5px}
}

/* Fullscreen canvas focus rings flash along both map edges when input changes.
   Keep keyboard focus visible on the camera controls in the dock instead. */
#survival-screen #game:focus,#survival-screen #game:focus-visible{outline:none;box-shadow:none}
#survival-screen:has(#game:focus-visible) .camera-tools{outline:1px solid var(--hud-metal);outline-offset:2px}
