/* BeanBot TEST — DexRun boss duel at the normal PvP fighter size.
 * SPI-12 size parity (Dexatron, 28 Nov 2026: "Keep the PvP size ... make
 * every mode match it"). No size fork: both bodies use the PvP draw size,
 * 128px x --pose-fit, where --pose-fit is calc(2.1 * --sprite-size-factor)
 * exactly as in pvp.html. FighterDrawScale sets the factor and places #ai /
 * #bi inside #dexrunBlazeStage on the PvP ring stance (15/85 portrait,
 * 30/70 landscape) with the feet (row 476 of the 512 sheet) on the shared
 * feet line. This file does not change HUD chrome, buttons or wallpapers,
 * except that short landscape phones use the PvP side-column button layout.
 * Version pin: 20261125-dexrun-boss-r2 (unchanged; no cache headers on /assets)
 */
html[data-boss-arena] #dexrunBossPvPPanel{
  --pose-fit:calc(2.1 * var(--sprite-size-factor, 1));
}
html[data-boss-arena] #dexrunBossPvPPanel #dexrunBlazePlayerSprite,
html[data-boss-arena] #dexrunBossPvPPanel[data-corrupted-sheet] #dexrunCorruptedBoss{
  width:calc(128px * var(--pose-fit))!important;
  height:calc(128px * var(--pose-fit))!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:contain!important;
  object-position:center bottom!important;
  transform-origin:50% 92.97%; /* feet at 476/512 */
}
/* With #ai / #bi placed on the ring, keep VS in the centre column. */
#dexrunBossPvPPanel #dexrunBlazeStage > .dexrun-blaze-vs{
  grid-column:2;
}
/* The additive FX canvas must paint above the bodies in the boss duel.
   It had been mounting nowhere (no .icons.clash) or behind z-index 24. */
#dexrunBossPvPPanel #dexrunBlazeStage canvas.pvp-fx-layer{
  z-index:26!important;
  pointer-events:none!important;
}
/* Short landscape phones: the same layout as PvP (arena_layout.css).
   A compact plate at the top (31% of the height), the turn text under it,
   the six moves in two columns at the screen edges and the fighters
   between them near the bottom. --dexa-moves-side tells FighterDrawScale. */
@media (max-height:520px) and (min-width:560px) and (orientation:landscape){
  html[data-boss-arena] #dexrunBossPvPPanel{
    --dexa-moves-side:1;
    --side-btn-w:clamp(124px, 18vw, 168px);
    --side-btn-h:clamp(34px, 10.5vh, 44px);
    --side-btn-gap:6px;
  }
  html[data-boss-arena] #dexrunBossPvPPanel #dexrunBossResourceBars{
    width:min(calc(31vh * 2172 / 832), 100%)!important;
  }
  /* Turn text where PvP has it: under the plate, centred between the
     heads, wrapped to two short lines (PvP: "YOUR TURN" + the hint). */
  html[data-boss-arena] #dexrunBossPvPPanel #dexrunBossStatus{
    top:calc(31vh + 29px)!important;
    bottom:auto!important;
    left:50%!important;
    right:auto!important;
    width:min(200px, 40vw)!important;
    min-height:40px!important; /* PvP: status + hint lines, 150-190px at 390 high */
    transform:translateX(-50%)!important;
    font-size:16px!important;
    line-height:1.2!important;
    white-space:normal!important;
  }
  /* Fixed to the screen edges (the panel's card is narrower than the
     screen here), like PvP's .moves columns. */
  html[data-boss-arena] #dexrunBossPvPPanel #dexrunBossActions{
    position:fixed!important;
    left:max(6px, env(safe-area-inset-left, 0px))!important;
    right:max(6px, env(safe-area-inset-right, 0px))!important;
    bottom:max(6px, env(safe-area-inset-bottom, 0px))!important;
    top:auto!important;
    width:auto!important;
    margin:0!important;
    padding:0!important;
    display:grid!important;
    grid-template-columns:var(--side-btn-w) minmax(0, 1fr) var(--side-btn-w)!important;
    grid-auto-rows:var(--side-btn-h)!important;
    row-gap:var(--side-btn-gap)!important;
    column-gap:0!important;
    pointer-events:none!important;
    z-index:9!important;
  }
  html[data-boss-arena] #dexrunBossPvPPanel #dexrunBossActions > button[data-combat-action]{
    pointer-events:auto!important;
    width:100%!important;
    height:var(--side-btn-h)!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
  }
  html[data-boss-arena] #dexrunBossPvPPanel #dexrunBossActions > button[data-combat-action]:nth-of-type(odd){
    grid-column:1!important;
  }
  html[data-boss-arena] #dexrunBossPvPPanel #dexrunBossActions > button[data-combat-action]:nth-of-type(even){
    grid-column:3!important;
  }
}
