/* UI 015.9 — battle top bar width rebalance.
   Three independent horizontal zones: round | feedback/AUTO | heat.
   No height changes, so the battlefield and tactics remain untouched. */

@media (orientation:portrait) and (max-width:700px){
  body.arena-battle014-active #battle014-root .b14-topline{
    display:grid!important;
    grid-template-columns:minmax(88px,.72fr) auto minmax(0,1.55fr)!important;
    align-items:center!important;
    column-gap:5px!important;
    height:51px!important;
    min-height:51px!important;
    padding:4px 7px!important;
    overflow:hidden!important;
  }

  /* Make the two children of round-block participate directly in the top grid.
     This permanently prevents the control cluster from covering RAUND N. */
  body.arena-battle014-active #battle014-root .b14-round-block{
    display:contents!important;
  }

  body.arena-battle014-active #battle014-root .b14-round-block>div:first-child{
    grid-column:1!important;
    display:flex!important;
    min-width:0!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    justify-content:center!important;
    padding-left:2px!important;
    overflow:visible!important;
  }

  body.arena-battle014-active #battle014-root .b14-round-block>div:first-child small{
    max-width:100%!important;
    font-size:7.5px!important;
    line-height:1.05!important;
    letter-spacing:.12em!important;
    white-space:normal!important;
  }

  body.arena-battle014-active #battle014-root .b14-round-block>div:first-child b{
    display:block!important;
    max-width:none!important;
    overflow:visible!important;
    font-size:11px!important;
    line-height:1.05!important;
    text-overflow:clip!important;
    white-space:nowrap!important;
  }

  body.arena-battle014-active #battle014-root .b14-feedback-controls{
    grid-column:2!important;
    display:flex!important;
    min-width:0!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:center!important;
    gap:2px!important;
    margin:0 1px 0 2px!important;
    transform:translateX(2px)!important;
  }

  body.arena-battle014-active #battle014-root .b14-feedback-controls button,
  body.arena-battle014-active #battle014-root .b14-feedback-controls label{
    width:23px!important;
    height:25px!important;
    min-width:23px!important;
    border-radius:7px!important;
  }

  body.arena-battle014-active #battle014-root .b14-feedback-controls button .b14-icon,
  body.arena-battle014-active #battle014-root .b14-feedback-controls label .b14-icon{
    width:12px!important;
    height:12px!important;
  }

  body.arena-battle014-active #battle014-root #battle0158-auto{
    width:27px!important;
    min-width:27px!important;
    height:25px!important;
  }

  body.arena-battle014-active #battle014-root #battle0158-auto .b158-auto-label{
    font-size:5.5px!important;
    letter-spacing:.02em!important;
  }

  body.arena-battle014-active #battle014-root .b14-heat{
    grid-column:3!important;
    display:flex!important;
    min-width:0!important;
    width:100%!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:center!important;
    padding-left:5px!important;
    overflow:hidden!important;
    text-align:right!important;
  }

  body.arena-battle014-active #battle014-root .b14-heat-copy{
    display:flex!important;
    min-width:0!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:5px!important;
    margin-bottom:2px!important;
    white-space:nowrap!important;
  }

  body.arena-battle014-active #battle014-root .b14-heat-copy small{
    overflow:hidden!important;
    min-width:0!important;
    font-size:7px!important;
    line-height:1!important;
    letter-spacing:.09em!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  body.arena-battle014-active #battle014-root .b14-heat-copy b{
    flex:0 0 auto!important;
    font-size:10px!important;
    line-height:1!important;
  }

  body.arena-battle014-active #battle014-root .b14-heat-copy .b14-icon{
    width:12px!important;
    height:12px!important;
  }

  body.arena-battle014-active #battle014-root .b14-heat-meter{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:10px!important;
    margin:0!important;
  }
}

/* Extra reserve for genuinely narrow iPhones. The round number remains sacred;
   controls and heat compress before it can be hidden. */
@media (orientation:portrait) and (max-width:380px){
  body.arena-battle014-active #battle014-root .b14-topline{
    grid-template-columns:minmax(82px,.7fr) auto minmax(0,1.35fr)!important;
    column-gap:3px!important;
    padding-inline:5px!important;
  }
  body.arena-battle014-active #battle014-root .b14-feedback-controls{
    gap:1px!important;
    transform:none!important;
    margin-inline:0!important;
  }
  body.arena-battle014-active #battle014-root .b14-feedback-controls button,
  body.arena-battle014-active #battle014-root .b14-feedback-controls label{
    width:21px!important;
    min-width:21px!important;
    height:23px!important;
  }
  body.arena-battle014-active #battle014-root #battle0158-auto{
    width:25px!important;
    min-width:25px!important;
    height:23px!important;
  }
  body.arena-battle014-active #battle014-root .b14-heat{
    padding-left:3px!important;
  }
  body.arena-battle014-active #battle014-root .b14-heat-copy small{
    font-size:6.5px!important;
    letter-spacing:.07em!important;
  }
}

@media (orientation:landscape) and (max-height:520px){
  body.arena-battle014-active #battle014-root .b14-topline{
    padding-inline:7px!important;
  }
}
