/* HUD corners (see hud_corners.js). Loaded last. P1 cluster top-left, P2
   cluster top-right, VS badge in the middle, for every fight HUD that uses
   the 2172x832 top plate. Fighters, arena art and move buttons are untouched.
   Slice lines: 896 / 2172 = 41.2523%, 1282 / 2172 = 59.0239% (right piece
   = 40.9761% wide). */
html[data-hud-corners-on] :is(#battle .arena-hud, #dexrunBossResourceBars)[data-hud-corners]{
  background:none!important;
  isolation:isolate;
}
html[data-hud-corners-on] :is(#battle .arena-hud, #dexrunBossResourceBars)[data-hud-corners] > img.hudpack-plate{
  clip-path:inset(0 40.9761% 0 41.2523%)!important;
}
html[data-hud-corners-on] :is(#battle .arena-hud, #dexrunBossResourceBars)[data-hud-corners]::before,
html[data-hud-corners-on] :is(#battle .arena-hud, #dexrunBossResourceBars)[data-hud-corners]::after{
  content:"";position:absolute;top:0;bottom:0;z-index:-1;pointer-events:none;
  background-image:var(--hudpack-top);background-repeat:no-repeat;
}
html[data-hud-corners-on] :is(#battle .arena-hud, #dexrunBossResourceBars)[data-hud-corners]::before{
  left:0;width:41.2523%;
  background-size:242.4107% 100%;background-position:0 0;
  translate:var(--hc-dxl,0px) var(--hc-dy,0px);
}
html[data-hud-corners-on] :is(#battle .arena-hud, #dexrunBossResourceBars)[data-hud-corners]::after{
  right:0;width:40.9761%;
  background-size:244.0449% 100%;background-position:100% 0;
  translate:var(--hc-dxr,0px) var(--hc-dy,0px);
}
/* Everything painted in a cluster's wells moves with its slice. */
html[data-hud-corners-on] :is(#battle .arena-hud, #dexrunBossResourceBars)[data-hud-corners] > .f:not(.r) :is(.hudpack-placed, .hudpack-pfp):not(.hudpack-placed .hudpack-placed){
  translate:var(--hc-dxl,0px) var(--hc-dy,0px)!important;
}
html[data-hud-corners-on] :is(#battle .arena-hud, #dexrunBossResourceBars)[data-hud-corners] > .f.r :is(.hudpack-placed, .hudpack-pfp):not(.hudpack-placed .hudpack-placed){
  translate:var(--hc-dxr,0px) var(--hc-dy,0px)!important;
}
/* DexRun: the shared HUD grid gives the left shield/energy bars a 91px
   margin-left (readout width) that slid them over the VS badge. The pack
   plate places every bar by absolute pixel box, so no margin belongs here. */
html[data-hud-corners-on] #dexrunBossPvPPanel #dexrunBossResourceBars.combat-hud-root[data-hud-corners] > .f > .resource-bar.hudpack-placed,
html[data-hud-corners-on] #dexrunBossPvPPanel #dexrunBossResourceBars.combat-hud-root[data-hud-corners] > .f.r > .resource-bar.hudpack-placed{
  margin:0!important;
}
/* Squad / series bench slots sat on top of the plate's top corners. Park them
   beside each profile ring instead, and move them with their cluster. */
html[data-hud-corners-on] #battle .arena-hud[data-hud-corners] > .f:not(.r) > .squad-bench,
html[data-hud-corners-on] #battle .arena-hud[data-hud-corners] > .f.r > .squad-bench{
  position:absolute!important;top:calc(66.7% - 17px)!important;margin:0!important;padding:0!important;
  max-width:none!important;width:auto!important;z-index:4!important;
}
html[data-hud-corners-on] #battle .arena-hud[data-hud-corners] > .f:not(.r) > .squad-bench{
  left:calc(31.7% + 5px)!important;right:auto!important;
  translate:var(--hc-dxl,0px) var(--hc-dy,0px);
}
html[data-hud-corners-on] #battle .arena-hud[data-hud-corners] > .f.r > .squad-bench{
  right:calc(31.8% + 5px)!important;left:auto!important;
  translate:var(--hc-dxr,0px) var(--hc-dy,0px);
}
/* DexRun boss HUD root is a 9-row grid with gap:clamp(14px,10vw,75px).
   Under 900px wide the shared sheet drops that to 8px, but a 932/956px wide
   iPhone landscape kept the 75px gap: 8 gaps = a 356x600 root. The size solver
   counted that tall box as an obstacle and pinned the boss at 0.80 / 215px.
   The plate is placed by pixel boxes, not by grid rows, so there is no gap. */
html[data-hud-corners-on] #dexrunBossPvPPanel #dexrunBossResourceBars.combat-hud-root{
  row-gap:0!important;gap:0!important;
  /* PvP's HUD plate sits 6px from the top; the shared sheet gave DexRun 7px,
     which the solver turned into 0.01 less fighter scale at 932x430. */
  margin-top:6px!important;
}
/* DexRun boss, portrait: the pack scene sets this plate to 152% of the
   screen, which cropped the clusters and let them overlap the VS badge.
   Keep it at 100% of the panel (landscape keeps its own width, so the
   fighter lane there is untouched). */
@media (min-height: 521px){
  html[data-hud-corners-on][data-boss-arena] #dexrunBossPvPPanel #dexrunBossResourceBars{
    width:min(640px, 100%)!important;
  }
}
