/* A fitted view of the real formation: empty columns remain real tactical gaps. */
.game-focus.battle-layout .standing-battle{--figure-height:140px;overflow:clip}
.standing-battle .formation-band{position:absolute;inset:0;min-height:0;min-width:0;pointer-events:none}
.game-focus.battle-layout .standing-battle .combat-row-scroll{position:absolute;inset:0;min-height:0;padding:0;overflow:visible;scrollbar-width:none;pointer-events:none}
.game-focus.battle-layout .standing-battle .combat-row{position:absolute;top:0;left:50%;display:grid;grid-template-columns:repeat(var(--row-slots),var(--column-pitch,116px));gap:0;min-width:0;align-items:end;transform-origin:50% 0;transition:transform 900ms cubic-bezier(.22,.65,.3,1)}
.standing-battle .combat-slot{position:relative;min-width:0;gap:0;width:116px;justify-self:center;transition:transform 900ms cubic-bezier(.22,.65,.3,1)}
.standing-battle .combatant,.standing-battle .summon-place{pointer-events:auto}
.standing-battle .battle-frontier{display:none}
.standing-battle .initiative-portraits{position:relative;z-index:5}
.game-focus.battle-layout .standing-battle .combatant,.game-focus.battle-layout .standing-battle .combatant.active,.game-focus.battle-layout:has(.action-preview) .standing-battle .combatant{display:flex;flex-direction:column;align-items:center;padding:3px 3px 10px;gap:0}
.game-focus.battle-layout .standing-battle .combatant>.standing-figure,.game-focus.battle-layout:has(.action-preview) .standing-battle .combatant>.standing-figure{width:100%;max-width:140px;flex:none;order:1}
.standing-figure .body-action{bottom:0}
.standing-figure .figure-ground{bottom:-2px;width:76%;height:14px}
/* No names, figures, type plaques or weapon badges cover the ground shadow. */
.standing-battle .figure-vitals{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:3px;min-height:14px;width:90px;max-width:90%;order:0;padding-bottom:5px;flex:none}
.standing-battle .combatant[data-side="hero"]>.figure-vitals{order:2;justify-content:flex-start;padding:9px 0 0;min-height:24px}
.standing-battle .figure-vitals>.bar{position:relative;width:64px;max-width:85%;margin:0;height:6px;min-height:6px;border-radius:3px;background:#111715;border:1px solid #a68b5990;box-shadow:0 1px 3px #000a,inset 0 1px 2px #000;flex:none}
.standing-battle .figure-vitals>.bar>i{background:linear-gradient(#9db68a,#608d69);border-radius:2px}
.standing-battle .combatant[data-side="enemy"] .figure-vitals>.bar>i{background:linear-gradient(#c87365,#aa504a)}
.standing-battle .figure-vitals>.bar.mana{height:5px;min-height:5px;border-color:#779fb680}
.standing-battle .figure-vitals>.bar.mana>i{background:linear-gradient(#79bbdc,#446fa2)}
.standing-battle .compact-status{width:fit-content;max-width:100%;justify-content:center;gap:2px;padding:0;margin:0;min-height:0;border:0;background:none}
.standing-battle .compact-status .status-symbol{width:17px;height:17px;min-width:17px;padding:1px}
.standing-battle .actor-badge{right:0;top:3px}
.game-focus.battle-layout .standing-battle .combat-empty{height:186px;min-height:0}
.game-focus.battle-layout .standing-battle .summon-place{height:186px;min-height:0!important}
@media(prefers-reduced-motion:reduce){.standing-battle .combat-row,.standing-battle .combat-slot{transition:none!important}}
.reduce-motion .standing-battle .combat-row,.reduce-motion .standing-battle .combat-slot{transition:none!important}
/* One frame is visible at a time; all movement is drawn into the sprite sheet. */
.game-focus.battle-layout .standing-battle .combatant>.standing-figure,.game-focus.battle-layout:has(.action-preview) .standing-battle .combatant>.standing-figure,.game-focus.battle-layout .standing-battle.figure-compact .combatant>.standing-figure{height:calc(var(--figure-height,140px)*var(--figure-size,1))}
.standing-battle .body-idle,.standing-battle .combatant[data-float="true"] .body-idle{animation:none;transform:none}
.sprite-frame.body-sprite{position:absolute;left:50%;bottom:0;width:calc(var(--figure-height,140px)*var(--figure-size,1)*.8);height:100%;transform:translateX(-50%);background-size:400% 300%;background-repeat:no-repeat;background-position:0 0;animation:none;transition:none;opacity:1}
.sprite-frame:not(.sprite-ready){background-image:none!important}
.sprite-fallback{display:block;width:100%;height:100%;object-fit:contain;object-position:50% 100%}
.sprite-ready>.sprite-fallback{display:none}
.sprite-sheet-loader{position:absolute!important;left:0!important;top:0!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none}
.standing-battle .combatant.ko .body-pose{transform:none;opacity:.42;filter:grayscale(.8)}
.standing-battle .combatant[data-pending-fall] .body-pose,.standing-battle .combatant[data-falling] .body-pose{transform:none;opacity:1;filter:none}
.standing-figure .figure-ground{width:calc(70%*var(--figure-size,1))}
.battle-actor-flight .sprite-frame{width:calc(var(--sprite-flight-height)*.8)}
/* In shallow landscape screens the controls sit beside the field. */
@media(min-width:650px) and (max-height:500px){
 .battle-mode .battle-layout{display:grid;grid-template-columns:minmax(0,1fr) 170px;grid-template-rows:40px minmax(0,1fr) auto;gap:5px}
 .battle-layout>.combat-heading{grid-column:1/-1;grid-row:1;min-height:0}
 .battle-layout>.standing-battle{grid-column:1;grid-row:2/4;min-width:0;padding:5px}
 .battle-layout>.combat-dock,.battle-layout>.spectator-hint{grid-column:2;grid-row:2;align-self:center;min-width:0}
 .battle-layout>.turn-finish{grid-column:2;grid-row:3;padding:0}
 .battle-layout .action-tabs{display:grid;grid-template-columns:1fr 1fr;gap:3px}
 .battle-layout .action-orb{min-height:48px;padding:0}
 .battle-layout .action-art{width:29px;height:29px}
 .battle-layout .action-orb>span:last-child{font-size:9px}
 .battle-layout .combat-sheet{left:auto;right:0;bottom:0;width:min(510px,75vw);max-width:none;max-height:calc(100dvh - 115px)}
 .battle-layout .action-preview{max-height:100px;padding:3px}
 .battle-layout .action-preview p{font-size:9px;line-height:11px}
 .standing-battle .initiative-portraits{height:22px;min-height:22px;padding:0;margin-bottom:0}
 .standing-battle .initiative-actor .portrait{width:18px;height:18px}
 .battle-mode nav.tabs{min-height:48px;padding-top:2px;padding-bottom:2px}
 .battle-mode nav.tabs button{min-height:44px;padding:0 8px}
 .battle-mode nav.tabs .menu-art{width:30px;height:30px}
}
