/* The arena keeps its grid track. The console itself grows over its upper edge. */
#battle-root .spell-panel-battle > .battle-console {
  --journal-growth: 138px;
  --journal-content: 128px;
  transition: height .3s cubic-bezier(.22,.72,.25,1), margin-top .3s cubic-bezier(.22,.72,.25,1), max-height .3s cubic-bezier(.22,.72,.25,1);
  overflow: hidden;
}
#battle-root .spell-panel-battle > .battle-console.journal-expanded {
  height: calc(var(--console-height) + var(--journal-growth));
  max-height: calc(var(--console-height) + var(--journal-growth));
  margin-top: calc(-1 * var(--journal-growth));
}
#battle-root .spell-panel-battle .battle-console.journal-expanded .combat-action-panel {
  height: calc(102px + var(--journal-growth));
  min-height: calc(102px + var(--journal-growth));
}
#battle-root .spell-panel-battle .battle-console.journal-expanded #battle-actions {
  height: calc(102px + var(--journal-growth));
  max-height: calc(102px + var(--journal-growth));
}
#battle-root .spell-panel-battle #battle-actions {overflow:hidden;gap:6px;}
#battle-root .spell-panel-battle .battle-log,
#battle-root .spell-panel-battle .battle-log.log-expanded {
  height:27px;min-height:27px;max-height:27px;overflow:hidden;
  transition:height .3s cubic-bezier(.22,.72,.25,1), max-height .3s cubic-bezier(.22,.72,.25,1);
}
#battle-root .spell-panel-battle .battle-log.log-expanded {
  height:calc(27px + var(--journal-content));
  max-height:calc(27px + var(--journal-content));
}
#battle-root .spell-panel-battle .battle-log-content {
  position:static;inset:auto;z-index:auto;
  width:100%;height:var(--journal-content);min-height:0;max-height:var(--journal-content);
  margin:0;padding:7px 9px;overflow-y:auto;overscroll-behavior:contain;
  border:1px solid #d7dfca;border-top:0;border-radius:0 0 8px 8px;
  background:#fcfbef;box-shadow:none;font-size:10px;line-height:1.5;
  opacity:0;transition:opacity .22s ease;pointer-events:none;
}
#battle-root .spell-panel-battle .battle-log.log-expanded .battle-log-content {opacity:1;pointer-events:auto;}
#battle-root .spell-panel-battle .journal-open .battle-buttons {opacity:1;transform:none;pointer-events:auto;}
#battle-root .spell-panel-battle .battle-buttons {min-width:0;gap:7px;}
#battle-root .spell-panel-battle .battle-console .battle-action {min-width:0;padding:5px 7px;font-size:16px;line-height:1.1;}
#battle-root .spell-panel-battle .battle-action > span:last-child {min-width:0;white-space:normal;}
#battle-root .spell-panel-battle .battle-action .icon {flex:none;font-size:22px;}

/* Fit effect frames inside the compact player cards. */
#battle-root .spell-panel-battle .player-compact,
#battle-root .spell-panel-battle .player-compact.player-expanded {height:76px;min-height:76px;max-height:76px;}
#battle-root .spell-panel-battle .player-card-effects {
  height:22px;min-height:22px;max-height:22px;
  margin:1px 0 0;padding:2px 3px 1px;overflow-x:auto;overflow-y:hidden;
}
#battle-root .spell-panel-battle .player-card-effects .combat-effect-icon {height:17px;min-height:17px;line-height:15px;}
@media(max-height:730px){
  #battle-root .spell-panel-battle .player-compact,
  #battle-root .spell-panel-battle .player-compact.player-expanded {height:68px;min-height:68px;max-height:68px;}
  #battle-root .spell-panel-battle .player-card-effects {height:19px;min-height:19px;max-height:19px;padding:1px 3px;}
  #battle-root .spell-panel-battle > .battle-console {--journal-growth:118px;--journal-content:106px;}
}

/* Each owner's circle is visible at one target. Unselected enemies have none. */
#battle-root .spell-panel-battle .hero-unit.has-target .selection-floor,
#battle-root .spell-panel-battle .party-ally.has-target .selection-floor,
#battle-root .spell-panel-battle .monster-unit .selection-floor {opacity:0!important;}
#battle-root .spell-panel-battle .monster-unit .selection-floor {display:none;}
#battle-root .spell-panel-battle .monster-unit .target-ring {opacity:0;}
#battle-root .spell-panel-battle .monster-unit.targeted .target-ring {opacity:1;}
#battle-root .spell-panel-battle .battle-unit.inspected .ground-shadow,
#battle-root .spell-panel-battle .party-ally.heal-selected .ground-shadow {box-shadow:none;}

/* Keep the model visible long enough for its death pose, then remove it. */
#battle-root .spell-panel-battle .monster-unit.defeated:not(.death-finished) {opacity:1;transform:none;}
#battle-root .spell-panel-battle .monster-unit.dying .unit-health,
#battle-root .spell-panel-battle .monster-unit.dying .battle-enemy-number,
#battle-root .spell-panel-battle .monster-unit.dying .target-ring {opacity:0;}
#battle-root .spell-panel-battle .monster-unit.death-finished {opacity:0;transform:none;pointer-events:none;}

/* Items start at the monster's center, then fan into a small landing area. */
#battle-root .spell-panel-battle .battle-drops .ground-loot {animation:v0163-ground-loot .62s var(--loot-delay,0s) cubic-bezier(.18,.72,.25,1) both;}
@keyframes v0163-ground-loot {
  0% {opacity:0;transform:translate(-50%,-50%) scale(.28) rotate(-17deg)}
  18% {opacity:1;transform:translate(-50%,calc(-50% - 12px)) scale(.72)}
  67% {opacity:1;transform:translate(calc(-50% + var(--loot-x)),calc(-50% + var(--loot-y) - 8px)) scale(1.04) rotate(6deg)}
  100% {opacity:1;transform:translate(calc(-50% + var(--loot-x)),calc(-50% + var(--loot-y))) scale(1)}
}
@media(prefers-reduced-motion:reduce){#battle-root .spell-panel-battle .battle-drops .ground-loot{animation:none;opacity:1;transform:translate(calc(-50% + var(--loot-x)),calc(-50% + var(--loot-y)));}}
