.exp-battle {position:absolute;top:0;right:0;bottom:0;left:0;z-index:4;background:#2b211b;display:grid;grid-template-rows:auto minmax(120px,1fr) auto;color:#fff4de}
.exp-battle[hidden]{display:none}
.exp-battle [hidden]{display:none!important}
.exp-battle header{display:flex;justify-content:space-between;gap:8px;padding:10px 12px;padding-top:max(10px,env(safe-area-inset-top));background:#271d17}
.exp-battle h3{font-size:18px;margin:0 0 4px;color:#ffe0a2}.exp-battle p{margin:4px 0;font-size:13px;line-height:1.45}
.exp-battle nav{display:flex;gap:6px;align-items:flex-start}.exp-battle canvas{width:100%;height:100%;min-height:0;display:block;image-rendering:pixelated}
.exp-battle footer{padding:10px 12px;padding-bottom:max(10px,env(safe-area-inset-bottom));background:#271d17;max-height:48vh;max-height:48dvh;max-height:calc(var(--exp-map-height)*.48);overflow:auto}
.exp-battle .battle-targets{display:flex;gap:6px;flex-wrap:wrap}.exp-battle .battle-targets button{flex:1;font-size:12px!important;padding:6px!important}
.exp-battle button[aria-pressed=true]{border-color:#ffe195!important;background:#695032!important;box-shadow:inset 0 0 0 1px #ffe195}
.battle-commands{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;margin-top:8px}.battle-options{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:8px}.battle-options:empty{display:none}
.exp-battle .battle-options button{text-align:left;font-size:12px!important}.battle-options small{display:block;color:#e7c9a6;margin-top:3px;line-height:1.4}
.exp-battle details{font-size:12px;margin-top:8px}.exp-battle ol{padding-left:20px;line-height:1.5;margin:6px 0}
.exp-battle .battle-result{position:absolute;top:0;right:0;bottom:0;left:0;z-index:6;display:grid;place-items:center;padding:16px;background:#1c140eb3}
.battle-result-card{box-sizing:border-box;width:min(100%,360px);max-height:90%;overflow:auto;padding:24px;text-align:center;background:#39291e;border:2px solid #dbb777;border-radius:16px;box-shadow:0 12px 40px #0008}
.battle-result-card h4{margin:0 0 10px;font-size:26px;color:#ffe19c}.battle-result-card p{margin:0 0 20px;font-size:14px;line-height:1.6}.battle-result-card button{min-width:130px;margin:4px}
@media(max-width:600px){.exp-battle header{padding:8px}.exp-battle h3{font-size:15px}.exp-battle nav{flex-direction:column}.exp-battle nav button{font-size:12px!important;padding:6px!important}.exp-battle footer{padding:8px}.battle-commands{grid-template-columns:repeat(3,1fr)}.battle-options{grid-template-columns:repeat(2,1fr)}.exp-battle .battle-targets{gap:4px}.exp-battle p{font-size:12px}}
@media(max-height:500px){.exp-battle{grid-template-columns:1fr minmax(280px,40%);grid-template-rows:auto 1fr}.exp-battle header{grid-column:1}.exp-battle canvas{grid-column:1}.exp-battle footer{grid-column:2;grid-row:1/3;max-height:none;border-left:1px solid #715438}.battle-commands{grid-template-columns:repeat(3,1fr)}.battle-options{grid-template-columns:repeat(2,1fr)}}
/* Compact information row; subcommands live in the shared overlay instead of growing this grid. */
#explorationMap .exp-battle>header{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 8px;padding:6px 8px;padding-top:max(6px,env(safe-area-inset-top));align-items:center}
#explorationMap .exp-battle>header>div{display:contents}
#explorationMap .exp-battle>header h3{grid-column:1;grid-row:1;font-size:13px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#explorationMap .exp-battle>header nav{grid-column:2;grid-row:1;flex-direction:row;gap:5px}
#explorationMap .exp-battle>header nav button{min-height:38px;min-width:44px;font-size:11px!important;padding:4px 7px!important}
#explorationMap #expBattleStats{grid-column:1/-1;grid-row:2;font-size:11px;line-height:1.4;margin:0}
#explorationMap #expBattleOrder{grid-column:1/-1;grid-row:3;font-size:10px;line-height:1.4;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#explorationMap .exp-battle>footer{padding:8px;max-height:45vh;max-height:calc(var(--exp-map-height,100vh)*.45)}
#explorationMap #expBattleNotice{font-size:11px;line-height:1.5;margin:5px 0}
#explorationMap .battle-targets button{min-height:38px}
#explorationMap .battle-commands{gap:5px;margin-top:6px}
#explorationMap .battle-commands button{min-height:44px;font-size:12px}
@media(max-height:500px){#explorationMap .exp-battle>footer{max-height:none}#explorationMap .exp-battle>header h3{font-size:12px}#explorationMap .exp-battle>header nav{gap:3px}#explorationMap .exp-battle>header nav button{min-width:42px;font-size:10px!important}}
#explorationMap #expBattleTitle:focus{outline:none}
