.zombie-adventure{--defense-bg:#1c2824;--defense-panel:#27382f;--defense-border:#607b5a;--defense-gold:#ddc381;--defense-copy:#d9e3cc;--defense-muted:#a6b99e;--defense-danger:#e2a487}
.defense-drawer.hidden,.defense-placement-hint.hidden,.action-btn-defense.hidden{display:none!important}
.zombie-adventure .expedition-nav .action-btn-defense{background:#374b34;border:1px solid #91a16a;color:#f0e3ae;white-space:nowrap}
.action-btn-defense[aria-expanded="true"]{box-shadow:inset 0 -2px 0 var(--defense-gold)}
.defense-drawer{position:fixed;z-index:82;right:18px;top:18px;bottom:18px;display:flex;flex-direction:column;width:min(460px,calc(100vw - 36px));border:1px solid var(--defense-border);border-radius:7px;background:#1c2824fa;color:var(--defense-copy);box-shadow:-15px 12px 70px #0008;backdrop-filter:blur(12px);font-family:Tahoma,sans-serif;isolation:isolate;animation:defense-enter .18s ease-out}
.defense-drawer-header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:18px 20px 14px;border-bottom:1px solid #435941;flex-shrink:0}
.defense-kicker{display:block;font-size:8px;font-weight:700;line-height:1.5;letter-spacing:.08em;color:#bfc690}
.defense-drawer-header h2{margin:5px 0 0;font-size:21px;line-height:1.5;color:#f0e2ac;font-weight:600}
.zombie-adventure #defense-close{min-width:36px;min-height:36px;padding:0;margin:0;background:#2d4032;border:1px solid #61724f;color:#dde2c3;border-radius:4px;font-size:16px}
.defense-drawer-body{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:0 20px 20px;scrollbar-width:thin;scrollbar-color:#677c52 var(--defense-bg)}
.defense-intro{margin:15px 0 12px;color:var(--defense-muted);font-size:11px;line-height:1.9}
.defense-stash{background:#17221d;border:1px solid #41543b;border-radius:4px;padding:9px 11px;color:#d3c38e;font-size:10px;line-height:1.8}
.defense-section{padding-top:18px;margin-top:3px}
.defense-section-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:6px}
.defense-section-heading h3{margin:0;color:#e7dfb8;font-size:12px;line-height:1.6;font-weight:700}
.defense-section-heading>small{color:#9fb08e;font-size:9px;text-align:right}
.defense-section-note{margin:0 0 12px;color:var(--defense-muted);font-size:10px;line-height:1.8}
.defense-blueprints{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.defense-blueprint{display:flex;flex-direction:column;min-width:0;padding:12px 10px 9px;border:1px solid #526c48;border-radius:4px;background:linear-gradient(150deg,#30432f,#25362b);gap:8px}
.defense-blueprint-heading{display:flex;align-items:center;gap:7px;min-height:35px}
.defense-blueprint-heading>div{min-width:0}
.defense-blueprint-heading h3{margin:2px 0 0;color:#f0dfaa;font-size:12px;line-height:1.6;font-weight:600}
.defense-blueprint-heading .defense-kicker{font-size:7px;letter-spacing:.02em;color:#9eb692;line-height:1.5}
.defense-symbol{display:grid;place-items:center;flex:0 0 31px;width:31px;height:33px;border:1px solid #899363;border-radius:4px;background:#a6b47312;color:#d2d6a2;font-size:25px;line-height:1}
.defense-symbol.cannon_turret{color:#e1bb85;border-color:#ae8e60;background:#ae8e6015}
.defense-symbol.snare_trap{color:#b2c8a0;border-color:#7d9665;font-size:31px}
.defense-card-description{flex:1;margin:0;color:#b4c3a8;font-size:9px;line-height:1.8;min-height:48px}
.defense-card-stats{margin:0;color:#c4d2b3;font-size:8px;line-height:1.8}
.defense-card-cost{padding-top:7px;border-top:1px solid #4d633d;color:#dfcd8e;font-size:9px;line-height:1.8}
.zombie-adventure .defense-blueprint-select{width:100%;margin:0;min-height:35px;padding:6px;background:#58653b;border:1px solid #a3a76a;border-radius:3px;color:#f3e8ba;font:600 10px/1.7 Tahoma,sans-serif;white-space:normal;box-shadow:none}
.zombie-adventure .defense-blueprint-select:hover{background:#6c7748;border-color:#c4c589}
.zombie-adventure .defense-blueprint-select:disabled{background:#2d3d29;border-color:#4d5e3f;color:#a0ae8e;opacity:.6;cursor:not-allowed}
.defense-card-reason{display:block;min-height:14px;color:#a3b28d;font-size:8px;line-height:1.7}
.defense-structure{padding:12px 0;border-bottom:1px solid #3e5137}
.defense-structure.is-selected{border-bottom-color:#98aa6e}
.defense-structure:focus-visible{outline:1px solid #c8be7a;outline-offset:5px}
.defense-structure-heading{display:flex;justify-content:space-between;align-items:baseline;gap:7px}
.defense-structure-heading>strong{color:#d8dfc2;font-size:11px;line-height:1.7;font-weight:600}
.defense-structure-heading>small{color:#97a78b;white-space:nowrap;font-size:8px;line-height:1.7}
.defense-structure.is-near .defense-structure-heading>small{color:#bed193}
.defense-structure-status{margin:5px 0;color:#adc29a;font-size:10px;line-height:1.6}
.defense-structure.is-empty .defense-structure-status{color:var(--defense-danger)}
.defense-health-meter{height:3px;background:#111d15;border-radius:2px;overflow:hidden;margin-bottom:9px}
.defense-health-meter>i{display:block;height:100%;background:#a5bb77}
.defense-structure-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.defense-structure.is-trap .defense-structure-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
.defense-structure-actions button[hidden]{display:none!important}
.zombie-adventure .defense-action{margin:0;min-height:46px;padding:6px 4px;border:1px solid #5e754a;border-radius:3px;background:#34472f;color:#e5e1b8;font:600 10px/1.7 Tahoma,sans-serif;white-space:normal;box-shadow:none}
.defense-action span,.defense-action small{display:block}
.defense-action small{font-size:8px;color:#bdbb8c;font-weight:400}
.zombie-adventure .defense-action:disabled{opacity:.43;cursor:not-allowed}
.zombie-adventure .defense-action:hover:not(:disabled){background:#4b5d3c;border-color:#a1ad72}
.defense-structure-hint{display:block;margin-top:7px;color:#91a47f;font-size:8px;line-height:1.8}
.defense-empty{padding:16px 12px;margin:10px 0 0;border:1px dashed #526546;border-radius:4px;background:#203020;color:#aabb98;text-align:center;font-size:10px;line-height:1.8}
.defense-status{padding-top:12px;margin:16px 0 0;border-top:1px solid #42543a;color:#b3bc90;font-size:9px;line-height:1.9}
.defense-placement-hint{position:absolute;z-index:7;left:50%;top:14px;transform:translateX(-50%);max-width:55%;display:flex;gap:12px;align-items:center;padding:8px 10px;border:1px solid #cfbe77;border-radius:4px;background:#293e27ee;box-shadow:0 4px 16px #13251f55;color:#eadca6;font-family:Tahoma,sans-serif;pointer-events:none}
.defense-placement-hint>div{min-width:0}
.defense-placement-hint strong{display:block;color:#f1dfa0;font-size:10px;line-height:1.7;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.defense-placement-hint span{display:block;color:#c1c7a2;font-size:9px;line-height:1.7;white-space:nowrap}
#defense-placement-reason:empty{display:none}
.defense-placement-hint[data-valid="false"] #defense-placement-reason{color:#ecc09b}
.defense-placement-hint[data-valid="true"] #defense-placement-reason{color:#c3df9f}
.zombie-adventure #defense-placement-cancel{flex:0 0 30px;min-width:30px;min-height:30px;padding:0;margin:0;border:1px solid #879261;border-radius:3px;background:#425236;color:#f1e1b0;font-size:15px;line-height:1;pointer-events:auto}
.defense-drawer button:focus-visible,.action-btn-defense:focus-visible,#defense-placement-cancel:focus-visible{outline:2px solid #e9cf80;outline-offset:2px}
@keyframes defense-enter{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:700px){.defense-drawer{right:8px;top:8px;bottom:8px;width:min(450px,calc(100vw - 16px))}.defense-drawer-header{padding:14px 14px 11px}.defense-drawer-header h2{font-size:18px}.defense-drawer-body{padding:0 14px 17px}.defense-blueprints{gap:7px}.defense-blueprint{padding:10px 8px 8px;gap:7px}.defense-blueprint-heading{gap:5px}.defense-blueprint-heading h3{font-size:11px}.defense-symbol{width:27px;flex-basis:27px;font-size:22px}.defense-card-description{font-size:9px;min-height:64px}.defense-section-heading h3{font-size:11px}.defense-section-heading>small{font-size:8px}.zombie-adventure .defense-blueprint-select{min-height:38px}.defense-placement-hint{left:10px;right:10px;top:49px;transform:none;max-width:unset;width:fit-content;gap:8px;padding:6px 8px}.defense-placement-hint strong{font-size:9px}.defense-placement-hint span{font-size:8px}.defense-structure-heading>strong{font-size:10px}.defense-structure-heading>small{font-size:8px}}
@media(prefers-reduced-motion:reduce){.defense-drawer{animation:none}}
/* The extra defense button adds a third 44px toolbar row. Keep the existing
   touch movement/interaction overlay above that toolbar, inside the map. */
@media(max-width:700px) and (orientation:portrait){.zombie-adventure .adventure:has(#defense-open:not(.hidden))>.play-controls{margin-bottom:195px}}
