/* [codex] 2026-10-23 廣告位與遊戲固定層讓位；廣告本體保持可見可操作。 */
:root { --ad-h:0px; }
body { padding-top:var(--ad-h); }
.shell.v3 { min-height:calc(100svh - var(--ad-h)); }
header.top { top:var(--ad-h); }
#battle { top:var(--ad-h); height:calc(100dvh - var(--ad-h)); }
#battle .battle-shell { min-width:0; grid-template-columns:minmax(0,1fr); }
#battle-hud { min-width:0; }
.modal-backdrop,.death-review,.reward-reveal,#orientation-hint { top:var(--ad-h); }
.modal { max-height:calc(100dvh - var(--ad-h) - 24px - env(safe-area-inset-bottom)); }
html[data-ad-layout="top"] header.top { padding-top:8px; }
html[data-ad-layout="top"] #battle { padding-top:0; }
#battle .battle-frame { width:min(100%,calc((100dvh - var(--ad-h) - 270px)*360/592)); }
.hud-status { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); gap:8px; align-items:center; }
.hud-status .hud-vitals { min-width:0; gap:6px; }
.hud-status .hud-vitals b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hud-status .hud-progress { min-width:0; height:auto; display:grid; gap:0; }
.hud-status #hud-progress-label { max-width:100%; }
.hud-status .hud-progress-track { min-width:0; }
#adbar { position:fixed; z-index:1300; color:#aebcb6; background:#18201d; box-sizing:border-box; }
#adbar[data-placement="top"] { inset:0 auto auto 0; width:100vw; padding-top:env(safe-area-inset-top); }
#adbar .ad-unit { width:var(--ad-unit-w); height:var(--ad-unit-h); margin:auto; }
#adbar .ad-gap { height:var(--ad-gap-h); font:10px/var(--ad-gap-h) system-ui; padding-inline:8px; background:#202924; user-select:none; }
#adbar[data-placement="side"] { left:calc(50% + var(--portrait-width)/2 + var(--ad-side-gap)); top:env(safe-area-inset-top); width:var(--ad-unit-w); }
#adbar[data-placement="side"] .ad-gap { position:absolute; top:100%; left:0; right:0; }
#adbar .ad-house { width:100%; height:100%; display:flex; align-items:center; gap:6px; padding:4px 6px; box-sizing:border-box; color:inherit; text-decoration:none; font:11px/1.25 system-ui; background:#18201d; }
.ad-house img { width:32px; height:32px; flex:none; border-radius:6px; }
.ad-house .ad-copy { flex:1; min-width:0; }
.ad-house strong { display:block; font-size:12px; }
.ad-house small { display:block; font-size:10px; }
.ad-house .ad-cta { flex:none; font-size:12px; color:#c0cfc6; }
#adbar[data-placement="side"] .ad-house { flex-direction:column; justify-content:center; padding:12px; text-align:center; gap:12px; }
#adbar[data-placement="side"] .ad-copy { flex:none; }
#adbar[data-placement="side"] .ad-house img { width:64px; height:64px; }
#adbar[data-placement="side"] .ad-house small { margin-top:8px; font-size:12px; }

#adbar .ad-unit { display:flex; align-items:center; justify-content:center; }
