/* Keep the full faces on the same fan as they settle behind the HUD. */
.battle-hand {
  --hand-height:300px;
  --hand-card-width:clamp(104px,29.5vw,121px);
  --hand-focus-width:calc(var(--hand-card-width) + 20px);
  --hand-step:clamp(55px,18vw,74px);
  --hand-overlap:20px;
  --hand-clearance:106px;
  --hand-focus-clearance:128px;
  --hand-tuck:43px;
  flex:0 0 var(--hand-height);
}
.battle-hand,.battle-hand-arc { touch-action:pan-y; }
.battle-hand.is-tucked { --hand-offset:var(--hand-tuck); }
.battle-root .battle-hand-card {
  --hand-width:var(--hand-card-width);
  width:var(--hand-width);
  --hand-outer-steps:calc(var(--hand-delta) - clamp(-1,var(--hand-delta),1));
  left:calc(50% + var(--hand-delta) * var(--hand-step) - var(--hand-outer-steps) * var(--hand-overlap) - var(--hand-width) / 2);
  bottom:calc(var(--hand-clearance) + var(--safe-bottom) - var(--hand-offset,0px) - var(--hand-distance) * 6px);
  rotate:clamp(-24deg,calc(var(--hand-delta) * 6deg),24deg);
  touch-action:none;
}
.battle-hand-nav { bottom:calc(var(--hand-clearance) + var(--safe-bottom) + 48px); }
.battle-root .battle-hand-card.is-expanded {
  --hand-width:var(--hand-focus-width);
  bottom:calc(var(--hand-focus-clearance) + var(--safe-bottom));
  z-index:45; border-radius:11px;
}
.battle-hand-card.is-expanded>.card-face { box-shadow:0 10px 28px #0008; }
.battle-hand-card.is-expanded::after { inset:-4px; border-width:2px; border-radius:14px; box-shadow:none; }
.is-dragging-card .battle-hand-card.is-expanded { visibility:hidden; }
.battle-hand-card.is-expanded:focus-visible { outline:none; }
.battle-is-animating .battle-hand-card { opacity:.22; }
.battle-is-animating .battle-hand-nav { visibility:hidden; }
@media(min-width:600px) {
  .battle-hand {
    --hand-height:340px;
    --hand-card-width:128px;
    --hand-focus-width:142px;
    --hand-step:clamp(72px,11vw,91px);
    --hand-overlap:10px;
    --hand-clearance:115px;
    --hand-focus-clearance:145px;
    --hand-tuck:45px;
  }
  .battle-hand-nav.is-previous { left:max(4px,calc(50% - 373px)); }
  .battle-hand-nav.is-next { right:max(4px,calc(50% - 373px)); }
}
@media(max-height:760px) and (max-width:599px) {
  .battle-hand {
    --hand-height:270px;
    --hand-card-width:clamp(96px,15.6dvh,112px);
    --hand-focus-width:calc(var(--hand-card-width) + 17px);
    --hand-focus-clearance:120px;
  }
  .battle-view:not(.is-opening-hand) .battle-field { translate:0 -12px; }
}
@media(max-height:640px) and (max-width:599px) {
  .battle-hand {
    --hand-height:220px;
    --hand-card-width:96px;
    --hand-focus-width:116px;
    --hand-step:59px;
    --hand-clearance:91px;
    --hand-focus-clearance:118px;
    --hand-tuck:30px;
  }
  .battle-view:not(.is-opening-hand) .battle-field { translate:0 clamp(-41px,50dvh - 325px,-12px); }
  .battle-fleet { min-height:76px; --board-card-width:48px; }
  .battle-orbit-divider { height:10px; flex:0 0 10px; }
}
@media(max-height:600px) and (orientation:landscape) {
  .battle-hand { --hand-focus-width:118px; --hand-card-width:104px; }
}
