/* UI 015.8 — round reset, wide journal swipe, compact AUTO battle control.
   No extra vertical layout: AUTO lives inside the existing feedback controls. */

/* AUTO button occupies only horizontal space in the existing top bar. */
body.arena-battle014-active #battle0158-auto{
  position:relative!important;
  display:grid!important;
  width:31px!important;
  height:27px!important;
  place-items:center!important;
  padding:0!important;
  overflow:hidden!important;
  border-radius:8px!important;
  touch-action:manipulation!important;
}
body.arena-battle014-active #battle0158-auto .b158-auto-label{
  position:relative;
  z-index:2;
  color:inherit;
  font-size:6px!important;
  font-weight:950!important;
  line-height:1!important;
  letter-spacing:.035em!important;
}
body.arena-battle014-active #battle0158-auto .b158-auto-dot{
  position:absolute;
  right:3px;
  top:3px;
  width:4px;
  height:4px;
  border-radius:50%;
  background:#6c665f;
  box-shadow:none;
}
body.arena-battle014-active #battle0158-auto.is-on{
  border-color:rgba(212,92,241,.92)!important;
  color:#fff2b9!important;
  background:linear-gradient(180deg,#78309b,#2e123c)!important;
  box-shadow:0 0 11px rgba(190,71,229,.4),inset 0 0 0 1px rgba(255,238,255,.08)!important;
}
body.arena-battle014-active #battle0158-auto.is-on .b158-auto-dot{
  background:#7dff9b;
  box-shadow:0 0 7px rgba(94,255,135,.88);
  animation:b158AutoPulse .8s ease-in-out infinite alternate;
}
body.arena-battle014-active #battle0158-auto.is-waiting .b158-auto-label{opacity:.66}
@keyframes b158AutoPulse{to{transform:scale(1.28);opacity:.72}}

/* Keep the journal geometry that proved more reliable in 015.7. */
body.arena-battle014-active #battle014-journal{
  top:0!important;
  bottom:auto!important;
  height:var(--b14-vv-height,100dvh)!important;
  min-height:var(--b14-vv-height,100dvh)!important;
  max-height:var(--b14-vv-height,100dvh)!important;
}
body.arena-battle014-active #battle014-journal .b14-journal-sheet{
  bottom:calc(var(--b14-dock,72px) + env(safe-area-inset-bottom))!important;
  height:min(680px,calc(var(--b14-vv-height,100dvh) - var(--b14-dock,72px) - env(safe-area-inset-bottom) - 96px))!important;
  min-height:0!important;
  max-height:calc(var(--b14-vv-height,100dvh) - var(--b14-dock,72px) - env(safe-area-inset-bottom) - 72px)!important;
}

/* Any point across the top ~96px can start the new drag gesture. */
body.arena-battle014-active #battle014-journal.is-open .b14-journal-sheet:not(.b158-dragging){
  transform:translate3d(-50%,0,0)!important;
}
body.arena-battle014-active #battle014-journal.is-open .b14-journal-sheet.b158-dragging{
  transform:translate3d(-50%,var(--b158-journal-drag,0px),0)!important;
  transition:none!important;
  will-change:transform!important;
}
body.arena-battle014-active #battle014-journal .b14-sheet-handle,
body.arena-battle014-active #battle014-journal .b14-journal-sheet header{
  touch-action:none!important;
}

/* Smooth only the hand tabs. Do not animate zone buttons: previous global button
   transitions caused the whole tactics block to shimmer on every DOM refresh. */
body.arena-battle014-active #battle014-root .b155-hand-tab{
  position:relative!important;
  isolation:isolate!important;
  overflow:hidden!important;
  background:linear-gradient(180deg,rgba(29,23,36,.94),rgba(8,8,14,.98))!important;
  transition:border-color .34s ease,color .34s ease,box-shadow .34s ease!important;
}
body.arena-battle014-active #battle014-root .b155-hand-tab::before{
  content:"";
  position:absolute;
  z-index:0;
  inset:0;
  border-radius:inherit;
  background:linear-gradient(180deg,rgba(112,40,143,.84),rgba(43,15,59,.98));
  opacity:0;
  transition:opacity .34s ease;
  pointer-events:none;
}
body.arena-battle014-active #battle014-root .b155-hand-tab>*{
  position:relative;
  z-index:1;
}
body.arena-battle014-active #battle014-root .b155-hand-tab.is-active{
  background:linear-gradient(180deg,rgba(29,23,36,.94),rgba(8,8,14,.98))!important;
  border-color:#bd5ade!important;
  box-shadow:0 0 10px rgba(181,67,219,.22)!important;
}
body.arena-battle014-active #battle014-root .b155-hand-tab.is-active::before{opacity:1}

/* No extra flash cue during AUTO: the fading active-state itself is the cue. */
.b155-hand-tab.b158-hand-cue{animation:none!important}

@media(max-width:350px){
  body.arena-battle014-active #battle0158-auto{width:26px!important;height:22px!important;border-radius:6px!important}
  body.arena-battle014-active #battle0158-auto .b158-auto-label{font-size:5px!important;letter-spacing:0!important}
  body.arena-battle014-active #battle0158-auto .b158-auto-dot{right:2px;top:2px;width:3px;height:3px}
}

@media(max-height:680px) and (orientation:portrait){
  body.arena-battle014-active #battle014-journal .b14-journal-sheet{
    height:calc(var(--b14-vv-height,100dvh) - var(--b14-dock,62px) - env(safe-area-inset-bottom) - 70px)!important;
    max-height:calc(var(--b14-vv-height,100dvh) - var(--b14-dock,62px) - env(safe-area-inset-bottom) - 54px)!important;
  }
}

@media(prefers-reduced-motion:reduce){
  body.arena-battle014-active #battle0158-auto.is-on .b158-auto-dot{animation:none!important}
  body.arena-battle014-active #battle014-root .b155-hand-tab,
  body.arena-battle014-active #battle014-root .b155-hand-tab::before{transition:none!important}
}
