/* Keep the battlefield and decisions in the viewport. Expanded detail panels
   remain scrollable; no command or status is removed to manufacture a fit. */
body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])):not(.intro-101){min-height:0!important;height:100dvh!important;margin:0!important;padding:0!important}
body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) main.app-shell{display:flex!important;flex-direction:column!important;box-sizing:border-box;height:calc(100dvh - 12px)!important;min-height:0!important;margin:6px auto!important;gap:4px!important}
body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) #game-panel:not([hidden]){display:flex!important;flex-direction:column!important;flex:1 1 0!important;min-height:0!important;gap:4px!important}
body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) #map-stage-page:has(#event-scene.combat-scene:not([hidden])){display:grid!important;flex:1 1 0!important;height:auto!important;min-height:0!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:28px 54px minmax(0,1fr)!important;padding:4px!important;gap:4px!important}
body #event-scene#event-scene#event-scene#event-scene.combat-scene{height:100%!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:visible!important}
body #event-scene#event-scene#event-scene#event-scene.combat-scene .battle-stage{flex:1 1 0!important;min-height:0!important;height:auto!important}
body #event-scene#event-scene#event-scene#event-scene.combat-scene .battle-arena{flex:1 1 0!important;min-height:120px!important;height:auto!important}
body #event-scene#event-scene#event-scene#event-scene.combat-scene .event-scene-copy{flex:0 1 auto!important;max-height:30dvh!important;min-height:0!important;overflow:auto!important}
body #event-scene#event-scene#event-scene#event-scene.combat-scene .battle-hud-row{max-height:25dvh;overflow:auto;box-sizing:border-box}
body #event-scene#event-scene#event-scene#event-scene.combat-scene :is(.battle-party,.battle-enemy){bottom:10px!important}
.battle-arena.has-combat-impact>:is(.battle-party,.battle-enemy),.battle-arena.has-combat-impact>:is(.battle-party,.battle-enemy) *{visibility:hidden!important}
.battle-enemy.has-impact-brace>img,.battle-enemy.has-impact-brace>.enemy-pose-070{visibility:hidden!important}
.battle-enemy>.impact-brace{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.battle-enemy.has-impact-reaction>:is(img,.impact-brace,.enemy-pose-070){visibility:hidden!important}
.battle-enemy>.impact-local-reaction{position:absolute;bottom:0;left:50%;height:122%;width:auto;max-width:none;transform:translateX(-57.14%);pointer-events:none}
@media(max-width:899px){
 body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) main.app-shell{width:calc(100% - 12px)!important}
 body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) .hero-header{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;height:42px!important;min-height:42px!important;padding:3px 6px!important;gap:8px!important}
 body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) .brand-lockup{flex:none}
 body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) .brand-lockup h1{font-size:16px!important}
 body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) .brand-lockup :is(.eyebrow,.brand-subtitle,.brand-mark){display:none!important}
 body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) .header-actions{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;overflow-x:auto;min-width:0;gap:4px!important}
 body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) .header-actions>*{flex:none;white-space:nowrap;font-size:12px!important;margin:0!important}
 body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) .session-bar{display:flex;flex-wrap:nowrap;height:34px;min-height:34px;padding:2px 6px!important;gap:8px;overflow:auto;font-size:11px}
 body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) .session-bar>*{flex:none;white-space:nowrap}
 body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) :is(.session-bar,.turn-copy) .panel-kicker{display:none}
 body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) #player-stats{display:grid!important;grid-template-columns:1fr 1fr!important;gap:4px;margin:0!important;min-height:0;overflow:auto}
 body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) #player-stats .player-stat{padding:3px 5px!important;min-height:0;font-size:11px!important}
 body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])) #player-stats .player-stat :is(strong,p,summary){font-size:11px!important;margin:0!important;line-height:1.3}
 body #event-scene#event-scene#event-scene#event-scene.combat-scene .battle-hud-row{padding:34px 4px 4px;gap:4px}
 body #event-scene#event-scene#event-scene#event-scene.combat-scene .battle-player-huds{grid-template-columns:1fr 1fr;gap:3px}
 body #event-scene#event-scene#event-scene#event-scene.combat-scene :is(.fighter-hud,.enemy-hud){padding:3px!important;font-size:11px}
 body #event-scene#event-scene#event-scene#event-scene.combat-scene #combat-panel{padding:5px!important;gap:4px}
 body #event-scene#event-scene#event-scene#event-scene.combat-scene :is(.combat-actions,#path-combat-actions)>button{flex:1 1 43%;min-width:0;min-height:36px;max-width:none;margin:0;padding:6px;font-size:13px}
}

body.battle-fit-117:has(#event-scene.combat-scene:not([hidden])){display:flow-root!important;box-sizing:border-box}
body #event-scene#event-scene#event-scene#event-scene.combat-scene{box-sizing:border-box}

body #event-scene#event-scene#event-scene#event-scene.combat-scene .battle-arena .battle-enemy[data-impact-tier="boss"]{height:calc(96% - 12px)!important;width:34%!important}
body #event-scene#event-scene#event-scene#event-scene.combat-scene .battle-arena .battle-enemy[data-impact-tier="elite"]{height:calc(90% - 12px)!important;width:31%!important}
