/* Original quarantine instrument panel. Layout only; no gameplay geometry. */
:root { --field-ink:#0c151a; --field-panel:#142027; --field-border:#435055; --field-amber:#e7b963; --field-cyan:#92cbd1; }
[hidden] { display:none !important; }
body { min-width:360px; background:radial-gradient(ellipse at 80% 0,#301d19 0,transparent 55%),linear-gradient(#111a1e,#070d11); }
.game-shell { max-width:1360px; width:calc(100% - 32px); padding:12px 0 24px; position:relative; }
.topbar { display:grid; grid-template-columns:minmax(185px,1fr) auto auto; gap:14px; align-items:center; margin-bottom:10px; }
.field-brand .eyebrow { font-size:9px; letter-spacing:.18em; color:#c97a5f; }
.topbar h1 { font-size:clamp(21px,2.1vw,30px); letter-spacing:.04em; }
.topbar .hud { display:flex; gap:4px; flex-wrap:nowrap; width:auto; order:initial; }
.hud > div { min-width:65px; padding:7px 9px; border:1px solid var(--field-border); background:linear-gradient(135deg,#233039,#111b21); border-radius:2px; position:relative; }
.hud span { font-size:9px; color:#b6c1bc; letter-spacing:.06em; }
.hud strong { color:#eee6d1; font-size:18px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.hud .credits strong { color:var(--field-amber); }
.hud .integrity { min-width:115px; padding-bottom:11px; }
#safehouse-meter { position:absolute; bottom:3px; left:9px; width:calc(100% - 18px); height:4px; border:0; background:#26363b; }
#safehouse-meter::-webkit-meter-bar { border:0; background:#26363b; border-radius:0; }
#safehouse-meter::-webkit-meter-optimum-value { background:#a6bf9c; }
#safehouse-meter::-moz-meter-bar { background:#a6bf9c; }
.combat-tools { display:flex; flex-wrap:wrap; gap:5px; justify-content:flex-end; max-width:265px; }
.combat-tools .speed-control { min-width:88px; padding:8px; background:#253b3a; border-color:#607a6b; }
.combat-tools .manager-control { padding:8px; font-size:12px; background:#182329; }
#save-status { width:100%; color:#aab8b6; text-align:right; min-height:11px; font-size:9px; }
.field-settings { margin:0 0 8px; font-size:11px; color:#bcc6c1; }
.field-settings > summary { cursor:pointer; width:max-content; padding:5px 10px; border:1px solid #39474d; background:#142027; border-radius:2px; }
.settings-content { position:absolute; z-index:7; top:100px; right:0; width:min(680px,100%); padding:16px; border:1px solid #788178; background:#111d24; box-shadow:0 12px 35px #000a; }
.audio-main { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.view-control { display:flex; align-items:center; gap:10px; flex-wrap:wrap; color:var(--field-amber); }
.view-control select { background:#213039; color:#eee5d1; border:1px solid #617174; padding:7px; border-radius:2px; }
#view-status { color:#bcc6c1; font-size:11px; margin:7px 0 12px; }
.volume-control { background:#1b2b31; border-radius:2px; border-color:#43555b; }
.controls-settings { border-top:1px solid #34434a; padding-top:8px; }
.controls-settings summary { color:var(--field-amber); }
#control-bindings select,.settings-content button { background:#213039; color:#dddcc9; border:1px solid #617174; padding:7px; border-radius:2px; }
.battle-wrap { border:1px solid #69716a; border-radius:2px; background:#091116; box-shadow:0 15px 45px #0008; }
.coach { margin-top:8px; padding:8px 12px; border:1px solid #40595e; border-left:3px solid #7aabae; background:#14252c; gap:12px; }
.coach strong { color:#dedcc6; font-size:12px; }
.coach p { font-size:11px; line-height:1.4; color:#b7c7c8; }
.coach button { font-size:11px; padding:7px; }
.controls { grid-template-columns:minmax(0,1fr) minmax(245px,.52fr); gap:8px; margin-top:8px; }
.build-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.build-list .build { position:relative; min-width:0; padding:11px 8px 10px 61px; min-height:76px; background:linear-gradient(135deg,#253138,#132027); border-color:#4f6064; text-align:left; }
.build-list .build span { font-size:13px; color:#eee5d1; }
.build-list .build small { font-size:10px; line-height:1.4; color:#bcc8c4; }
.build-list .build.active { background:linear-gradient(135deg,#3c372a,#222923); border-color:var(--field-amber); box-shadow:inset 0 0 0 1px #e7b96333,0 0 12px #e7b96312; }
.build-list .build[aria-pressed="true"]::after { content:"SELECTED"; position:absolute; top:-1px; right:4px; font-size:7px; letter-spacing:.07em; color:var(--field-amber); }
.build:disabled { opacity:.48; cursor:not-allowed; }
.turret-card-art { position:absolute; width:54px; height:54px; top:10px; left:3px; background-image:url('./assets/art/turrets-v1.png'); background-size:300% 100%; background-repeat:no-repeat; filter:drop-shadow(0 3px 3px #0009); }
[data-kind="smg"] .turret-card-art { background-position:0 0; }
[data-kind="shotgun"] .turret-card-art { background-position:50% 0; }
[data-kind="minigun"] .turret-card-art { background-position:100% 0; }
.action-list { display:grid; grid-template-columns:1.2fr 1fr; gap:6px; max-width:none; grid-row:1; grid-column:2; }
.action-list .wave-control,.action-list .ability { min-width:0; min-height:76px; padding:11px; }
.wave-control { background:linear-gradient(145deg,#3d3829,#26281e); border-color:#8f7f56; }
.ability { background:linear-gradient(145deg,#53312a,#2b211d); border-color:#a8684f; }
.action-list span { font-size:14px; }
.action-list small { font-size:10px; line-height:1.35; color:#c5bda6; }
.build-editor { display:grid; grid-template-columns:1fr 1fr 1fr; gap:0 16px; padding:14px; background:linear-gradient(125deg,#1d2a31,#111d24); border-color:#4c6167; }
.editor-heading { grid-column:1/3; margin:0 0 8px; }
.editor-heading span { color:var(--field-amber); font-size:9px; }
.editor-heading strong { font-size:13px; }
.rhythm-preview { grid-column:3; grid-row:1; margin:0 0 8px; padding:6px 8px; font-size:9px; border-radius:2px; border-color:#46616d; background:#12242d; }
.briefing-column { grid-column:1; }
.upgrade-column { grid-column:2; }
.aim-column { grid-column:3; }
.wave-preview { margin:0 0 9px; padding:9px; background:#172329; border:1px solid #46565c; font-size:11px; color:#cfceba; }
.field-guide summary { color:var(--field-cyan); font-size:11px; cursor:pointer; }
.field-guide .threat-preview { margin-top:8px; }
.terrain-preview { margin-top:10px; flex-wrap:wrap; gap:8px; }
.manager-stats { margin:0 0 8px; border:1px solid #34484f; border-radius:2px; padding:9px; background:#0f1c23; font-size:11px; gap:4px 10px; }
.upgrade-options { margin:0; }
.upgrade-choice { background:#23343c; border-color:#62747b; }
.upgrade-choice strong { font-size:12px; }
.upgrade-choice small { font-size:10px; line-height:1.5; color:#c4cbc7; }
.build-editor label { margin-top:0; margin-bottom:12px; font-size:11px; color:#c5cdc8; }
.build-editor input { min-height:24px; accent-color:var(--field-amber); }
.manager-actions { margin-top:0; }
.manager-actions button { font-size:11px; min-height:34px; border-color:#587078; background:#20323a; }
.manager-actions .remove-control { border-color:#986653; color:#e4b9a1; background:#362822; }
.game-shell[data-selection="none"] .upgrade-column,.game-shell[data-selection="none"] .aim-column { display:none; }
.game-shell[data-selection="none"] .briefing-column { grid-column:1/-1; }
.game-shell[data-selection="none"] .wave-preview { margin:0; }
.game-shell[data-selection="none"] .field-guide { margin-top:8px; }
.game-shell[data-phase="combat"] .build-editor { display:grid; grid-template-columns:1fr auto; gap:8px 16px; padding:10px 12px; }
.game-shell[data-phase="combat"] .build-editor .editor-heading { grid-column:1; max-width:none; margin:0; }
.game-shell[data-phase="combat"] .build-editor .rhythm-preview { grid-column:2; margin:0; }
.game-shell[data-phase="combat"] .briefing-column { grid-column:1/-1; }
.game-shell[data-phase="combat"] .field-guide,.game-shell[data-phase="combat"] .aim-column { display:none; }
.game-shell[data-phase="combat"] .upgrade-column { grid-column:1/-1; }
.panel { border-color:#65777b; background:linear-gradient(145deg,#24333b,#111c23); }
.panel h2 { color:#ede2c4; }
.skill-node { background:#1a2b33; border-color:#52666b; }
.skill-node small { color:#bac7c4; }
.tower-tooltip { background:#0f1b22f5; border-color:#839487; }
/* Desktop command station: the inspector scrolls, never the battlefield.
   Keep the canvas's native aspect ratio and leave every map pixel clickable. */
@media(min-width:1101px) and (min-height:640px) {
  .game-shell[data-phase="build"],.game-shell[data-phase="combat"] {
    display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:8px 12px;
    max-width:calc(var(--battle-height,calc(100dvh - 255px))*var(--battle-ratio,1.777778) + 294px);
  }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .topbar,.game-shell:is([data-phase="build"],[data-phase="combat"]) .field-settings { grid-column:1/-1; margin-bottom:0; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .combat-tools { max-width:300px; flex-wrap:nowrap; position:relative; padding-bottom:14px; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) #save-status { position:absolute; bottom:0; right:0; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .battle-wrap { grid-column:1; grid-row:3; justify-self:center; width:100%; align-self:start; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .coach { grid-column:1; grid-row:4; margin:0; padding:6px 10px; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .controls { display:contents; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .build-list { grid-column:1; grid-row:5; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .build-list .build { min-height:64px; padding-top:7px; padding-bottom:7px; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .turret-card-art { top:5px; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .action-list { grid-column:2; grid-row:3; align-self:start; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .action-list button { min-height:70px; padding:8px; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .build-editor { grid-column:2; grid-row:3/6; align-self:start; margin-top:78px; max-height:calc(100dvh - 240px); overflow:auto; scrollbar-gutter:stable; grid-template-columns:minmax(0,1fr); gap:10px; padding:12px; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .build-editor > *,.game-shell:is([data-phase="build"],[data-phase="combat"]) .build-editor .rhythm-preview { grid-column:1; grid-row:auto; margin:0; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .build-editor .editor-heading { grid-row:1; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .build-editor .rhythm-preview { grid-row:2; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .build-editor .aim-column { grid-row:3; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .build-editor .upgrade-column { grid-row:4; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .build-editor .briefing-column { grid-row:5; }
  .game-shell:is([data-phase="build"],[data-phase="combat"]) .build-editor .manager-actions { flex-wrap:wrap; }
}
@media(max-width:1100px) {
  .topbar { grid-template-columns:1fr auto; gap:8px; }
  .topbar .hud { grid-column:1/-1; grid-row:2; }
  .hud > div { flex:1; }
  .combat-tools { max-width:285px; }
  .controls { grid-template-columns:1fr; }
  .action-list { grid-column:1; grid-row:2; }
  .action-list .wave-control,.action-list .ability { min-height:54px; }
  .build-editor { grid-row:3; }
  .settings-content { top:130px; }
}
@media(max-width:650px) {
  .game-shell { width:calc(100% - 16px); }
  .topbar { grid-template-columns:1fr; }
  .topbar .hud { grid-row:2; gap:3px; }
  .hud > div { padding:6px; min-width:0; }
  .hud .integrity { min-width:94px; }
  .hud span { font-size:8px; }
  .hud strong { font-size:13px; }
  .combat-tools { max-width:none; grid-row:3; justify-content:flex-start; }
  #save-status { width:auto; align-self:center; text-align:left; }
  .field-brand .eyebrow { display:none; }
  .topbar h1 { font-size:23px; }
  .settings-content { position:static; width:100%; margin-top:6px; }
  .build-list .build { padding:48px 5px 8px; min-height:112px; text-align:center; }
  .turret-card-art { top:2px; left:calc(50% - 25px); width:50px; height:50px; }
  .build-list .build span { font-size:11px; }
  .build-list .build small { font-size:9px; }
  .build-editor { grid-template-columns:1fr; gap:10px; }
  .editor-heading,.rhythm-preview,.briefing-column,.upgrade-column,.aim-column { grid-column:1; grid-row:auto; }
  .game-shell[data-phase="combat"] .build-editor { grid-template-columns:1fr; }
  .game-shell[data-phase="combat"] .build-editor .rhythm-preview { grid-column:1; grid-row:auto; }
  .coach { align-items:flex-start; }
  .skill-tree { grid-template-columns:1fr; }
  .overlay { padding:6px; }
  .panel { width:100%; padding:12px; }
  .panel h2 { font-size:25px; }
}
