/*
  PokePark Online v2.9.9 — FINAL BATTLE UI CONTRACT
  --------------------------------------------------------------------------
  This file is intentionally loaded after styles.css and battle-v299.css.
  Legacy battle CSS still owns historical component detail and animations;
  this layer is the single source of truth for final geometry, typography,
  theme surfaces, pause composition and responsive containment.
*/

#battleHud[data-battle-ui="2.9.9"] {
  --bui-font:"Segoe UI Variable","Segoe UI",Inter,system-ui,sans-serif;
  --bui-micro:9px;
  --bui-xs:10px;
  --bui-sm:11px;
  --bui-md:12px;
  --bui-body:13px;
  --bui-name:18px;
  --bui-title:28px;
  --bui-pause:50px;

  --bui-accent:#35b8ef;
  --bui-accent-strong:#168dcc;
  --bui-good:#54cf8b;
  --bui-danger:#ef5b63;
  --bui-warning:#e3b54f;
  --bui-text:#f3f9fc;
  --bui-muted:#9fb7c3;
  --bui-surface:#102a38;
  --bui-surface-raised:#173746;
  --bui-surface-soft:#1b3e4d;
  --bui-card:#15323f;
  --bui-line:rgba(123,205,231,.27);
  --bui-line-strong:rgba(111,213,244,.55);
  --bui-track:rgba(146,202,220,.16);
  --bui-shadow:rgba(0,14,22,.34);

  --bui-shell-w:min(1080px,calc(100vw - 56px));
  --bui-shell-h:min(680px,calc(100dvh - 88px));
  --bui-command-w:min(820px,calc(100% - 132px));
  --bui-command-h:196px;
  --bui-command-bottom:14px;

  /* Keep high-specificity legacy window rules on the same final geometry. */
  --battle-modal-width:var(--bui-shell-w);
  --battle-modal-height:var(--bui-shell-h);

  font-family:var(--bui-font)!important;
  font-size:var(--bui-body)!important;
  font-variant-numeric:tabular-nums;
}

/* ========================================================================== 
   V36.2 — narrow visual repair over the verified v36.1 battle layout.
   No combat geometry, bindings or mechanics are owned by this layer.
   ========================================================================== */

/* Fighter cards: replace the solid side rails with quiet team tinting and a
   low-contrast Poké Ball watermark. Status rows remain outside on mobile. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleHealth > article {
  isolation:isolate!important;
  border-color:color-mix(in srgb,var(--fighter-accent,#49b7c9) 34%,#cfe2e8)!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleHealth > .ally-health {
  --fighter-accent:#38aa92;
  background:linear-gradient(145deg,rgba(226,249,244,.99),rgba(250,253,254,.99) 38%,rgba(241,249,251,.98))!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleHealth > .enemy-health {
  --fighter-accent:#e46f66;
  background:linear-gradient(215deg,rgba(255,234,231,.99),rgba(251,253,254,.99) 38%,rgba(247,249,250,.98))!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleHealth > article::before {
  content:""!important;
  position:absolute!important;
  z-index:0!important;
  inset:0!important;
  width:auto!important;
  height:auto!important;
  display:block!important;
  border:0!important;
  border-radius:inherit!important;
  background:linear-gradient(112deg,color-mix(in srgb,var(--fighter-accent) 11%,transparent),transparent 45%)!important;
  box-shadow:none!important;
  opacity:1!important;
  pointer-events:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleHealth > article::after {
  content:""!important;
  position:absolute!important;
  z-index:0!important;
  inset:0!important;
  display:block!important;
  border-radius:inherit!important;
  background:var(--fighter-accent)!important;
  -webkit-mask:url('/assets/v3.0/combat/fighter-card-pokeball-pattern.svg') left -26px center / 150px 100px no-repeat!important;
  mask:url('/assets/v3.0/combat/fighter-card-pokeball-pattern.svg') left -26px center / 150px 100px no-repeat!important;
  opacity:.065!important;
  pointer-events:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleHealth > .enemy-health::after {
  -webkit-mask-position:right -26px center!important;
  mask-position:right -26px center!important;
  transform:scaleX(-1)!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleHealth > article > * {
  z-index:1!important;
}

/* Skill artwork and cooldowns are independently clipped to their circular
   face. Hover uses light/color only, so no texture or overlay can leave it. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-action-button .combat-skill-art {
  overflow:hidden!important;
  border-radius:50%!important;
  clip-path:circle(50% at 50% 50%)!important;
  contain:paint!important;
  isolation:isolate!important;
  transform:none!important;
  background-clip:padding-box!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-action-button .combat-skill-art :is(img,svg),
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-action-button .combat-skill-art::before,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-action-button .combat-skill-art::after {
  border-radius:50%!important;
  clip-path:circle(50% at 50% 50%)!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-action-button .combat-skill-art > img {
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  object-position:center!important;
  transform:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-action-button:is(:hover,:focus-visible),
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-action-button.is-previewed {
  transform:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-action-button:is(:hover,:focus-visible) .combat-skill-art,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-action-button.is-previewed .combat-skill-art {
  transform:none!important;
  filter:brightness(1.055) saturate(1.035)!important;
  box-shadow:inset 0 0 0 3px rgba(1,18,28,.7),0 0 0 3px color-mix(in srgb,var(--combat-ring) 86%,#fff),0 7px 17px var(--cockpit-shadow),0 0 18px color-mix(in srgb,var(--combat-ring) 22%,transparent)!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-action-button > .combat-cooldown {
  top:2px!important;
  left:50%!important;
  width:var(--combat-size)!important;
  height:var(--combat-size)!important;
  overflow:hidden!important;
  border-radius:50%!important;
  clip-path:circle(50% at 50% 50%)!important;
  contain:paint!important;
  transform:translateX(-50%)!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-action-button.is-cooling {
  opacity:1!important;
  filter:saturate(.97) brightness(.98)!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-action-button.is-cooling > .combat-cooldown {
  background:conic-gradient(from 0deg,rgba(3,17,26,.38) var(--cooldown-sweep,0deg),rgba(9,37,48,.045) 0)!important;
  box-shadow:inset 0 0 0 2px rgba(2,22,31,.48),0 0 0 2px color-mix(in srgb,var(--combat-ring) 46%,rgba(5,32,42,.44))!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-skill-preview.battle-tooltip {
  max-width:calc(100% - 16px)!important;
  overflow:hidden!important;
  border-radius:13px!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-skill-preview.battle-tooltip::before,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-skill-preview.battle-tooltip::after {
  content:none!important;
  display:none!important;
}

/* Energy endpoint: only the lightning glyph remains—no second dot, glow or
   generated cap. This applies to the live and capture command deck. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleCommandEnergyBar::before,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleCommandEnergyBar::after {
  content:none!important;
  display:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-energy-current {
  display:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-energy-marker {
  overflow:visible!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  filter:none!important;
}

html[data-game-theme="light"] #battleHud[data-battle-ui="2.9.9"] {
  --bui-accent:#2299dc;
  --bui-accent-strong:#087fc0;
  --bui-good:#38b977;
  --bui-danger:#ea535b;
  --bui-warning:#ce9630;
  --bui-text:#173d51;
  --bui-muted:#6a8796;
  --bui-surface:#f4fbfd;
  --bui-surface-raised:#ffffff;
  --bui-surface-soft:#e8f5f9;
  --bui-card:#f5fbfd;
  --bui-line:rgba(52,136,170,.23);
  --bui-line-strong:rgba(31,150,199,.48);
  --bui-track:rgba(47,124,155,.12);
  --bui-shadow:rgba(32,75,93,.16);
}

/* One font family and a constrained hierarchy for every battle component. */
#battleHud[data-battle-ui="2.9.9"] .battle-shell,
#battleHud[data-battle-ui="2.9.9"] .battle-shell *,
#battleHud[data-battle-ui="2.9.9"] .battle-shell button,
#battleHud[data-battle-ui="2.9.9"] .battle-shell input,
#battleHud[data-battle-ui="2.9.9"] .battle-shell select,
#battleHud[data-battle-ui="2.9.9"] .battle-shell textarea {
  font-family:var(--bui-font)!important;
  text-rendering:optimizeLegibility;
}

#battleHud[data-battle-ui="2.9.9"] .battle-shell small,
#battleHud[data-battle-ui="2.9.9"] .battle-shell kbd,
#battleHud[data-battle-ui="2.9.9"] .battle-shell .combat-skill-tag b {
  font-size:var(--bui-micro)!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-shell button {
  font-size:var(--bui-md)!important;
  font-weight:800!important;
}

/* --------------------------------------------------------------------------
   Shell / stage
   -------------------------------------------------------------------------- */
#battleHud[data-battle-ui="2.9.9"] .battle-shell {
  left:50%!important;
  right:auto!important;
  top:50%!important;
  bottom:auto!important;
  width:var(--bui-shell-w)!important;
  height:var(--bui-shell-h)!important;
  min-width:min(720px,calc(100vw - 12px))!important;
  min-height:min(500px,calc(100dvh - 12px))!important;
  transform:translate(-50%,-50%)!important;
  overflow:hidden!important;
  border:1px solid var(--bui-line-strong)!important;
  border-radius:24px!important;
  background:transparent!important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--bui-accent) 13%,transparent),0 24px 62px var(--bui-shadow)!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-stage,
#battleHud[data-battle-ui="2.9.9"] .battle-stage::before,
#battleHud[data-battle-ui="2.9.9"] .battle-stage::after {
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-stage::before {
  background:linear-gradient(180deg,rgba(6,33,45,.08),transparent 24% 72%,rgba(5,29,40,.12))!important;
}

html[data-game-theme="light"] #battleHud[data-battle-ui="2.9.9"] .battle-stage::before {
  background:linear-gradient(180deg,rgba(218,243,251,.025),transparent 24% 72%,rgba(25,93,119,.035))!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-world-backdrop,
#battleHud[data-battle-ui="2.9.9"] .battle-world-backdrop > i {
  display:none!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

/* --------------------------------------------------------------------------
   Fighter cards / VS card
   -------------------------------------------------------------------------- */
#battleHud[data-battle-ui="2.9.9"] .battle-health > article {
  top:14px!important;
  width:318px!important;
  min-height:146px!important;
  padding:10px 12px!important;
  border:1px solid var(--bui-line)!important;
  border-radius:18px!important;
  background:linear-gradient(155deg,var(--bui-surface-raised),var(--bui-surface))!important;
  color:var(--bui-text)!important;
  box-shadow:0 10px 24px var(--bui-shadow),inset 0 1px rgba(255,255,255,.12)!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-health > .ally-health { left:14px!important;right:auto!important; }
#battleHud[data-battle-ui="2.9.9"] .battle-health > .enemy-health { right:14px!important;left:auto!important; }

#battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > b {
  color:var(--bui-text)!important;
  font-size:var(--bui-name)!important;
  font-weight:850!important;
  line-height:1.05!important;
  letter-spacing:0!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > em,
#battleHud[data-battle-ui="2.9.9"] .battle-health > article > .battle-vital > span :is(b,strong,small),
#battleHud[data-battle-ui="2.9.9"] .battle-card-status-area,
#battleHud[data-battle-ui="2.9.9"] .battle-exp > span {
  font-size:var(--bui-xs)!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-card-status-area {
  border-color:var(--bui-line)!important;
  background:var(--bui-surface-soft)!important;
  color:var(--bui-text)!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-versus-card {
  top:18px!important;
  left:50%!important;
  right:auto!important;
  width:230px!important;
  min-height:92px!important;
  padding:10px 12px!important;
  transform:translateX(-50%)!important;
  border:1px solid var(--bui-line)!important;
  border-radius:17px!important;
  background:linear-gradient(155deg,var(--bui-surface-raised),var(--bui-surface))!important;
  color:var(--bui-text)!important;
  box-shadow:0 10px 24px var(--bui-shadow),inset 0 1px rgba(255,255,255,.12)!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-versus-card > strong {
  color:var(--bui-text)!important;
  font-size:15px!important;
  font-weight:850!important;
  line-height:1.15!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-versus-card > small,
#battleHud[data-battle-ui="2.9.9"] .battle-versus-card > em {
  font-size:var(--bui-micro)!important;
}

/* --------------------------------------------------------------------------
   Six-slot roster + active arrow
   -------------------------------------------------------------------------- */
#battleHud[data-battle-ui="2.9.9"] .battle-roster-panel {
  z-index:30!important;
  left:20px!important;
  right:auto!important;
  top:186px!important;
  bottom:214px!important;
  width:49px!important;
  height:auto!important;
  min-height:0!important;
  padding:5px!important;
  display:grid!important;
  grid-template-rows:18px minmax(0,1fr)!important;
  gap:4px!important;
  transform:none!important;
  overflow:visible!important;
  border:1px solid var(--bui-line)!important;
  border-radius:16px!important;
  background:linear-gradient(155deg,var(--bui-surface-raised),var(--bui-surface))!important;
  box-shadow:0 9px 22px var(--bui-shadow),inset 0 1px rgba(255,255,255,.1)!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-roster-panel > header {
  height:18px!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-roster-panel > header span,
#battleHud[data-battle-ui="2.9.9"] .battle-roster-panel > p { display:none!important; }

#battleHud[data-battle-ui="2.9.9"] .battle-roster-panel > header em {
  max-width:40px!important;
  font-size:var(--bui-micro)!important;
  font-weight:800!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-roster {
  width:37px!important;
  height:auto!important;
  min-height:0!important;
  display:grid!important;
  grid-template-columns:37px!important;
  grid-template-rows:repeat(6,37px)!important;
  align-content:start!important;
  gap:3px!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-roster-slot {
  position:relative!important;
  width:37px!important;
  height:37px!important;
  min-width:37px!important;
  min-height:37px!important;
  padding:2px!important;
  overflow:visible!important;
  border:1px solid var(--bui-line)!important;
  border-radius:50%!important;
  background:var(--bui-card)!important;
  box-shadow:inset 0 1px rgba(255,255,255,.13)!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-roster-portrait,
#battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-empty > .battle-roster-empty {
  width:31px!important;
  height:31px!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-active {
  border-color:var(--bui-good)!important;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--bui-good) 25%,transparent),inset 0 1px rgba(255,255,255,.16)!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > .battle-roster-active-arrow {
  left:-16px!important;
  top:50%!important;
  width:18px!important;
  height:18px!important;
  color:var(--bui-accent)!important;
  opacity:0!important;
  transform:translate(-2px,-50%) scale(.86)!important;
  filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-active > .battle-roster-active-arrow {
  opacity:1!important;
  transform:translate(0,-50%) scale(1)!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-roster-active-arrow > svg {
  width:100%!important;
  height:100%!important;
}


/* Roster slots are self-contained circles; portraits never inherit legacy offsets. */
#battleHud[data-battle-ui="2.9.9"] .battle-roster-slot {
  display:grid!important;
  place-items:center!important;
  line-height:0!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-roster-portrait,
#battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-empty > .battle-roster-empty {
  position:relative!important;
  inset:auto!important;
  margin:0!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
  border-radius:50%!important;
  transform:none!important;
  line-height:0!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-roster-portrait > img,
#battleHud[data-battle-ui="2.9.9"] .battle-roster-empty > img {
  position:static!important;
  inset:auto!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  margin:0!important;
  padding:0!important;
  display:block!important;
  object-fit:contain!important;
  object-position:50% 50%!important;
  transform:none!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > kbd {
  left:auto!important;
  right:-4px!important;
  top:-4px!important;
  margin:0!important;
  line-height:1!important;
}

/* --------------------------------------------------------------------------
   Bottom command panel: one fixed grid, nothing may escape it.
   -------------------------------------------------------------------------- */
#battleHud[data-battle-ui="2.9.9"] .combat-command-deck[data-view="combat"] {
  z-index:40!important;
  left:50%!important;
  right:auto!important;
  top:auto!important;
  bottom:var(--bui-command-bottom)!important;
  width:var(--bui-command-w)!important;
  height:var(--bui-command-h)!important;
  min-width:0!important;
  min-height:0!important;
  padding:9px 10px 7px!important;
  transform:translateX(-50%)!important;
  overflow:visible!important;
  border:1px solid var(--bui-line)!important;
  border-radius:20px!important;
  background:linear-gradient(155deg,var(--bui-surface-raised),var(--bui-surface))!important;
  box-shadow:0 9px 20px color-mix(in srgb,var(--bui-shadow) 68%,transparent),inset 0 1px rgba(255,255,255,.1)!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-live-controls {
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  display:grid!important;
  grid-template-rows:minmax(0,1fr) 28px!important;
  gap:6px!important;
  overflow:visible!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-main-row {
  min-width:0!important;
  min-height:0!important;
  display:grid!important;
  grid-template-columns:minmax(380px,1fr) 164px 118px!important;
  grid-template-rows:minmax(0,1fr)!important;
  align-items:stretch!important;
  gap:8px!important;
  overflow:visible!important;
}

#battleHud[data-battle-ui="2.9.9"] :is(.combat-skills-panel,.combat-items-panel,.combat-utility-panel) {
  min-width:0!important;
  min-height:0!important;
  overflow:visible!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}

#battleHud[data-battle-ui="2.9.9"] :is(.combat-skills-panel,.combat-items-panel) {
  padding:0!important;
  display:grid!important;
  grid-template-rows:18px minmax(0,1fr)!important;
  gap:3px!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-items-panel {
  padding-left:8px!important;
  border-left:1px solid var(--bui-line)!important;
}

#battleHud[data-battle-ui="2.9.9"] :is(.combat-skills-panel,.combat-items-panel) > header {
  height:18px!important;
  padding:0 3px!important;
  display:flex!important;
  align-items:center!important;
}

#battleHud[data-battle-ui="2.9.9"] :is(.combat-skills-panel,.combat-items-panel) > header b {
  color:var(--bui-muted)!important;
  font-size:var(--bui-micro)!important;
  font-weight:800!important;
  letter-spacing:.08em!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-skills {
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:minmax(0,1fr)!important;
  align-items:stretch!important;
  justify-content:stretch!important;
  gap:6px!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-action-button {
  --combat-size:72px;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  padding:2px 3px 29px!important;
  overflow:visible!important;
  box-shadow:none!important;
  filter:none!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
  overflow:hidden!important;
  border-radius:50%!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
  width:var(--combat-size)!important;
  height:var(--combat-size)!important;
  max-width:100%!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-skill-name {
  font-size:var(--bui-xs)!important;
  font-weight:800!important;
  line-height:1.05!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-action-button > kbd,
#battleHud[data-battle-ui="2.9.9"] .combat-item-button > kbd {
  font-size:var(--bui-micro)!important;
  font-weight:800!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-item-grid {
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  padding:3px 4px!important;
  box-sizing:border-box!important;
  overflow:visible!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,minmax(0,1fr))!important;
  align-items:center!important;
  justify-items:center!important;
  gap:6px!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-item-button {
  --combat-size:45px;
  width:48px!important;
  height:50px!important;
  min-width:48px!important;
  min-height:50px!important;
  padding:2px!important;
  overflow:visible!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-item-button > span:first-child,
#battleHud[data-battle-ui="2.9.9"] .combat-item-button > .combat-cooldown {
  width:45px!important;
  height:45px!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-resource-row {
  height:28px!important;
  min-height:28px!important;
  padding:2px 8px!important;
  overflow:hidden!important;
  border:0!important;
  border-radius:11px!important;
  background:var(--bui-surface-soft)!important;
  box-shadow:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-energy {
  grid-template-columns:112px minmax(0,1fr)!important;
  gap:8px!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-energy :is(small,b) {
  font-size:var(--bui-xs)!important;
}

/* Item wells: badges may overflow, only the circular art/cooldown mask clips. */
#battleHud[data-battle-ui="2.9.9"] .combat-items-panel,
#battleHud[data-battle-ui="2.9.9"] .combat-item-grid,
#battleHud[data-battle-ui="2.9.9"] .combat-item-button {
  overflow:visible!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-item-button {
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  filter:none!important;
  transform:none!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-item-button::before,
#battleHud[data-battle-ui="2.9.9"] .combat-item-button::after {
  content:none!important;
  display:none!important;
  box-shadow:none!important;
  filter:none!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-item-button > span:first-child {
  overflow:hidden!important;
  border:1px solid var(--bui-line)!important;
  border-radius:50%!important;
  background:radial-gradient(circle at 38% 30%,var(--bui-surface-raised),var(--bui-surface-soft))!important;
  box-shadow:inset 0 1px rgba(255,255,255,.22),0 2px 5px color-mix(in srgb,var(--bui-shadow) 42%,transparent)!important;
  transform:none!important;
  filter:none!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-item-button:is(:hover,:focus-visible) > span:first-child,
#battleHud[data-battle-ui="2.9.9"] .combat-item-button.is-ready > span:first-child {
  border-color:color-mix(in srgb,var(--bui-accent) 55%,var(--bui-line))!important;
  box-shadow:inset 0 1px rgba(255,255,255,.24),0 2px 6px color-mix(in srgb,var(--bui-shadow) 46%,transparent)!important;
  transform:none!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-quick-painted,
#battleHud[data-battle-ui="2.9.9"] svg.combat-item-art {
  filter:none!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-item-button > .combat-cooldown {
  overflow:hidden!important;
  border-radius:50%!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--bui-line) 65%,transparent)!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-item-button > kbd {
  left:-2px!important;
  top:-2px!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-item-button > b {
  right:-2px!important;
  bottom:-2px!important;
  box-shadow:none!important;
}

/* --------------------------------------------------------------------------
   Utility actions: compact, contained, no floating shadow.
   -------------------------------------------------------------------------- */
#battleHud[data-battle-ui="2.9.9"] .combat-utility-panel {
  width:118px!important;
  min-width:118px!important;
  max-width:118px!important;
  height:auto!important;
  padding:0!important;
  align-self:end!important;
  overflow:visible!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-utility-actions {
  width:100%!important;
  height:auto!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:repeat(3,31px)!important;
  align-content:end!important;
  gap:4px!important;
  overflow:visible!important;
  background:transparent!important;
  box-shadow:none!important;
  filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
#battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button.is-active,
#battleHud[data-battle-ui="2.9.9"] #cancelBattle {
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:31px!important;
  min-height:31px!important;
  margin:0!important;
  padding:0 8px!important;
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:16px minmax(0,1fr)!important;
  align-items:center!important;
  justify-items:start!important;
  gap:6px!important;
  overflow:hidden!important;
  border:1px solid rgba(61,161,208,.34)!important;
  border-radius:11px!important;
  background:linear-gradient(180deg,#fff,#edf7fa)!important;
  color:#228bd3!important;
  box-shadow:none!important;
  filter:none!important;
  transform:none!important;
  transition:border-color .14s ease,background .14s ease,color .14s ease!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button::before,
#battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button::after {
  box-shadow:none!important;
  filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > :is(svg,i) {
  width:16px!important;
  height:16px!important;
  min-width:16px!important;
  min-height:16px!important;
  margin:0!important;
  display:grid!important;
  place-items:center!important;
  color:currentColor!important;
  filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > i > svg,
#battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > svg {
  width:100%!important;
  height:100%!important;
  display:block!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > b,
#battleHud[data-battle-ui="2.9.9"] #cancelBattle > b {
  min-width:0!important;
  overflow:hidden!important;
  color:currentColor!important;
  font-size:var(--bui-micro)!important;
  font-weight:800!important;
  line-height:1!important;
  letter-spacing:.01em!important;
  text-overflow:clip!important;
  white-space:nowrap!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button:is(:hover,:focus-visible),
#battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button.is-active {
  border-color:rgba(45,151,205,.56)!important;
  background:linear-gradient(180deg,#fff,#e3f3f8)!important;
  box-shadow:none!important;
  filter:none!important;
  transform:none!important;
}

#battleHud[data-battle-ui="2.9.9"] #cancelBattle {
  border-color:rgba(229,103,115,.45)!important;
  background:linear-gradient(180deg,#fffafa,#fcedef)!important;
  color:var(--bui-danger)!important;
  box-shadow:none!important;
}

#battleHud[data-battle-ui="2.9.9"] #cancelBattle:is(:hover,:focus-visible) {
  border-color:rgba(226,83,99,.62)!important;
  background:linear-gradient(180deg,#fffdfd,#fae2e5)!important;
  box-shadow:none!important;
}

html[data-game-theme="dark"] #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
html[data-game-theme="dark"] #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button.is-active {
  border-color:rgba(86,180,224,.31)!important;
  background:linear-gradient(180deg,#203d4c,#18313e)!important;
  color:#73caff!important;
  box-shadow:none!important;
}

html[data-game-theme="dark"] #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button:is(:hover,:focus-visible),
html[data-game-theme="dark"] #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button.is-active {
  border-color:rgba(105,201,245,.49)!important;
  background:linear-gradient(180deg,#284959,#1d3947)!important;
}

html[data-game-theme="dark"] #battleHud[data-battle-ui="2.9.9"] #cancelBattle {
  border-color:rgba(213,102,116,.37)!important;
  background:linear-gradient(180deg,#452b32,#352229)!important;
  color:#ff818b!important;
}

html[data-game-theme="dark"] #battleHud[data-battle-ui="2.9.9"] #cancelBattle:is(:hover,:focus-visible) {
  border-color:rgba(232,123,136,.53)!important;
  background:linear-gradient(180deg,#52323a,#3d272d)!important;
}

/* --------------------------------------------------------------------------
   Pause = status only. Direct SVG, no card, no blur, no pointer capture.
   -------------------------------------------------------------------------- */
#battleHud[data-battle-ui="2.9.9"] .battle-pause-overlay {
  z-index:55!important;
  position:absolute!important;
  inset:0!important;
  display:grid!important;
  place-items:center!important;
  padding:0 0 var(--bui-command-h)!important;
  background:transparent!important;
  color:var(--bui-text)!important;
  pointer-events:none!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-pause-overlay[aria-hidden="true"] {
  display:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-pause-status {
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:13px!important;
  margin:0!important;
  padding:0!important;
  transform:none!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  pointer-events:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-pause-glyph {
  width:42px!important;
  height:52px!important;
  min-width:42px!important;
  min-height:52px!important;
  display:block!important;
  overflow:visible!important;
  color:var(--bui-accent)!important;
  filter:drop-shadow(0 4px 9px color-mix(in srgb,var(--bui-accent) 20%,transparent))!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-pause-status > b {
  margin:0!important;
  color:var(--bui-text)!important;
  font-family:var(--bui-font)!important;
  font-size:var(--bui-pause)!important;
  font-weight:850!important;
  line-height:.94!important;
  letter-spacing:.035em!important;
  text-shadow:0 3px 12px var(--bui-shadow)!important;
}

html[data-game-theme="light"] #battleHud[data-battle-ui="2.9.9"] .battle-pause-status > b {
  color:#173d51!important;
  text-shadow:0 2px 7px rgba(255,255,255,.9),0 4px 12px rgba(42,91,109,.12)!important;
}

/* --------------------------------------------------------------------------
   Tactics and surrender confirmation
   -------------------------------------------------------------------------- */
#battleHud[data-battle-ui="2.9.9"] .battle-tactics {
  z-index:60!important;
  right:14px!important;
  left:auto!important;
  top:auto!important;
  bottom:calc(var(--bui-command-bottom) + var(--bui-command-h) + 10px)!important;
  width:306px!important;
  max-height:min(390px,calc(100% - var(--bui-command-h) - var(--bui-command-bottom) - 34px))!important;
  overflow:auto!important;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  border:1px solid var(--bui-line)!important;
  border-radius:17px!important;
  background:linear-gradient(155deg,var(--bui-surface-raised),var(--bui-surface))!important;
  color:var(--bui-text)!important;
  box-shadow:0 14px 30px var(--bui-shadow),inset 0 1px rgba(255,255,255,.1)!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-tactics :is(b,small,footer,label) {
  font-family:var(--bui-font)!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-tactics > header b { font-size:14px!important;font-weight:850!important; }
#battleHud[data-battle-ui="2.9.9"] .battle-tactics > header small,
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-modes small,
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules small,
#battleHud[data-battle-ui="2.9.9"] .battle-tactics > footer { font-size:var(--bui-micro)!important; }
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-modes b,
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules b { font-size:var(--bui-xs)!important;font-weight:800!important; }


#battleHud[data-battle-ui="2.9.9"] .battle-tactic-modes {
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:7px!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-modes > button {
  min-height:72px!important;
  padding:7px 8px!important;
  grid-template-rows:34px auto!important;
  gap:4px!important;
  border-radius:12px!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-modes > button > i,
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-modes > button > i > * {
  width:34px!important;
  height:34px!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-manual-note {
  margin:2px 0 0!important;
  padding:10px 11px!important;
  border:1px solid var(--bui-line)!important;
  border-radius:11px!important;
  background:var(--bui-surface-soft)!important;
  color:var(--bui-muted)!important;
  font-size:var(--bui-xs)!important;
  font-weight:650!important;
  line-height:1.4!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-manual-note[hidden],
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules[hidden],
#battleHud[data-battle-ui="2.9.9"] .battle-tactics[data-mode="manual"] .battle-tactic-rules,
#battleHud[data-battle-ui="2.9.9"] .battle-tactics[data-mode="smart"] .battle-tactic-manual-note {
  display:none!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules {
  gap:5px!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules-head {
  min-height:32px!important;
  padding:4px 2px!important;
  display:grid!important;
  gap:1px!important;
  border:0!important;
  background:transparent!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules-head small {
  color:var(--bui-accent)!important;
  font-size:var(--bui-micro)!important;
  font-weight:800!important;
  letter-spacing:.08em!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules-head b {
  color:var(--bui-text)!important;
  font-size:var(--bui-sm)!important;
  font-weight:800!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules label {
  min-height:42px!important;
  padding:6px 8px!important;
  grid-template-columns:34px minmax(0,1fr)!important;
  gap:8px!important;
  border-color:var(--bui-line)!important;
  background:var(--bui-card)!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules input {
  width:32px!important;
  height:19px!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules input::after {
  left:2px!important;
  top:2px!important;
  width:13px!important;
  height:13px!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules input:checked::after {
  transform:translateX(13px)!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-surrender-confirm {
  z-index:70!important;
  background:transparent!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-surrender-confirm > article {
  width:min(380px,calc(100% - 32px))!important;
  padding:16px!important;
  border:1px solid color-mix(in srgb,var(--bui-danger) 42%,var(--bui-line))!important;
  border-radius:18px!important;
  background:linear-gradient(155deg,var(--bui-surface-raised),var(--bui-surface))!important;
  color:var(--bui-text)!important;
  box-shadow:0 16px 38px var(--bui-shadow),inset 0 1px rgba(255,255,255,.1)!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-surrender-confirm b { font-size:18px!important;font-weight:850!important; }
#battleHud[data-battle-ui="2.9.9"] .battle-surrender-confirm p { font-size:var(--bui-sm)!important;line-height:1.45!important; }
#battleHud[data-battle-ui="2.9.9"] .battle-surrender-confirm footer button { min-height:42px!important;font-size:var(--bui-sm)!important; }

/* --------------------------------------------------------------------------
   Result / rewards typography and containment
   -------------------------------------------------------------------------- */
#battleHud[data-battle-ui="2.9.9"] .combat-command-deck[data-view="decision"],
#battleHud[data-battle-ui="2.9.9"] .combat-command-deck[data-view="result"] {
  left:50%!important;
  right:auto!important;
  bottom:var(--bui-command-bottom)!important;
  width:min(760px,calc(100% - 104px))!important;
  height:min(340px,calc(100% - 188px))!important;
  min-height:250px!important;
  transform:translateX(-50%)!important;
  overflow:hidden!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-result-copy > b,
#battleHud[data-battle-ui="2.9.9"] .combat-reward-card > header b {
  font-family:var(--bui-font)!important;
  font-size:32px!important;
  font-weight:850!important;
  line-height:1!important;
  letter-spacing:.025em!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-result-copy :is(small,em),
#battleHud[data-battle-ui="2.9.9"] .combat-reward-item :is(small,strong),
#battleHud[data-battle-ui="2.9.9"] .battle-result-action small {
  font-size:var(--bui-xs)!important;
}

#battleHud[data-battle-ui="2.9.9"] .combat-reward-item b,
#battleHud[data-battle-ui="2.9.9"] .battle-result-action b {
  font-size:var(--bui-md)!important;
  font-weight:850!important;
}


/* --------------------------------------------------------------------------
   Secondary battle chrome: skill preview, co-op strips and capture feedback.
   These were still inheriting legacy 7px type, dark-only surfaces and blur.
   -------------------------------------------------------------------------- */
#battleHud[data-battle-ui="2.9.9"] .battle-tooltip-layer {
  position:absolute!important;
  z-index:68!important;
  inset:0!important;
  overflow:visible!important;
  pointer-events:none!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip {
  position:absolute!important;
  z-index:1!important;
  left:0!important;
  top:0!important;
  bottom:auto!important;
  width:min(280px,calc(100% - 20px))!important;
  min-height:72px!important;
  max-height:150px!important;
  padding:9px 10px!important;
  display:grid!important;
  grid-template-columns:48px minmax(0,1fr)!important;
  align-items:center!important;
  gap:9px!important;
  overflow:hidden!important;
  transform:translate3d(var(--battle-tooltip-x,10px),var(--battle-tooltip-y,10px),0)!important;
  border:1px solid var(--bui-line-strong)!important;
  border-radius:12px!important;
  background:linear-gradient(155deg,var(--bui-surface-raised),var(--bui-surface))!important;
  color:var(--bui-text)!important;
  box-shadow:0 8px 18px color-mix(in srgb,var(--bui-shadow) 72%,transparent)!important;
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
  transition:opacity .12s ease!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip.is-open {
  opacity:1!important;
  visibility:visible!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip[aria-hidden="true"] {
  display:grid!important;
  opacity:0!important;
  visibility:hidden!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip > span {
  width:48px!important;
  height:48px!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
  border:1px solid var(--bui-line)!important;
  border-radius:11px!important;
  background:var(--bui-surface-soft)!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip :is(.combat-preview-art,.combat-preview-item-art) {
  width:44px!important;
  height:44px!important;
  max-width:44px!important;
  max-height:44px!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip small {
  color:var(--bui-accent)!important;
  font-size:var(--bui-micro)!important;
  font-weight:800!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip b {
  color:var(--bui-text)!important;
  font-size:var(--bui-md)!important;
  font-weight:850!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip p,
#battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip em {
  color:var(--bui-muted)!important;
  font-size:var(--bui-micro)!important;
  line-height:1.3!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip p {
  margin:2px 0!important;
  white-space:normal!important;
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
}
#battleHud[data-battle-ui="2.9.9"] :is(.battle-team-member,.battle-target-strip > button) {
  border-color:var(--bui-line)!important;
  background:linear-gradient(155deg,var(--bui-surface-raised),var(--bui-surface))!important;
  color:var(--bui-text)!important;
  box-shadow:0 8px 18px var(--bui-shadow)!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}
#battleHud[data-battle-ui="2.9.9"] :is(.battle-team-member,.battle-target-strip > button) small {
  color:var(--bui-muted)!important;
  font-size:var(--bui-micro)!important;
}
#battleHud[data-battle-ui="2.9.9"] :is(.battle-team-member,.battle-target-strip > button) b {
  color:var(--bui-text)!important;
  font-size:var(--bui-xs)!important;
  font-weight:800!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-target-strip > button.is-selected {
  border-color:var(--bui-accent)!important;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--bui-accent) 18%,transparent),0 8px 18px var(--bui-shadow)!important;
}
#battleHud[data-battle-ui="2.9.9"] :is(.capture-feedback,.capture-gesture-hint) {
  border:1px solid var(--bui-line)!important;
  background:color-mix(in srgb,var(--bui-surface-raised) 94%,transparent)!important;
  color:var(--bui-text)!important;
  box-shadow:0 8px 18px var(--bui-shadow)!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}
#battleHud[data-battle-ui="2.9.9"] .capture-feedback small,
#battleHud[data-battle-ui="2.9.9"] .capture-gesture-hint small {
  color:var(--bui-muted)!important;
  font-size:var(--bui-micro)!important;
}
#battleHud[data-battle-ui="2.9.9"] .capture-feedback b,
#battleHud[data-battle-ui="2.9.9"] .capture-gesture-hint b {
  color:var(--bui-text)!important;
  font-size:var(--bui-sm)!important;
  font-weight:800!important;
}

/* AI-only rows keep a consistent 3-column layout in both themes. */
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules label.is-ai-rule {
  grid-template-columns:32px 24px minmax(0,1fr)!important;
  border-color:color-mix(in srgb,var(--bui-good) 30%,var(--bui-line))!important;
  background:color-mix(in srgb,var(--bui-good) 7%,var(--bui-card))!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules label.is-ai-rule > i,
#battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules label.is-ai-rule > i > svg {
  width:21px!important;
  height:21px!important;
  color:var(--bui-good)!important;
}

/* The surrender card must remain usable even on a short landscape viewport. */
#battleHud[data-battle-ui="2.9.9"] .battle-surrender-confirm > article {
  max-height:calc(100% - 24px)!important;
  overflow:auto!important;
  overscroll-behavior:contain;
}

/* --------------------------------------------------------------------------
   No blur on battle UI surfaces. This is intentional.
   -------------------------------------------------------------------------- */
#battleHud[data-battle-ui="2.9.9"],
#battleHud[data-battle-ui="2.9.9"]::before,
#battleHud[data-battle-ui="2.9.9"]::after,
#battleHud[data-battle-ui="2.9.9"] *,
#battleHud[data-battle-ui="2.9.9"] *::before,
#battleHud[data-battle-ui="2.9.9"] *::after {
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

/* --------------------------------------------------------------------------
   Compact desktop / landscape tablet
   -------------------------------------------------------------------------- */
@media (max-width:1099px) {
  #battleHud[data-battle-ui="2.9.9"] {
    --bui-shell-w:calc(100vw - 24px);
    --bui-shell-h:min(680px,calc(100dvh - 36px));
    --bui-command-w:calc(100% - 92px);
    --bui-command-h:188px;
    --bui-pause:44px;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-health > article {
    width:278px!important;
    min-height:136px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-versus-card {
    width:205px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
    grid-template-columns:minmax(318px,1fr) 148px 112px!important;
    gap:6px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel {
    width:112px!important;
    min-width:112px!important;
    max-width:112px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions {
    grid-template-rows:repeat(3,32px)!important;
    gap:5px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
  #battleHud[data-battle-ui="2.9.9"] #cancelBattle {
    height:32px!important;
    min-height:32px!important;
    padding-inline:8px!important;
    grid-template-columns:17px minmax(0,1fr)!important;
    gap:6px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > :is(svg,i) {
    width:17px!important;
    height:17px!important;
    min-width:17px!important;
    min-height:17px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > b,
  #battleHud[data-battle-ui="2.9.9"] #cancelBattle > b {
    font-size:9px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-pause-glyph {
    width:38px!important;
    height:47px!important;
  }
}

/* --------------------------------------------------------------------------
   Narrow / mobile: buttons become a contained horizontal row.
   -------------------------------------------------------------------------- */
@media (max-width:760px) {
  #battleHud[data-battle-ui="2.9.9"] {
    --bui-shell-w:calc(100vw - 8px);
    --bui-shell-h:calc(100dvh - 8px);
    --bui-command-w:calc(100% - 8px);
    --bui-command-h:282px;
    --bui-command-bottom:4px;
    --bui-pause:36px;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-shell {
    min-width:0!important;
    min-height:0!important;
    border-radius:18px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-health > article {
    top:6px!important;
    width:calc(50% - 10px)!important;
    min-height:118px!important;
    padding:7px!important;
    border-radius:14px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-health > .ally-health { left:5px!important; }
  #battleHud[data-battle-ui="2.9.9"] .battle-health > .enemy-health { right:5px!important; }
  #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > b { font-size:14px!important; }
  #battleHud[data-battle-ui="2.9.9"] .battle-versus-card { display:none!important; }

  #battleHud[data-battle-ui="2.9.9"] .battle-roster-panel {
    left:5px!important;
    right:5px!important;
    top:130px!important;
    bottom:auto!important;
    width:auto!important;
    height:46px!important;
    padding:4px 7px!important;
    display:block!important;
    border-radius:14px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-roster-panel > header { display:none!important; }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster {
    width:100%!important;
    height:38px!important;
    grid-template-columns:repeat(6,38px)!important;
    grid-template-rows:38px!important;
    justify-content:center!important;
    gap:4px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot {
    width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > .battle-roster-active-arrow {
    left:50%!important;
    top:-13px!important;
    width:16px!important;
    height:16px!important;
    transform:translate(-50%,-2px) rotate(90deg) scale(.86)!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-active > .battle-roster-active-arrow {
    transform:translate(-50%,0) rotate(90deg) scale(1)!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-command-deck[data-view="combat"] {
    padding:6px!important;
    border-radius:16px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-live-controls {
    grid-template-rows:minmax(0,1fr) 25px!important;
    gap:4px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
    grid-template-columns:1fr!important;
    grid-template-rows:120px 64px 40px!important;
    gap:5px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-items-panel {
    padding:0!important;
    border-left:0!important;
    border-top:1px solid var(--bui-line)!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-item-grid {
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    grid-template-rows:1fr!important;
    gap:3px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-item-button {
    width:42px!important;
    min-width:40px!important;
    height:44px!important;
    min-height:44px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-item-button > span:first-child,
  #battleHud[data-battle-ui="2.9.9"] .combat-item-button > .combat-cooldown {
    width:39px!important;
    height:39px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel {
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:40px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions {
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:40px!important;
    gap:5px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
  #battleHud[data-battle-ui="2.9.9"] #cancelBattle {
    height:40px!important;
    min-height:40px!important;
    padding-inline:7px!important;
    grid-template-columns:18px minmax(0,1fr)!important;
    gap:5px!important;
    border-radius:12px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > :is(svg,i) {
    width:18px!important;
    height:18px!important;
    min-width:18px!important;
    min-height:18px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > b,
  #battleHud[data-battle-ui="2.9.9"] #cancelBattle > b {
    font-size:10px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-pause-overlay {
    padding-bottom:var(--bui-command-h)!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-pause-status { gap:9px!important; }
  #battleHud[data-battle-ui="2.9.9"] .battle-pause-glyph { width:30px!important;height:38px!important; }

  #battleHud[data-battle-ui="2.9.9"] .battle-tactics {
    right:6px!important;
    left:6px!important;
    width:auto!important;
    bottom:calc(var(--bui-command-bottom) + var(--bui-command-h) + 6px)!important;
    max-height:calc(100% - var(--bui-command-h) - 28px)!important;
  }
}



/* --------------------------------------------------------------------------
   Portrait tablet edge case (768–819 CSS px)
   This width is too narrow for the compact-desktop trio (ally + VS + enemy),
   but has enough vertical room for the mobile-style command composition.
   Keep two fighter cards, hide VS, use a horizontal roster and contained rows.
   -------------------------------------------------------------------------- */
@media (min-width:761px) and (max-width:819px) and (orientation:portrait) {
  #battleHud[data-battle-ui="2.9.9"] {
    --bui-shell-w:calc(100vw - 16px);
    --bui-shell-h:calc(100dvh - 20px);
    --bui-command-w:calc(100% - 18px);
    --bui-command-h:282px;
    --bui-command-bottom:8px;
    --bui-pause:38px;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-shell {
    min-width:0!important;
    min-height:0!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-health > article {
    top:8px!important;
    width:calc(50% - 14px)!important;
    min-height:132px!important;
    padding:8px 10px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-health > .ally-health { left:7px!important; }
  #battleHud[data-battle-ui="2.9.9"] .battle-health > .enemy-health { right:7px!important; }
  #battleHud[data-battle-ui="2.9.9"] .battle-versus-card { display:none!important; }

  #battleHud[data-battle-ui="2.9.9"] .battle-roster-panel {
    left:50%!important;
    right:auto!important;
    top:148px!important;
    bottom:auto!important;
    width:314px!important;
    height:50px!important;
    padding:5px 8px!important;
    display:block!important;
    transform:translateX(-50%)!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-panel > header { display:none!important; }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster {
    width:100%!important;
    height:40px!important;
    display:grid!important;
    grid-template-columns:repeat(6,40px)!important;
    grid-template-rows:40px!important;
    justify-content:center!important;
    gap:7px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot {
    width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > .battle-roster-active-arrow {
    left:50%!important;
    top:-14px!important;
    width:17px!important;
    height:17px!important;
    transform:translate(-50%,-2px) rotate(90deg) scale(.86)!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-active > .battle-roster-active-arrow {
    transform:translate(-50%,0) rotate(90deg) scale(1)!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-command-deck[data-view="combat"] {
    padding:6px 8px!important;
    border-radius:18px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-live-controls {
    grid-template-rows:minmax(0,1fr) 25px!important;
    gap:4px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
    grid-template-columns:1fr!important;
    grid-template-rows:120px 64px 40px!important;
    gap:5px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-items-panel {
    padding:0!important;
    border-left:0!important;
    border-top:1px solid var(--bui-line)!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-item-grid {
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    grid-template-rows:1fr!important;
    gap:5px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel {
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:40px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions {
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:40px!important;
    gap:7px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
  #battleHud[data-battle-ui="2.9.9"] #cancelBattle {
    height:40px!important;
    min-height:40px!important;
    padding-inline:10px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-pause-overlay {
    padding-bottom:var(--bui-command-h)!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-tactics {
    right:10px!important;
    left:10px!important;
    width:auto!important;
    bottom:calc(var(--bui-command-bottom) + var(--bui-command-h) + 8px)!important;
    max-height:calc(100% - var(--bui-command-h) - 34px)!important;
  }
}

@media (max-height:650px) and (orientation:landscape) and (min-width:761px) {
  #battleHud[data-battle-ui="2.9.9"] {
    --bui-shell-h:calc(100dvh - 10px);
    --bui-command-h:178px;
    --bui-command-bottom:5px;
    --bui-pause:40px;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-health > article {
    top:7px!important;
    min-height:126px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-versus-card { top:8px!important; }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-panel {
    left:12px!important;
    right:auto!important;
    top:143px!important;
    bottom:auto!important;
    width:238px!important;
    height:42px!important;
    padding:4px 6px!important;
    display:block!important;
    transform:none!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-panel > header { display:none!important; }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster {
    width:226px!important;
    height:34px!important;
    grid-template-columns:repeat(6,34px)!important;
    grid-template-rows:34px!important;
    gap:4px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot {
    width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-portrait,
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-empty > .battle-roster-empty { width:28px!important;height:28px!important; }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > .battle-roster-active-arrow {
    left:50%!important;top:-12px!important;width:15px!important;height:15px!important;
    transform:translate(-50%,-2px) rotate(90deg) scale(.86)!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-active > .battle-roster-active-arrow {
    transform:translate(-50%,0) rotate(90deg) scale(1)!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-action-button { --combat-size:64px; }
  #battleHud[data-battle-ui="2.9.9"] .battle-pause-glyph { width:34px!important;height:42px!important; }
}



/* --------------------------------------------------------------------------
   TABLET CONTRACT — 761..1100px
   Tablets previously sat between old <=800px mobile rules and the compact
   desktop contract. These rules deliberately load last and make tablet
   geometry explicit in both orientations without changing the phone layout.
   -------------------------------------------------------------------------- */
@media (min-width:761px) and (max-width:1100px) {
  #battleHud[data-battle-ui="2.9.9"] {
    --bui-shell-w:calc(100vw - 16px);
    --bui-shell-h:min(720px,calc(100dvh - 20px));
    --bui-command-w:min(850px,calc(100% - 48px));
    --bui-command-h:184px;
    --bui-command-bottom:10px;
    --bui-pause:44px;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-shell {
    min-width:0!important;
    min-height:0!important;
    border-radius:21px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-health > article {
    top:10px!important;
    width:264px!important;
    min-height:132px!important;
    padding:8px 9px!important;
    border-radius:16px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-health > .ally-health { left:10px!important; }
  #battleHud[data-battle-ui="2.9.9"] .battle-health > .enemy-health { right:10px!important; }
  #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > b { font-size:16px!important; }

  #battleHud[data-battle-ui="2.9.9"] .battle-versus-card {
    top:12px!important;
    width:188px!important;
    min-height:82px!important;
    padding:8px 10px!important;
    border-radius:15px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-versus-card > strong { font-size:13px!important; }

  #battleHud[data-battle-ui="2.9.9"] .battle-roster-panel {
    left:14px!important;
    top:158px!important;
    bottom:calc(var(--bui-command-h) + var(--bui-command-bottom) + 12px)!important;
    width:48px!important;
    padding:4px!important;
    border-radius:15px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster {
    width:38px!important;
    grid-template-columns:38px!important;
    grid-template-rows:repeat(6,38px)!important;
    gap:3px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot {
    width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-portrait,
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-empty > .battle-roster-empty {
    width:32px!important;height:32px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > .battle-roster-active-arrow {
    left:-16px!important;width:18px!important;height:18px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-command-deck[data-view="combat"] {
    padding:7px 8px 6px!important;
    border-radius:18px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-live-controls {
    grid-template-rows:minmax(0,1fr) 26px!important;
    gap:4px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
    grid-template-columns:minmax(0,1fr) 144px 112px!important;
    gap:6px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-action-button { --combat-size:64px; }
  #battleHud[data-battle-ui="2.9.9"] .combat-skills { gap:4px!important; }

  #battleHud[data-battle-ui="2.9.9"] .combat-items-panel { padding-left:6px!important; }
  #battleHud[data-battle-ui="2.9.9"] .combat-item-grid { gap:4px!important; }
  #battleHud[data-battle-ui="2.9.9"] .combat-item-button {
    width:43px!important;height:46px!important;min-width:43px!important;min-height:46px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-item-button > span:first-child,
  #battleHud[data-battle-ui="2.9.9"] .combat-item-button > .combat-cooldown {
    width:40px!important;height:40px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel {
    width:112px!important;min-width:112px!important;max-width:112px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions {
    grid-template-rows:repeat(3,31px)!important;
    gap:4px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
  #battleHud[data-battle-ui="2.9.9"] #cancelBattle {
    height:31px!important;min-height:31px!important;
    padding:0 7px!important;
    grid-template-columns:16px minmax(0,1fr)!important;
    gap:5px!important;
    border-radius:10px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > :is(svg,i) {
    width:16px!important;height:16px!important;min-width:16px!important;min-height:16px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > b,
  #battleHud[data-battle-ui="2.9.9"] #cancelBattle > b { font-size:9px!important; }

  #battleHud[data-battle-ui="2.9.9"] .combat-resource-row {
    height:26px!important;min-height:26px!important;padding:1px 7px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-pause-status { gap:10px!important; }
  #battleHud[data-battle-ui="2.9.9"] .battle-pause-glyph {
    width:38px!important;height:48px!important;min-width:38px!important;min-height:48px!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-tactics {
    right:10px!important;
    width:min(300px,calc(100% - 20px))!important;
    bottom:calc(var(--bui-command-bottom) + var(--bui-command-h) + 8px)!important;
    max-height:calc(100% - var(--bui-command-h) - var(--bui-command-bottom) - 26px)!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .combat-command-deck[data-view="decision"],
  #battleHud[data-battle-ui="2.9.9"] .combat-command-deck[data-view="result"] {
    width:min(700px,calc(100% - 40px))!important;
    max-width:calc(100% - 40px)!important;
  }

  #battleHud[data-battle-ui="2.9.9"] .battle-surrender-confirm > article {
    width:min(360px,calc(100% - 24px))!important;
    max-height:calc(100% - 20px)!important;
  }
}

/* 7–8 inch portrait tablets: keep all three top cards separated. */
@media (min-width:761px) and (max-width:850px) and (orientation:portrait) {
  #battleHud[data-battle-ui="2.9.9"] {
    --bui-shell-h:min(740px,calc(100dvh - 16px));
    --bui-command-w:calc(100% - 32px);
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-health > article {
    width:232px!important;
    min-height:128px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-versus-card {
    width:174px!important;
    min-height:78px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-versus-card > strong { font-size:12px!important; }
  #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
    grid-template-columns:minmax(0,1fr) 138px 110px!important;
    gap:5px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel {
    width:110px!important;min-width:110px!important;max-width:110px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-action-button { --combat-size:60px; }
  #battleHud[data-battle-ui="2.9.9"] .battle-pause-glyph {
    width:40px!important;height:50px!important;min-width:40px!important;min-height:50px!important;
  }
}

/* Short landscape tablets: spend vertical space on the arena, not chrome. */
@media (min-width:761px) and (max-width:1100px) and (max-height:700px) and (orientation:landscape) {
  #battleHud[data-battle-ui="2.9.9"] {
    --bui-shell-w:calc(100vw - 10px);
    --bui-shell-h:calc(100dvh - 10px);
    --bui-command-w:min(820px,calc(100% - 76px));
    --bui-command-h:170px;
    --bui-command-bottom:5px;
    --bui-pause:40px;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-health > article {
    top:6px!important;width:248px!important;min-height:118px!important;padding:7px 8px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-versus-card {
    top:7px!important;width:176px!important;min-height:72px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-panel {
    left:8px!important;top:132px!important;bottom:auto!important;
    width:78px!important;height:auto!important;
    grid-template-rows:16px auto!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster {
    width:68px!important;
    grid-template-columns:repeat(2,32px)!important;
    grid-template-rows:repeat(3,32px)!important;
    gap:3px 4px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot {
    width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-portrait,
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-empty > .battle-roster-empty {
    width:27px!important;height:27px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > .battle-roster-active-arrow {
    left:-13px!important;width:15px!important;height:15px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-action-button { --combat-size:58px; }
  #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
    grid-template-columns:minmax(0,1fr) 138px 108px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel {
    width:108px!important;min-width:108px!important;max-width:108px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions {
    grid-template-rows:repeat(3,29px)!important;gap:4px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
  #battleHud[data-battle-ui="2.9.9"] #cancelBattle {
    height:29px!important;min-height:29px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-pause-glyph {
    width:35px!important;height:44px!important;min-width:35px!important;min-height:44px!important;
  }
  #battleHud[data-battle-ui="2.9.9"] .battle-tactics {
    width:286px!important;
    max-height:calc(100% - var(--bui-command-h) - 18px)!important;
  }
}

@media (prefers-reduced-motion:reduce) {
  #battleHud[data-battle-ui="2.9.9"] *,
  #battleHud[data-battle-ui="2.9.9"] *::before,
  #battleHud[data-battle-ui="2.9.9"] *::after {
    scroll-behavior:auto!important;
    animation-duration:.001ms!important;
    animation-iteration-count:1!important;
    transition-duration:.001ms!important;
  }
}

/* --------------------------------------------------------------------------
   VISUAL CLARITY + MOTION CONTRACT
   Keep the approved geometry intact. This section only standardises motion,
   visual feedback and readability so battle states feel deliberate rather
   than like unrelated legacy CSS effects.
   -------------------------------------------------------------------------- */
#battleHud[data-battle-ui="2.9.9"] {
  --bui-ease:cubic-bezier(.22,.78,.22,1);
  --bui-ease-soft:cubic-bezier(.2,.72,.2,1);
  --bui-motion-fast:140ms;
  --bui-motion:220ms;
  --bui-motion-slow:320ms;
}

/* Smooth numeric state changes instead of snapping HP/energy bars. */
#battleHud[data-battle-ui="2.9.9"] :is(
  .battle-hp-bar > em,
  .battle-stamina > i > em,
  .battle-exp > i > em,
  .battle-roster-hp > em,
  .battle-roster-energy > em,
  .combat-energy > i > em
) {
  transition:width var(--bui-motion-slow) var(--bui-ease-soft),filter var(--bui-motion-fast) ease!important;
}

/* Open the battle as one coherent surface. Never change final geometry. */
#battleHud[data-battle-ui="2.9.9"].is-open .battle-shell {
  animation:bui-shell-enter var(--bui-motion) var(--bui-ease) both!important;
}
#battleHud[data-battle-ui="2.9.9"].is-open .battle-health > .ally-health {
  animation:bui-fighter-left 260ms var(--bui-ease) 35ms both!important;
}
#battleHud[data-battle-ui="2.9.9"].is-open .battle-health > .enemy-health {
  animation:bui-fighter-right 260ms var(--bui-ease) 35ms both!important;
}
#battleHud[data-battle-ui="2.9.9"].is-open .battle-versus-card {
  animation:bui-versus-enter 250ms var(--bui-ease) 70ms both!important;
}

/* Interaction feedback: short and physical, no bouncing/floating layout. */
#battleHud[data-battle-ui="2.9.9"] :is(.combat-action-button,.combat-item-button,.battle-roster-slot) {
  transition:border-color var(--bui-motion-fast) ease,background var(--bui-motion-fast) ease,
    box-shadow var(--bui-motion-fast) ease,filter var(--bui-motion-fast) ease,
    opacity var(--bui-motion-fast) ease,transform var(--bui-motion-fast) var(--bui-ease)!important;
}
#battleHud[data-battle-ui="2.9.9"] :is(.combat-action-button,.combat-item-button):active:not(:disabled) {
  transform:scale(.965)!important;
  transition-duration:70ms!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-active > .battle-roster-active-arrow {
  animation:bui-active-arrow-in 220ms var(--bui-ease) both!important;
}

/* Queued/ready states remain visible but stop screaming continuously. */
#battleHud[data-battle-ui="2.9.9"] .combat-action-button.is-queued .combat-skill-art {
  animation:bui-queued-soft 1.8s ease-in-out infinite!important;
}
#battleHud[data-battle-ui="2.9.9"] :is(.combat-action-button,.combat-item-button).is-just-ready {
  animation:bui-control-ready 520ms var(--bui-ease) both!important;
}

/* The old energy bar had three independent infinite animations. A stable fill
   plus smooth width changes is clearer and cheaper to render. */
#battleHud[data-battle-ui="2.9.9"] .combat-energy > i > em,
#battleHud[data-battle-ui="2.9.9"] .combat-energy > i > em::before,
#battleHud[data-battle-ui="2.9.9"] .combat-energy > i > em::after,
#battleHud[data-battle-ui="2.9.9"] .combat-energy[data-energy-state="full"] > i {
  animation:none!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-energy > i > em::before {
  opacity:.18!important;
  transform:none!important;
  background:linear-gradient(180deg,rgba(255,255,255,.32),transparent 62%)!important;
}
#battleHud[data-battle-ui="2.9.9"] .combat-energy > i > em::after {
  opacity:.75!important;
}

/* Pause is a state change, not a cinematic. One fast, clean lockup. */
#battleHud[data-battle-ui="2.9.9"] .battle-pause-overlay[aria-hidden="false"] .battle-pause-status {
  animation:bui-pause-in 160ms var(--bui-ease) both!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-pause-glyph {
  filter:none!important;
}

/* Tactics appears as a child panel without spring/overshoot animation. */
#battleHud[data-battle-ui="2.9.9"] .battle-tactics.is-open {
  animation:bui-panel-in 170ms var(--bui-ease-soft) both!important;
}

/* Result reveal follows the JS reveal order, but removes the legacy overshoot. */
#battleHud[data-battle-ui="2.9.9"] .battle-result-outcome {
  opacity:0!important;
  transform:translateY(8px) scale(.985)!important;
  transition:opacity 180ms ease,transform 240ms var(--bui-ease)!important;
  filter:none!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-result-scene.is-outcome-visible .battle-result-outcome {
  opacity:1!important;
  transform:none!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-reward-drop {
  opacity:0!important;
  transform:translateY(10px) scale(.97)!important;
  transition:opacity 180ms ease,transform 260ms var(--bui-ease)!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-reward-drop.is-visible {
  opacity:1!important;
  transform:none!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-result-action {
  transition:opacity 170ms ease,transform 200ms var(--bui-ease),border-color 140ms ease,background 140ms ease!important;
}

/* One type rhythm: labels are tracked, controls/names are not artificially
   stretched. This does not alter component placement. */
#battleHud[data-battle-ui="2.9.9"] :is(
  .battle-fighter-identity > header > b,
  .combat-skill-name,
  .combat-utility-actions > button > b,
  .battle-tactic-modes b,
  .battle-result-copy > b
) {
  letter-spacing:0!important;
}
#battleHud[data-battle-ui="2.9.9"] :is(
  .battle-card-status-area > small,
  .combat-skills-panel > header b,
  .combat-items-panel > header b,
  .battle-result-copy > small,
  .battle-result-drops > header,
  .battle-tactic-rules-head small
) {
  letter-spacing:.08em!important;
}

@keyframes bui-shell-enter {
  from { opacity:0;transform:translate(-50%,-50%) scale(.992); }
  to { opacity:1;transform:translate(-50%,-50%) scale(1); }
}
@keyframes bui-fighter-left {
  from { opacity:0;transform:translateX(-8px); }
  to { opacity:1;transform:none; }
}
@keyframes bui-fighter-right {
  from { opacity:0;transform:translateX(8px); }
  to { opacity:1;transform:none; }
}
@keyframes bui-versus-enter {
  from { opacity:0;transform:translateX(-50%) translateY(-5px) scale(.985); }
  to { opacity:1;transform:translateX(-50%) translateY(0) scale(1); }
}
@keyframes bui-active-arrow-in {
  from { opacity:0;filter:none; }
  to { opacity:1;filter:none; }
}
@keyframes bui-queued-soft {
  0%,100% { filter:brightness(1); }
  50% { filter:brightness(1.07); }
}
@keyframes bui-control-ready {
  0% { box-shadow:0 0 0 0 color-mix(in srgb,var(--bui-good) 0%,transparent);filter:brightness(1); }
  45% { box-shadow:0 0 0 3px color-mix(in srgb,var(--bui-good) 18%,transparent);filter:brightness(1.08); }
  100% { box-shadow:0 0 0 0 transparent;filter:brightness(1); }
}
@keyframes bui-pause-in {
  from { opacity:0;transform:scale(.975); }
  to { opacity:1;transform:scale(1); }
}
@keyframes bui-panel-in {
  from { opacity:0;transform:translateY(5px); }
  to { opacity:1;transform:none; }
}

@media (prefers-reduced-motion: reduce) {
  #battleHud[data-battle-ui="2.9.9"] .battle-shell,
  #battleHud[data-battle-ui="2.9.9"] .battle-health > article,
  #battleHud[data-battle-ui="2.9.9"] .battle-versus-card,
  #battleHud[data-battle-ui="2.9.9"] .battle-pause-status,
  #battleHud[data-battle-ui="2.9.9"] .battle-tactics,
  #battleHud[data-battle-ui="2.9.9"] .battle-roster-active-arrow,
  #battleHud[data-battle-ui="2.9.9"] :is(.combat-action-button,.combat-item-button),
  #battleHud[data-battle-ui="2.9.9"] :is(.battle-result-outcome,.battle-reward-drop,.battle-result-action) {
    animation:none!important;
    transition:none!important;
  }
}

/* ========================================================================== 
   BATTLE UI V6 — isolated phases + rebuilt fragile components
   One authoritative geometry block. Major phases are mutually exclusive in
   DOM (hidden) and in CSS. Result is stage-level, never a child of live HUD.
   ========================================================================== */

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
  --v6-card-w:320px;
  --v6-card-h:154px;
  --v6-card-top:14px;
  --v6-roster-top:184px;
  --v6-slot:38px;
  --v6-roster-gap:5px;
  --v6-deck-w:min(940px,calc(100% - 92px));
  --v6-deck-h:166px;
  --v6-main-h:118px;
  --v6-energy-h:26px;
  --v6-item-w:166px;
  --v6-util-w:122px;
  --v6-gap:8px;
  --v6-pad:10px;
  --bui-command-w:var(--v6-deck-w);
  --bui-command-h:var(--v6-deck-h);
}

/* Hidden always wins. Old !important display rules may never resurrect a phase. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] [hidden] {
  display:none!important;
}

/* --------------------------------------------------------------------------
   Phase whitelist. These rules are a second safety net behind JS hidden state.
   -------------------------------------------------------------------------- */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-view="loading"] :is(
  #battleIntro,#battleMatchHeader,#battleHealth,#battleRosterPanel,#battleAllies,#battleTargets,
  #battleCommandDeck,#battleDecision,#captureStage,#battlePauseOverlay,#battleTactics,#capturePanel
) { display:none!important; }

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-view="intro"] :is(
  #battleAssetLoader,#battleMatchHeader,#battleHealth,#battleRosterPanel,#battleAllies,#battleTargets,
  #battleCommandDeck,#battleDecision,#captureStage,#battlePauseOverlay,#battleTactics,#capturePanel
) { display:none!important; }

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"]:is([data-view="combat"],[data-view="paused"]) :is(
  #battleAssetLoader,#battleIntro,#battleDecision,#captureStage,#capturePanel
) { display:none!important; }

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-view="capture"] :is(
  #battleAssetLoader,#battleIntro,#battleRosterPanel,#battleDecision,#battleLiveControls,#battlePauseOverlay,#battleTactics
) { display:none!important; }

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-view="resolving"] :is(
  #battleAssetLoader,#battleIntro,#battleMatchHeader,#battleHealth,#battleRosterPanel,#battleAllies,#battleTargets,
  #battleCommandDeck,#battleLiveControls,#battleDecision,#captureStage,#capturePanel,#battlePauseOverlay,#battleTactics
) { display:none!important; }

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"]:is([data-view="decision"],[data-view="result"]) :is(
  #battleAssetLoader,#battleIntro,#battleMatchHeader,#battleHealth,#battleRosterPanel,#battleAllies,#battleTargets,
  #battleCommandDeck,#battleLiveControls,#captureStage,#capturePanel,#battlePauseOverlay,#battleTactics
) { display:none!important; }

body.is-battling #interactionCard { display:none!important; }

/* --------------------------------------------------------------------------
   Loader — arena reveal, no modal card. The battle opens instead of showing
   another white window. One emblem + copy + two lightweight shutters.
   -------------------------------------------------------------------------- */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleAssetLoader {
  position:absolute!important;
  z-index:54!important;
  inset:0!important;
  width:auto!important;
  height:auto!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  transform:none!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:hidden!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
  pointer-events:none!important;
  isolation:isolate!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleAssetLoader::before,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleAssetLoader::after {
  content:''!important;
  position:absolute!important;
  z-index:-1!important;
  top:0!important;
  bottom:0!important;
  width:50.5%!important;
  display:block!important;
  opacity:.18!important;
  background:linear-gradient(90deg,color-mix(in srgb,var(--bui-accent) 18%,transparent),transparent 72%)!important;
  border:0!important;
  box-shadow:none!important;
  transform:translateX(0)!important;
  transition:transform .22s cubic-bezier(.3,.8,.2,1),opacity .18s ease!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleAssetLoader::before {
  left:0!important;
  clip-path:polygon(0 0,100% 0,88% 100%,0 100%)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleAssetLoader::after {
  right:0!important;
  background:linear-gradient(270deg,color-mix(in srgb,var(--bui-accent) 18%,transparent),transparent 72%)!important;
  clip-path:polygon(12% 0,100% 0,100% 100%,0 100%)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleAssetLoader.is-opening::before {
  transform:translateX(-104%)!important;
  opacity:0!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleAssetLoader.is-opening::after {
  transform:translateX(104%)!important;
  opacity:0!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-loader-emblem {
  position:absolute!important;
  left:50%!important;
  top:calc(50% - 34px)!important;
  width:62px!important;
  height:62px!important;
  display:grid!important;
  place-items:center!important;
  transform:translate(-50%,-50%)!important;
  border-radius:50%!important;
  color:var(--bui-accent)!important;
  background:conic-gradient(var(--bui-accent) var(--battle-load-progress,0deg),color-mix(in srgb,var(--bui-line) 70%,transparent) 0)!important;
  box-shadow:0 8px 20px rgba(12,91,130,.16)!important;
  animation:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-loader-emblem::before {
  content:''!important;
  position:absolute!important;
  inset:4px!important;
  border-radius:50%!important;
  background:color-mix(in srgb,var(--bui-surface-raised) 96%,transparent)!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--bui-line) 76%,transparent)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-loader-emblem svg {
  position:relative!important;
  z-index:1!important;
  width:33px!important;
  height:33px!important;
  animation:v13-clean-loader-core 1.35s ease-in-out infinite!important;
}
@keyframes v13-clean-loader-core {
  0%,100% { transform:scale(.97);opacity:.82; }
  50% { transform:scale(1);opacity:1; }
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleAssetLoader.is-opening .battle-loader-emblem {
  animation:none!important;
  transform:translate(-50%,-50%) scale(1.06)!important;
  opacity:0!important;
  transition:transform .2s ease,opacity .18s ease!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleAssetLoader.is-opening .battle-loader-emblem svg {
  animation:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-loader-copy {
  position:absolute!important;
  left:50%!important;
  top:calc(50% + 16px)!important;
  width:min(280px,70%)!important;
  display:grid!important;
  justify-items:center!important;
  gap:4px!important;
  transform:translateX(-50%)!important;
  text-align:center!important;
  text-shadow:0 1px 2px rgba(255,255,255,.55)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-loader-copy small {
  color:var(--bui-accent)!important;font-size:9px!important;font-weight:900!important;letter-spacing:.12em!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-loader-copy b {
  color:var(--bui-text)!important;font-size:14px!important;font-weight:850!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-loader-copy strong {
  color:var(--bui-muted)!important;font-size:8px!important;font-weight:800!important;letter-spacing:.05em!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-load-track {
  width:128px!important;height:3px!important;margin:5px 0 2px!important;overflow:hidden!important;border-radius:999px!important;
  background:color-mix(in srgb,var(--bui-track) 76%,transparent)!important;box-shadow:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-load-track > em {
  height:100%!important;border-radius:inherit!important;background:var(--bui-accent)!important;box-shadow:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleAssetLoader.is-opening .battle-loader-copy {
  opacity:0!important;
  transform:translateX(-50%) translateY(-4px)!important;
  transition:opacity .16s ease,transform .18s ease!important;
}

/* --------------------------------------------------------------------------
   Encounter beat — no modal card. Arena actors remain left/right while one
   compact centered label announces the fight and disappears.
   -------------------------------------------------------------------------- */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleIntro {
  position:absolute!important;
  z-index:49!important;
  inset:0!important;
  width:auto!important;
  min-width:0!important;
  height:auto!important;
  min-height:0!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  transform:none!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:visible!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
  pointer-events:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleIntro::before,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleIntro::after {
  content:none!important;
  display:none!important;
}
/* Portraits already exist as the real arena actors; duplicated intro portraits
   only made the entrance feel like another window. Keep DOM hooks hidden. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleIntro .battle-intro-fighter {
  display:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleIntro .battle-intro-copy {
  min-width:210px!important;
  max-width:min(360px,70%)!important;
  padding:10px 18px 11px!important;
  display:grid!important;
  justify-items:center!important;
  gap:3px!important;
  border:1px solid color-mix(in srgb,var(--bui-accent) 28%,var(--bui-line))!important;
  border-radius:16px!important;
  background:color-mix(in srgb,var(--bui-surface-raised) 86%,transparent)!important;
  color:var(--bui-text)!important;
  box-shadow:0 8px 18px color-mix(in srgb,var(--bui-shadow) 30%,transparent)!important;
  text-align:center!important;
  animation:v13-base-intro-beat .58s cubic-bezier(.2,.8,.2,1) both!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleIntro .battle-intro-copy > small {
  color:var(--bui-accent)!important;
  font-size:8px!important;
  font-weight:900!important;
  letter-spacing:.13em!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleIntro .battle-intro-copy > strong {
  color:var(--bui-text)!important;
  font-size:21px!important;
  font-weight:900!important;
  line-height:1!important;
  letter-spacing:.03em!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleIntro .battle-intro-copy > em {
  max-width:100%!important;
  overflow:hidden!important;
  color:var(--bui-muted)!important;
  font-size:9px!important;
  font-style:normal!important;
  font-weight:750!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
@keyframes v13-base-intro-beat {
  0% { opacity:0; transform:translateY(6px) scale(.97); }
  18%,70% { opacity:1; transform:none; }
  100% { opacity:0; transform:translateY(-3px) scale(.99); }
}
/* The old foreground matchup card remains retired. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleMatchHeader {
  display:none!important;
}
@media (max-width: 900px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleIntro .battle-intro-copy {
    min-width:180px!important;
    max-width:calc(100% - 88px)!important;
    padding:9px 14px 10px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleIntro .battle-intro-copy > strong { font-size:18px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleIntro .battle-intro-copy > em { font-size:8px!important; }
}

/* --------------------------------------------------------------------------
   Fighter cards — one shared grid, explicit player/enemy secondary resource.
   -------------------------------------------------------------------------- */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth {
  position:absolute!important;inset:0!important;z-index:33!important;display:block!important;pointer-events:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article {
  position:absolute!important;
  top:var(--v6-card-top)!important;
  width:var(--v6-card-w)!important;
  height:var(--v6-card-h)!important;
  min-height:0!important;
  max-height:var(--v6-card-h)!important;
  padding:11px 12px!important;
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:70px minmax(0,1fr)!important;
  grid-template-rows:34px 28px 23px 32px!important;
  column-gap:10px!important;
  row-gap:3px!important;
  align-items:center!important;
  border:1px solid var(--bui-line)!important;
  border-radius:18px!important;
  background:linear-gradient(155deg,var(--bui-surface-raised),var(--bui-surface))!important;
  color:var(--bui-text)!important;
  box-shadow:0 9px 22px color-mix(in srgb,var(--bui-shadow) 52%,transparent),inset 0 1px rgba(255,255,255,.12)!important;
  overflow:hidden!important;
  filter:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .ally-health { left:14px!important;right:auto!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .enemy-health { right:14px!important;left:auto!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait {
  grid-column:1!important;grid-row:1/4!important;width:64px!important;height:64px!important;align-self:start!important;
  border:1px solid var(--bui-line-strong)!important;border-radius:16px!important;background:var(--bui-surface-soft)!important;
  box-shadow:inset 0 1px rgba(255,255,255,.18)!important;overflow:hidden!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art > * { width:56px!important;height:56px!important;max-width:56px!important;max-height:56px!important;object-fit:contain!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity {
  grid-column:2!important;grid-row:1!important;min-width:0!important;display:grid!important;grid-template-rows:21px 15px!important;gap:2px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header { display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;min-width:0!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > b { min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;color:var(--bui-text)!important;font-size:18px!important;font-weight:850!important;line-height:1!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > em { flex:none!important;min-width:46px!important;height:20px!important;padding:0 7px!important;display:grid!important;place-items:center!important;border:1px solid var(--bui-line)!important;border-radius:7px!important;background:var(--bui-surface-soft)!important;color:var(--bui-text)!important;font-size:9px!important;font-style:normal!important;font-weight:800!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-types { min-width:0!important;display:flex!important;align-items:center!important;gap:4px!important;overflow:hidden!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-types .pokemon-type-badge { height:15px!important;min-height:15px!important;padding:0 5px!important;gap:3px!important;border-radius:999px!important;box-shadow:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-types .pokemon-type-badge img { width:9px!important;height:9px!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-types .pokemon-type-badge b { font-size:7px!important;font-weight:800!important; }

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > .battle-vital,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > .battle-exp {
  grid-column:2!important;min-width:0!important;display:grid!important;grid-template-rows:12px 11px!important;grid-template-columns:1fr!important;gap:4px!important;align-items:center!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > .battle-vital-hp { grid-row:2!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .ally-health > .battle-exp { grid-row:3!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .enemy-health > .battle-energy { grid-row:3!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span {
  min-width:0!important;display:grid!important;grid-template-columns:12px minmax(0,1fr) auto!important;align-items:center!important;gap:4px!important;color:var(--bui-muted)!important;font-size:8px!important;font-weight:800!important;line-height:1!important;letter-spacing:.03em!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span :is(i,svg) { width:11px!important;height:11px!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span > :is(strong,small) { color:var(--bui-text)!important;font-size:9px!important;font-weight:850!important;white-space:nowrap!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > .battle-vital-hp > span > :is(i,svg,b) { color:var(--bui-good)!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .ally-health > .battle-exp > span > :is(i,svg,b) { color:#9d7cf6!important; }

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-hp-bar,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-energy > i,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-exp > i {
  position:relative!important;width:100%!important;overflow:hidden!important;border:1px solid color-mix(in srgb,var(--bui-line) 70%,transparent)!important;border-radius:999px!important;background:var(--bui-track)!important;box-shadow:inset 0 1px 2px rgba(0,0,0,.12)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-hp-bar { height:11px!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-energy > i { height:8px!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-exp > i { height:7px!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-hp-bar > em { height:100%!important;display:block!important;border-radius:inherit!important;background:linear-gradient(90deg,#30bd6a,#55da7d 58%,#98efad)!important;box-shadow:none!important;transition:width .24s ease!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-energy > i > em { height:100%!important;display:block!important;border-radius:inherit!important;background:linear-gradient(90deg,#279bd1,#4ecdec)!important;box-shadow:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-exp > i > em { height:100%!important;display:block!important;border-radius:inherit!important;background:linear-gradient(90deg,#8d71ef,#c38cff)!important;box-shadow:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-hp-bar > strong {
  position:absolute!important;left:0!important;top:0!important;bottom:0!important;height:100%!important;border-radius:inherit!important;
  background:repeating-linear-gradient(135deg,rgba(128,224,255,.9) 0 7px,rgba(181,240,255,.94) 7px 14px)!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.24)!important;opacity:.88!important;
}

/* Player top energy was removed from DOM. It must never reappear via legacy rules. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .ally-health > .battle-energy { display:none!important; }

/* One-line status strip. Status duration uses one tiny bottom progress line. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area {
  grid-column:1/-1!important;grid-row:4!important;height:30px!important;min-height:30px!important;padding:3px 6px!important;
  display:grid!important;grid-template-columns:58px minmax(0,1fr)!important;align-items:center!important;gap:6px!important;
  overflow:hidden!important;border:1px solid var(--bui-line)!important;border-radius:10px!important;background:var(--bui-surface-soft)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area > small { display:flex!important;align-items:center!important;gap:4px!important;color:var(--bui-muted)!important;font-size:8px!important;font-weight:800!important;letter-spacing:.06em!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area > small > i { width:6px!important;height:6px!important;border-radius:50%!important;background:var(--bui-accent)!important;box-shadow:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-statuses { min-width:0!important;height:24px!important;display:flex!important;align-items:center!important;gap:4px!important;overflow:hidden!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip {
  position:relative!important;flex:0 1 auto!important;max-width:138px!important;height:22px!important;min-height:22px!important;padding:2px 6px 3px!important;
  display:flex!important;align-items:center!important;gap:5px!important;overflow:hidden!important;border:1px solid var(--bui-line)!important;border-radius:8px!important;
  background:color-mix(in srgb,var(--status-color,var(--bui-accent)) 8%,var(--bui-card))!important;color:var(--status-color,var(--bui-text))!important;box-shadow:none!important;filter:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip::before { content:none!important;display:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip::after {
  content:''!important;position:absolute!important;left:0!important;bottom:0!important;width:calc(var(--status-ratio,1) * 100%)!important;height:2px!important;border-radius:0 999px 999px 0!important;background:currentColor!important;opacity:.48!important;pointer-events:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip:is(.is-buff,.is-debuff) { border-color:color-mix(in srgb,var(--status-color,currentColor) 34%,var(--bui-line))!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip.is-shield { --status-color:#2aa9c8;color:var(--status-color)!important;border-color:color-mix(in srgb,var(--status-color) 36%,var(--bui-line))!important;background:color-mix(in srgb,var(--status-color) 9%,var(--bui-card))!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-icon { flex:none!important;width:15px!important;height:15px!important;display:grid!important;place-items:center!important;border-radius:50%!important;background:color-mix(in srgb,currentColor 10%,transparent)!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-icon svg { width:13px!important;height:13px!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-copy { min-width:0!important;display:flex!important;align-items:center!important;gap:5px!important;white-space:nowrap!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-copy > b { min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;color:var(--bui-text)!important;font-size:9px!important;font-weight:800!important;line-height:1!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-copy > small { flex:none!important;color:var(--bui-muted)!important;font-size:8px!important;font-weight:750!important;line-height:1!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-empty { display:flex!important;align-items:center!important;gap:5px!important;color:var(--bui-muted)!important;font-size:9px!important;font-weight:750!important;white-space:nowrap!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-empty > i { width:12px!important;height:12px!important;display:grid!important;place-items:center!important;background:transparent!important;box-shadow:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-more { flex:none!important;height:20px!important;min-width:24px!important;padding:0 5px!important;display:grid!important;place-items:center!important;border:1px solid var(--bui-line)!important;border-radius:7px!important;background:var(--bui-card)!important;color:var(--bui-muted)!important;font-size:8px!important;font-weight:850!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article.is-shield-pulse .battle-hp-bar > strong { animation:v7-shield-charge .22s ease-out both!important; }
@keyframes v7-shield-charge { 0% { opacity:.35;filter:brightness(1); } 45% { opacity:1;filter:brightness(1.35); } 100% { opacity:.82;filter:brightness(1); } }

/* --------------------------------------------------------------------------
   Roster — six floating slots, no stretched white capsule.
   -------------------------------------------------------------------------- */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel {
  position:absolute!important;z-index:36!important;left:18px!important;right:auto!important;top:var(--v6-roster-top)!important;bottom:auto!important;
  width:42px!important;min-width:42px!important;max-width:42px!important;height:auto!important;min-height:0!important;max-height:none!important;
  padding:0!important;display:grid!important;grid-template-rows:18px auto!important;gap:5px!important;align-content:start!important;
  transform:none!important;overflow:visible!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;filter:none!important;
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel > header { width:42px!important;height:18px!important;display:block!important;overflow:visible!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel > header span,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel > p { display:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSwitchCooldown { width:42px!important;height:18px!important;display:grid!important;place-items:center!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;border:1px solid color-mix(in srgb,var(--bui-good) 40%,var(--bui-line))!important;border-radius:8px!important;background:color-mix(in srgb,var(--bui-good) 8%,var(--bui-surface-raised))!important;color:var(--bui-good)!important;font-size:7px!important;font-style:normal!important;font-weight:850!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRoster {
  width:42px!important;height:auto!important;display:grid!important;grid-template-columns:42px!important;grid-auto-rows:var(--v6-slot)!important;gap:var(--v6-roster-gap)!important;align-content:start!important;overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot {
  position:relative!important;width:var(--v6-slot)!important;height:var(--v6-slot)!important;min-width:var(--v6-slot)!important;min-height:var(--v6-slot)!important;
  margin:0 auto!important;padding:2px!important;display:grid!important;place-items:center!important;overflow:visible!important;border:1px solid var(--bui-line)!important;border-radius:50%!important;
  background:var(--bui-surface-raised)!important;box-shadow:0 2px 6px color-mix(in srgb,var(--bui-shadow) 34%,transparent),inset 0 1px rgba(255,255,255,.15)!important;transform:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-empty { opacity:.62!important;background:var(--bui-surface-soft)!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-active { opacity:1!important;border-color:var(--bui-accent)!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--bui-accent) 16%,transparent),inset 0 1px rgba(255,255,255,.18)!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-portrait,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-empty > .battle-roster-empty { width:32px!important;height:32px!important;display:grid!important;place-items:center!important;object-fit:contain!important;object-position:center!important;transform:none!important;margin:0!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > span,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > strong { display:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > kbd { position:absolute!important;right:-3px!important;top:-4px!important;min-width:17px!important;height:17px!important;padding:0 3px!important;display:grid!important;place-items:center!important;border:1px solid var(--bui-line)!important;border-radius:7px!important;background:#10242d!important;color:#fff!important;font-size:7px!important;font-weight:850!important;box-shadow:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-active-arrow { position:absolute!important;z-index:5!important;left:-15px!important;top:50%!important;width:16px!important;height:16px!important;display:grid!important;place-items:center!important;color:var(--bui-accent)!important;opacity:0!important;transform:translateY(-50%) scale(.88)!important;filter:none!important;pointer-events:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-active > .battle-roster-active-arrow { opacity:1!important;transform:translateY(-50%) scale(1)!important; }

/* --------------------------------------------------------------------------
   Command deck — one surface. Energy belongs to skills column only.
   -------------------------------------------------------------------------- */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandDeck {
  position:absolute!important;z-index:42!important;left:50%!important;right:auto!important;bottom:12px!important;top:auto!important;
  width:var(--v6-deck-w)!important;min-width:0!important;max-width:var(--v6-deck-w)!important;height:var(--v6-deck-h)!important;min-height:0!important;max-height:var(--v6-deck-h)!important;
  padding:var(--v6-pad)!important;box-sizing:border-box!important;transform:translateX(-50%)!important;overflow:visible!important;
  border:1px solid var(--bui-line)!important;border-radius:20px!important;background:linear-gradient(160deg,var(--bui-surface-raised),var(--bui-surface))!important;
  box-shadow:0 10px 24px color-mix(in srgb,var(--bui-shadow) 48%,transparent),inset 0 1px rgba(255,255,255,.12)!important;
  filter:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandDeck::before,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandDeck::after { content:none!important;display:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls {
  width:100%!important;height:100%!important;display:grid!important;grid-template-rows:var(--v6-main-h) var(--v6-energy-h)!important;gap:6px!important;overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
  width:100%!important;height:var(--v6-main-h)!important;display:grid!important;grid-template-columns:minmax(360px,1fr) var(--v6-item-w) var(--v6-util-w)!important;grid-template-rows:1fr!important;gap:var(--v6-gap)!important;align-items:stretch!important;overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] :is(.combat-skills-panel,.combat-items-panel,.combat-utility-panel) { min-width:0!important;min-height:0!important;height:100%!important;overflow:visible!important;border:0!important;background:transparent!important;box-shadow:none!important;filter:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel { padding-left:8px!important;border-left:1px solid var(--bui-line)!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel { width:var(--v6-util-w)!important;padding-left:8px!important;border-left:1px solid var(--bui-line)!important;align-self:stretch!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions { width:100%!important;height:100%!important;padding-top:18px!important;box-sizing:border-box!important;display:grid!important;grid-template-columns:1fr!important;grid-template-rows:repeat(3,31px)!important;align-content:start!important;gap:5px!important;background:transparent!important;box-shadow:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #cancelBattle { width:100%!important;height:31px!important;min-height:31px!important;margin:0!important;padding:0 8px!important;display:grid!important;grid-template-columns:16px minmax(0,1fr)!important;align-items:center!important;gap:6px!important;overflow:hidden!important;border-radius:11px!important;box-shadow:none!important;filter:none!important;transform:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > :is(i,svg) { width:16px!important;height:16px!important;color:currentColor!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > b { overflow:visible!important;text-overflow:clip!important;white-space:nowrap!important;font-size:9px!important;font-weight:850!important; }

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row {
  width:100%!important;height:var(--v6-energy-h)!important;min-height:var(--v6-energy-h)!important;padding:0!important;display:grid!important;
  grid-template-columns:minmax(360px,1fr) var(--v6-item-w) var(--v6-util-w)!important;gap:var(--v6-gap)!important;align-items:center!important;
  border:0!important;background:transparent!important;box-shadow:none!important;overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row::before,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row::after { content:none!important;display:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy {
  grid-column:1!important;width:100%!important;max-width:none!important;height:var(--v6-energy-h)!important;margin:0!important;padding:0 4px!important;box-sizing:border-box!important;
  display:grid!important;grid-template-columns:154px minmax(0,1fr)!important;align-items:center!important;gap:8px!important;border:0!important;background:transparent!important;box-shadow:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy > span { min-width:0!important;display:grid!important;grid-template-columns:20px auto 1fr!important;align-items:center!important;gap:5px!important;color:var(--bui-text)!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy > span > :is(i,svg) { width:20px!important;height:20px!important;color:var(--bui-accent)!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy > span :is(small,b) { font-size:9px!important;font-weight:850!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandEnergyTrack { position:relative!important;width:100%!important;height:8px!important;overflow:hidden!important;border:1px solid color-mix(in srgb,var(--bui-accent) 24%,var(--bui-line))!important;border-radius:999px!important;background:var(--bui-track)!important;box-shadow:inset 0 1px 2px rgba(0,0,0,.12)!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandEnergyBar { height:100%!important;border-radius:inherit!important;background:linear-gradient(90deg,#28a9dc,#35c3eb)!important;box-shadow:none!important;transition:width .22s ease!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandEnergyBar::after { content:''!important;float:right!important;width:4px!important;height:100%!important;border-radius:999px!important;background:#b8f3ff!important;opacity:.9!important;box-shadow:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy-current { display:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLog { display:none!important; }

/* Capture keeps the command surface but never restores live controls. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-view="capture"] #battleCommandDeck { height:122px!important;max-height:122px!important; }

/* --------------------------------------------------------------------------
   V7 Result — terminal-only stage card. Auto-sized on desktop, no live HUD.
   -------------------------------------------------------------------------- */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision.battle-result-layer {
  position:absolute!important;z-index:58!important;inset:0!important;width:auto!important;height:auto!important;margin:0!important;padding:28px!important;
  display:grid!important;place-items:center!important;transform:none!important;overflow:visible!important;border:0!important;background:transparent!important;box-shadow:none!important;filter:none!important;
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important;pointer-events:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-card {
  width:min(560px,calc(100% - 24px))!important;height:auto!important;min-height:0!important;max-height:calc(100% - 24px)!important;padding:18px!important;box-sizing:border-box!important;
  display:grid!important;grid-template-rows:auto auto auto!important;gap:14px!important;align-content:start!important;overflow:visible!important;
  border:1px solid var(--bui-line)!important;border-radius:20px!important;background:linear-gradient(160deg,var(--bui-surface-raised),var(--bui-surface))!important;
  color:var(--bui-text)!important;box-shadow:0 16px 36px color-mix(in srgb,var(--bui-shadow) 58%,transparent),inset 0 1px rgba(255,255,255,.12)!important;
  pointer-events:auto!important;filter:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-view="result"] .battle-result-card { animation:v7-result-card-in .24s ease-out both!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-view="decision"] .battle-result-card { animation:v7-result-card-in .2s ease-out both!important; }
@keyframes v7-result-card-in { from { opacity:0;transform:translateY(8px) scale(.988); } to { opacity:1;transform:none; } }

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-outcome {
  width:100%!important;display:grid!important;grid-template-columns:64px minmax(0,1fr)!important;align-items:center!important;gap:16px!important;padding:0 0 14px!important;
  border-bottom:1px solid var(--bui-line)!important;filter:none!important;opacity:1!important;transform:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-emblem {
  width:68px!important;height:68px!important;display:grid!important;place-items:center!important;border:0!important;
  border-radius:0!important;background:transparent!important;box-shadow:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-emblem > svg,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-emblem .combat-result-art { width:68px!important;height:68px!important;color:var(--outcome-accent,var(--bui-danger))!important;filter:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-copy { min-width:0!important;display:grid!important;gap:4px!important;margin:0!important;transform:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-copy > small { margin:0!important;color:var(--outcome-accent,var(--bui-accent))!important;font-size:9px!important;font-weight:850!important;letter-spacing:.11em!important;line-height:1!important;text-shadow:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-copy > b { margin:0!important;color:var(--bui-text)!important;font-size:36px!important;font-weight:900!important;line-height:1!important;letter-spacing:0!important;text-shadow:none!important;white-space:normal!important;overflow:visible!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-copy > em { margin:0!important;max-width:none!important;color:var(--bui-muted)!important;font-size:10px!important;font-style:normal!important;font-weight:700!important;line-height:1.3!important;white-space:normal!important;text-overflow:unset!important;text-shadow:none!important; }

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-drops { min-height:0!important;display:grid!important;grid-template-rows:auto auto!important;gap:8px!important;overflow:visible!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-drops > header { min-height:18px!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;border:0!important;background:transparent!important;color:var(--outcome-accent,var(--bui-accent))!important;font-size:9px!important;font-weight:850!important;letter-spacing:.1em!important;text-shadow:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-reward-list,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-reward-list[data-mode="losses"] {
  width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;padding:0!important;display:grid!important;grid-template-columns:1fr!important;align-content:start!important;gap:7px!important;overflow:visible!important;scrollbar-width:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-reward-list::-webkit-scrollbar { display:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop {
  width:100%!important;min-width:0!important;min-height:54px!important;padding:8px 11px!important;box-sizing:border-box!important;display:grid!important;grid-template-columns:38px minmax(0,1fr) auto!important;grid-template-rows:1fr!important;align-items:center!important;gap:9px!important;
  border:1px solid var(--bui-line)!important;border-radius:12px!important;background:var(--bui-surface-soft)!important;box-shadow:none!important;filter:none!important;transform:translateY(5px)!important;opacity:0!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop.is-visible { opacity:1!important;transform:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop::before { content:none!important;display:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop-art { grid-column:1!important;grid-row:1!important;width:36px!important;height:36px!important;padding:0!important;filter:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > span { grid-column:2!important;grid-row:1!important;min-width:0!important;display:grid!important;gap:2px!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > span > b { color:var(--bui-text)!important;font-size:10px!important;font-weight:850!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;text-shadow:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > span > small { color:var(--bui-muted)!important;font-size:8px!important;font-weight:700!important;white-space:normal!important;text-shadow:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > strong { grid-column:3!important;grid-row:1!important;align-self:center!important;justify-self:end!important;color:var(--outcome-accent,var(--bui-accent))!important;font-size:20px!important;font-weight:900!important;line-height:1!important;text-shadow:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop.is-loss > strong { color:var(--bui-danger)!important; }

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-action { width:min(360px,100%)!important;height:50px!important;min-height:50px!important;margin-top:2px!important;justify-self:center!important;padding:0 15px!important;display:grid!important;grid-template-columns:minmax(0,1fr) 24px!important;align-items:center!important;gap:8px!important;border-radius:14px!important;box-shadow:none!important;transform:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-action > span { display:grid!important;gap:1px!important;text-align:left!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-action b { font-size:10px!important;font-weight:850!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-action small { font-size:8px!important;white-space:normal!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-action > i,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-action > i > svg { width:22px!important;height:22px!important; }

/* Empty roster slots remain readable without turning the rail into a white capsule. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-empty { opacity:.62!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-active { opacity:1!important; }

@media (max-height:620px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision.battle-result-layer { padding:12px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision.has-many-results .battle-result-card { max-height:calc(100% - 12px)!important;overflow:auto!important;overscroll-behavior:contain!important; }
}

/* --------------------------------------------------------------------------
   Responsive containment.
   -------------------------------------------------------------------------- */
@media (max-width:1100px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --v6-card-w:294px;--v6-card-h:146px;--v6-roster-top:174px;--v6-deck-w:calc(100% - 42px);--v6-item-w:154px;--v6-util-w:116px;--v6-main-h:114px;--v6-deck-h:162px;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-main-row,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row { grid-template-columns:minmax(320px,1fr) var(--v6-item-w) var(--v6-util-w)!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article { grid-template-columns:64px minmax(0,1fr)!important;grid-template-rows:32px 27px 22px 29px!important;padding:10px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait { width:58px!important;height:58px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art > * { width:52px!important;height:52px!important; }
}

@media (max-width:900px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --v6-card-w:calc(50% - 16px);--v6-card-h:134px;--v6-deck-w:calc(100% - 18px);--v6-item-w:148px;--v6-util-w:112px;--v6-main-h:110px;--v6-deck-h:158px;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .ally-health { left:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .enemy-health { right:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article { padding:8px!important;grid-template-columns:54px minmax(0,1fr)!important;grid-template-rows:32px 27px 22px 29px!important;column-gap:7px!important;row-gap:2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait { width:48px!important;height:48px!important;border-radius:13px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art > * { width:43px!important;height:43px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > b { font-size:14px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area { height:27px!important;min-height:27px!important;grid-template-columns:46px minmax(0,1fr)!important;padding:2px 4px!important;gap:4px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area > small { font-size:7px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip { max-width:108px!important;height:20px!important;min-height:20px!important;padding:1px 4px 2px!important;gap:3px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-icon { width:13px!important;height:13px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-icon svg { width:11px!important;height:11px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-copy > b { font-size:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-copy > small { font-size:7px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel { left:50%!important;top:auto!important;bottom:calc(var(--v6-deck-h) + 18px)!important;width:282px!important;min-width:282px!important;max-width:calc(100% - 20px)!important;height:42px!important;padding:0!important;display:block!important;transform:translateX(-50%)!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel > header { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRoster { width:282px!important;display:grid!important;grid-template-columns:repeat(6,42px)!important;grid-template-rows:42px!important;gap:6px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-active-arrow { left:50%!important;top:-14px!important;transform:translateX(-50%) rotate(90deg) scale(.88)!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-active > .battle-roster-active-arrow { transform:translateX(-50%) rotate(90deg) scale(1)!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-main-row,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row { grid-template-columns:minmax(0,1fr) var(--v6-item-w) var(--v6-util-w)!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy { grid-template-columns:138px minmax(0,1fr)!important; }
}

@media (max-width:760px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --v6-card-w:calc(50% - 9px);--v6-card-h:124px;--v6-deck-w:calc(100% - 12px);--v6-deck-h:184px;--v6-main-h:136px;--v6-item-w:138px;--v6-util-w:auto;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleMatchHeader { top:8px!important;width:190px!important;min-height:56px!important;padding:6px 9px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article { top:6px!important;padding:6px!important;grid-template-columns:46px minmax(0,1fr)!important;grid-template-rows:29px 25px 20px 27px!important;column-gap:5px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait { width:40px!important;height:40px!important;border-radius:11px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art > * { width:36px!important;height:36px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > b { font-size:12px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-types .pokemon-type-badge { height:13px!important;min-height:13px!important;padding:0 3px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area { height:25px!important;min-height:25px!important;grid-template-columns:38px minmax(0,1fr)!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area > small { font-size:6px!important;letter-spacing:.02em!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip:nth-child(n+2) { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-main-row { grid-template-columns:minmax(0,1fr) var(--v6-item-w)!important;grid-template-rows:94px 36px!important;gap:6px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-panel { grid-column:1!important;grid-row:1!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel { grid-column:2!important;grid-row:1!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel { grid-column:1/-1!important;grid-row:2!important;width:100%!important;padding:0!important;border-left:0!important;border-top:1px solid var(--bui-line)!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions { grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:32px!important;align-content:end!important;gap:5px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #cancelBattle { height:32px!important;min-height:32px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row { grid-template-columns:minmax(0,1fr) var(--v6-item-w)!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy { grid-column:1!important;grid-template-columns:118px minmax(0,1fr)!important;padding:0 2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel { bottom:calc(var(--v6-deck-h) + 10px)!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-card { width:min(470px,94%)!important;padding:14px!important;grid-template-rows:auto minmax(0,1fr) 46px!important;gap:9px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-copy > b { font-size:28px!important; }
}

@media (max-height:620px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] { --v6-deck-h:150px;--v6-main-h:104px; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article { top:6px!important;height:128px!important;max-height:128px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel { bottom:calc(var(--v6-deck-h) + 8px)!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision.battle-result-layer { padding:36px 16px 24px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-card { max-height:calc(100% - 12px)!important; }
}

@media (prefers-reduced-motion:reduce) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-loader-emblem,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-loader-emblem svg,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-card { animation:none!important;transition:none!important;opacity:1!important;transform:none!important; }
}

/* ========================================================================== 
   V8 HARD-RESET / FIRST-FRAME SAFETY
   A hidden battle component must stay out of layout even before body.is-battling
   is applied. This prevents stale result/tooltip/roster surfaces from flashing
   during the first frame of a new battle session.
   ========================================================================== */
#battleHud[data-battle-ui="2.9.9"] [hidden] {
  display:none!important;
}

/* Tooltip is a floating layer only. It can never become an extra row under Q/W/E/R. */
#battleHud[data-battle-ui="2.9.9"] #battleTooltipLayer {
  position:absolute!important;
  inset:0!important;
  z-index:68!important;
  width:100%!important;
  height:100%!important;
  overflow:visible!important;
  pointer-events:none!important;
}
#battleHud[data-battle-ui="2.9.9"] #battleSkillPreview {
  position:absolute!important;
  left:0!important;
  top:0!important;
  right:auto!important;
  bottom:auto!important;
  margin:0!important;
  float:none!important;
  pointer-events:none!important;
}
#battleHud[data-battle-ui="2.9.9"] #battleSkillPreview[hidden] {
  display:none!important;
}

/* Roster art owns one centered 32px well; old item/sprite transforms may not leak in. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot {
  grid-template-columns:1fr!important;
  grid-template-rows:1fr!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] :is(.battle-roster-portrait,.battle-roster-empty) {
  position:relative!important;
  inset:auto!important;
  width:32px!important;
  height:32px!important;
  min-width:32px!important;
  min-height:32px!important;
  margin:0!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  align-self:center!important;
  justify-self:center!important;
  overflow:hidden!important;
  transform:none!important;
  translate:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] :is(.battle-roster-portrait,.battle-roster-empty) > :is(img,svg,picture,span),
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] :is(.battle-roster-portrait,.battle-roster-empty) > * > :is(img,svg) {
  position:static!important;
  inset:auto!important;
  width:29px!important;
  height:29px!important;
  max-width:29px!important;
  max-height:29px!important;
  margin:0!important;
  object-fit:contain!important;
  object-position:center!important;
  transform:none!important;
  translate:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > kbd {
  top:-4px!important;
  right:-4px!important;
  left:auto!important;
  bottom:auto!important;
  transform:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-active-arrow {
  left:-13px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
}

/* Result header: icon and copy are isolated grid columns, never overlapping. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-outcome {
  position:relative!important;
  inset:auto!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0 0 14px!important;
  display:grid!important;
  grid-template-columns:72px minmax(0,1fr)!important;
  grid-template-rows:auto!important;
  align-items:center!important;
  column-gap:18px!important;
  transform:none!important;
  overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem {
  position:static!important;
  inset:auto!important;
  grid-column:1!important;
  grid-row:1!important;
  width:68px!important;
  height:68px!important;
  min-width:68px!important;
  margin:0!important;
  align-self:center!important;
  justify-self:center!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  transform:none!important;
  translate:none!important;
  overflow:hidden!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem :is(svg,.combat-result-art),
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem .combat-result-art > * {
  position:static!important;
  inset:auto!important;
  width:68px!important;
  height:68px!important;
  margin:0!important;
  transform:none!important;
  translate:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy {
  position:static!important;
  inset:auto!important;
  grid-column:2!important;
  grid-row:1!important;
  width:auto!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  transform:none!important;
  translate:none!important;
  text-indent:0!important;
  overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > :is(small,b,em) {
  position:static!important;
  inset:auto!important;
  margin:0!important;
  transform:none!important;
  translate:none!important;
  text-indent:0!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > b {
  font-size:34px!important;
  line-height:1!important;
  white-space:normal!important;
  overflow:visible!important;
}

/* Standard desktop result content must size to content; two losses never create an admin-like scrollbar. */
@media (min-width:901px) and (min-height:621px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-card {
    width:min(540px,calc(100% - 48px))!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList[data-mode="losses"] {
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
  }
}

/* ========================================================================== 
   V9 — terminal result isolation + skill text geometry
   Fixes the three screenshot regressions: result over live HUD/actors, stale
   tooltip/FX at terminal, and skill title/type rows being clipped by energy.
   ========================================================================== */

/* Terminal views own the arena. Live HUD components are never allowed to
   survive under a result card, even if a legacy selector tries to resurrect
   them with !important. */
#battleHud[data-battle-ui="2.9.9"]:is([data-view="resolving"],[data-view="result"]) :is(
  #battleMatchHeader,#battleHealth,#battleRosterPanel,#battleAllies,#battleTargets,
  #battleCommandDeck,#battleLiveControls,#battlePauseOverlay,#battleTactics,
  #captureStage,#capturePanel,#battleTooltipLayer,#battleHint,#battleLog
) {
  display:none!important;
}
#battleHud[data-battle-ui="2.9.9"][data-view="result"] #battleDecision:not([hidden]) {
  display:grid!important;
}
#battleHud[data-battle-ui="2.9.9"][data-view="resolving"] #battleDecision,
#battleHud[data-battle-ui="2.9.9"][data-view="combat"] #battleDecision,
#battleHud[data-battle-ui="2.9.9"][data-view="paused"] #battleDecision,
#battleHud[data-battle-ui="2.9.9"][data-view="intro"] #battleDecision,
#battleHud[data-battle-ui="2.9.9"][data-view="loading"] #battleDecision {
  display:none!important;
}

/* Tooltip is inspection-only. In terminal phases it cannot remain visible or
   reopen because the mouse happens to still be over a former skill slot. */
#battleHud[data-battle-ui="2.9.9"]:is([data-view="resolving"],[data-view="result"]) #battleSkillPreview,
#battleHud[data-battle-ui="2.9.9"]:is([data-view="resolving"],[data-view="result"]) #battleTooltipLayer {
  display:none!important;
}

/* Result card sizes to content on desktop. The icon and copy use separate
   columns and no transform/negative offsets, so ПОБЕДА/ПОРАЖЕНИЕ cannot slide
   underneath the emblem. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision.battle-result-layer {
  padding:18px!important;
  overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-card {
  width:min(540px,calc(100% - 36px))!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  padding:18px!important;
  grid-template-rows:auto auto auto!important;
  gap:12px!important;
  align-content:start!important;
  overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-outcome {
  position:static!important;
  width:100%!important;
  display:grid!important;
  grid-template-columns:72px minmax(0,1fr)!important;
  align-items:center!important;
  column-gap:18px!important;
  padding:0 0 12px!important;
  margin:0!important;
  transform:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem {
  position:static!important;
  grid-column:1!important;
  width:68px!important;
  height:68px!important;
  min-width:68px!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  transform:none!important;
  translate:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy {
  position:static!important;
  grid-column:2!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  transform:none!important;
  translate:none!important;
  text-indent:0!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > :is(small,b,em) {
  position:static!important;
  inset:auto!important;
  margin:0!important;
  transform:none!important;
  translate:none!important;
  text-indent:0!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > b {
  font-size:34px!important;
  line-height:1!important;
  white-space:normal!important;
  overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-drops {
  gap:7px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList[data-mode="losses"] {
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  gap:9px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision.has-many-results .battle-result-card {
  max-height:calc(100% - 24px)!important;
  overflow:auto!important;
  overscroll-behavior:contain!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-pending {
  width:100%!important;
  min-height:54px!important;
  padding:8px 11px!important;
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:36px minmax(0,1fr)!important;
  align-items:center!important;
  gap:10px!important;
  border:1px solid var(--bui-line)!important;
  border-radius:12px!important;
  background:var(--bui-surface-soft)!important;
  color:var(--bui-text)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-pending > i,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-pending > i > svg {
  width:30px!important;height:30px!important;color:var(--outcome-accent,var(--bui-accent))!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-pending > span {
  min-width:0!important;display:grid!important;gap:2px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-pending b {
  font-size:10px!important;font-weight:850!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-pending small {
  color:var(--bui-muted)!important;font-size:8px!important;font-weight:700!important;
}

/* Result actions only exist after the rows have finished revealing. */
#battleHud[data-battle-ui="2.9.9"] #battleResultAction[hidden] {
  display:none!important;
}

/* Skills: title and tags are now real grid rows rather than absolute labels
   sitting on top of the energy footer. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
  --v6-main-h:128px;
  --v6-deck-h:180px;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-panel {
  grid-template-rows:18px minmax(0,1fr)!important;
  gap:3px!important;
  overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-shell,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills {
  overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button {
  --combat-size:70px;
  position:relative!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  padding:0 3px!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:70px 18px 15px!important;
  align-content:start!important;
  justify-items:center!important;
  row-gap:2px!important;
  overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
  position:relative!important;
  grid-column:1!important;
  grid-row:1!important;
  align-self:start!important;
  justify-self:center!important;
  width:70px!important;
  height:70px!important;
  min-width:70px!important;
  min-height:70px!important;
  margin:0!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-name {
  position:static!important;
  inset:auto!important;
  grid-column:1!important;
  grid-row:2!important;
  width:100%!important;
  height:18px!important;
  min-height:18px!important;
  margin:0!important;
  display:block!important;
  overflow:hidden!important;
  color:var(--bui-text)!important;
  font-size:9px!important;
  font-weight:850!important;
  line-height:18px!important;
  text-align:center!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  transform:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-tags {
  position:static!important;
  inset:auto!important;
  grid-column:1!important;
  grid-row:3!important;
  width:100%!important;
  height:15px!important;
  min-height:15px!important;
  margin:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:3px!important;
  overflow:visible!important;
  transform:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-tag {
  height:15px!important;
  min-height:15px!important;
  padding:0 4px 0 3px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-tag > b {
  font-size:7px!important;
  line-height:1!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-tag > span {
  font-size:8px!important;
  line-height:1!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-cost {
  top:52px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row {
  position:relative!important;
  margin:0!important;
  transform:none!important;
}
#battleHud[data-battle-ui="2.9.9"] #battleHint {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}

@media (max-width:1100px) and (min-width:901px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] { --v6-main-h:124px;--v6-deck-h:176px; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button { --combat-size:66px;grid-template-rows:66px 18px 15px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art { width:66px!important;height:66px!important;min-width:66px!important;min-height:66px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-cost { top:48px!important; }
}
@media (max-width:900px) and (min-width:761px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] { --v6-main-h:120px;--v6-deck-h:172px; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button { --combat-size:62px;grid-template-rows:62px 18px 15px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art { width:62px!important;height:62px!important;min-width:62px!important;min-height:62px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-cost { top:44px!important; }
}
@media (max-width:760px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] { --v6-main-h:142px;--v6-deck-h:190px; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-main-row { grid-template-rows:100px 36px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-panel { grid-template-rows:15px minmax(0,1fr)!important;gap:2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button { --combat-size:54px;grid-template-rows:54px 14px 12px!important;row-gap:1px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art { width:54px!important;height:54px!important;min-width:54px!important;min-height:54px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-name { height:14px!important;min-height:14px!important;font-size:7.5px!important;line-height:14px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-tags { height:12px!important;min-height:12px!important;gap:2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-tag { height:12px!important;min-height:12px!important;padding:0 2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-tag > b { font-size:5.8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-tag > span { font-size:6.5px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-cost { top:38px!important; }
}


/* ========================================================================== 
   V10 — cross-battle result leak / t=0 terminal flash hard stop
   Hidden battle nodes use two IDs so no one-ID legacy selector with !important
   can resurrect a previous Result or live HUD component.
   ========================================================================== */
html body #battleHud[data-battle-ui="2.9.9"] #battleAssetLoader[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #battleIntro[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #battleMatchHeader[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #battleHealth[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #battleAllies[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #battleTargets[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #battleCommandDeck[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #battleDecision[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #battleResultAction[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #battleSkillPreview[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #captureStage[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #capturePanel[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #battlePauseOverlay[hidden],
html body #battleHud[data-battle-ui="2.9.9"] #battleTactics[hidden] {
  display:none!important;
}

/* The first frame of a fresh fight can only be loader/intro. A stale Result
   from the previous battle is prohibited even before all JS render work ends. */
html body #battleHud[data-battle-ui="2.9.9"][data-view="loading"] #battleDecision,
html body #battleHud[data-battle-ui="2.9.9"][data-view="intro"] #battleDecision,
html body #battleHud[data-battle-ui="2.9.9"][data-view="combat"] #battleDecision,
html body #battleHud[data-battle-ui="2.9.9"][data-view="paused"] #battleDecision,
html body #battleHud[data-battle-ui="2.9.9"][data-view="capture"] #battleDecision,
html body #battleHud[data-battle-ui="2.9.9"][data-view="resolving"] #battleDecision {
  display:none!important;
}

html body #battleHud[data-battle-ui="2.9.9"][data-view="result"] #battleCommandDeck,
html body #battleHud[data-battle-ui="2.9.9"][data-view="result"] #battleLiveControls,
html body #battleHud[data-battle-ui="2.9.9"][data-view="result"] #battleRosterPanel,
html body #battleHud[data-battle-ui="2.9.9"][data-view="result"] #battleHealth,
html body #battleHud[data-battle-ui="2.9.9"][data-view="result"] #battleMatchHeader,
html body #battleHud[data-battle-ui="2.9.9"][data-view="result"] #battleTooltipLayer,
html body #battleHud[data-battle-ui="2.9.9"][data-view="result"] #battleAllies,
html body #battleHud[data-battle-ui="2.9.9"][data-view="result"] #battleTargets,
html body #battleHud[data-battle-ui="2.9.9"][data-view="result"] #battleTactics,
html body #battleHud[data-battle-ui="2.9.9"][data-view="result"] #battleHint,
html body #battleHud[data-battle-ui="2.9.9"][data-view="result"] #battleLog {
  display:none!important;
}

/* --------------------------------------------------------------------------
   Stable single-target matchup summary (V13-base continuation).
   Replaces the jumping "ЦЕЛЬ" button only when there is one wild opponent.
   Multi-target/co-op keeps the real interactive target buttons.
   -------------------------------------------------------------------------- */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleTargets.is-matchup-summary {
  position:absolute!important;
  z-index:26!important;
  left:0!important;
  right:0!important;
  top:14px!important;
  width:min(360px,calc(100% - 700px))!important;
  max-width:380px!important;
  min-width:320px!important;
  margin:0 auto!important;
  padding:0!important;
  display:block!important;
  overflow:visible!important;
  transform:none!important;
  pointer-events:none!important;
  scrollbar-width:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleTargets.is-matchup-summary::-webkit-scrollbar { display:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary {
  position:relative!important;
  min-height:52px!important;
  height:58px!important;
  box-sizing:border-box!important;
  padding:15px 12px 7px!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 30px minmax(0,1fr)!important;
  align-items:center!important;
  gap:7px!important;
  border:1px solid color-mix(in srgb,var(--bui-accent) 18%,var(--bui-line))!important;
  border-radius:15px!important;
  background:linear-gradient(160deg,color-mix(in srgb,var(--bui-surface-raised) 98%,transparent),color-mix(in srgb,var(--bui-surface) 96%,transparent))!important;
  color:var(--bui-text)!important;
  box-shadow:0 5px 12px color-mix(in srgb,var(--bui-shadow) 25%,transparent)!important;
  transform:none!important;
  transition:none!important;
  animation:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary > small {
  position:absolute!important;
  left:50%!important;
  top:5px!important;
  transform:translateX(-50%)!important;
  color:var(--bui-accent)!important;
  font-size:7px!important;
  font-weight:900!important;
  letter-spacing:.1em!important;
  white-space:nowrap!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary > span {
  min-width:0!important;
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary > span.is-enemy {
  flex-direction:row-reverse!important;
  text-align:right!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary > span > b {
  min-width:0!important;
  overflow:hidden!important;
  color:var(--bui-text)!important;
  font-size:10px!important;
  font-weight:850!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-portrait {
  width:30px!important;
  height:30px!important;
  min-width:30px!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
  border:1px solid color-mix(in srgb,var(--bui-accent) 25%,var(--bui-line))!important;
  border-radius:50%!important;
  background:var(--bui-surface-soft)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-portrait,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-portrait > * {
  object-fit:contain!important;
  object-position:center!important;
  transform:none!important;
  margin:0!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-arrow {
  width:22px!important;
  height:22px!important;
  display:grid!important;
  place-items:center!important;
  color:var(--bui-accent)!important;
  transform:none!important;
  transition:none!important;
  animation:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-arrow svg {
  width:22px!important;
  height:22px!important;
}
@media (max-width: 900px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleTargets.is-matchup-summary {
    top:10px!important;
    min-width:220px!important;
    max-width:calc(100% - 80px)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary {
    min-height:50px!important;
    padding:15px 10px 7px!important;
    grid-template-columns:minmax(0,1fr) 28px minmax(0,1fr)!important;
    gap:5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-portrait {
    width:26px!important;height:26px!important;min-width:26px!important;border-radius:9px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary > span > b { font-size:9px!important; }
}

/* ========================================================================== 
   CLEAN FIX 03 — phase-safe matchup + keyboard clarity
   ========================================================================== */
/* At compact desktop widths the centre gap between the two fighter cards is
   narrower. Keep the informational matchup compact so it never touches them. */
@media (max-width:1100px) and (min-width:901px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleTargets.is-matchup-summary {
    min-width:230px!important;
    max-width:280px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary {
    min-height:48px!important;
    padding:14px 9px 6px!important;
    grid-template-columns:minmax(0,1fr) 24px minmax(0,1fr)!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-portrait {
    width:25px!important;
    height:25px!important;
    min-width:25px!important;
    border-radius:8px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary > span > b {
    font-size:8px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-arrow,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-arrow svg {
    width:22px!important;
  }
}

/* On tablet/phone the two fighter cards already identify both participants and
   there is no safe centre column. Do not force a third card between them. */
@media (max-width:900px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleTargets.is-matchup-summary {
    display:none!important;
  }
}

/* Keyboard focus should be clear without moving or resizing dense battle UI. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] :is(
  .combat-action-button,
  .combat-item-button,
  .combat-utility-actions > button,
  .battle-roster-slot
):focus-visible {
  outline:2px solid color-mix(in srgb,var(--bui-accent) 78%,#fff 22%)!important;
  outline-offset:2px!important;
  transform:none!important;
}

/* V16 — the inventory loadout is retained without changing the stable combat
   geometry. Empty quick slots use the same circular wells as filled items. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button.is-empty-slot {
  opacity:.72!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button.is-empty-slot > span:first-child {
  border-style:dashed!important;
  border-color:color-mix(in srgb,var(--bui-muted) 42%,var(--bui-line))!important;
  background:var(--bui-surface-soft)!important;
  box-shadow:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-empty-art {
  width:24px!important;
  height:24px!important;
  color:var(--bui-muted)!important;
}

/* ========================================================================== 
   V17 — focused visual polish. This layer intentionally leaves the stable
   skill/item geometry, input mapping and battle phase visibility untouched.
   ========================================================================== */

/* Empty item slots read as loadout sockets, not add buttons. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button.is-empty-slot {
  opacity:.82!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button.is-empty-slot > span:first-child {
  border-style:solid!important;
  border-color:color-mix(in srgb,var(--bui-accent) 18%,var(--bui-line))!important;
  background:
    radial-gradient(circle at 50% 48%,color-mix(in srgb,var(--bui-accent) 10%,transparent) 0 31%,transparent 32%),
    linear-gradient(145deg,color-mix(in srgb,var(--bui-accent) 7%,var(--bui-surface-soft)) 0 51%,var(--bui-surface-soft) 52%)!important;
  box-shadow:inset 0 1px rgba(255,255,255,.2)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-empty-art {
  width:22px!important;
  height:22px!important;
  color:color-mix(in srgb,var(--bui-accent) 34%,var(--bui-muted))!important;
}

/* Subtle card texture over the existing skill art. It never changes the
   circular hit target and stays non-interactive. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
  isolation:isolate!important;
  background-color:color-mix(in srgb,var(--skill-type,#39b7dc) 14%,var(--bui-surface-soft))!important;
  border-color:color-mix(in srgb,var(--skill-type,#39b7dc) 58%,var(--bui-line))!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art::after {
  content:''!important;
  position:absolute!important;
  z-index:3!important;
  inset:0!important;
  border-radius:inherit!important;
  background:
    linear-gradient(132deg,color-mix(in srgb,var(--skill-type,#39b7dc) 15%,transparent) 0 48%,transparent 49%),
    repeating-linear-gradient(60deg,color-mix(in srgb,var(--skill-type,#39b7dc) 9%,transparent) 0 1px,transparent 1px 9px)!important;
  opacity:.55!important;
  pointer-events:none!important;
}

/* Effects are now icon telemetry inside the fighter card, without a third
   labelled panel. The full name and timer remain available to assistive tech. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area {
  height:26px!important;
  min-height:26px!important;
  padding:1px 0!important;
  display:flex!important;
  align-items:center!important;
  gap:0!important;
  overflow:hidden!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-statuses {
  width:100%!important;
  height:24px!important;
  min-width:0!important;
  display:flex!important;
  align-items:center!important;
  gap:5px!important;
  overflow:hidden!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .enemy-health .battle-statuses {
  justify-content:flex-end!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip {
  position:relative!important;
  flex:0 0 24px!important;
  width:24px!important;
  max-width:24px!important;
  height:24px!important;
  min-height:24px!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
  border:1px solid color-mix(in srgb,var(--status-color,currentColor) 34%,var(--bui-line))!important;
  border-radius:8px!important;
  background:
    linear-gradient(135deg,color-mix(in srgb,var(--status-color,currentColor) 15%,var(--bui-card)) 0 52%,color-mix(in srgb,var(--status-color,currentColor) 6%,var(--bui-card)) 53%)!important;
  box-shadow:inset 0 1px rgba(255,255,255,.22)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-icon {
  width:16px!important;
  height:16px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:0!important;
  background:transparent!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-icon svg {
  width:15px!important;
  height:15px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-copy,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-empty {
  display:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-more {
  height:22px!important;
  min-width:22px!important;
  padding:0 4px!important;
  border-radius:8px!important;
  background:color-mix(in srgb,var(--bui-accent) 6%,var(--bui-card))!important;
}

/* Compact, responsive matchup plaque with a real VS glyph. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleTargets.is-matchup-summary {
  top:10px!important;
  width:min(320px,calc(100% - 720px))!important;
  min-width:280px!important;
  max-width:320px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary {
  min-height:50px!important;
  height:50px!important;
  padding:13px 10px 5px!important;
  grid-template-columns:minmax(0,1fr) 24px minmax(0,1fr)!important;
  gap:5px!important;
  border-radius:14px!important;
  background:
    linear-gradient(132deg,color-mix(in srgb,var(--bui-accent) 10%,transparent) 0 51%,transparent 52%),
    repeating-linear-gradient(60deg,color-mix(in srgb,var(--bui-accent) 5%,transparent) 0 1px,transparent 1px 10px),
    linear-gradient(160deg,var(--bui-surface-raised),var(--bui-surface))!important;
  box-shadow:0 4px 10px color-mix(in srgb,var(--bui-shadow) 22%,transparent)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary > small {
  top:4px!important;
  font-size:6.5px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary > span {
  gap:5px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary > span > b {
  font-size:9px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-portrait {
  width:26px!important;
  height:26px!important;
  min-width:26px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-arrow,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-arrow svg {
  width:22px!important;
  height:22px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-arrow {
  color:color-mix(in srgb,var(--bui-accent) 88%,var(--bui-text))!important;
}

/* The result uses the painted outcome atlas and a light thematic surface. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-card {
  background:
    radial-gradient(circle at 10% 8%,color-mix(in srgb,var(--outcome-accent,var(--bui-accent)) 12%,transparent),transparent 35%),
    repeating-linear-gradient(60deg,color-mix(in srgb,var(--outcome-accent,var(--bui-accent)) 4%,transparent) 0 1px,transparent 1px 13px),
    linear-gradient(160deg,var(--bui-surface-raised),color-mix(in srgb,var(--outcome-accent,var(--bui-accent)) 4%,var(--bui-surface)))!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-emblem .battle-outcome-art {
  width:68px!important;
  height:68px!important;
  filter:drop-shadow(0 5px 8px color-mix(in srgb,var(--outcome-accent,var(--bui-danger)) 24%,transparent))!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-action {
  width:min(280px,100%)!important;
  height:46px!important;
  min-height:46px!important;
  padding:0 13px!important;
  border-radius:13px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision[data-outcome="defeat"] .battle-result-action {
  border-color:#c92c38!important;
  background:linear-gradient(180deg,#f44f56,#da3542)!important;
  color:#fff!important;
  box-shadow:0 4px 0 #b52330,0 8px 16px rgba(158,25,38,.2)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision[data-outcome="defeat"] .battle-result-action :is(b,small,i,svg) {
  color:#fff!important;
}

@media (max-width:1100px) and (min-width:901px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleTargets.is-matchup-summary {
    width:min(248px,calc(100% - 650px))!important;
    min-width:220px!important;
    max-width:248px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary {
    min-height:46px!important;
    height:46px!important;
    padding:12px 8px 4px!important;
    grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr)!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-portrait {
    width:22px!important;height:22px!important;min-width:22px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary > span > b { font-size:7.5px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-arrow,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-arrow svg { width:18px!important;height:18px!important; }
}

@media (max-width:900px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleTargets.is-matchup-summary { display:none!important; }
}

@media (max-width:560px), (max-height:620px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-action {
    width:min(250px,100%)!important;
    height:44px!important;
    min-height:44px!important;
  }
}

/* ========================================================================== 
   V18 — visibility repair from live screenshots. Component-scoped only.
   ========================================================================== */

/* Empty means an unfilled battle pouch. Keep the preview pictogram smaller
   than its tile so it cannot turn into an unexplained full-size logo. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button.is-empty-slot > span:first-child {
  border-color:color-mix(in srgb,var(--bui-muted) 35%,var(--bui-line))!important;
  background:linear-gradient(180deg,var(--bui-surface-raised),var(--bui-surface-soft))!important;
  box-shadow:inset 0 1px rgba(255,255,255,.24)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] :is(.combat-item-empty-art,.combat-preview-empty-art) {
  color:color-mix(in srgb,var(--bui-accent) 28%,var(--bui-muted))!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-empty-art {
  width:20px!important;
  height:20px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip .combat-preview-empty-art {
  width:30px!important;
  height:30px!important;
  max-width:30px!important;
  max-height:30px!important;
}

/* The matchup is intentionally plain: no diagonal tiles or striped texture. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-matchup-summary {
  border-color:color-mix(in srgb,var(--bui-accent) 22%,var(--bui-line))!important;
  background:linear-gradient(180deg,var(--bui-surface-raised),color-mix(in srgb,var(--bui-accent) 3%,var(--bui-surface)))!important;
  box-shadow:0 4px 10px color-mix(in srgb,var(--bui-shadow) 18%,transparent),inset 0 1px rgba(255,255,255,.24)!important;
}

/* The live screenshot exposed two clipping ancestors. Effects must be the top
   telemetry layer of a fighter card and both visible icons stay available. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth {
  z-index:38!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article {
  overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area {
  position:relative!important;
  z-index:20!important;
  overflow:visible!important;
  transform:translateY(-2px)!important;
  isolation:isolate!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-statuses {
  position:relative!important;
  z-index:21!important;
  overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip:nth-child(n+2) {
  z-index:22!important;
  display:grid!important;
}

/* Defeat no longer depends on a background-positioned PNG cell. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem {
  overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-defeat-crest {
  width:68px!important;
  height:68px!important;
  max-width:68px!important;
  max-height:68px!important;
  display:block!important;
  overflow:visible!important;
  opacity:1!important;
  visibility:visible!important;
  filter:drop-shadow(0 6px 9px rgba(173,31,45,.26))!important;
}

/* ========================================================================== 
   V19 — foreground battle application + dedicated phone composition.
   The phone is no longer a scaled desktop deck. This final layer owns all
   mobile geometry and deliberately supersedes the old world-window contract.
   ========================================================================== */

/* Combat owns focus and stacking. World chrome can return after combat, but it
   cannot cover, shrink or intercept the active battle. */
body.is-battling #battleHud[data-battle-ui="2.9.9"].is-open {
  position:fixed!important;
  z-index:8000!important;
  inset:0!important;
  width:100vw!important;
  height:100dvh!important;
  max-width:none!important;
  max-height:none!important;
  padding:0!important;
  overflow:hidden!important;
  opacity:1!important;
  visibility:visible!important;
  pointer-events:auto!important;
  transform:none!important;
  isolation:isolate!important;
}
body.is-battling :is(
  .world-topbar,#partyHud,#playerProfileButton,#playerStaminaHud,#questWidget,
  #worldMinimapShell,#desktopDock,#desktopUtilityRail,#desktopMoreMenu,
  .world-rail,.desktop-dock,.desktop-utility-rail,.mobile-dock,
  #chatPanel,#sidePanel,#editorPanel,#inventoryItemDialog
) {
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  transform:none!important;
}
body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-shell {
  z-index:1!important;
  opacity:1!important;
  pointer-events:auto!important;
}

#battleHud[data-battle-ui="2.9.9"] .battle-quick-help {
  display:grid!important;
  gap:5px!important;
  padding:7px!important;
  border:1px solid var(--bui-line)!important;
  border-radius:12px!important;
  background:var(--bui-surface-soft)!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-quick-help[hidden] { display:none!important; }
#battleHud[data-battle-ui="2.9.9"] .battle-quick-help > article {
  min-height:38px!important;
  display:grid!important;
  grid-template-columns:24px minmax(0,1fr)!important;
  align-items:center!important;
  gap:7px!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-quick-help > article > i {
  width:24px!important;
  height:24px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:8px!important;
  background:color-mix(in srgb,var(--bui-accent) 12%,var(--bui-card))!important;
  color:var(--bui-accent)!important;
  font-size:9px!important;
  font-style:normal!important;
  font-weight:900!important;
}
#battleHud[data-battle-ui="2.9.9"] .battle-quick-help > article > span { min-width:0!important;display:grid!important;gap:1px!important; }
#battleHud[data-battle-ui="2.9.9"] .battle-quick-help > article b { color:var(--bui-text)!important;font-size:9px!important; }
#battleHud[data-battle-ui="2.9.9"] .battle-quick-help > article small { color:var(--bui-muted)!important;font-size:7px!important;line-height:1.3!important; }

/* Phone-only action switch. Desktop and tablet keep their simultaneous rows. */
#battleHud[data-battle-ui="2.9.9"] .mobile-combat-tabs {
  display:none!important;
}

@media (max-width:760px), (max-width:900px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --mobile-command-h:228px;
    --mobile-safe-bottom:max(4px,env(safe-area-inset-bottom));
    --bui-shell-w:100vw;
    --bui-shell-h:100dvh;
    --bui-command-w:auto;
    --bui-command-h:var(--mobile-command-h);
    --bui-command-bottom:var(--mobile-safe-bottom);
    --v6-deck-w:auto;
    --v6-deck-h:var(--mobile-command-h);
    --v6-main-h:142px;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-shell {
    position:fixed!important;
    left:0!important;
    right:0!important;
    top:0!important;
    bottom:0!important;
    width:100vw!important;
    height:100dvh!important;
    min-width:0!important;
    min-height:0!important;
    max-width:none!important;
    max-height:none!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    transform:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-stage {
    inset:0!important;
    width:100%!important;
    height:100%!important;
    border-radius:0!important;
  }

  /* Two readable status cards; no third header or duplicated VS plaque. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleMatchHeader,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleTargets.is-matchup-summary {
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth {
    z-index:52!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article {
    top:max(6px,env(safe-area-inset-top))!important;
    width:calc(50% - 8px)!important;
    height:112px!important;
    min-height:112px!important;
    max-height:112px!important;
    padding:7px!important;
    grid-template-columns:43px minmax(0,1fr)!important;
    grid-template-rows:29px 25px 18px 24px!important;
    column-gap:6px!important;
    row-gap:2px!important;
    overflow:visible!important;
    border-radius:14px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .ally-health { left:5px!important;right:auto!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .enemy-health { right:5px!important;left:auto!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait {
    width:40px!important;
    height:40px!important;
    border-radius:11px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art > * {
    width:36px!important;
    height:36px!important;
    max-width:36px!important;
    max-height:36px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity {
    grid-template-rows:17px 12px!important;
    gap:0!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header { gap:3px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > b {
    font-size:11px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > em {
    min-width:34px!important;
    height:17px!important;
    padding:0 4px!important;
    font-size:7px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-types .pokemon-type-badge {
    height:12px!important;
    min-height:12px!important;
    padding:0 3px!important;
    gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-types .pokemon-type-badge img { width:8px!important;height:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-types .pokemon-type-badge b { font-size:6px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > :is(.battle-vital,.battle-exp) {
    grid-template-rows:10px 8px!important;
    gap:3px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span {
    grid-template-columns:9px minmax(0,1fr) auto!important;
    gap:2px!important;
    font-size:6px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span :is(i,svg) { width:8px!important;height:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span > :is(strong,small) { font-size:7px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-hp-bar { height:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-energy > i,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-exp > i { height:6px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area {
    grid-column:1/-1!important;
    grid-row:4!important;
    height:24px!important;
    min-height:24px!important;
    padding:0!important;
    display:flex!important;
    align-items:center!important;
    overflow:visible!important;
    transform:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-statuses {
    height:24px!important;
    gap:4px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip:nth-child(n+2) {
    flex:0 0 24px!important;
    width:24px!important;
    max-width:24px!important;
    height:24px!important;
    min-height:24px!important;
    display:grid!important;
  }

  /* Switch row is anchored above the command sheet, never over the actors or
     underneath the sheet. Six 44px targets still fit a 320px viewport. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel {
    z-index:54!important;
    left:50%!important;
    right:auto!important;
    top:auto!important;
    bottom:calc(var(--mobile-command-h) + var(--mobile-safe-bottom) + 7px)!important;
    width:min(304px,calc(100% - 12px))!important;
    min-width:0!important;
    max-width:none!important;
    height:48px!important;
    padding:2px 5px!important;
    display:block!important;
    overflow:visible!important;
    border-radius:15px!important;
    transform:translateX(-50%)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel > header,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel > p { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRoster {
    width:100%!important;
    height:44px!important;
    display:grid!important;
    grid-template-columns:repeat(6,minmax(0,44px))!important;
    grid-template-rows:44px!important;
    justify-content:center!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot {
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    min-height:44px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-empty > .battle-roster-empty {
    width:38px!important;
    height:38px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > kbd { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-active-arrow {
    left:50%!important;
    top:-14px!important;
    width:17px!important;
    height:17px!important;
    transform:translateX(-50%) rotate(90deg) scale(.88)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-active > .battle-roster-active-arrow {
    transform:translateX(-50%) rotate(90deg) scale(1)!important;
  }

  /* Dedicated bottom sheet: a selector, one action page, stable utility row
     and the shared energy meter. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandDeck[data-view="combat"] {
    z-index:60!important;
    left:max(4px,env(safe-area-inset-left))!important;
    right:max(4px,env(safe-area-inset-right))!important;
    top:auto!important;
    bottom:var(--mobile-safe-bottom)!important;
    width:auto!important;
    height:var(--mobile-command-h)!important;
    min-height:var(--mobile-command-h)!important;
    max-height:var(--mobile-command-h)!important;
    padding:6px!important;
    overflow:hidden!important;
    border-radius:18px!important;
    transform:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls {
    width:100%!important;
    height:100%!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:44px minmax(0,1fr) 26px!important;
    gap:4px!important;
    overflow:hidden!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .mobile-combat-tabs {
    grid-column:1!important;
    grid-row:1!important;
    height:44px!important;
    padding:0!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:3px!important;
    border:1px solid var(--bui-line)!important;
    border-radius:12px!important;
    background:var(--bui-surface-soft)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .mobile-combat-tabs > button {
    min-width:0!important;
    min-height:44px!important;
    padding:0 8px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px!important;
    border:0!important;
    border-radius:11px!important;
    background:transparent!important;
    color:var(--bui-muted)!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .mobile-combat-tabs > button.is-active {
    background:var(--bui-surface-raised)!important;
    color:var(--bui-accent)!important;
    box-shadow:0 1px 4px color-mix(in srgb,var(--bui-shadow) 35%,transparent)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .mobile-combat-tabs > button > i,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .mobile-combat-tabs > button > i > svg {
    width:16px!important;
    height:16px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .mobile-combat-tabs > button > b { font-size:10px!important; }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
    grid-column:1!important;
    grid-row:2!important;
    width:100%!important;
    height:100%!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:minmax(0,1fr) 44px!important;
    gap:4px!important;
    overflow:hidden!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel {
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="skills"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="items"] .combat-skills-panel {
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-panel > header,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel > header { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-shell,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills {
    width:100%!important;
    height:100%!important;
    min-height:0!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills {
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-template-rows:1fr!important;
    align-items:start!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button {
    --combat-size:60px;
    width:100%!important;
    height:88px!important;
    min-width:44px!important;
    min-height:88px!important;
    padding:0 1px!important;
    grid-template-rows:60px 15px!important;
    row-gap:2px!important;
    overflow:visible!important;
    touch-action:manipulation!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
    width:60px!important;
    height:60px!important;
    min-width:60px!important;
    min-height:60px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-name {
    grid-row:2!important;
    height:15px!important;
    min-height:15px!important;
    font-size:8px!important;
    line-height:15px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-tags { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-cost { top:42px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button > kbd { left:0!important;top:0!important; }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleQuickItems {
    width:100%!important;
    height:100%!important;
    display:grid!important;
    grid-template-columns:repeat(6,46px)!important;
    grid-template-rows:52px!important;
    align-content:center!important;
    justify-content:center!important;
    gap:3px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button {
    width:46px!important;
    height:52px!important;
    min-width:46px!important;
    min-height:52px!important;
    touch-action:manipulation!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button > span:first-child,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button > .combat-cooldown {
    width:44px!important;
    height:44px!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel {
    grid-column:1!important;
    grid-row:2!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:44px!important;
    padding:0!important;
    border:0!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions {
    width:100%!important;
    height:44px!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:44px!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #cancelBattle {
    width:100%!important;
    height:44px!important;
    min-width:0!important;
    min-height:44px!important;
    padding:0 7px!important;
    grid-template-columns:18px minmax(0,1fr)!important;
    gap:5px!important;
    border-radius:12px!important;
    touch-action:manipulation!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > :is(i,svg) {
    width:18px!important;
    height:18px!important;
    min-width:18px!important;
    min-height:18px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > b { font-size:9px!important; }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row {
    grid-column:1!important;
    grid-row:3!important;
    width:100%!important;
    height:26px!important;
    min-height:26px!important;
    padding:1px 4px!important;
    display:block!important;
    overflow:hidden!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy {
    width:100%!important;
    height:24px!important;
    display:grid!important;
    grid-template-columns:112px minmax(0,1fr)!important;
    gap:7px!important;
  }

  /* Touch tooltip is pinned above the sheet. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip {
    position:absolute!important;
    left:50%!important;
    top:auto!important;
    bottom:calc(var(--mobile-command-h) + var(--mobile-safe-bottom) + 64px)!important;
    width:min(310px,calc(100% - 18px))!important;
    max-height:132px!important;
    transform:translateX(-50%)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-tactics {
    z-index:72!important;
    left:max(6px,env(safe-area-inset-left))!important;
    right:max(6px,env(safe-area-inset-right))!important;
    top:max(124px,calc(env(safe-area-inset-top) + 120px))!important;
    bottom:calc(var(--mobile-command-h) + var(--mobile-safe-bottom) + 6px)!important;
    width:auto!important;
    max-height:none!important;
    border-radius:17px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-tactics > header nav > button {
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    min-height:44px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-surrender-confirm footer button {
    min-height:44px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-pause-overlay {
    padding:112px 0 calc(var(--mobile-command-h) + 56px)!important;
  }

  /* Terminal card is viewport-bound. Losses become a readable vertical list. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-view="result"] #battleDecision.battle-result-layer:not([hidden]) {
    z-index:80!important;
    inset:0!important;
    padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important;
    display:grid!important;
    place-items:center!important;
    overflow:hidden!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-card {
    width:min(420px,100%)!important;
    height:auto!important;
    min-height:0!important;
    max-height:100%!important;
    padding:15px!important;
    grid-template-rows:auto auto auto!important;
    gap:10px!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    border-radius:20px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-outcome {
    grid-template-columns:58px minmax(0,1fr)!important;
    column-gap:10px!important;
    padding:0 0 10px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem :is(.battle-outcome-art,.battle-defeat-crest,.combat-result-art) {
    width:56px!important;
    height:56px!important;
    min-width:56px!important;
    max-width:56px!important;
    max-height:56px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > b {
    max-width:100%!important;
    overflow:hidden!important;
    font-size:clamp(24px,8vw,32px)!important;
    line-height:1!important;
    text-overflow:clip!important;
    white-space:nowrap!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > em {
    display:block!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList[data-mode="losses"] {
    width:100%!important;
    height:auto!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:7px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop {
    width:100%!important;
    min-width:0!important;
    min-height:62px!important;
    padding:5px 8px!important;
    grid-template-columns:46px minmax(0,1fr) auto!important;
    grid-template-rows:1fr!important;
    column-gap:8px!important;
    border:1px solid var(--bui-line)!important;
    border-radius:14px!important;
    background:var(--bui-surface-soft)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop::before { width:42px!important;height:42px!important;left:7px!important;top:9px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop-art {
    grid-column:1!important;
    grid-row:1!important;
    width:42px!important;
    height:42px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > span {
    grid-column:2!important;
    grid-row:1!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > span > b,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > span > small {
    white-space:normal!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > strong {
    grid-column:3!important;
    grid-row:1!important;
    align-self:center!important;
    justify-self:end!important;
    font-size:20px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-action {
    width:100%!important;
    height:52px!important;
    min-height:52px!important;
    padding:0 13px!important;
    border-radius:14px!important;
    touch-action:manipulation!important;
  }
}

/* 320px phones retain 44px actions by removing only decorative text. */
@media (max-width:340px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills { gap:2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button { --combat-size:56px; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
    width:56px!important;height:56px!important;min-width:56px!important;min-height:56px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-name { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleQuickItems {
    grid-template-columns:repeat(6,44px)!important;
    gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button { width:44px!important;min-width:44px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > b { font-size:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-card { padding:12px!important; }
}

/* Short portrait: preserve touch sizes and reclaim vertical space from labels. */
@media (max-width:760px) and (max-height:650px) and (orientation:portrait) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --mobile-command-h:214px;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article {
    height:104px!important;
    min-height:104px!important;
    max-height:104px!important;
    grid-template-rows:27px 23px 16px 22px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button {
    height:76px!important;
    min-height:76px!important;
    grid-template-rows:58px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
    width:58px!important;height:58px!important;min-width:58px!important;min-height:58px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-name { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-card {
    padding:11px!important;
    gap:7px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop { min-height:56px!important; }
}

/* Landscape phone: a lower sheet and top row leave the arena centre readable. */
@media (max-width:900px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --mobile-command-h:190px;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article {
    width:min(250px,calc((100% - 316px) / 2))!important;
    height:104px!important;
    min-height:104px!important;
    max-height:104px!important;
    grid-template-rows:27px 23px 16px 22px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel {
    left:50%!important;
    top:max(20px,calc(env(safe-area-inset-top) + 14px))!important;
    bottom:auto!important;
    width:304px!important;
    height:48px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRoster {
    height:44px!important;
    grid-template-columns:repeat(6,44px)!important;
    grid-template-rows:44px!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot {
    width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot.is-empty > .battle-roster-empty { width:38px!important;height:38px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls {
    grid-template-rows:44px minmax(0,1fr) 22px!important;
    gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .mobile-combat-tabs { height:44px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
    grid-template-rows:minmax(0,1fr) 38px!important;
    gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button {
    height:62px!important;
    min-height:62px!important;
    grid-template-rows:54px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
    width:54px!important;height:54px!important;min-width:54px!important;min-height:54px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-name { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions {
    height:44px!important;
    grid-template-rows:44px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #cancelBattle {
    height:44px!important;
    min-height:44px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy { height:22px!important;min-height:22px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row {
    grid-column:1!important;
    grid-row:1!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-tactics {
    top:110px!important;
    bottom:calc(var(--mobile-command-h) + var(--mobile-safe-bottom) + 4px)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-card {
    width:min(620px,100%)!important;
    grid-template-columns:minmax(210px,.85fr) minmax(260px,1.15fr)!important;
    grid-template-rows:auto auto!important;
    align-items:start!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-outcome { grid-column:1!important;grid-row:1!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-drops { grid-column:2!important;grid-row:1/3!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-action { grid-column:1!important;grid-row:2!important; }
}

/* ========================================================================== 
   V29 — mobile resource and fighter-card polish.
   The stable native-v28 layout stays intact; this isolated layer improves
   resource readability, item-slot language and fighter-card hierarchy.
   ========================================================================== */

@media (max-width:760px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article {
    top:max(5px,env(safe-area-inset-top))!important;
    width:calc(50% - 6px)!important;
    height:100px!important;
    min-height:100px!important;
    max-height:100px!important;
    padding:6px!important;
    grid-template-columns:44px minmax(0,1fr)!important;
    grid-template-rows:27px 20px 15px 20px!important;
    column-gap:6px!important;
    row-gap:2px!important;
    overflow:visible!important;
    border:1px solid #bad7de!important;
    border-radius:15px!important;
    background:linear-gradient(155deg,rgba(255,255,255,.99),rgba(241,249,251,.98))!important;
    box-shadow:0 5px 14px rgba(18,62,77,.14),inset 0 1px #fff!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > .ally-health {
    left:3px!important;
    border-color:#a7d8ce!important;
    background:linear-gradient(145deg,rgba(226,249,244,.99),rgba(250,253,254,.99) 31%)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > .enemy-health {
    right:3px!important;
    border-color:#efc2bd!important;
    background:linear-gradient(215deg,rgba(255,235,232,.99),rgba(250,253,254,.99) 31%)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article::before,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article::after {
    content:none!important;
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait-art > * {
    width:42px!important;
    height:42px!important;
    min-width:42px!important;
    min-height:42px!important;
    max-width:42px!important;
    max-height:42px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait {
    grid-column:1!important;
    grid-row:1/4!important;
    align-self:start!important;
    border-width:1.5px!important;
    border-radius:13px!important;
    background:linear-gradient(145deg,#fff,#e8f6f8)!important;
    box-shadow:inset 0 0 0 2px rgba(255,255,255,.68),0 2px 7px rgba(20,67,82,.12)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .ally-health .battle-combat-portrait { border-color:#50bba7!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .enemy-health .battle-combat-portrait { border-color:#ef756b!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-fighter-identity {
    grid-template-rows:15px 10px!important;
    gap:1px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-fighter-identity > header { gap:4px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-fighter-identity > header > b {
    font-size:11px!important;
    line-height:1!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-fighter-identity > header > em {
    min-width:31px!important;
    height:16px!important;
    padding:0 4px!important;
    border-radius:7px!important;
    font-size:7px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-fighter-types {
    height:10px!important;
    gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-fighter-types .pokemon-type-badge {
    height:10px!important;
    min-height:10px!important;
    padding:0 3px!important;
    gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-fighter-types .pokemon-type-badge img { width:7px!important;height:7px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-fighter-types .pokemon-type-badge b { font-size:6.8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article > .battle-vital-hp {
    grid-template-rows:9px 9px!important;
    gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > .ally-health > .battle-exp,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > .enemy-health > .battle-energy {
    grid-template-rows:7px 7px!important;
    gap:1px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span {
    grid-template-columns:10px minmax(0,1fr) auto!important;
    gap:3px!important;
    min-height:9px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span :is(i,svg) {
    width:10px!important;
    height:10px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span :is(b,strong,small) {
    font-size:8px!important;
    line-height:1!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > :is(.ally-health,.enemy-health) > :is(.battle-exp,.battle-energy) > span :is(i,svg) {
    width:8px!important;
    height:8px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > :is(.ally-health,.enemy-health) > :is(.battle-exp,.battle-energy) > span :is(b,strong,small) {
    font-size:7.5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth .battle-hp-bar {
    height:9px!important;
    min-height:9px!important;
    border-color:#bad4d9!important;
    background:#dce9ec!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth .battle-energy > i,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth .battle-exp > i {
    height:7px!important;
    min-height:7px!important;
    border-color:#bfd5da!important;
    background:#dfeaed!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-card-status-area {
    grid-column:1/-1!important;
    grid-row:4!important;
    width:100%!important;
    height:20px!important;
    min-height:20px!important;
    padding:0 2px!important;
    display:block!important;
    overflow:visible!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    transform:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-statuses {
    width:100%!important;
    height:20px!important;
    min-height:20px!important;
    gap:3px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-status-chip,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-status-chip:nth-child(n+2) {
    height:20px!important;
    min-height:20px!important;
  }

  /* The energy row remains unboxed, but the actual resource is now readable. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] {
    grid-template-rows:28px 80px 48px 36px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] :is(.combat-resource-row,.combat-energy) {
    height:28px!important;
    min-height:28px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy {
    grid-template-columns:132px minmax(0,1fr)!important;
    gap:8px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy > span {
    height:28px!important;
    grid-template-columns:22px auto minmax(0,1fr)!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy > span > :is(i,svg) {
    width:22px!important;
    height:22px!important;
    min-width:22px!important;
    min-height:22px!important;
    color:#149bc7!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy > span :is(small,b) {
    font-size:8.8px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyTrack {
    height:8px!important;
    min-height:8px!important;
    max-height:8px!important;
    border:1px solid #abd5df!important;
    background:#dcebef!important;
    box-shadow:inset 0 1px 2px rgba(20,73,89,.13),0 1px rgba(255,255,255,.9)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyBar {
    height:100%!important;
    min-height:6px!important;
    background:linear-gradient(90deg,#38c8e9,#169dcc 72%,#77ddf0)!important;
    box-shadow:inset 0 1px rgba(255,255,255,.48)!important;
  }

  /* Empty slots read as prepared loadout cells, not disabled system buttons. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel {
    grid-template-columns:52px minmax(0,1fr)!important;
    gap:4px!important;
    border-top-color:#cee1e6!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header {
    width:52px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header > b {
    color:#456c79!important;
    font-size:7.2px!important;
    letter-spacing:.045em!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] #battleQuickItems { gap:4px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button {
    max-width:42px!important;
    height:42px!important;
    min-height:42px!important;
    padding:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > span:first-child,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > .combat-cooldown {
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    min-height:38px!important;
    max-width:38px!important;
    max-height:38px!important;
    border-radius:12px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > span:first-child {
    border:1px solid #a9cbd4!important;
    background:linear-gradient(145deg,#fff,#eaf4f6)!important;
    box-shadow:inset 0 1px #fff,0 2px 5px rgba(24,73,87,.1)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button.is-empty-slot,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button.is-empty-slot.is-disabled {
    opacity:1!important;
    filter:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button.is-empty-slot > span:first-child {
    overflow:hidden!important;
    border:1px solid #afcbd2!important;
    border-radius:12px!important;
    background:linear-gradient(145deg,rgba(249,253,254,.98),rgba(225,239,243,.94))!important;
    box-shadow:inset 0 1px #fff,inset 0 0 0 2px rgba(255,255,255,.34),0 2px 5px rgba(28,71,83,.08)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-empty-art {
    width:22px!important;
    height:22px!important;
    color:#5f7f8a!important;
    opacity:.9!important;
    filter:none!important;
  }
}

@media (max-width:340px) and (orientation:portrait) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article {
    grid-template-columns:40px minmax(0,1fr)!important;
    column-gap:5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait-art > * {
    width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;max-width:38px!important;max-height:38px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-fighter-identity > header { gap:3px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-fighter-identity > header > b { font-size:10px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-fighter-identity > header > em { min-width:28px!important;padding:0 3px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel {
    grid-template-columns:44px minmax(0,1fr)!important;
    gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header { width:44px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header > b { font-size:6.4px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] #battleQuickItems { gap:2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button { max-width:40px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > span:first-child,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > .combat-cooldown {
    width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;max-width:36px!important;max-height:36px!important;
  }
}

@media (max-width:760px) and (max-height:650px) and (orientation:portrait) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article {
    height:92px!important;
    min-height:92px!important;
    max-height:92px!important;
    padding:6px!important;
    grid-template-columns:40px minmax(0,1fr)!important;
    grid-template-rows:24px 19px 14px 17px!important;
    column-gap:5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait-art > * {
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    min-height:38px!important;
    max-width:38px!important;
    max-height:38px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth .battle-hp-bar { height:8px!important;min-height:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth .battle-energy > i,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth .battle-exp > i { height:6px!important;min-height:6px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article > .battle-vital-hp { grid-template-rows:9px 8px!important;gap:2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > .ally-health > .battle-exp,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > .enemy-health > .battle-energy { grid-template-rows:7px 6px!important;gap:1px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-card-status-area,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-statuses { height:17px!important;min-height:17px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] {
    grid-template-rows:26px 72px 44px 34px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] :is(.combat-resource-row,.combat-energy) {
    height:26px!important;
    min-height:26px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyTrack {
    height:7px!important;
    min-height:7px!important;
    max-height:7px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > span:first-child,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > .combat-cooldown {
    width:36px!important;
    height:36px!important;
    min-width:36px!important;
    min-height:36px!important;
    max-width:36px!important;
    max-height:36px!important;
  }
}

@media (max-width:900px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] {
    --mobile-command-h:150px;
    --v6-deck-h:150px;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article {
    top:max(4px,env(safe-area-inset-top))!important;
    width:min(280px,calc(50% - 6px))!important;
    height:84px!important;
    min-height:84px!important;
    max-height:84px!important;
    padding:5px!important;
    grid-template-columns:40px minmax(0,1fr)!important;
    grid-template-rows:22px 18px 14px 14px!important;
    column-gap:5px!important;
    row-gap:2px!important;
    overflow:visible!important;
    border:1px solid #bad7de!important;
    border-radius:13px!important;
    background:linear-gradient(155deg,rgba(255,255,255,.99),rgba(241,249,251,.98))!important;
    box-shadow:0 4px 12px rgba(18,62,77,.13),inset 0 1px #fff!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > .ally-health { left:3px!important;border-color:#a7d8ce!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > .enemy-health { right:3px!important;border-color:#efc2bd!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article::before,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article::after { content:none!important;display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait-art > * {
    width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;max-width:38px!important;max-height:38px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait { grid-column:1!important;grid-row:1/4!important;border-width:1.5px!important;border-radius:12px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .ally-health .battle-combat-portrait { border-color:#50bba7!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .enemy-health .battle-combat-portrait { border-color:#ef756b!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-fighter-identity > header > b { font-size:10px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article > .battle-vital-hp { grid-template-rows:8px 8px!important;gap:2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > .ally-health > .battle-exp,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > .enemy-health > .battle-energy { grid-template-rows:7px 6px!important;gap:1px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth .battle-hp-bar { height:8px!important;min-height:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth .battle-energy > i,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth .battle-exp > i { height:6px!important;min-height:6px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-card-status-area,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-statuses { height:14px!important;min-height:14px!important;transform:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] {
    grid-template-rows:26px 72px 34px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] :is(.combat-resource-row,.combat-energy) {
    height:26px!important;
    min-height:26px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy {
    grid-template-columns:128px minmax(0,1fr)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy > span > :is(i,svg) {
    width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important;color:#149bc7!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyTrack {
    height:7px!important;min-height:7px!important;max-height:7px!important;border:1px solid #abd5df!important;background:#dcebef!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyBar { min-height:5px!important;background:linear-gradient(90deg,#38c8e9,#169dcc 72%,#77ddf0)!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel { border-left-color:#cee1e6!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button.is-empty-slot,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button.is-empty-slot.is-disabled { opacity:1!important;filter:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button.is-empty-slot > span:first-child {
    border:1px solid #afcbd2!important;border-radius:12px!important;background:linear-gradient(145deg,#fff,#e5f1f4)!important;box-shadow:inset 0 1px #fff,0 2px 5px rgba(28,71,83,.08)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-empty-art { width:21px!important;height:21px!important;color:#5f7f8a!important;opacity:.9!important; }
}

@media (max-width:560px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article {
    width:calc(50% - 6px)!important;
    height:64px!important;
    min-height:64px!important;
    max-height:64px!important;
    padding:5px!important;
    grid-template-columns:36px minmax(0,1fr)!important;
    grid-template-rows:22px 24px!important;
    column-gap:4px!important;
    row-gap:3px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait-art > * {
    width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;max-width:34px!important;max-height:34px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-combat-portrait { grid-row:1/3!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth > article > .battle-vital-hp {
    grid-column:2!important;grid-row:2!important;grid-template-rows:9px 8px!important;gap:2px!important;padding-right:68px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] #battleHealth .battle-hp-bar { height:8px!important;min-height:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-card-status-area {
    position:absolute!important;right:5px!important;bottom:5px!important;width:64px!important;height:18px!important;min-height:18px!important;padding:0!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v29"] .battle-statuses { width:64px!important;height:18px!important;min-height:18px!important; }
}

/* ========================================================================== 
   V20 — pre-release responsive audit.
   Repairs confirmed boundary collisions without changing combat mechanics.
   ========================================================================== */

/* Capture uses the same stage as combat, so its interactive ball must be
   explicitly parked above the capture selector instead of underneath it. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
  --v20-capture-deck-h:122px;
  --v20-capture-deck-bottom:12px;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandDeck[data-view="capture"] {
  left:50%!important;
  right:auto!important;
  bottom:var(--v20-capture-deck-bottom)!important;
  width:min(790px,calc(100% - 110px))!important;
  min-width:0!important;
  max-width:none!important;
  height:var(--v20-capture-deck-h)!important;
  min-height:var(--v20-capture-deck-h)!important;
  max-height:var(--v20-capture-deck-h)!important;
  transform:translateX(-50%)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .capture-throw {
  bottom:calc(var(--v20-capture-deck-bottom) + var(--v20-capture-deck-h) + 16px)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .capture-gesture-hint {
  bottom:calc(var(--v20-capture-deck-bottom) + var(--v20-capture-deck-h) + 18px)!important;
}

@media (max-width:760px), (max-width:900px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --v20-capture-deck-h:152px;
    --v20-capture-deck-bottom:var(--mobile-safe-bottom);
  }

  /* The four explicit tracks now equal the card's inner height. The status
     row no longer protrudes below the surface on short devices. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article {
    grid-template-rows:28px 24px 17px 23px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-statuses {
    height:23px!important;
    min-height:23px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip:nth-child(n+2) {
    flex-basis:23px!important;
    width:23px!important;
    max-width:23px!important;
    height:23px!important;
    min-height:23px!important;
  }

  /* Capture is a separate mobile composition: zero-HP telemetry is replaced
     by the target reticle and the full-width selector remains touchable. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-view="capture"] #battleHealth {
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandDeck[data-view="capture"] {
    left:max(4px,env(safe-area-inset-left))!important;
    right:max(4px,env(safe-area-inset-right))!important;
    bottom:var(--v20-capture-deck-bottom)!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    height:var(--v20-capture-deck-h)!important;
    min-height:var(--v20-capture-deck-h)!important;
    max-height:var(--v20-capture-deck-h)!important;
    padding:6px!important;
    overflow:hidden!important;
    border-radius:18px!important;
    transform:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-capture-panel {
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    padding:4px!important;
    box-sizing:border-box!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-capture-cancel {
    min-height:44px!important;
    touch-action:manipulation!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .capture-throw {
    bottom:calc(var(--v20-capture-deck-bottom) + var(--v20-capture-deck-h) + 12px)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .capture-gesture-hint {
    bottom:calc(var(--v20-capture-deck-bottom) + var(--v20-capture-deck-h) + 14px)!important;
  }
}

@media (max-width:760px) and (max-height:650px) and (orientation:portrait) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article {
    grid-template-rows:26px 22px 15px 21px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-statuses {
    height:21px!important;
    min-height:21px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip:nth-child(n+2) {
    flex-basis:21px!important;
    width:21px!important;
    max-width:21px!important;
    height:21px!important;
    min-height:21px!important;
  }
}

@media (max-width:900px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --v20-capture-deck-h:104px;
  }

  /* 108px of live main space = 62px action row + 2px gap + 44px utility
     row. The previous 38px track forced the 44px buttons into energy. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
    grid-template-rows:minmax(0,1fr) 44px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions {
    height:44px!important;
    grid-template-rows:44px!important;
  }

  /* Tactics cannot fit in the thin arena strip above a landscape command
     sheet. While explicitly open, it becomes a contained, scrollable modal. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-tactics {
    left:max(6px,env(safe-area-inset-left))!important;
    right:max(6px,env(safe-area-inset-right))!important;
    top:max(6px,env(safe-area-inset-top))!important;
    bottom:max(6px,env(safe-area-inset-bottom))!important;
    width:auto!important;
    height:auto!important;
    max-height:none!important;
    border-radius:17px!important;
  }

  /* The two-column result stays compact, but its longest Russian outcome
     now fits the left column instead of being clipped. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > b {
    font-size:clamp(20px,3.7vw,26px)!important;
  }

  /* Landscape capture uses one compact row and reserves the middle of the
     arena for a 64px throw target above the selector. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-capture-panel {
    grid-template-columns:minmax(126px,176px) minmax(0,1fr) 110px!important;
    grid-template-rows:1fr!important;
    align-items:center!important;
    gap:5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-capture-copy {
    grid-column:1!important;
    grid-row:1!important;
    grid-template-columns:1fr!important;
    align-items:start!important;
    gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-capture-balls {
    grid-column:2!important;
    grid-row:1!important;
    min-width:0!important;
    justify-content:flex-start!important;
    overflow-x:auto!important;
    overscroll-behavior-inline:contain!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-capture-balls > button {
    width:54px!important;
    min-width:54px!important;
    height:72px!important;
    min-height:72px!important;
    padding:4px!important;
    grid-template-rows:38px 11px 9px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-capture-balls .capture-ball-icon {
    width:36px!important;
    height:36px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-capture-cancel {
    grid-column:3!important;
    grid-row:1!important;
    height:44px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .capture-feedback {
    top:max(6px,env(safe-area-inset-top))!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .capture-target-reticle {
    top:clamp(86px,25dvh,102px)!important;
    width:86px!important;
    height:86px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .capture-target-reticle > span {
    top:-21px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .capture-throw {
    width:64px!important;
    height:64px!important;
    bottom:calc(var(--v20-capture-deck-bottom) + var(--v20-capture-deck-h) + 10px)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .capture-throw-icon {
    width:44px!important;
    height:44px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .capture-gesture-hint {
    display:none!important;
  }
}

/* ========================================================================== 
   V21 — final mobile battle and capture edge audit.
   Covers 320px capture results, 480px landscape and in-flight ball locking.
   ========================================================================== */

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-capture-balls > button:disabled,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #capturePanel[aria-busy="true"] .combat-capture-cancel {
  opacity:.48!important;
  cursor:wait!important;
  pointer-events:none!important;
  filter:saturate(.55)!important;
}

@media (max-width:760px) {
  /* The longest Russian outcome must remain complete on a 320px viewport. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision[data-outcome="capture"] .battle-result-copy > b {
    font-size:clamp(19px,6vw,25px)!important;
    line-height:1.02!important;
    white-space:normal!important;
  }
}

@media (max-width:900px) and (max-height:650px) and (orientation:landscape) {
  /* Feedback already names the current action. Removing the second label
     prevents it from covering the ring on 320–375px-tall viewports. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .capture-target-reticle > span {
    display:none!important;
  }
}

/* Ultra-narrow landscape (for example 480×320): cards become concise status
   telemetry, while the six 44px switch targets remain fully available below
   them. The terminal card stacks because two fixed columns cannot fit here. */
@media (max-width:560px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article {
    width:calc(50% - 7px)!important;
    height:56px!important;
    min-height:56px!important;
    max-height:56px!important;
    padding:5px!important;
    grid-template-columns:34px minmax(0,1fr)!important;
    grid-template-rows:22px 20px!important;
    column-gap:4px!important;
    row-gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art > * {
    width:32px!important;
    height:32px!important;
    min-width:32px!important;
    min-height:32px!important;
    max-width:32px!important;
    max-height:32px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait {
    grid-column:1!important;
    grid-row:1/3!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity {
    grid-column:2!important;
    grid-row:1!important;
    grid-template-rows:20px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-types {
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > b {
    font-size:9px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > em {
    min-width:30px!important;
    height:16px!important;
    padding:0 3px!important;
    font-size:6px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > .battle-vital-hp {
    grid-column:2!important;
    grid-row:2!important;
    grid-template-rows:9px 7px!important;
    gap:2px!important;
    padding-right:26px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .ally-health > .battle-exp,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .enemy-health > .battle-energy {
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area {
    position:absolute!important;
    right:5px!important;
    bottom:4px!important;
    width:22px!important;
    height:22px!important;
    min-height:22px!important;
    overflow:hidden!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-statuses {
    width:22px!important;
    height:22px!important;
    gap:0!important;
    overflow:hidden!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip {
    flex-basis:22px!important;
    width:22px!important;
    min-width:22px!important;
    max-width:22px!important;
    height:22px!important;
    min-height:22px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip:nth-child(n+2),
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-more {
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel {
    top:max(66px,calc(env(safe-area-inset-top) + 62px))!important;
    bottom:auto!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-card {
    width:100%!important;
    max-height:100%!important;
    grid-template-columns:1fr!important;
    grid-template-rows:auto auto auto!important;
    overflow:auto!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-outcome {
    grid-column:1!important;
    grid-row:1!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-drops {
    grid-column:1!important;
    grid-row:2!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-action {
    grid-column:1!important;
    grid-row:3!important;
  }
}

/* ========================================================================== 
   V22 — verified capture decision and terminal acknowledgement.
   The decision card may expose finish and capture at the same time. Keeping
   their layout on a wrapper prevents legacy direct-child grid rules from
   stacking the buttons or stretching either control beyond the result card.
   ========================================================================== */

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-actions {
  width:min(570px,100%)!important;
  min-width:0!important;
  justify-self:center!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  align-items:stretch!important;
  gap:8px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-actions[data-mode="single"] {
  width:min(280px,100%)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-actions[data-mode="split"] {
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-actions > .battle-result-action {
  grid-column:auto!important;
  grid-row:auto!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
  justify-self:stretch!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-actions > .battle-result-action[hidden] {
  display:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-capture-action {
  border-color:#32bea8!important;
  background:linear-gradient(135deg,#22bba3,#168dac)!important;
  color:#fff!important;
  box-shadow:0 7px 16px rgba(18,139,151,.2)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-capture-action :is(b,small,i,svg) {
  color:#fff!important;
  stroke:currentColor!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-capture-action:disabled {
  border-color:#b7c9cf!important;
  background:linear-gradient(135deg,#8fa6ad,#758d96)!important;
  box-shadow:none!important;
}

@media (max-width:760px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-actions {
    width:100%!important;
    gap:6px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-actions > .battle-result-action {
    height:52px!important;
    min-height:52px!important;
    padding:0 9px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-actions[data-mode="split"] .battle-result-action small {
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
}

@media (max-width:340px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-actions[data-mode="split"] {
    gap:5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-actions[data-mode="split"] > .battle-result-action {
    grid-template-columns:minmax(0,1fr) 19px!important;
    gap:4px!important;
    padding:0 7px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-actions[data-mode="split"] .battle-result-action > i,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-actions[data-mode="split"] .battle-result-action > i > svg {
    width:19px!important;
    height:19px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-actions[data-mode="split"] .battle-result-action small {
    display:none!important;
  }
}

@media (max-width:900px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-actions {
    grid-column:1!important;
    grid-row:2!important;
    width:100%!important;
  }
}

@media (max-width:560px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-actions {
    grid-column:1!important;
    grid-row:3!important;
  }
}

/* ========================================================================== 
   V23 — centered result gallery + simultaneous mobile combat controls.
   Result art is now real SVG, rewards are game tiles rather than admin rows,
   and phone players can see skills, items, utilities and energy together.
   ========================================================================== */

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision.battle-result-layer:not([hidden]) {
  position:absolute!important;
  z-index:86!important;
  inset:0!important;
  width:auto!important;
  height:auto!important;
  padding:clamp(14px,3dvh,34px)!important;
  display:grid!important;
  place-items:center!important;
  align-content:center!important;
  overflow:hidden!important;
  transform:none!important;
  pointer-events:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-card {
  width:min(650px,calc(100% - 20px))!important;
  height:auto!important;
  min-height:0!important;
  max-height:min(720px,calc(100% - 20px))!important;
  margin:0!important;
  padding:22px 24px 20px!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:auto auto auto!important;
  gap:16px!important;
  align-self:center!important;
  align-content:start!important;
  overflow:visible!important;
  border:1px solid color-mix(in srgb,var(--outcome-accent,var(--bui-accent)) 24%,var(--bui-line))!important;
  border-radius:24px!important;
  background:
    linear-gradient(155deg,var(--bui-surface-raised),color-mix(in srgb,var(--outcome-accent,var(--bui-accent)) 2%,var(--bui-surface)))!important;
  box-shadow:0 22px 50px color-mix(in srgb,var(--bui-shadow) 62%,transparent),inset 0 1px rgba(255,255,255,.2)!important;
  transform:none!important;
  pointer-events:auto!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-card::before,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-card::after,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-drops::before,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-drops::after {
  content:none!important;
  display:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision.has-many-results .battle-result-card {
  overflow:auto!important;
  overscroll-behavior:contain!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-outcome {
  grid-column:1!important;
  grid-row:1!important;
  width:100%!important;
  padding:0 0 15px!important;
  display:grid!important;
  grid-template-columns:82px minmax(0,1fr)!important;
  align-items:center!important;
  gap:18px!important;
  border-bottom:1px solid color-mix(in srgb,var(--outcome-accent,var(--bui-accent)) 18%,var(--bui-line))!important;
  opacity:1!important;
  transform:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem > .battle-result-vector,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem > .combat-result-art {
  width:78px!important;
  height:78px!important;
  min-width:78px!important;
  min-height:78px!important;
  max-width:78px!important;
  max-height:78px!important;
  display:block!important;
  overflow:visible!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  filter:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy {
  min-width:0!important;
  display:grid!important;
  gap:5px!important;
  text-align:left!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > small {
  color:var(--outcome-accent,var(--bui-accent))!important;
  font-size:10px!important;
  font-weight:900!important;
  letter-spacing:.12em!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > b {
  max-width:100%!important;
  color:var(--bui-text)!important;
  font-size:clamp(31px,4vw,43px)!important;
  line-height:.94!important;
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:normal!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > em {
  display:block!important;
  max-width:100%!important;
  color:var(--bui-muted)!important;
  font-size:11px!important;
  line-height:1.35!important;
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:normal!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-drops {
  grid-column:1!important;
  grid-row:2!important;
  width:100%!important;
  min-height:0!important;
  display:grid!important;
  grid-template-rows:auto auto!important;
  gap:10px!important;
  overflow:visible!important;
  border:0!important;
  border-radius:0!important;
  outline:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-drops > header {
  min-height:16px!important;
  justify-content:center!important;
  color:var(--outcome-accent,var(--bui-accent))!important;
  font-size:9px!important;
  font-weight:900!important;
  letter-spacing:.14em!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList[data-mode="losses"] {
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(112px,140px))!important;
  grid-auto-rows:auto!important;
  align-items:start!important;
  justify-content:center!important;
  gap:12px!important;
  overflow:visible!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop {
  position:relative!important;
  width:100%!important;
  min-width:0!important;
  min-height:116px!important;
  padding:2px 3px 4px!important;
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:62px auto 24px!important;
  align-items:start!important;
  justify-items:center!important;
  gap:4px!important;
  overflow:visible!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  opacity:0!important;
  transform:translateY(7px) scale(.97)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop.is-visible {
  opacity:1!important;
  transform:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop::before {
  content:none!important;
  display:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop.is-loss::before {
  content:none!important;
  display:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop-art {
  position:relative!important;
  z-index:1!important;
  grid-column:1!important;
  grid-row:1!important;
  align-self:start!important;
  width:60px!important;
  height:60px!important;
  min-width:60px!important;
  min-height:60px!important;
  padding:0!important;
  display:block!important;
  overflow:visible!important;
  color:inherit!important;
  filter:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > span {
  position:relative!important;
  z-index:1!important;
  grid-column:1!important;
  grid-row:2!important;
  min-width:0!important;
  width:100%!important;
  display:block!important;
  text-align:center!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > span > b {
  display:-webkit-box!important;
  min-height:24px!important;
  overflow:hidden!important;
  color:var(--bui-text)!important;
  font-size:10px!important;
  font-weight:850!important;
  line-height:1.2!important;
  text-align:center!important;
  white-space:normal!important;
  text-overflow:ellipsis!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > span > small {
  display:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > strong {
  position:relative!important;
  z-index:1!important;
  grid-column:1!important;
  grid-row:3!important;
  align-self:center!important;
  justify-self:center!important;
  color:var(--outcome-accent,var(--bui-accent))!important;
  font-size:20px!important;
  font-weight:950!important;
  line-height:1!important;
  text-align:center!important;
  text-shadow:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop.is-loss > strong {
  color:var(--bui-danger)!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-actions {
  grid-column:1!important;
  grid-row:3!important;
  width:min(560px,100%)!important;
  min-width:0!important;
  justify-self:center!important;
  gap:8px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-actions[data-mode="single"] {
  width:min(240px,100%)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-action {
  width:100%!important;
  height:44px!important;
  min-height:44px!important;
  margin:0!important;
  padding:0 14px!important;
  grid-template-columns:minmax(0,1fr) 22px!important;
  gap:8px!important;
  border:1px solid #238fd0!important;
  border-radius:14px!important;
  background:linear-gradient(135deg,#25aee9,#147dcc)!important;
  color:#fff!important;
  box-shadow:0 7px 16px rgba(20,125,204,.22),inset 0 1px rgba(255,255,255,.2)!important;
  transform:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-action :is(b,small,i,svg) {
  color:#fff!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-action b { font-size:10px!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-action small { font-size:8px!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision[data-outcome="defeat"] .battle-result-action {
  border-color:#c92c38!important;
  background:linear-gradient(135deg,#f35660,#d93343)!important;
  box-shadow:0 7px 16px rgba(170,28,45,.2),inset 0 1px rgba(255,255,255,.18)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-action:disabled {
  border-color:var(--bui-line)!important;
  background:linear-gradient(135deg,#8ea4ad,#718992)!important;
  box-shadow:none!important;
}

@media (max-width:760px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --mobile-command-h:206px;
    --v6-deck-h:206px;
  }

  /* Compact top telemetry: readable but no longer dominates the arena. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article {
    top:max(5px,env(safe-area-inset-top))!important;
    width:calc(50% - 7px)!important;
    height:94px!important;
    min-height:94px!important;
    max-height:94px!important;
    padding:5px 6px!important;
    grid-template-columns:37px minmax(0,1fr)!important;
    grid-template-rows:23px 18px 13px 19px!important;
    column-gap:5px!important;
    row-gap:2px!important;
    overflow:visible!important;
    border-radius:13px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .ally-health { left:4px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .enemy-health { right:4px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art > * {
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    min-height:34px!important;
    max-width:34px!important;
    max-height:34px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait { border-radius:10px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity {
    grid-template-rows:14px 10px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > b {
    font-size:10px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > em {
    min-width:30px!important;
    height:15px!important;
    padding:0 3px!important;
    font-size:6px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-types .pokemon-type-badge {
    height:10px!important;
    min-height:10px!important;
    padding:0 2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-types .pokemon-type-badge img { width:7px!important;height:7px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-types .pokemon-type-badge b { font-size:6.2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > :is(.battle-vital,.battle-exp) {
    grid-template-rows:8px 7px!important;
    gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span {
    grid-template-columns:8px minmax(0,1fr) auto!important;
    gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span :is(i,svg) { width:7px!important;height:7px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span :is(b,strong,small) { font-size:7.2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-hp-bar { height:7px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-energy > i,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth .battle-exp > i { height:5px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-statuses {
    grid-column:1/-1!important;
    grid-row:4!important;
    width:100%!important;
    height:19px!important;
    min-height:19px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-statuses { gap:3px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip:nth-child(n+2) {
    flex:0 0 19px!important;
    width:19px!important;
    min-width:19px!important;
    max-width:19px!important;
    height:19px!important;
    min-height:19px!important;
    display:grid!important;
  }

  /* Mobile controls are one continuous battle sheet. The legacy tab state is
     still maintained for compatibility, but it no longer hides a control. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandDeck[data-view="combat"] {
    height:var(--mobile-command-h)!important;
    min-height:var(--mobile-command-h)!important;
    max-height:var(--mobile-command-h)!important;
    padding:6px!important;
    overflow:hidden!important;
    border-radius:18px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls {
    width:100%!important;
    height:100%!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:74px 22px 44px 44px!important;
    gap:3px!important;
    overflow:hidden!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .mobile-combat-tabs {
    display:none!important;
  }
  /* V26 — native touch contract. A phone is not a keyboard. Slot hotkeys stay
     available on desktop, while touch uses art, name, cost and live state. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button > kbd,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button > kbd,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > kbd {
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] :is(.combat-action-button,.combat-item-button,.battle-roster-slot,.combat-utility-actions > button) {
    -webkit-tap-highlight-color:transparent!important;
    -webkit-touch-callout:none!important;
    user-select:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row {
    grid-column:1!important;
    grid-row:2!important;
    width:100%!important;
    height:22px!important;
    min-height:22px!important;
    padding:0 4px!important;
    display:block!important;
    overflow:hidden!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy {
    width:100%!important;
    height:22px!important;
    min-height:22px!important;
    display:grid!important;
    grid-template-columns:108px minmax(0,1fr)!important;
    gap:6px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy > span {
    grid-template-columns:17px auto 1fr!important;
    gap:3px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy > span > :is(i,svg) { width:17px!important;height:17px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy > span :is(small,b) { font-size:7.5px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandEnergyTrack { height:7px!important; }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
    display:contents!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="items"] .combat-skills-panel {
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    height:74px!important;
    display:block!important;
    padding:0!important;
    border:0!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="skills"] .combat-items-panel {
    grid-column:1!important;
    grid-row:3!important;
    width:100%!important;
    height:44px!important;
    display:block!important;
    padding:0!important;
    border:0!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] :is(.combat-skills-panel,.combat-items-panel) > header { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-shell,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills {
    width:100%!important;
    height:74px!important;
    min-height:74px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills {
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-template-rows:74px!important;
    gap:3px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button {
    --combat-size:52px;
    width:100%!important;
    height:74px!important;
    min-width:44px!important;
    min-height:74px!important;
    padding:0 1px!important;
    grid-template-rows:52px 18px!important;
    row-gap:2px!important;
    overflow:visible!important;
    touch-action:manipulation!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
    width:52px!important;
    height:52px!important;
    min-width:52px!important;
    min-height:52px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-name {
    grid-row:2!important;
    width:100%!important;
    height:18px!important;
    min-height:18px!important;
    display:-webkit-box!important;
    font-size:7px!important;
    line-height:8.5px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:normal!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-tags { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-cost { top:35px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleQuickItems {
    width:100%!important;
    height:44px!important;
    padding:0!important;
    display:grid!important;
    grid-template-columns:repeat(6,44px)!important;
    grid-template-rows:44px!important;
    align-content:center!important;
    justify-content:center!important;
    gap:2px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button {
    width:100%!important;
    max-width:44px!important;
    height:44px!important;
    min-width:44px!important;
    min-height:44px!important;
    padding:2px!important;
    touch-action:manipulation!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button > span:first-child,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button > .combat-cooldown {
    width:40px!important;
    height:40px!important;
    max-width:100%!important;
    max-height:40px!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel {
    grid-column:1!important;
    grid-row:4!important;
    width:min(300px,100%)!important;
    min-width:0!important;
    max-width:300px!important;
    height:44px!important;
    padding:0!important;
    border:0!important;
    justify-self:center!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions {
    width:min(300px,100%)!important;
    height:44px!important;
    padding:0!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:44px!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #cancelBattle {
    width:100%!important;
    height:44px!important;
    min-width:0!important;
    min-height:44px!important;
    padding:0 5px!important;
    grid-template-columns:15px minmax(0,1fr)!important;
    gap:4px!important;
    border-radius:12px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > :is(i,svg) {
    width:15px!important;
    height:15px!important;
    min-width:15px!important;
    min-height:15px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > b { font-size:7.2px!important; }
  /* The visible utilities differ by mode: PvE has three, co-op has two and
     manual PvP only needs surrender. Do not reserve invisible grid columns. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions[data-visible-actions="1"] {
    width:min(108px,100%)!important;
    grid-template-columns:minmax(0,1fr)!important;
    justify-self:center!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions[data-visible-actions="2"] {
    width:min(216px,100%)!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    justify-self:center!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions[data-visible-actions="3"] {
    width:min(300px,100%)!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel {
    bottom:calc(var(--mobile-command-h) + var(--mobile-safe-bottom) + 6px)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip {
    bottom:calc(var(--mobile-command-h) + var(--mobile-safe-bottom) + 60px)!important;
  }

  /* The result card is genuinely centred and its rewards stay graphical. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-view="result"] #battleDecision.battle-result-layer:not([hidden]),
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-view="decision"] #battleDecision.battle-result-layer:not([hidden]) {
    inset:0!important;
    padding:max(9px,env(safe-area-inset-top)) max(9px,env(safe-area-inset-right)) max(9px,env(safe-area-inset-bottom)) max(9px,env(safe-area-inset-left))!important;
    display:grid!important;
    place-items:center!important;
    align-content:center!important;
    overflow:hidden!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-card {
    width:min(410px,calc(100% - 4px))!important;
    height:auto!important;
    min-height:0!important;
    max-height:calc(100% - 4px)!important;
    padding:14px 13px 13px!important;
    grid-template-columns:1fr!important;
    grid-template-rows:auto auto auto!important;
    gap:10px!important;
    align-self:center!important;
    overflow:visible!important;
    border-radius:21px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision.has-many-results .battle-result-card {
    overflow:auto!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-outcome {
    grid-template-columns:64px minmax(0,1fr)!important;
    gap:10px!important;
    padding:0 0 10px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem > .battle-result-vector,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem > .combat-result-art {
    width:60px!important;
    height:60px!important;
    min-width:60px!important;
    min-height:60px!important;
    max-width:60px!important;
    max-height:60px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy { gap:3px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > small { font-size:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > b {
    font-size:clamp(24px,8vw,32px)!important;
    line-height:.96!important;
    overflow:visible!important;
    white-space:normal!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > em {
    font-size:8.5px!important;
    line-height:1.3!important;
    overflow:visible!important;
    text-overflow:clip!important;
    white-space:normal!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-drops { gap:7px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList[data-mode="losses"] {
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop {
    min-height:118px!important;
    padding:3px 1px 5px!important;
    grid-template-rows:60px auto 20px!important;
    gap:3px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop::before {
    top:5px!important;
    width:58px!important;
    height:58px!important;
    border-radius:20px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop-art {
    width:56px!important;
    height:56px!important;
    min-width:56px!important;
    min-height:56px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > span > b {
    min-height:22px!important;
    font-size:8px!important;
    line-height:1.3!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > strong { font-size:16px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-actions {
    width:100%!important;
    gap:5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-actions[data-mode="single"] {
    width:min(250px,100%)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-action {
    height:46px!important;
    min-height:46px!important;
    padding:0 10px!important;
    border-radius:13px!important;
    touch-action:manipulation!important;
  }
}

@media (max-width:340px) and (orientation:portrait) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] { --mobile-command-h:202px; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls {
    grid-template-rows:70px 22px 44px 44px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="items"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-shell,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills { height:70px!important;min-height:70px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills { grid-template-rows:70px!important;gap:2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button {
    --combat-size:49px;
    height:70px!important;
    min-height:70px!important;
    grid-template-rows:49px 17px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
    width:49px!important;height:49px!important;min-width:49px!important;min-height:49px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-cost { top:32px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="skills"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleQuickItems { height:44px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleQuickItems {
    grid-template-columns:repeat(6,44px)!important;
    grid-template-rows:44px!important;
    gap:1px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button { height:44px!important;min-height:44px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battleRewardList,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList[data-mode="losses"] {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop { min-height:112px!important; }
}

@media (max-width:760px) and (max-height:650px) and (orientation:portrait) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] { --mobile-command-h:198px; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls {
    grid-template-rows:66px 20px 44px 44px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy {
    height:20px!important;
    min-height:20px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandEnergyTrack { height:5px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article {
    height:86px!important;
    min-height:86px!important;
    max-height:86px!important;
    grid-template-rows:21px 16px 12px 15px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-statuses { height:15px!important;min-height:15px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip:nth-child(n+2) {
    flex-basis:15px!important;width:15px!important;min-width:15px!important;max-width:15px!important;height:15px!important;min-height:15px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="items"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-shell,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills { height:66px!important;min-height:66px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills { grid-template-rows:66px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button {
    --combat-size:46px;
    height:66px!important;
    min-height:66px!important;
    grid-template-rows:46px 16px!important;
    row-gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
    width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-cost { top:29px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-name {
    display:-webkit-box!important;
    height:16px!important;
    min-height:16px!important;
    font-size:6.8px!important;
    line-height:8px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="skills"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleQuickItems { height:44px!important; }
}

@media (max-width:900px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] { --mobile-command-h:146px; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls {
    grid-template-rows:22px minmax(0,1fr)!important;
    gap:3px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy { height:22px!important;min-height:22px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row {
    grid-column:1!important;
    grid-row:1!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
    grid-column:1!important;
    grid-row:2!important;
    width:100%!important;
    height:100%!important;
    display:grid!important;
    grid-template-columns:minmax(176px,.42fr) minmax(264px,.58fr)!important;
    grid-template-rows:61px 44px!important;
    gap:3px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="items"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-shell,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills {
    grid-column:1!important;
    grid-row:1!important;
    height:61px!important;
    min-height:61px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills { grid-template-rows:61px!important;gap:2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button {
    --combat-size:48px;
    height:61px!important;
    min-height:61px!important;
    grid-template-rows:48px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
    width:48px!important;height:48px!important;min-width:48px!important;min-height:48px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-name { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-cost { top:31px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="skills"] .combat-items-panel {
    grid-column:2!important;
    grid-row:1!important;
    height:61px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleQuickItems {
    height:61px!important;
    grid-template-columns:repeat(6,44px)!important;
    grid-template-rows:48px!important;
    gap:1px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button { width:44px!important;height:48px!important;min-width:44px!important;min-height:48px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel {
    grid-column:1/-1!important;
    grid-row:2!important;
    width:min(300px,100%)!important;
    max-width:300px!important;
    justify-self:center!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions {
    width:min(300px,100%)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel {
    top:auto!important;
    bottom:calc(var(--mobile-command-h) + var(--mobile-safe-bottom) + 5px)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-card {
    width:min(620px,calc(100% - 8px))!important;
    max-height:calc(100% - 8px)!important;
    grid-template-columns:1fr!important;
    grid-template-rows:auto auto auto!important;
    padding:10px 12px!important;
    gap:7px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-outcome,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-drops,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-actions {
    grid-column:1!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-outcome { grid-row:1!important;grid-template-columns:52px minmax(0,1fr)!important;padding-bottom:6px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-drops { grid-row:2!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-actions { grid-row:3!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem > .battle-result-vector { width:48px!important;height:48px!important;min-width:48px!important;min-height:48px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > b { font-size:24px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList[data-mode="losses"] { grid-template-columns:repeat(auto-fit,minmax(90px,116px))!important;gap:4px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop { min-height:92px!important;grid-template-rows:48px auto 16px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop::before { width:46px!important;height:46px!important;top:3px!important;border-radius:16px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop-art { width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > span > b { min-height:16px!important;font-size:7px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > strong { font-size:14px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-action { height:44px!important;min-height:44px!important; }
}

@media (max-width:560px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] { --mobile-command-h:140px; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article {
    width:calc(50% - 7px)!important;
    height:56px!important;
    min-height:56px!important;
    max-height:56px!important;
    padding:5px!important;
    grid-template-columns:34px minmax(0,1fr)!important;
    grid-template-rows:22px 20px!important;
    column-gap:4px!important;
    row-gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art > * {
    width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;max-width:32px!important;max-height:32px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait { grid-column:1!important;grid-row:1/3!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity { grid-column:2!important;grid-row:1!important;grid-template-rows:20px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-types,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .ally-health > .battle-exp,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .enemy-health > .battle-energy { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > .battle-vital-hp {
    grid-column:2!important;grid-row:2!important;grid-template-rows:9px 7px!important;gap:2px!important;padding-right:70px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area {
    position:absolute!important;right:5px!important;bottom:4px!important;grid-column:auto!important;grid-row:auto!important;width:66px!important;height:20px!important;min-height:20px!important;overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-statuses { width:66px!important;height:20px!important;min-height:20px!important;gap:2px!important;overflow:visible!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip {
    flex-basis:20px!important;width:20px!important;min-width:20px!important;max-width:20px!important;height:20px!important;min-height:20px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-chip:nth-child(n+2) { display:grid!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-status-more {
    width:22px!important;height:20px!important;min-width:22px!important;padding:0 2px!important;display:grid!important;place-items:center!important;font-size:7px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
    grid-template-columns:minmax(174px,.4fr) minmax(264px,.6fr)!important;
    grid-template-rows:57px 44px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="items"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-shell,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills { height:57px!important;min-height:57px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills { grid-template-rows:57px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button { --combat-size:45px;height:57px!important;min-height:57px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art { width:45px!important;height:45px!important;min-width:45px!important;min-height:45px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-cost { top:28px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="skills"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleQuickItems { height:57px!important; }
}

/* V26 also covers touch tablets that intentionally use the wider tablet
   composition: physical-key hints are useful on a PC, not under a finger. */
@media (hover:none) and (pointer:coarse) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button > kbd,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button > kbd,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > kbd {
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] :is(.combat-action-button,.combat-item-button,.battle-roster-slot,.combat-utility-actions > button) {
    -webkit-tap-highlight-color:transparent!important;
    -webkit-touch-callout:none!important;
    user-select:none!important;
  }
}

@media (prefers-reduced-motion:reduce) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-result-card {
    transition:none!important;
    animation:none!important;
  }
}

/* ========================================================================== 
   V27 — native mobile battle application.
   The phone cockpit is deliberately authored after every legacy breakpoint:
   it is not a scaled desktop deck and it never exposes keyboard bindings.
   ========================================================================== */

/* Terminal result: one clean card. No decorative circles, ovals, pseudo
   backgrounds or CSS geometry may sit behind the actual result artwork. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision.battle-result-layer:not([hidden]) {
  background:color-mix(in srgb,#071b27 18%,transparent)!important;
  backdrop-filter:blur(2px)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-card {
  width:min(620px,calc(100% - 24px))!important;
  padding:20px 22px 18px!important;
  gap:14px!important;
  overflow:visible!important;
  border:1px solid color-mix(in srgb,var(--outcome-accent,var(--bui-accent)) 22%,#d8e8ed)!important;
  border-radius:22px!important;
  outline:0!important;
  background:#f8fcfd!important;
  box-shadow:0 22px 52px rgba(9,42,56,.25),inset 0 1px #fff!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision :is(
  .battle-result-card,.battle-result-outcome,.battle-result-emblem,.battle-result-drops,
  .combat-reward-list,.battle-reward-drop,.battle-result-actions
)::before,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision :is(
  .battle-result-card,.battle-result-outcome,.battle-result-emblem,.battle-result-drops,
  .combat-reward-list,.battle-reward-drop,.battle-result-actions
)::after {
  content:none!important;
  display:none!important;
  width:0!important;
  height:0!important;
  border:0!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem {
  position:static!important;
  width:70px!important;
  height:70px!important;
  min-width:70px!important;
  min-height:70px!important;
  max-width:70px!important;
  max-height:70px!important;
  overflow:visible!important;
  border:0!important;
  border-radius:0!important;
  outline:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem > :is(svg,.battle-result-vector,.combat-result-art) {
  position:static!important;
  inset:auto!important;
  width:70px!important;
  height:70px!important;
  min-width:70px!important;
  min-height:70px!important;
  max-width:70px!important;
  max-height:70px!important;
  margin:0!important;
  overflow:visible!important;
  transform:none!important;
  background:transparent!important;
  box-shadow:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem .combat-result-art > :is(defs,path,g,use,circle,ellipse,rect,linearGradient,stop) {
  position:static!important;
  inset:auto!important;
  width:revert!important;
  height:revert!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  transform:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-defeat-crest > ellipse {
  display:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-outcome {
  grid-template-columns:76px minmax(0,1fr)!important;
  gap:14px!important;
  padding:0 0 13px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > b {
  font-size:clamp(30px,4.4vw,42px)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-actions[data-mode="single"] {
  width:min(232px,100%)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-action {
  height:42px!important;
  min-height:42px!important;
  border-radius:12px!important;
}

@media (max-width:760px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --mobile-command-h:236px;
    --v6-deck-h:236px;
    --v27-touch-gap:4px;
  }

  /* Top telemetry remains compact but no longer uses microscopic copy. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article {
    top:max(5px,env(safe-area-inset-top))!important;
    width:calc(50% - 6px)!important;
    height:91px!important;
    min-height:91px!important;
    max-height:91px!important;
    padding:6px!important;
    grid-template-columns:38px minmax(0,1fr)!important;
    grid-template-rows:24px 18px 13px 18px!important;
    column-gap:5px!important;
    row-gap:2px!important;
    overflow:visible!important;
    border-radius:14px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .ally-health { left:3px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > .enemy-health { right:3px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-combat-portrait-art > * {
    width:36px!important;
    height:36px!important;
    min-width:36px!important;
    min-height:36px!important;
    max-width:36px!important;
    max-height:36px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > b {
    font-size:10.5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-identity > header > em {
    min-width:31px!important;
    height:16px!important;
    font-size:6.8px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-fighter-types .pokemon-type-badge b {
    font-size:6.8px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span :is(b,strong,small) {
    font-size:8px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-card-status-area,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-statuses {
    z-index:6!important;
    height:18px!important;
    min-height:18px!important;
    overflow:visible!important;
  }

  /* Native touch cockpit: energy -> skills -> items -> named utilities. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandDeck[data-view="combat"] {
    height:var(--mobile-command-h)!important;
    min-height:var(--mobile-command-h)!important;
    max-height:var(--mobile-command-h)!important;
    padding:7px!important;
    overflow:visible!important;
    border-radius:18px!important;
    background:rgba(248,253,254,.97)!important;
    box-shadow:0 -9px 28px rgba(13,53,67,.18),inset 0 1px #fff!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v27"] {
    width:100%!important;
    height:100%!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:34px 82px 50px 38px!important;
    gap:var(--v27-touch-gap)!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .mobile-combat-tabs {
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
    display:contents!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row {
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    height:34px!important;
    min-height:34px!important;
    padding:3px 7px!important;
    display:block!important;
    overflow:hidden!important;
    border:1px solid #b8dfeb!important;
    border-radius:11px!important;
    background:#eaf9fd!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy {
    width:100%!important;
    height:26px!important;
    min-height:26px!important;
    display:grid!important;
    grid-template-columns:124px minmax(0,1fr)!important;
    align-items:center!important;
    gap:8px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy > span {
    grid-template-columns:20px auto 1fr!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy > span > :is(i,svg) {
    width:20px!important;
    height:20px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy > span :is(small,b) {
    font-size:9px!important;
    line-height:1!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandEnergyTrack {
    height:10px!important;
    border-radius:999px!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="items"] .combat-skills-panel {
    grid-column:1!important;
    grid-row:2!important;
    width:100%!important;
    height:82px!important;
    min-height:82px!important;
    padding:0!important;
    display:block!important;
    overflow:visible!important;
    border:0!important;
    background:transparent!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-panel > header {
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] :is(.combat-skills-shell,#battleSkills) {
    width:100%!important;
    height:82px!important;
    min-height:82px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills {
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-template-rows:82px!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button {
    --combat-size:54px;
    width:100%!important;
    height:82px!important;
    min-width:0!important;
    min-height:82px!important;
    padding:0 2px!important;
    display:grid!important;
    grid-template-rows:56px 22px!important;
    align-items:start!important;
    justify-items:center!important;
    row-gap:2px!important;
    overflow:visible!important;
    touch-action:manipulation!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
    grid-row:1!important;
    width:54px!important;
    height:54px!important;
    min-width:54px!important;
    min-height:54px!important;
    max-width:54px!important;
    max-height:54px!important;
    border-radius:50%!important;
    overflow:hidden!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-name {
    grid-row:2!important;
    width:100%!important;
    height:22px!important;
    min-height:22px!important;
    display:-webkit-box!important;
    overflow:hidden!important;
    color:#173d4e!important;
    font-size:8.8px!important;
    font-weight:850!important;
    line-height:10px!important;
    text-align:center!important;
    white-space:normal!important;
    text-overflow:ellipsis!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button > kbd,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button > kbd,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot > kbd,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-tags {
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-cost {
    top:36px!important;
    right:calc(50% - 29px)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-ultimate-badge {
    top:1px!important;
    right:1px!important;
    font-size:6.5px!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="skills"] .combat-items-panel {
    position:relative!important;
    grid-column:1!important;
    grid-row:3!important;
    width:100%!important;
    height:50px!important;
    min-height:50px!important;
    padding:3px 4px!important;
    display:grid!important;
    grid-template-columns:54px minmax(0,1fr)!important;
    align-items:center!important;
    gap:4px!important;
    overflow:visible!important;
    border:1px solid #d2e5e9!important;
    border-radius:12px!important;
    background:#f4fafb!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel > header {
    width:54px!important;
    height:100%!important;
    padding:0!important;
    display:grid!important;
    place-items:center!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel > header > b {
    color:#527583!important;
    font-size:7.5px!important;
    font-weight:900!important;
    letter-spacing:.04em!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleQuickItems {
    width:100%!important;
    height:42px!important;
    min-height:42px!important;
    padding:0!important;
    display:grid!important;
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    grid-template-rows:42px!important;
    align-items:center!important;
    justify-content:stretch!important;
    gap:2px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button {
    width:100%!important;
    max-width:42px!important;
    height:42px!important;
    min-width:0!important;
    min-height:42px!important;
    justify-self:center!important;
    padding:2px!important;
    touch-action:manipulation!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button > span:first-child,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button > .combat-cooldown {
    width:38px!important;
    height:38px!important;
    max-width:100%!important;
    max-height:38px!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel {
    grid-column:1!important;
    grid-row:4!important;
    width:100%!important;
    max-width:none!important;
    height:38px!important;
    min-height:38px!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions[data-visible-actions="3"] {
    width:100%!important;
    max-width:none!important;
    height:38px!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:38px!important;
    gap:5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions[data-visible-actions="1"] {
    width:min(142px,100%)!important;
    grid-template-columns:minmax(0,1fr)!important;
    justify-self:center!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions[data-visible-actions="2"] {
    width:min(286px,100%)!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    justify-self:center!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #cancelBattle {
    width:100%!important;
    height:38px!important;
    min-width:0!important;
    min-height:38px!important;
    padding:0 7px!important;
    display:grid!important;
    grid-template-columns:16px minmax(0,auto)!important;
    place-content:center!important;
    gap:5px!important;
    border-radius:11px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > :is(i,svg) {
    width:16px!important;
    height:16px!important;
    min-width:16px!important;
    min-height:16px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > b {
    display:block!important;
    overflow:visible!important;
    color:currentColor!important;
    font-size:9.5px!important;
    font-weight:900!important;
    line-height:1!important;
    white-space:nowrap!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel {
    bottom:calc(var(--mobile-command-h) + var(--mobile-safe-bottom) + 8px)!important;
    width:min(286px,calc(100% - 20px))!important;
    min-width:0!important;
    max-width:286px!important;
    height:42px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-roster-slot {
    width:40px!important;
    min-width:40px!important;
    height:40px!important;
    min-height:40px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip {
    bottom:calc(var(--mobile-command-h) + var(--mobile-safe-bottom) + 58px)!important;
    width:min(328px,calc(100% - 16px))!important;
    max-width:328px!important;
  }

  /* Tactics is a modal phone sheet with its own scrolling and safe-area. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-tactics:not([hidden]) {
    position:absolute!important;
    z-index:104!important;
    top:auto!important;
    right:max(8px,env(safe-area-inset-right))!important;
    bottom:max(8px,env(safe-area-inset-bottom))!important;
    left:max(8px,env(safe-area-inset-left))!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
    max-height:calc(100% - max(16px,env(safe-area-inset-top)) - max(16px,env(safe-area-inset-bottom)))!important;
    margin:0!important;
    padding:12px!important;
    display:grid!important;
    grid-template-rows:auto auto auto minmax(0,1fr) auto!important;
    gap:9px!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    border:1px solid #b8dce7!important;
    border-radius:20px!important;
    background:#f7fcfd!important;
    box-shadow:0 24px 60px rgba(5,29,42,.38)!important;
    transform:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-tactics > header {
    position:sticky!important;
    z-index:2!important;
    top:-12px!important;
    min-height:46px!important;
    padding:5px 0 7px!important;
    background:#f7fcfd!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-tactics > header nav > button {
    width:36px!important;
    height:36px!important;
    min-width:36px!important;
    min-height:36px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-tactic-modes {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-tactic-modes > button {
    min-height:70px!important;
    padding:8px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules {
    min-height:0!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-tactic-rules > label {
    min-height:46px!important;
    padding:7px 8px!important;
  }

  /* Mobile result uses icon -> label -> value, centred in the viewport. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision.battle-result-layer:not([hidden]) {
    inset:0!important;
    padding:max(9px,env(safe-area-inset-top)) max(9px,env(safe-area-inset-right)) max(9px,env(safe-area-inset-bottom)) max(9px,env(safe-area-inset-left))!important;
    display:grid!important;
    place-items:center!important;
    align-content:center!important;
    overflow:hidden!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-card {
    width:min(404px,calc(100% - 2px))!important;
    max-height:calc(100% - 2px)!important;
    padding:13px!important;
    gap:9px!important;
    align-self:center!important;
    overflow:visible!important;
    border-radius:19px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision.has-many-results .battle-result-card {
    overflow:auto!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-outcome {
    grid-template-columns:58px minmax(0,1fr)!important;
    gap:10px!important;
    padding:0 0 9px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-emblem > :is(svg,.battle-result-vector,.combat-result-art) {
    width:56px!important;
    height:56px!important;
    min-width:56px!important;
    min-height:56px!important;
    max-width:56px!important;
    max-height:56px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > small {
    font-size:8.5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > b {
    font-size:clamp(25px,8.7vw,33px)!important;
    line-height:.96!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-copy > em {
    font-size:9.5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRewardList[data-mode="losses"] {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:6px 8px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop {
    min-height:104px!important;
    grid-template-rows:54px auto 20px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop-art {
    width:52px!important;
    height:52px!important;
    min-width:52px!important;
    min-height:52px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > span > b {
    min-height:20px!important;
    font-size:9px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-reward-drop > strong {
    font-size:17px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-actions[data-mode="single"] {
    width:min(224px,100%)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleDecision .battle-result-action {
    height:42px!important;
    min-height:42px!important;
  }
}

@media (max-width:760px) and (max-height:650px) and (orientation:portrait) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --mobile-command-h:218px;
    --v6-deck-h:218px;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v27"] {
    grid-template-rows:32px 72px 48px 36px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row {
    height:32px!important;
    min-height:32px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy {
    height:24px!important;
    min-height:24px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] :is(.combat-skills-shell,#battleSkills) {
    height:72px!important;
    min-height:72px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills {
    grid-template-rows:72px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button {
    --combat-size:48px;
    height:72px!important;
    min-height:72px!important;
    grid-template-rows:49px 20px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
    width:48px!important;
    height:48px!important;
    min-width:48px!important;
    min-height:48px!important;
    max-width:48px!important;
    max-height:48px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-name {
    height:20px!important;
    min-height:20px!important;
    font-size:8.2px!important;
    line-height:9px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-cost { top:31px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="skills"] .combat-items-panel {
    height:48px!important;
    min-height:48px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #cancelBattle {
    height:36px!important;
    min-height:36px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleHealth > article {
    height:84px!important;
    min-height:84px!important;
    max-height:84px!important;
  }
}

@media (max-width:900px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --mobile-command-h:154px;
    --v6-deck-h:154px;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandDeck[data-view="combat"] {
    height:var(--mobile-command-h)!important;
    min-height:var(--mobile-command-h)!important;
    max-height:var(--mobile-command-h)!important;
    padding:6px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v27"] {
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:28px 74px 36px!important;
    gap:3px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-resource-row {
    grid-column:1!important;
    grid-row:1!important;
    height:28px!important;
    min-height:28px!important;
    padding:2px 7px!important;
    display:block!important;
    border:1px solid #b8dfeb!important;
    border-radius:9px!important;
    background:#eaf9fd!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy {
    height:22px!important;
    min-height:22px!important;
    grid-template-columns:122px minmax(0,1fr)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-energy > span :is(small,b) { font-size:8.5px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandEnergyTrack { height:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-main-row {
    grid-column:1!important;
    grid-row:2/4!important;
    width:100%!important;
    height:113px!important;
    display:grid!important;
    grid-template-columns:minmax(280px,.58fr) minmax(250px,.42fr)!important;
    grid-template-rows:74px 36px!important;
    gap:3px 5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="items"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] :is(.combat-skills-shell,#battleSkills) {
    grid-column:1!important;
    grid-row:1!important;
    height:74px!important;
    min-height:74px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleSkills {
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-template-rows:74px!important;
    gap:3px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button {
    --combat-size:49px;
    height:74px!important;
    min-height:74px!important;
    grid-template-rows:50px 20px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-action-button .combat-skill-art {
    width:49px!important;
    height:49px!important;
    min-width:49px!important;
    min-height:49px!important;
    max-width:49px!important;
    max-height:49px!important;
    border-radius:50%!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-name {
    display:-webkit-box!important;
    height:20px!important;
    min-height:20px!important;
    font-size:8px!important;
    line-height:9px!important;
    -webkit-line-clamp:2!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-cost { top:32px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-tab="skills"] .combat-items-panel {
    grid-column:2!important;
    grid-row:1!important;
    width:100%!important;
    height:74px!important;
    min-height:74px!important;
    padding:4px!important;
    display:grid!important;
    grid-template-columns:46px minmax(0,1fr)!important;
    gap:3px!important;
    overflow:visible!important;
    border:1px solid #d2e5e9!important;
    border-radius:11px!important;
    background:#f4fafb!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel > header {
    display:grid!important;
    place-items:center!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-items-panel > header > b {
    font-size:7px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleQuickItems {
    width:100%!important;
    height:64px!important;
    display:grid!important;
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    grid-template-rows:42px!important;
    align-content:center!important;
    gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-item-button {
    width:100%!important;
    max-width:42px!important;
    height:42px!important;
    min-width:0!important;
    min-height:42px!important;
    justify-self:center!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-panel {
    grid-column:1/-1!important;
    grid-row:2!important;
    width:min(420px,100%)!important;
    max-width:420px!important;
    height:36px!important;
    justify-self:center!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #cancelBattle {
    height:36px!important;
    min-height:36px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-utility-actions > button > b {
    display:block!important;
    font-size:9px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel {
    bottom:calc(var(--mobile-command-h) + var(--mobile-safe-bottom) + 5px)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .battle-tactics:not([hidden]) {
    top:max(6px,env(safe-area-inset-top))!important;
    bottom:max(6px,env(safe-area-inset-bottom))!important;
    max-height:none!important;
    grid-template-columns:minmax(210px,.42fr) minmax(300px,.58fr)!important;
    grid-template-rows:auto auto 1fr auto!important;
  }
}

@media (hover:none) and (pointer:coarse) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] :is(
    .combat-action-button,.combat-item-button,.battle-roster-slot,.combat-utility-actions > button,
    .battle-tactic-modes > button,.battle-tactic-rules > label
  ) {
    -webkit-tap-highlight-color:transparent!important;
    -webkit-touch-callout:none!important;
    user-select:none!important;
  }
}

/* ========================================================================== 
   V28 — clean mobile command deck.
   One cockpit surface, no nested energy/item cards, no empty quantity pills.
   ========================================================================== */

@media (max-width:760px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --mobile-command-h:218px;
    --v6-deck-h:218px;
    --v28-row-gap:3px;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleCommandDeck[data-view="combat"] {
    height:var(--mobile-command-h)!important;
    min-height:var(--mobile-command-h)!important;
    max-height:var(--mobile-command-h)!important;
    padding:7px!important;
    overflow:visible!important;
    border-radius:18px!important;
    background:rgba(249,253,254,.98)!important;
    box-shadow:0 -8px 24px rgba(14,52,66,.16),inset 0 1px #fff!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] {
    width:100%!important;
    height:100%!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:24px 80px 48px 36px!important;
    gap:var(--v28-row-gap)!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-main-row {
    display:contents!important;
  }

  /* Energy is telemetry, not another card. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-resource-row {
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    height:24px!important;
    min-height:24px!important;
    padding:0 3px!important;
    display:block!important;
    overflow:visible!important;
    border:0!important;
    border-radius:0!important;
    outline:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy {
    width:100%!important;
    height:24px!important;
    min-height:24px!important;
    padding:0!important;
    display:grid!important;
    grid-template-columns:122px minmax(0,1fr)!important;
    align-items:center!important;
    gap:8px!important;
    border:0!important;
    border-radius:0!important;
    outline:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy::before,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy::after {
    content:none!important;
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy > span {
    min-width:0!important;
    height:22px!important;
    display:grid!important;
    grid-template-columns:18px auto 1fr!important;
    align-items:center!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy > span > :is(i,svg) {
    width:18px!important;
    height:18px!important;
    min-width:18px!important;
    min-height:18px!important;
    color:#24acd7!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy > span :is(small,b) {
    font-size:8.5px!important;
    font-weight:900!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyTrack {
    position:relative!important;
    width:100%!important;
    height:5px!important;
    min-height:5px!important;
    max-height:5px!important;
    overflow:hidden!important;
    border:0!important;
    border-radius:999px!important;
    outline:0!important;
    background:#d7e8ed!important;
    box-shadow:inset 0 1px 2px rgba(22,73,91,.12)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyTrack::before,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyTrack::after {
    content:none!important;
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyBar {
    height:100%!important;
    min-height:5px!important;
    border-radius:999px!important;
    background:linear-gradient(90deg,#3bc4e7,#1da5d7)!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy-current {
    display:none!important;
  }

  /* Skills remain the main visual row, with no inner panel surface. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-skills-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"][data-mobile-tab="items"] .combat-skills-panel {
    grid-column:1!important;
    grid-row:2!important;
    width:100%!important;
    height:80px!important;
    min-height:80px!important;
    padding:0!important;
    display:block!important;
    overflow:visible!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-skills-panel > header {
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] :is(.combat-skills-shell,#battleSkills) {
    width:100%!important;
    height:80px!important;
    min-height:80px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] #battleSkills {
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-template-rows:80px!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-action-button {
    --combat-size:52px;
    width:100%!important;
    height:80px!important;
    min-width:0!important;
    min-height:80px!important;
    padding:0 2px!important;
    grid-template-rows:54px 22px!important;
    row-gap:2px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-action-button .combat-skill-art {
    width:52px!important;
    height:52px!important;
    min-width:52px!important;
    min-height:52px!important;
    max-width:52px!important;
    max-height:52px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-skill-name {
    height:22px!important;
    min-height:22px!important;
    font-size:8.7px!important;
    line-height:10px!important;
    -webkit-line-clamp:2!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-skill-cost {
    top:34px!important;
    right:calc(50% - 28px)!important;
  }

  /* Items are a clean row separated only by one hairline. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"][data-mobile-tab="skills"] .combat-items-panel {
    position:relative!important;
    grid-column:1!important;
    grid-row:3!important;
    width:100%!important;
    height:48px!important;
    min-height:48px!important;
    padding:4px 0 0!important;
    display:grid!important;
    grid-template-columns:50px minmax(0,1fr)!important;
    align-items:center!important;
    gap:2px!important;
    overflow:visible!important;
    border:0!important;
    border-top:1px solid #d7e6ea!important;
    border-radius:0!important;
    outline:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel::before,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel::after {
    content:none!important;
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header {
    width:50px!important;
    height:43px!important;
    padding:0!important;
    display:grid!important;
    place-items:center start!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header > b {
    color:#5d7984!important;
    font-size:7px!important;
    font-weight:900!important;
    letter-spacing:.035em!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] #battleQuickItems {
    width:100%!important;
    height:43px!important;
    min-height:43px!important;
    padding:0!important;
    display:grid!important;
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    grid-template-rows:40px!important;
    align-content:center!important;
    align-items:center!important;
    justify-content:stretch!important;
    gap:3px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button {
    width:100%!important;
    max-width:40px!important;
    height:40px!important;
    min-width:0!important;
    min-height:40px!important;
    padding:2px!important;
    justify-self:center!important;
    overflow:visible!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > span:first-child,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > .combat-cooldown {
    width:36px!important;
    height:36px!important;
    min-width:36px!important;
    min-height:36px!important;
    max-width:36px!important;
    max-height:36px!important;
    border-radius:11px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > span:first-child {
    border:1px solid #b9cfd6!important;
    background:#f1f6f7!important;
    box-shadow:inset 0 1px #fff!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button.is-empty-slot {
    opacity:1!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button.is-empty-slot > span:first-child {
    overflow:hidden!important;
    border:1px dashed #a9c0c7!important;
    border-radius:11px!important;
    background:rgba(235,243,245,.72)!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-empty-art {
    width:20px!important;
    height:20px!important;
    color:#79939d!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button.is-empty-slot > .combat-cooldown,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button.is-empty-slot > b,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > b:empty {
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button:not(.is-empty-slot) > b {
    right:-1px!important;
    bottom:-1px!important;
    min-width:17px!important;
    height:15px!important;
    padding:0 4px!important;
    display:grid!important;
    place-items:center!important;
    border-radius:7px!important;
    background:#29434c!important;
    color:#fff!important;
    font-size:7.5px!important;
  }

  /* Compact named actions remain the final row of the same surface. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-utility-panel {
    grid-column:1!important;
    grid-row:4!important;
    width:100%!important;
    max-width:none!important;
    height:36px!important;
    min-height:36px!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-utility-actions,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-utility-actions[data-visible-actions="3"] {
    width:100%!important;
    max-width:none!important;
    height:36px!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:36px!important;
    gap:5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-utility-actions[data-visible-actions="1"] {
    width:min(138px,100%)!important;
    grid-template-columns:minmax(0,1fr)!important;
    justify-self:center!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-utility-actions[data-visible-actions="2"] {
    width:min(280px,100%)!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    justify-self:center!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-utility-actions > button,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] #cancelBattle {
    height:36px!important;
    min-height:36px!important;
    border-radius:10px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-utility-actions > button > b {
    display:block!important;
    font-size:9.2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel {
    bottom:calc(var(--mobile-command-h) + var(--mobile-safe-bottom) + 7px)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] .combat-skill-preview.battle-tooltip {
    bottom:calc(var(--mobile-command-h) + var(--mobile-safe-bottom) + 57px)!important;
  }
}

@media (max-width:340px) and (orientation:portrait) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"][data-mobile-tab="skills"] .combat-items-panel {
    grid-template-columns:42px minmax(0,1fr)!important;
    gap:1px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header {
    width:42px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header > b {
    font-size:6.2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] #battleQuickItems {
    gap:2px!important;
  }
}

@media (max-width:760px) and (max-height:650px) and (orientation:portrait) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --mobile-command-h:204px;
    --v6-deck-h:204px;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] {
    grid-template-rows:22px 72px 44px 34px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] :is(.combat-resource-row,.combat-energy) {
    height:22px!important;
    min-height:22px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] :is(.combat-skills-panel,.combat-skills-shell,#battleSkills) {
    height:72px!important;
    min-height:72px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] #battleSkills {
    grid-template-rows:72px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-action-button {
    --combat-size:47px;
    height:72px!important;
    min-height:72px!important;
    grid-template-rows:49px 20px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-action-button .combat-skill-art {
    width:47px!important;
    height:47px!important;
    min-width:47px!important;
    min-height:47px!important;
    max-width:47px!important;
    max-height:47px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-skill-name {
    height:20px!important;
    min-height:20px!important;
    font-size:8px!important;
    line-height:9px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-skill-cost { top:30px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel {
    height:44px!important;
    min-height:44px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] :is(.combat-utility-panel,.combat-utility-actions,.combat-utility-actions > button,#cancelBattle) {
    height:34px!important;
    min-height:34px!important;
  }
}

@media (max-width:900px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] {
    --mobile-command-h:146px;
    --v6-deck-h:146px;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] {
    width:100%!important;
    height:100%!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:22px 72px 34px!important;
    gap:3px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-resource-row {
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    height:22px!important;
    min-height:22px!important;
    padding:0 3px!important;
    display:block!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy {
    height:22px!important;
    min-height:22px!important;
    grid-template-columns:118px minmax(0,1fr)!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyTrack {
    height:4px!important;
    min-height:4px!important;
    max-height:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-main-row {
    grid-column:1!important;
    grid-row:2/4!important;
    width:100%!important;
    height:109px!important;
    display:grid!important;
    grid-template-columns:minmax(280px,.59fr) minmax(244px,.41fr)!important;
    grid-template-rows:72px 34px!important;
    gap:3px 5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] :is(.combat-skills-panel,.combat-skills-shell,#battleSkills) {
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    height:72px!important;
    min-height:72px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] #battleSkills {
    grid-template-rows:72px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-action-button {
    --combat-size:47px;
    height:72px!important;
    min-height:72px!important;
    grid-template-rows:49px 20px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-action-button .combat-skill-art {
    width:47px!important;
    height:47px!important;
    min-width:47px!important;
    min-height:47px!important;
    max-width:47px!important;
    max-height:47px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-skill-name {
    display:-webkit-box!important;
    height:20px!important;
    min-height:20px!important;
    font-size:8px!important;
    line-height:9px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-skill-cost { top:30px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"][data-mobile-tab="skills"] .combat-items-panel {
    grid-column:2!important;
    grid-row:1!important;
    width:100%!important;
    height:72px!important;
    min-height:72px!important;
    padding:0 0 0 5px!important;
    display:grid!important;
    grid-template-columns:42px minmax(0,1fr)!important;
    gap:2px!important;
    overflow:visible!important;
    border:0!important;
    border-left:1px solid #d7e6ea!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header {
    width:42px!important;
    height:72px!important;
    display:grid!important;
    place-items:center start!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header > b {
    font-size:6.5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] #battleQuickItems {
    width:100%!important;
    height:72px!important;
    display:grid!important;
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    grid-template-rows:40px!important;
    align-content:center!important;
    gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-utility-panel {
    grid-column:1/-1!important;
    grid-row:2!important;
    width:min(410px,100%)!important;
    max-width:410px!important;
    height:34px!important;
    justify-self:center!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleLiveControls[data-mobile-layout="native-v28"] :is(.combat-utility-actions,.combat-utility-actions > button,#cancelBattle) {
    height:34px!important;
    min-height:34px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"] #battleRosterPanel {
    bottom:calc(var(--mobile-command-h) + var(--mobile-safe-bottom) + 5px)!important;
  }
}

/* ========================================================================== 
   V30 — detached mobile statuses and resource-row geometry.
   This is the last mobile owner: the card surface ends after HP + the
   secondary resource, while status telemetry lives below each fighter.
   ========================================================================== */

@media (max-width:760px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth {
    z-index:46!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article {
    top:max(5px,env(safe-area-inset-top))!important;
    width:calc(50% - 6px)!important;
    height:78px!important;
    min-height:78px!important;
    max-height:78px!important;
    padding:6px!important;
    grid-template-columns:44px minmax(0,1fr)!important;
    grid-template-rows:27px 20px 15px!important;
    column-gap:6px!important;
    row-gap:2px!important;
    overflow:visible!important;
    border:1px solid #bad7de!important;
    border-radius:15px!important;
    background:linear-gradient(155deg,rgba(255,255,255,.99),rgba(241,249,251,.98))!important;
    box-shadow:0 5px 14px rgba(18,62,77,.14),inset 0 1px #fff!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > .ally-health {
    left:3px!important;
    border-color:#a7d8ce!important;
    background:linear-gradient(145deg,rgba(226,249,244,.99),rgba(250,253,254,.99) 31%)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > .enemy-health {
    right:3px!important;
    border-color:#efc2bd!important;
    background:linear-gradient(215deg,rgba(255,235,232,.99),rgba(250,253,254,.99) 31%)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article::before,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article::after {
    content:none!important;
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait-art > * {
    width:42px!important;
    height:42px!important;
    min-width:42px!important;
    min-height:42px!important;
    max-width:42px!important;
    max-height:42px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait {
    grid-column:1!important;
    grid-row:1/4!important;
    align-self:start!important;
    border-width:1.5px!important;
    border-radius:13px!important;
    background:linear-gradient(145deg,#fff,#e8f6f8)!important;
    box-shadow:inset 0 0 0 2px rgba(255,255,255,.68),0 2px 7px rgba(20,67,82,.12)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .ally-health .battle-combat-portrait { border-color:#50bba7!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .enemy-health .battle-combat-portrait { border-color:#ef756b!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-fighter-identity {
    grid-template-rows:15px 10px!important;
    gap:1px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-fighter-identity > header { gap:4px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-fighter-identity > header > b { font-size:11px!important;line-height:1!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-fighter-identity > header > em {
    min-width:31px!important;
    height:16px!important;
    padding:0 4px!important;
    border-radius:7px!important;
    font-size:7px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-fighter-types { height:10px!important;gap:2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-fighter-types .pokemon-type-badge {
    height:10px!important;
    min-height:10px!important;
    padding:0 3px!important;
    gap:2px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-fighter-types .pokemon-type-badge img { width:7px!important;height:7px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-fighter-types .pokemon-type-badge b { font-size:6.8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article > .battle-vital-hp { grid-template-rows:9px 9px!important;gap:2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > .ally-health > .battle-exp,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > .enemy-health > .battle-energy {
    display:grid!important;
    grid-template-rows:7px 7px!important;
    gap:1px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span {
    grid-template-columns:10px minmax(0,1fr) auto!important;
    gap:3px!important;
    min-height:9px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span :is(i,svg) { width:10px!important;height:10px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article > :is(.battle-vital,.battle-exp) > span :is(b,strong,small) { font-size:8px!important;line-height:1!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > :is(.ally-health,.enemy-health) > :is(.battle-exp,.battle-energy) > span :is(i,svg) { width:8px!important;height:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > :is(.ally-health,.enemy-health) > :is(.battle-exp,.battle-energy) > span :is(b,strong,small) { font-size:7.5px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth .battle-hp-bar {
    height:9px!important;
    min-height:9px!important;
    border-color:#bad4d9!important;
    background:#dce9ec!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth .battle-energy > i,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth .battle-exp > i {
    height:7px!important;
    min-height:7px!important;
    border-color:#bfd5da!important;
    background:#dfeaed!important;
  }

  /* Statuses are independent, readable telemetry below the matching fighter. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-card-status-area {
    position:absolute!important;
    z-index:30!important;
    left:0!important;
    right:0!important;
    top:calc(100% + 4px)!important;
    bottom:auto!important;
    width:100%!important;
    height:22px!important;
    min-height:22px!important;
    padding:0 2px!important;
    display:block!important;
    overflow:visible!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    transform:none!important;
    isolation:isolate!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-card-status-area:not(:has(.battle-status-chip)) {
    height:0!important;
    min-height:0!important;
    padding:0!important;
    pointer-events:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-statuses {
    position:relative!important;
    z-index:31!important;
    width:100%!important;
    height:22px!important;
    min-height:22px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:3px!important;
    overflow:visible!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .enemy-health .battle-statuses { justify-content:flex-end!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-empty { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-chip,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-chip:nth-child(n+2) {
    position:relative!important;
    z-index:32!important;
    flex:0 1 auto!important;
    width:auto!important;
    min-width:22px!important;
    max-width:calc(50% - 2px)!important;
    height:22px!important;
    min-height:22px!important;
    padding:2px 5px!important;
    display:flex!important;
    align-items:center!important;
    gap:3px!important;
    overflow:hidden!important;
    border-radius:8px!important;
    box-shadow:0 2px 7px rgba(17,59,72,.13),inset 0 1px rgba(255,255,255,.65)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-icon { flex:none!important;width:15px!important;height:15px!important;border-radius:5px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-icon svg { width:13px!important;height:13px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-copy { min-width:0!important;display:flex!important;align-items:center!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-copy > b { font-size:7.5px!important;line-height:1!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-copy > small { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-more {
    height:22px!important;
    min-width:22px!important;
    padding:0 4px!important;
    display:grid!important;
    place-items:center!important;
  }

  /* Energy is one unboxed resource row with a visible battery gauge. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] {
    grid-template-rows:30px 80px 48px 36px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] :is(.combat-resource-row,.combat-energy) {
    height:30px!important;
    min-height:30px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-resource-row { padding:0 3px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy {
    grid-template-columns:134px minmax(0,1fr)!important;
    gap:8px!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy > span {
    height:30px!important;
    grid-template-columns:23px auto minmax(0,1fr)!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy > span > :is(i,svg) {
    width:23px!important;
    height:23px!important;
    min-width:23px!important;
    min-height:23px!important;
    padding:0!important;
    display:grid!important;
    place-items:center!important;
    border:0!important;
    border-radius:0!important;
    outline:0!important;
    background:transparent!important;
    color:#149fc9!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy > span > i > svg { width:100%!important;height:100%!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy > span :is(small,b) { font-size:8.8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyTrack {
    height:10px!important;
    min-height:10px!important;
    max-height:10px!important;
    border:1px solid #9fcfdc!important;
    background:#d7e9ed!important;
    box-shadow:inset 0 1px 2px rgba(20,73,89,.14),0 1px rgba(255,255,255,.9)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyBar {
    height:100%!important;
    min-height:8px!important;
    background:linear-gradient(90deg,#42d2ed,#159dcb 72%,#70dcef)!important;
    box-shadow:inset 0 1px rgba(255,255,255,.52)!important;
  }

  /* The divider occupies its own pixel; item cells begin seven pixels lower. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel {
    height:48px!important;
    min-height:48px!important;
    padding:8px 0 0!important;
    grid-template-columns:52px minmax(0,1fr)!important;
    gap:4px!important;
    overflow:visible!important;
    border:0!important;
    border-top:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel::before {
    content:""!important;
    position:absolute!important;
    left:0!important;
    right:0!important;
    top:1px!important;
    width:auto!important;
    height:1px!important;
    display:block!important;
    background:#cee1e6!important;
    pointer-events:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel::after { content:none!important;display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header {
    width:52px!important;
    height:40px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header > b {
    color:#456c79!important;
    font-size:7.2px!important;
    letter-spacing:.045em!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] #battleQuickItems {
    height:40px!important;
    min-height:40px!important;
    grid-template-rows:40px!important;
    gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button {
    max-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    padding:1px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > span:first-child,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > .combat-cooldown {
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    min-height:38px!important;
    max-width:38px!important;
    max-height:38px!important;
    border-radius:12px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button.is-empty-slot,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button.is-empty-slot.is-disabled { opacity:1!important;filter:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button.is-empty-slot > span:first-child {
    overflow:hidden!important;
    border:1px solid #afcbd2!important;
    border-radius:12px!important;
    background:linear-gradient(145deg,rgba(249,253,254,.98),rgba(225,239,243,.94))!important;
    box-shadow:inset 0 1px #fff,inset 0 0 0 2px rgba(255,255,255,.34),0 2px 5px rgba(28,71,83,.08)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-empty-art {
    width:22px!important;
    height:22px!important;
    color:#5f7f8a!important;
    opacity:.9!important;
    filter:none!important;
  }
}

@media (max-width:340px) and (orientation:portrait) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article { grid-template-columns:40px minmax(0,1fr)!important;column-gap:5px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait-art > * {
    width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;max-width:38px!important;max-height:38px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-fighter-identity > header { gap:3px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-fighter-identity > header > b { font-size:10px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-fighter-identity > header > em { min-width:28px!important;padding:0 3px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy { grid-template-columns:128px minmax(0,1fr)!important;gap:6px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel { grid-template-columns:44px minmax(0,1fr)!important;gap:2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header { width:44px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header > b { font-size:6.4px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] #battleQuickItems { gap:2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button { max-width:38px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > span:first-child,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > .combat-cooldown {
    width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;max-width:36px!important;max-height:36px!important;
  }
}

@media (max-width:760px) and (max-height:650px) and (orientation:portrait) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article {
    height:74px!important;
    min-height:74px!important;
    max-height:74px!important;
    grid-template-columns:40px minmax(0,1fr)!important;
    grid-template-rows:24px 19px 14px!important;
    column-gap:5px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait-art > * {
    width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;max-width:38px!important;max-height:38px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-card-status-area { top:calc(100% + 3px)!important;height:18px!important;min-height:18px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-statuses,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-chip,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-chip:nth-child(n+2) { height:18px!important;min-height:18px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-icon { width:13px!important;height:13px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-copy > b { font-size:6.8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] { grid-template-rows:28px 72px 44px 34px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] :is(.combat-resource-row,.combat-energy) { height:28px!important;min-height:28px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyTrack { height:8px!important;min-height:8px!important;max-height:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyBar { min-height:6px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel { height:44px!important;min-height:44px!important;padding-top:7px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] #battleQuickItems { height:37px!important;min-height:37px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] #battleQuickItems { grid-template-rows:37px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > span:first-child,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-item-button > .combat-cooldown {
    width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;max-width:36px!important;max-height:36px!important;
  }
}

@media (max-width:900px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] { --mobile-command-h:152px;--v6-deck-h:152px; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth { z-index:46!important;overflow:visible!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article {
    top:max(4px,env(safe-area-inset-top))!important;
    width:min(280px,calc(50% - 6px))!important;
    height:68px!important;
    min-height:68px!important;
    max-height:68px!important;
    padding:5px!important;
    grid-template-columns:40px minmax(0,1fr)!important;
    grid-template-rows:22px 18px 14px!important;
    column-gap:5px!important;
    row-gap:2px!important;
    overflow:visible!important;
    border:1px solid #bad7de!important;
    border-radius:13px!important;
    background:linear-gradient(155deg,rgba(255,255,255,.99),rgba(241,249,251,.98))!important;
    box-shadow:0 4px 12px rgba(18,62,77,.13),inset 0 1px #fff!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > .ally-health { left:3px!important;border-color:#a7d8ce!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > .enemy-health { right:3px!important;border-color:#efc2bd!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article::before,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article::after { content:none!important;display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait-art > * {
    width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;max-width:38px!important;max-height:38px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait { grid-column:1!important;grid-row:1/4!important;border-width:1.5px!important;border-radius:12px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .ally-health .battle-combat-portrait { border-color:#50bba7!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .enemy-health .battle-combat-portrait { border-color:#ef756b!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-fighter-identity > header > b { font-size:10px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article > .battle-vital-hp { grid-template-rows:8px 8px!important;gap:2px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > .ally-health > .battle-exp,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > .enemy-health > .battle-energy { display:grid!important;grid-template-rows:7px 6px!important;gap:1px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth .battle-hp-bar { height:8px!important;min-height:8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth .battle-energy > i,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth .battle-exp > i { height:6px!important;min-height:6px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-card-status-area {
    position:absolute!important;z-index:30!important;left:0!important;right:0!important;top:calc(100% + 3px)!important;bottom:auto!important;width:100%!important;height:18px!important;min-height:18px!important;padding:0 2px!important;display:block!important;overflow:visible!important;border:0!important;background:transparent!important;box-shadow:none!important;transform:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-card-status-area:not(:has(.battle-status-chip)) { height:0!important;min-height:0!important;padding:0!important;pointer-events:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-statuses { width:100%!important;height:18px!important;min-height:18px!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:2px!important;overflow:visible!important;transform:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .enemy-health .battle-statuses { justify-content:flex-end!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-empty { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-chip,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-chip:nth-child(n+2) {
    flex:0 1 auto!important;width:auto!important;min-width:18px!important;max-width:calc(50% - 1px)!important;height:18px!important;min-height:18px!important;padding:1px 4px!important;display:flex!important;align-items:center!important;gap:2px!important;border-radius:7px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-icon { width:13px!important;height:13px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-copy { display:flex!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-copy > b { font-size:6.8px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-status-copy > small { display:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] { grid-template-rows:28px 72px 34px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] :is(.combat-resource-row,.combat-energy) { height:28px!important;min-height:28px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy { grid-template-columns:128px minmax(0,1fr)!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy > span > :is(i,svg) { width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important;border:0!important;background:transparent!important;box-shadow:none!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyTrack { height:8px!important;min-height:8px!important;max-height:8px!important;border:1px solid #9fcfdc!important;background:#d7e9ed!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyBar { min-height:6px!important;background:linear-gradient(90deg,#42d2ed,#159dcb 72%,#70dcef)!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel { padding-left:8px!important;border:0!important;border-left:0!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel::before {
    content:""!important;position:absolute!important;left:1px!important;right:auto!important;top:4px!important;bottom:4px!important;width:1px!important;height:auto!important;display:block!important;background:#cee1e6!important;pointer-events:none!important;
  }
}

@media (max-width:560px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article {
    width:calc(50% - 6px)!important;
    height:68px!important;
    min-height:68px!important;
    max-height:68px!important;
    grid-template-columns:36px minmax(0,1fr)!important;
    grid-template-rows:22px 18px 14px!important;
    column-gap:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait-art,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait-art > * {
    width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;max-width:34px!important;max-height:34px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-combat-portrait { grid-row:1/4!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] .battle-fighter-identity { grid-template-rows:20px!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > article > .battle-vital-hp { grid-column:2!important;grid-row:2!important;padding-right:0!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > .ally-health > .battle-exp,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-polish="v30"] #battleHealth > .enemy-health > .battle-energy { grid-column:2!important;grid-row:3!important;display:grid!important; }
}

/* ========================================================================== 
   V31 — readable desktop status timers and aligned mobile resources.
   V30 remains the mobile geometry owner; this additive final layer repairs
   desktop effect chips, energy alignment/tip and the repeated item divider.
   ========================================================================== */

@media (min-width:901px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] .battle-card-status-area {
    grid-column:1/-1!important;
    grid-row:4!important;
    width:100%!important;
    height:28px!important;
    min-height:28px!important;
    padding:2px 0!important;
    display:block!important;
    overflow:hidden!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    transform:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] .battle-statuses {
    position:relative!important;
    width:100%!important;
    height:24px!important;
    min-height:24px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:4px!important;
    overflow:hidden!important;
    transform:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] .enemy-health .battle-statuses {
    justify-content:flex-end!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] .battle-status-empty {
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] .battle-status-chip,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] .battle-status-chip:nth-child(n+2) {
    position:relative!important;
    z-index:1!important;
    flex:0 1 calc(50% - 2px)!important;
    width:auto!important;
    min-width:0!important;
    max-width:calc(50% - 2px)!important;
    height:24px!important;
    min-height:24px!important;
    padding:2px 5px!important;
    display:grid!important;
    grid-template-columns:16px minmax(0,1fr)!important;
    align-items:center!important;
    gap:4px!important;
    overflow:hidden!important;
    border:1px solid color-mix(in srgb,var(--status-color,currentColor) 38%,var(--bui-line))!important;
    border-radius:8px!important;
    background:linear-gradient(135deg,color-mix(in srgb,var(--status-color,currentColor) 13%,var(--bui-card)),color-mix(in srgb,var(--status-color,currentColor) 5%,var(--bui-card)))!important;
    color:var(--status-color,var(--bui-text))!important;
    box-shadow:inset 0 1px rgba(255,255,255,.55),0 2px 5px rgba(16,55,68,.08)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] .battle-status-chip::before {
    content:none!important;
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] .battle-status-chip::after {
    content:""!important;
    position:absolute!important;
    left:0!important;
    right:auto!important;
    bottom:0!important;
    width:calc(var(--status-ratio,1) * 100%)!important;
    height:2px!important;
    display:block!important;
    border-radius:0 999px 999px 0!important;
    background:currentColor!important;
    opacity:.42!important;
    pointer-events:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] .battle-status-icon {
    grid-column:1!important;
    width:16px!important;
    height:16px!important;
    display:grid!important;
    place-items:center!important;
    border-radius:5px!important;
    background:color-mix(in srgb,currentColor 10%,transparent)!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] .battle-status-icon svg {
    width:14px!important;
    height:14px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] .battle-status-copy {
    grid-column:2!important;
    min-width:0!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:4px!important;
    white-space:nowrap!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] .battle-status-copy > b {
    min-width:0!important;
    overflow:hidden!important;
    color:var(--bui-text)!important;
    font-size:9px!important;
    font-weight:850!important;
    line-height:1!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] .battle-status-copy > small {
    min-width:29px!important;
    height:16px!important;
    padding:0 4px!important;
    display:grid!important;
    place-items:center!important;
    overflow:hidden!important;
    border:1px solid color-mix(in srgb,currentColor 22%,transparent)!important;
    border-radius:6px!important;
    background:color-mix(in srgb,currentColor 8%,rgba(255,255,255,.72))!important;
    color:currentColor!important;
    font-size:8px!important;
    font-weight:900!important;
    line-height:1!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] .battle-status-more {
    flex:none!important;
    width:auto!important;
    min-width:24px!important;
    height:22px!important;
    padding:0 5px!important;
    display:grid!important;
    place-items:center!important;
  }
}

@media (max-width:760px), (max-width:900px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-resource-row,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy {
    align-items:center!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy > span {
    align-self:center!important;
    margin:0!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyTrack {
    position:relative!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    align-self:center!important;
    margin:0!important;
    display:block!important;
    overflow:visible!important;
    box-sizing:border-box!important;
    vertical-align:middle!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyBar {
    position:relative!important;
    min-height:0!important;
    overflow:visible!important;
    border-radius:inherit!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyBar::before {
    content:none!important;
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyBar::after {
    content:""!important;
    position:absolute!important;
    top:1px!important;
    right:-2px!important;
    width:6px!important;
    height:6px!important;
    display:block!important;
    float:none!important;
    border:1px solid rgba(255,255,255,.94)!important;
    border-radius:50%!important;
    background:#d8faff!important;
    opacity:1!important;
    box-shadow:0 0 4px #baf5ff,0 0 8px rgba(58,211,241,.82)!important;
    pointer-events:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-energy[data-energy-state="empty"] #battleCommandEnergyBar::after {
    content:none!important;
    display:none!important;
  }

  /* The repeated divider is removed; whitespace now separates skills/items. */
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel {
    padding:4px 0 0!important;
    border:0!important;
    border-top:0!important;
    border-left:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel::before,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel::after {
    content:none!important;
    display:none!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel > header,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] #battleQuickItems {
    align-self:center!important;
    margin:0!important;
  }
}

@media (max-width:760px) and (max-height:650px) and (orientation:portrait),
       (max-width:900px) and (max-height:650px) and (orientation:landscape) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] #battleCommandEnergyBar::after {
    top:1px!important;
    right:-1px!important;
    width:4px!important;
    height:4px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-status-polish="v31"] #battleLiveControls[data-mobile-layout="native-v28"] .combat-items-panel {
    padding-top:3px!important;
  }
}

/* ========================================================================== 
   V32 — cohesive surrender, contained energy and native capture scene.
   The capture UI is a dedicated state on desktop and phone. All chance,
   inventory and animation data remains server authoritative.
   ========================================================================== */

#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] {
  --bui-font:Inter,"Segoe UI Variable","Segoe UI",ui-rounded,system-ui,sans-serif;
}

#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] :is(
  .battle-surrender-confirm,.battle-surrender-confirm *,
  .capture-stage,.capture-stage *,
  .combat-capture-panel,.combat-capture-panel *
) {
  font-family:var(--bui-font)!important;
  font-variant-numeric:tabular-nums;
}

#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .battle-surrender-confirm {
  padding:clamp(12px,3vw,24px)!important;
  background:color-mix(in srgb,#062635 28%,transparent)!important;
  -webkit-backdrop-filter:blur(2px)!important;
  backdrop-filter:blur(2px)!important;
}
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .battle-surrender-confirm > article {
  width:min(460px,calc(100% - 16px))!important;
  padding:18px!important;
  grid-template-columns:48px minmax(0,1fr)!important;
  gap:10px 14px!important;
  overflow:hidden!important;
  border:1px solid color-mix(in srgb,var(--bui-danger) 38%,var(--bui-line))!important;
  border-radius:17px!important;
  background:linear-gradient(145deg,color-mix(in srgb,var(--bui-danger) 5%,var(--bui-surface-raised)),var(--bui-surface))!important;
  color:var(--bui-text)!important;
  box-shadow:inset 0 1px rgba(255,255,255,.55),0 22px 60px var(--bui-shadow)!important;
}
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .battle-surrender-confirm > article::before {
  content:""!important;
  position:absolute!important;
  top:0!important;
  right:0!important;
  left:0!important;
  height:3px!important;
  background:linear-gradient(90deg,var(--bui-danger),color-mix(in srgb,var(--bui-danger) 18%,transparent))!important;
}
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .battle-surrender-confirm > article > i {
  width:46px!important;
  height:46px!important;
  padding:10px!important;
  border:1px solid color-mix(in srgb,var(--bui-danger) 32%,var(--bui-line))!important;
  border-radius:12px!important;
  background:color-mix(in srgb,var(--bui-danger) 9%,var(--bui-card))!important;
  color:var(--bui-danger)!important;
  box-shadow:none!important;
}
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .battle-surrender-confirm small { color:var(--bui-danger)!important;font-size:9px!important;line-height:1.1!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .battle-surrender-confirm b { color:var(--bui-text)!important;font-size:21px!important;font-weight:850!important;line-height:1.05!important;letter-spacing:-.02em!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .battle-surrender-confirm p { color:var(--bui-muted)!important;font-size:12px!important;line-height:1.45!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .battle-surrender-confirm footer { gap:9px!important;margin-top:3px!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .battle-surrender-confirm footer > button {
  min-height:44px!important;
  padding:0 14px!important;
  border-radius:11px!important;
  border:1px solid var(--bui-line)!important;
  background:var(--bui-card)!important;
  color:var(--bui-text)!important;
  font-size:12px!important;
  box-shadow:none!important;
}
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] #confirmSurrender {
  border-color:color-mix(in srgb,var(--bui-danger) 52%,var(--bui-line))!important;
  background:var(--bui-danger)!important;
  color:#fff!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] #battleCommandEnergyTrack {
  position:relative!important;
  height:10px!important;
  min-height:10px!important;
  max-height:10px!important;
  padding:1px!important;
  overflow:hidden!important;
  border:1px solid color-mix(in srgb,var(--bui-accent) 32%,var(--bui-line))!important;
  border-radius:999px!important;
  background:color-mix(in srgb,var(--bui-accent) 10%,var(--bui-track))!important;
  box-shadow:inset 0 1px 2px rgba(7,63,82,.16)!important;
  box-sizing:border-box!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] #battleCommandEnergyBar {
  position:relative!important;
  width:min(var(--energy-level,0%),100%)!important;
  max-width:100%!important;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  border-radius:999px!important;
  background:linear-gradient(90deg,#39c4e6 0%,#199fd0 72%,#69ddf0 100%)!important;
  box-shadow:0 0 7px rgba(45,194,229,.28)!important;
  box-sizing:border-box!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] #battleCommandEnergyBar::after {
  content:""!important;
  position:absolute!important;
  top:50%!important;
  right:1px!important;
  width:4px!important;
  height:calc(100% - 2px)!important;
  display:block!important;
  transform:translateY(-50%)!important;
  border:0!important;
  border-radius:3px!important;
  background:#eaffff!important;
  box-shadow:0 0 4px #d9fbff,0 0 7px rgba(71,214,240,.72)!important;
  pointer-events:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-energy[data-energy-state="empty"] #battleCommandEnergyBar::after { display:none!important; }
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-energy-current { display:none!important; }

#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-stage { --capture-chance-color:#ef6666; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-stage[data-chance="medium"] { --capture-chance-color:#e6b64f; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-stage[data-chance="high"] { --capture-chance-color:#54cf8b; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-ring-inner { border-color:var(--capture-chance-color)!important;box-shadow:0 0 16px color-mix(in srgb,var(--capture-chance-color) 62%,transparent)!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-feedback {
  min-width:220px!important;
  padding:8px 12px!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:2px 10px!important;
  border-radius:12px!important;
}
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-feedback > small { grid-column:1!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-feedback > b { grid-column:1!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-feedback > em {
  grid-column:2!important;
  grid-row:1/3!important;
  align-self:center!important;
  color:var(--capture-chance-color)!important;
  font-size:9px!important;
  font-style:normal!important;
  font-weight:900!important;
  letter-spacing:.06em!important;
}
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-command-deck[data-view="capture"] { height:132px!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-panel {
  grid-template-columns:190px minmax(0,1fr) 126px!important;
  gap:10px!important;
  padding:10px!important;
  border-radius:16px!important;
}
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-copy { gap:3px!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-copy b { font-size:13px!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-copy em { white-space:normal!important;font-size:9px!important;line-height:1.25!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-copy strong { color:var(--capture-chance-color,var(--bui-accent))!important;font-size:10px!important;font-weight:900!important;letter-spacing:.04em!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls {
  justify-content:flex-start!important;
  gap:7px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  overscroll-behavior-inline:contain!important;
  scrollbar-width:thin!important;
  scrollbar-color:var(--bui-line-strong) transparent!important;
}
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls > button {
  width:68px!important;
  min-width:68px!important;
  height:96px!important;
  min-height:96px!important;
  padding:5px 4px!important;
  grid-template-rows:46px 13px 13px 12px!important;
  gap:1px!important;
  overflow:hidden!important;
  border-radius:12px!important;
  box-shadow:none!important;
}
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls > button.is-selected { transform:translateY(-1px)!important;box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--bui-accent) 42%,transparent)!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls .capture-ball-icon,
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-throw-icon {
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls .capture-ball-icon { width:44px!important;height:44px!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls b { font-size:8px!important;line-height:1!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls > button > span { width:100%!important;display:flex!important;justify-content:center!important;gap:3px!important;font-size:7px!important;line-height:1!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls > button > span em { color:var(--bui-muted)!important;font-style:normal!important;font-weight:800!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls > button > span strong { color:var(--capture-chance-color,var(--bui-accent))!important;font-weight:950!important; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls > button[data-chance="medium"] { --capture-chance-color:#d6a22f; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls > button[data-chance="high"] { --capture-chance-color:#32b876; }
#battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-cancel { min-height:44px!important;height:auto!important;padding:8px 10px!important;font-size:9px!important;line-height:1.2!important; }

@media (max-width:760px), (hover:none) and (pointer:coarse) {
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .battle-surrender-confirm > article { width:min(430px,calc(100% - 8px))!important;padding:15px!important;grid-template-columns:42px minmax(0,1fr)!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .battle-surrender-confirm > article > i { width:40px!important;height:40px!important;padding:8px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .battle-surrender-confirm b { font-size:19px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .battle-surrender-confirm p { font-size:11px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .battle-surrender-confirm footer > button { min-height:44px!important;font-size:11px!important; }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] #battleCommandEnergyTrack { height:10px!important;min-height:10px!important;max-height:10px!important;overflow:hidden!important; }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] #battleCommandEnergyBar { overflow:hidden!important;max-width:100%!important; }

  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-command-deck[data-view="capture"] {
    right:6px!important;
    bottom:max(6px,env(safe-area-inset-bottom))!important;
    left:6px!important;
    width:auto!important;
    height:154px!important;
    max-height:34dvh!important;
  }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-panel {
    padding:8px!important;
    grid-template-columns:minmax(0,1fr) 112px!important;
    grid-template-rows:43px minmax(0,1fr)!important;
    grid-template-areas:"copy cancel" "balls balls"!important;
    gap:5px 8px!important;
    border-radius:16px!important;
  }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-copy { grid-area:copy!important;display:grid!important;grid-template-columns:auto 1fr!important;grid-template-rows:13px 14px!important;column-gap:7px!important;align-content:center!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-copy small { grid-column:1!important;grid-row:1!important;font-size:7px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-copy b { grid-column:1/3!important;grid-row:2!important;font-size:11px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-copy em { display:none!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-copy strong { grid-column:2!important;grid-row:1!important;justify-self:start!important;font-size:8px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls { grid-area:balls!important;min-height:0!important;align-items:center!important;padding:0 1px 1px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls > button { width:62px!important;min-width:62px!important;height:86px!important;min-height:86px!important;grid-template-rows:42px 12px 12px 11px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls .capture-ball-icon { width:40px!important;height:40px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-cancel { grid-area:cancel!important;min-height:40px!important;height:40px!important;padding:0 8px!important;font-size:8px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-throw { width:72px!important;height:72px!important;bottom:calc(max(6px,env(safe-area-inset-bottom)) + 164px)!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-throw-icon { width:52px!important;height:52px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-throw > em { font-size:7px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-target-reticle { top:31dvh!important;width:clamp(88px,24vw,118px)!important;height:clamp(88px,24vw,118px)!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-feedback { top:clamp(116px,17dvh,148px)!important;min-width:0!important;width:min(280px,calc(100% - 24px))!important;padding:7px 10px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-gesture-hint { display:none!important; }
}

@media (max-width:380px), (max-height:650px) {
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-command-deck[data-view="capture"] { height:138px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-panel { grid-template-rows:38px minmax(0,1fr)!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls > button { width:56px!important;min-width:56px!important;height:76px!important;min-height:76px!important;grid-template-rows:36px 11px 11px 10px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .combat-capture-balls .capture-ball-icon { width:35px!important;height:35px!important; }
  #battleHud[data-battle-ui="2.9.9"][data-capture-polish="v32"] .capture-throw { width:64px!important;height:64px!important;bottom:calc(max(6px,env(safe-area-inset-bottom)) + 147px)!important; }
}

/* ========================================================================== 
   V34 — generated raster capture atlas, contained result CTA and energy rail.
   This is the terminal ownership layer for result/capture geometry.
   ========================================================================== */

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleDecision.battle-result-layer:not([hidden]) {
  position:absolute!important;
  inset:0!important;
  box-sizing:border-box!important;
  display:grid!important;
  place-items:center!important;
  align-content:center!important;
  padding:clamp(18px,4dvh,38px) clamp(14px,3vw,32px)!important;
  overflow:hidden!important;
  transform:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleDecision .battle-result-card {
  position:relative!important;
  width:min(680px,calc(100% - 8px))!important;
  height:auto!important;
  min-height:0!important;
  max-height:calc(100% - 8px)!important;
  margin:0!important;
  padding:22px 26px 30px!important;
  box-sizing:border-box!important;
  grid-template-rows:auto auto auto!important;
  gap:16px!important;
  align-self:center!important;
  align-content:start!important;
  overflow:visible!important;
  transform:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleDecision.has-many-results .battle-result-card {
  overflow:auto!important;
  overscroll-behavior:contain!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleDecision .battle-result-actions {
  position:static!important;
  inset:auto!important;
  min-height:46px!important;
  margin:4px 0 0!important;
  align-self:start!important;
  transform:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleDecision .battle-result-action {
  position:static!important;
  inset:auto!important;
  margin:0!important;
  transform:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleCommandEnergyTrack {
  position:relative!important;
  height:10px!important;
  min-height:10px!important;
  max-height:10px!important;
  padding:1px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  border:1px solid color-mix(in srgb,var(--bui-accent) 34%,var(--bui-line))!important;
  border-radius:999px!important;
  background:linear-gradient(180deg,color-mix(in srgb,var(--bui-accent) 9%,#e8f3f5),color-mix(in srgb,var(--bui-accent) 15%,#d7e7ea))!important;
  box-shadow:inset 0 1px 2px rgba(7,63,82,.16)!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleCommandEnergyBar {
  position:relative!important;
  width:min(var(--energy-level,0%),100%)!important;
  max-width:100%!important;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  border-radius:inherit!important;
  background:linear-gradient(90deg,#1597d3 0%,#28c7ea 62%,#79f1db 100%)!important;
  box-shadow:inset 0 1px rgba(255,255,255,.42),0 0 7px rgba(40,199,234,.34)!important;
  box-sizing:border-box!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleCommandEnergyBar::before {
  content:none!important;
  display:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleCommandEnergyBar::after {
  content:""!important;
  position:absolute!important;
  top:50%!important;
  right:1px!important;
  width:6px!important;
  height:6px!important;
  display:block!important;
  float:none!important;
  transform:translateY(-50%)!important;
  border:0!important;
  border-radius:50%!important;
  background:#efffff!important;
  box-shadow:0 0 4px #fff,0 0 7px #52e7ef!important;
  pointer-events:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] .combat-energy[data-energy-state="empty"] #battleCommandEnergyBar::after {
  content:none!important;
  display:none!important;
}

#battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] .item-ball-raster {
  width:100%!important;
  height:100%!important;
  background-image:var(--ball-atlas)!important;
  background-repeat:no-repeat!important;
  background-size:500% 300%!important;
  background-position:var(--ball-atlas-x) var(--ball-atlas-y)!important;
  filter:drop-shadow(0 3px 3px rgba(12,42,58,.2))!important;
}
#battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] :is(.capture-ball-icon,.capture-throw-icon).category-balls,
#battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] .combat-capture-balls .capture-ball-icon {
  overflow:visible!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
#battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] :is(.capture-ball-icon,.capture-throw-icon).category-balls::before {
  content:none!important;
  display:none!important;
}

@media (max-width:760px), (hover:none) and (pointer:coarse) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleDecision.battle-result-layer:not([hidden]) {
    padding:max(12px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleDecision .battle-result-card {
    width:min(420px,calc(100% - 2px))!important;
    max-height:calc(100% - 2px)!important;
    padding:15px 14px 20px!important;
    gap:10px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleDecision .battle-result-actions {
    min-height:44px!important;
    margin-top:3px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleCommandEnergyTrack {
    height:12px!important;
    min-height:12px!important;
    max-height:12px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleCommandEnergyBar::after {
    width:7px!important;
    height:7px!important;
  }
}

/* ========================================================================== 
   V37 — authored 3D capture balls and a single presentation owner.
   Core ball art is shared by inventory, selector, held control and Canvas.
   The legacy phase atlas is deliberately not layered over these images.
   ========================================================================== */

.item-ball-raster-v37 {
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
  object-position:center!important;
  background:transparent!important;
  filter:drop-shadow(0 4px 4px rgba(7,35,50,.22))!important;
  transform:translateZ(0)!important;
}

#battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] #battleLiveControls[hidden],
#battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] #capturePanel[hidden] {
  display:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw {
  width:96px!important;
  height:96px!important;
  contain:layout style!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw-icon {
  width:92px!important;
  height:92px!important;
  display:grid!important;
  place-items:center!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw-icon > .item-ball-raster-v37 {
  width:90px!important;
  height:90px!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw.is-aiming .item-ball-raster-v37 {
  filter:drop-shadow(0 7px 7px rgba(2,31,45,.32)) drop-shadow(0 0 7px rgba(99,228,255,.38))!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .combat-capture-balls > button {
  isolation:isolate!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .combat-capture-balls .capture-ball-icon {
  display:grid!important;
  place-items:center!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .combat-capture-balls > button.is-selected {
  border-color:color-mix(in srgb,var(--bui-accent) 62%,#fff)!important;
  background:linear-gradient(180deg,color-mix(in srgb,var(--bui-accent) 8%,#fff),rgba(240,249,252,.86))!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-stage.is-resolving .capture-aim-guide,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-stage.is-resolving .capture-ring-inner {
  opacity:0!important;
}

@media (max-width:760px), (hover:none) and (pointer:coarse) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw {
    width:82px!important;
    height:82px!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw-icon,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw-icon > .item-ball-raster-v37 {
    width:78px!important;
    height:78px!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .combat-capture-balls {
    scroll-snap-type:x mandatory!important;
    -webkit-overflow-scrolling:touch!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .combat-capture-balls > button {
    scroll-snap-align:center!important;
    touch-action:manipulation!important;
  }
}

@media (max-width:380px), (max-height:650px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw {
    width:68px!important;
    height:68px!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw-icon,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw-icon > .item-ball-raster-v37 {
    width:64px!important;
    height:64px!important;
  }
}

@media (max-width:380px), (max-height:650px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-atlas="v34"] #battleDecision .battle-result-card {
    padding:10px 10px 14px!important;
    gap:7px!important;
  }
}

/* ========================================================================== 
   V35.1 — minimal fixes on the verified v34 layout.
   This layer intentionally owns no deck, card, item or roster geometry.
   ========================================================================== */

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-minimal-fix="v35-1"] .combat-energy > span > :is(i,svg) {
  border:0!important;
  outline:0!important;
  background:transparent!important;
  box-shadow:none!important;
  filter:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-minimal-fix="v35-1"] #battleCommandEnergyBar::after {
  content:none!important;
  display:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-minimal-fix="v35-1"] .combat-energy-marker {
  position:absolute!important;
  z-index:4!important;
  left:clamp(6px,var(--energy-level,0%),calc(100% - 6px))!important;
  top:50%!important;
  width:10px!important;
  height:10px!important;
  display:block!important;
  overflow:visible!important;
  color:#f4fdff!important;
  filter:none!important;
  transform:translate(-50%,-50%)!important;
  transition:left .22s ease!important;
  pointer-events:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-minimal-fix="v35-1"] .combat-energy[data-energy-state="empty"] .combat-energy-marker {
  display:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-minimal-fix="v35-1"] .combat-action-button.is-cooling {
  opacity:1!important;
  filter:saturate(.9) brightness(.94)!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-minimal-fix="v35-1"] .combat-action-button.is-cooling > .combat-cooldown {
  background:conic-gradient(from 0deg,rgba(3,17,26,.52) var(--cooldown-sweep,0deg),rgba(9,37,48,.08) 0)!important;
  box-shadow:inset 0 0 0 2px rgba(2,22,31,.58),0 0 0 2px color-mix(in srgb,var(--combat-ring) 54%,rgba(5,32,42,.54))!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-minimal-fix="v35-1"] .combat-action-button.is-cooling > .combat-cooldown > b {
  border-color:rgba(189,235,246,.3)!important;
  background:rgba(2,21,30,.74)!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-minimal-fix="v35-1"] .battle-matchup-arrow {
  font-size:12px!important;
  font-style:normal!important;
  font-weight:950!important;
  letter-spacing:-.04em!important;
  line-height:1!important;
}

/* ========================================================================== 
   V36 — raster capture presentation.
   The interactive area remains large, but the visible control is only the
   selected 3D ball: no white disc, card or duplicate frame behind it.
   ========================================================================== */

#battleHud[data-battle-ui="2.9.9"][data-capture-presentation="v36"] .item-ball-raster {
  background-image:var(--ball-atlas)!important;
  background-size:500% 300%!important;
  background-position:var(--ball-atlas-x) var(--ball-atlas-y)!important;
  filter:drop-shadow(0 4px 4px rgba(7,35,50,.2))!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-presentation="v36"] .capture-throw {
  width:92px!important;
  height:92px!important;
  padding:0!important;
  overflow:visible!important;
  border:0!important;
  border-radius:50%!important;
  outline:0!important;
  background:transparent!important;
  box-shadow:none!important;
  filter:drop-shadow(0 10px 10px rgba(4,36,50,.28))!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-presentation="v36"] .capture-throw::before {
  inset:3px!important;
  border-radius:50%!important;
  background:conic-gradient(from -90deg,#66e5ff var(--capture-spin-turn),transparent 0)!important;
  -webkit-mask:radial-gradient(circle,transparent 66%,#000 69%,#000 74%,transparent 77%)!important;
  mask:radial-gradient(circle,transparent 66%,#000 69%,#000 74%,transparent 77%)!important;
  opacity:0!important;
  transition:opacity .12s ease!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-presentation="v36"] .capture-throw.is-aiming::before {
  opacity:.9!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-presentation="v36"] .capture-throw.is-aiming {
  box-shadow:none!important;
  filter:drop-shadow(0 14px 12px rgba(4,36,50,.34)) drop-shadow(0 0 8px rgba(92,224,255,.42))!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-presentation="v36"] .capture-throw-icon {
  width:86px!important;
  height:86px!important;
  overflow:visible!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-presentation="v36"] .capture-throw > em,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-presentation="v36"] .capture-spin-meter {
  display:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-presentation="v36"] .combat-capture-balls .capture-ball-icon {
  overflow:visible!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-presentation="v36"] .combat-capture-balls > button.is-selected .capture-ball-icon {
  transform:translateY(-1px) scale(1.05)!important;
}

@media (max-width:760px), (hover:none) and (pointer:coarse) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-presentation="v36"] .capture-throw {
    width:74px!important;
    height:74px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-presentation="v36"] .capture-throw-icon {
    width:70px!important;
    height:70px!important;
  }
}

@media (max-width:380px), (max-height:650px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-presentation="v36"] .capture-throw {
    width:64px!important;
    height:64px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-presentation="v36"] .capture-throw-icon {
    width:60px!important;
    height:60px!important;
  }
}

/* ========================================================================== 
   V36.1 — mobile-only energy alignment and true result centring.
   No combat deck, skill, item, roster or capture geometry is changed here.
   ========================================================================== */

@media (max-width:760px), (hover:none) and (pointer:coarse) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-hotfix="v36-1"] .combat-energy {
    align-items:center!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-hotfix="v36-1"] .combat-energy > span {
    grid-template-columns:24px auto minmax(0,1fr)!important;
    align-items:center!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-hotfix="v36-1"] .combat-energy > span > i {
    width:24px!important;
    height:24px!important;
    min-width:24px!important;
    min-height:24px!important;
    display:grid!important;
    place-items:center!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-hotfix="v36-1"] .combat-energy > span > i > svg {
    width:19px!important;
    height:19px!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-hotfix="v36-1"] #battleCommandEnergyTrack {
    align-self:center!important;
    top:auto!important;
    bottom:auto!important;
    width:100%!important;
    height:12px!important;
    min-height:12px!important;
    max-height:12px!important;
    margin:0!important;
    overflow:visible!important;
    transform:translateY(-1px)!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-hotfix="v36-1"] #battleCommandEnergyBar {
    top:auto!important;
    bottom:auto!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    margin:0!important;
    overflow:hidden!important;
    transform:none!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-hotfix="v36-1"] .combat-energy-marker {
    left:clamp(8px,var(--energy-level,0%),calc(100% - 8px))!important;
    top:50%!important;
    width:16px!important;
    height:16px!important;
    min-width:16px!important;
    min-height:16px!important;
    color:#f7feff!important;
    filter:drop-shadow(0 0 2px rgba(34,189,224,.9))!important;
    transform:translate(-50%,-50%)!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-hotfix="v36-1"] #battleDecision.battle-result-layer:not([hidden]) {
    position:absolute!important;
    inset:0!important;
    top:0!important;
    right:0!important;
    bottom:0!important;
    left:0!important;
    width:100%!important;
    height:100%!important;
    min-height:100%!important;
    max-height:none!important;
    box-sizing:border-box!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important;
    overflow:hidden!important;
    transform:none!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-hotfix="v36-1"] #battleDecision .battle-result-card {
    flex:0 1 420px!important;
    align-self:auto!important;
    justify-self:auto!important;
    width:min(420px,100%)!important;
    max-height:calc(100% - 2px)!important;
    margin:auto!important;
    transform:none!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-hotfix="v36-1"] #battleDecision.has-many-results .battle-result-card {
    overflow:auto!important;
    overscroll-behavior:contain!important;
  }
}

@media (max-width:760px) and (max-height:650px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-mobile-hotfix="v36-1"] #battleDecision .battle-result-card {
    max-height:calc(100% - 2px)!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
  }
}

/* V36.2 cascade lock — placed after the v36.1 mobile owner on purpose. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleCommandEnergyBar::before,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleCommandEnergyBar::after {
  content:none!important;
  display:none!important;
}

html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] .combat-energy-marker {
  overflow:visible!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  filter:none!important;
}

@media (max-width:760px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleHealth > .ally-health {
    --fighter-accent:#38aa92;
    border-color:#a7d8ce!important;
    background:linear-gradient(145deg,rgba(226,249,244,.99),rgba(250,253,254,.99) 38%,rgba(241,249,251,.98))!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleHealth > .enemy-health {
    --fighter-accent:#e46f66;
    border-color:#efc2bd!important;
    background:linear-gradient(215deg,rgba(255,234,231,.99),rgba(251,253,254,.99) 38%,rgba(247,249,250,.98))!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleHealth > article::before {
    content:""!important;
    position:absolute!important;
    z-index:0!important;
    inset:0!important;
    width:auto!important;
    height:auto!important;
    display:block!important;
    border:0!important;
    border-radius:inherit!important;
    background:linear-gradient(112deg,color-mix(in srgb,var(--fighter-accent) 11%,transparent),transparent 45%)!important;
    box-shadow:none!important;
    opacity:1!important;
    pointer-events:none!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleHealth > article::after {
    content:""!important;
    position:absolute!important;
    z-index:0!important;
    inset:0!important;
    display:block!important;
    border-radius:inherit!important;
    background:var(--fighter-accent)!important;
    -webkit-mask:url('/assets/v3.0/combat/fighter-card-pokeball-pattern.svg') left -26px center / 150px 100px no-repeat!important;
    mask:url('/assets/v3.0/combat/fighter-card-pokeball-pattern.svg') left -26px center / 150px 100px no-repeat!important;
    opacity:.055!important;
    pointer-events:none!important;
  }

  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-visual-fix="v36-2"] #battleHealth > .enemy-health::after {
    -webkit-mask-position:right -26px center!important;
    mask-position:right -26px center!important;
    transform:scaleX(-1)!important;
  }
}

/* V37 terminal capture ownership. Keep this after every v36 compatibility layer. */
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw {
  width:96px!important;
  height:96px!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw-icon,
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw-icon > .item-ball-raster-v37 {
  width:92px!important;
  height:92px!important;
}
html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .item-ball-raster-v37 {
  object-fit:contain!important;
  background:transparent!important;
}
@media (max-width:760px), (hover:none) and (pointer:coarse) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw {
    width:82px!important;
    height:82px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw-icon,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw-icon > .item-ball-raster-v37 {
    width:78px!important;
    height:78px!important;
  }
}
@media (max-width:380px), (max-height:650px) {
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw {
    width:68px!important;
    height:68px!important;
  }
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw-icon,
  html[data-game-theme] body.is-battling #battleHud[data-battle-ui="2.9.9"][data-capture-flight="v37"] .capture-throw-icon > .item-ball-raster-v37 {
    width:64px!important;
    height:64px!important;
  }
}
