/* Isolated, non-production battle presentation. Runtime readiness also requires authenticated black-gold. */
@media (orientation: landscape) {
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat {
    --mobile-map-width: 116px;
    --mobile-joystick-size: 124px;
    --mobile-skill-size: 62px;
    --mobile-attack-size: 104px;
    --mobile-attack-choice-size: 48px;
    --battle-attack-right: 76px;
    --battle-attack-bottom: 76px;
    --battle-skill-0-out: 160px;
    --battle-skill-1-out: 130px;
    --battle-skill-1-rise: 82px;
    --battle-skill-2-out: 64px;
    --battle-skill-2-rise: 136px;
    --battle-skill-3-out: 0px;
    --battle-skill-3-rise: 164px;
    --battle-fifth-top: 88px;
    --battle-label: #f5dfa5;
    --battle-muted: #d1c3a2;
  }

  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat::after {
    border-image: var(--battle-art-frame) 40 / 10px / 0 stretch;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat::before {
    width: 34px; height: 22px; top: 0; left: calc(50% - 17px);
    background: var(--battle-art-gem) center / contain no-repeat;
  }

  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #minimap-dock {
    top: var(--mobile-edge-top); width: var(--mobile-map-width); padding: 5px;
    box-sizing: border-box; border: 0; border-radius: 0;
    background: #10151a; border-image: var(--battle-art-frame) 32 / 8px / 0 stretch;
    box-shadow: 0 3px 8px #0009;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat :is(.minimap-heading, .minimap-hint) { display: none; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #minimap { aspect-ratio: 4 / 3; }

  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #combat-quick-access {
    left: calc(var(--mobile-edge-left) + var(--mobile-map-width) + 8px); gap: 5px;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat :is(#combat-quick-access button, #mobile-menu-open) {
    width: 46px; height: 46px; min-height: 46px; padding: 5px;
    border: 0; border-radius: 0; color: var(--battle-label); background: #11171c;
    border-image: var(--battle-art-panel) 32 fill / 8px / 0 stretch;
    box-shadow: 0 3px 7px #0007;
    font: 600 12px/15px "RD Battle Serif", "Microsoft YaHei", serif;
    text-shadow: 0 1px 2px #000;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #combat-quick-access button:disabled { opacity: .6; filter: saturate(.3); }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #mobile-skill-upgrade { border: 0; border-radius: 0; background: #11171c; border-image: var(--battle-art-panel) 32 fill / 7px / 0 stretch; color: var(--battle-label); }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #mobile-toolbar #mobile-menu-open {
    font-size: 0;
    background: #11171c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M5 7h18M5 14h18M5 21h18' fill='none' stroke='%23f5dfa5' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 26px no-repeat;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #top-bar {
    right: calc(var(--mobile-edge-right) + 54px); min-height: 46px;
    max-width: calc(100vw - var(--mobile-edge-left) - var(--mobile-edge-right) - var(--mobile-map-width) - 270px);
    padding: 5px 12px; box-sizing: border-box; gap: 10px;
    background: #10161bea; border: 0; border-radius: 0;
    border-image: var(--battle-art-panel) 32 fill / 8px / 0 stretch;
    font: 12px/16px "Microsoft YaHei", system-ui, sans-serif;
    color: var(--battle-muted); box-shadow: 0 3px 8px #0006;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #top-bar .top-wave { font-size: 12px; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #top-bar > div[style] { display: none; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #top-bar .top-res-item:has(#wave-enemies-left) { white-space: nowrap; font-size: 11px; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #top-bar .top-res-item:has(#wave-enemies-left) > span { color: var(--battle-muted) !important; }

  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #target-frame-dock {
    top: calc(var(--mobile-edge-top) + 52px) !important;
    width: 234px; max-width: calc(100vw - var(--mobile-edge-left) - var(--mobile-edge-right) - 240px);
    border: 0; border-radius: 0; background: #11171ced;
    border-image: var(--battle-art-panel) 32 fill / 8px / 0 stretch;
    box-shadow: 0 3px 8px #0008;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .tf-inner { min-height: 54px; height: 54px; padding: 6px 8px; box-sizing: border-box; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .tf-center-info { min-width: 0; padding-right: 44px; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .tf-header-line { margin-bottom: 3px; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .tf-name {
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--battle-label); font: 600 11px/15px "RD Battle Serif", "Microsoft YaHei", serif;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .tf-hp-bar-bg { height: 15px; border-radius: 1px; background: #27131a; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .tf-hp-text { font: 600 10px/15px "Microsoft YaHei", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #tf-btn-close {
    position: absolute; top: 5px; right: 5px; width: 44px; height: 44px; border: 0; border-radius: 0;
    color: #eee5cf; background: transparent;
    border-image: var(--battle-art-panel) 48 fill / 4px / 0 stretch;
    font-size: 24px;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #hero-status-hud {
    top: calc(var(--mobile-edge-top) + 116px); bottom: auto; width: 280px; max-width: calc(100vw - var(--mobile-edge-left) - var(--mobile-edge-right) - 220px);
    display: flex; flex-flow: row nowrap; gap: 7px; align-items: flex-start; justify-content: center;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #hero-status-hud :is(.status-effects-buffs, .status-effects-debuffs) { flex-flow: row nowrap; gap: 4px; width: auto; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #hero-status-hud .status-effect {
    width: 32px; min-height: 44px; flex: 0 0 32px; padding: 2px; gap: 2px;
    background: #12191c9c; border: 0; border-radius: 0; box-shadow: none;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #hero-status-hud .status-effect-icon {
    width: 28px; height: 28px; flex-basis: 28px; padding: 2px; box-sizing: border-box;
    border: 0; border-radius: 0; border-image: var(--battle-art-slot) 12 / 3px / 0 stretch;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #hero-status-hud .status-effect[data-kind="debuff"] .status-effect-icon { outline: 1px solid #c57d8c; outline-offset: -2px; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #hero-status-hud .status-effect-compact-time { font-size: 10px; line-height: 12px; color: #f2e7d0; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #hero-status-hud .status-effect-stacks { font-size: 10px; line-height: 12px; background: #122c40; }

  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #mobile-joystick {
    left: calc(var(--mobile-edge-left) + 12px); bottom: calc(var(--mobile-edge-bottom) + 22px);
    border: 0; background: #111c279e;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #mobile-joystick::after { inset: -2px; background-image: var(--battle-art-control-ring); }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #mobile-joystick-thumb { background-image: var(--battle-art-joystick-thumb); width: 42px; height: 42px; margin: -21px 0 0 -21px; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #mobile-attack {
    right: calc(var(--mobile-edge-right) + var(--battle-attack-right) - var(--mobile-attack-size) / 2);
    bottom: calc(var(--mobile-edge-bottom) + var(--battle-attack-bottom) - var(--mobile-attack-size) / 2);
    border: 0; background: #11171ce8; filter: none;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #mobile-attack img { position: absolute; left: -8%; top: -8%; width: 116%; height: 116%; clip-path: circle(41% at 50% 50%); object-fit: cover; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #mobile-attack small { bottom: 12px; background: #10171abf; padding: 1px 6px; color: var(--battle-label); font: 600 14px/18px "RD Battle Serif", "Microsoft YaHei", serif; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat :is(#mobile-attack, .mobile-attack-choice)::after { inset: -1px; background-image: var(--battle-art-control-ring); }

  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid > :is(#skill-slot-q, #skill-slot-w, #skill-slot-r, .cmd-slot)[data-mobile-active-index] {
    --battle-skill-out: var(--battle-skill-0-out); --battle-skill-rise: 0px;
    position: fixed; display: block; width: var(--mobile-skill-size); height: var(--mobile-skill-size);
    right: calc(var(--mobile-edge-right) + var(--battle-attack-right) + var(--battle-skill-out) - var(--mobile-skill-size) / 2);
    bottom: calc(var(--mobile-edge-bottom) + var(--battle-attack-bottom) + var(--battle-skill-rise) - var(--mobile-skill-size) / 2);
    border: 0; border-radius: 50%; background: #11171c; box-shadow: 0 3px 7px #0007;
    box-sizing: border-box; touch-action: none; pointer-events: auto; z-index: 28;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid > :is(#skill-slot-q, #skill-slot-w, #skill-slot-r, .cmd-slot)[data-mobile-active-index="1"] { --battle-skill-out: var(--battle-skill-1-out); --battle-skill-rise: var(--battle-skill-1-rise); }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid > :is(#skill-slot-q, #skill-slot-w, #skill-slot-r, .cmd-slot)[data-mobile-active-index="2"] { --battle-skill-out: var(--battle-skill-2-out); --battle-skill-rise: var(--battle-skill-2-rise); }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid > :is(#skill-slot-q, #skill-slot-w, #skill-slot-r, .cmd-slot)[data-mobile-active-index="3"] { --battle-skill-out: var(--battle-skill-3-out); --battle-skill-rise: var(--battle-skill-3-rise); }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid > :is(#skill-slot-q, #skill-slot-w, #skill-slot-r, .cmd-slot)[data-mobile-active-index="4"] {
    top: calc(var(--mobile-edge-top) + var(--battle-fifth-top)); bottom: auto;
    right: calc(var(--mobile-edge-right) + 4px); width: var(--mobile-skill-size); height: var(--mobile-skill-size);
  }
  /* The incumbent hide rule has three :not(#id) selectors; only configured extra actives override it. */
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid > .cmd-slot:is([data-mobile-active-index="3"], [data-mobile-active-index="4"]) { display: block !important; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid > .cmd-slot[data-mobile-active-index]::before {
    content: ""; position: absolute; inset: -1px; z-index: 5; pointer-events: none;
    background: var(--battle-art-control-ring) center / contain no-repeat;
  }
  /* Enlarge past Warcraft icons' baked square bevel, then crop beneath the separate metal ring. */
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid > .cmd-slot[data-mobile-active-index] > img { width: 116%; height: 116%; margin: -8%; clip-path: circle(41% at 50% 50%); opacity: 1; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid > .cmd-slot.unlearned { opacity: 1; filter: none; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid .cmd-key { display: none; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .cmd-cd { inset: 5px; font-size: 18px; color: #fff2cd; background: #061019c9; z-index: 4; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid .skill-level-badge { top: -2px; left: -3px; z-index: 6; padding: 1px 4px; border: 1px solid #92825c; background: #12191dec; color: #f8e8bd; font-size: 10px; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid .skill-uses { right: -3px; top: -5px; z-index: 7; padding: 2px 4px; background: #174669; border: 1px solid #8fb7cd; border-radius: 5px; color: #fff1cb; font-size: 11px; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid .cmd-slot[data-unavailable]::after { z-index: 6; bottom: 10px; color: #f5e5c3; font-size: 10px; line-height: 15px; background: #111820e6; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid .cmd-slot[data-unavailable="unlearned"]::after { content: attr(data-learn-label); }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid .cmd-slot[data-unavailable]::before { filter: saturate(.3) brightness(.7); }

  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .mobile-attack-choice { color: var(--battle-label); border: 0; background: #11171ce8; font-size: 11px; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #mobile-attack-boss {
    right: calc(var(--mobile-edge-right) + 4px);
    bottom: calc(var(--mobile-edge-bottom) + var(--battle-attack-bottom) + 84px - var(--mobile-attack-choice-size) / 2);
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #mobile-attack-minion {
    right: calc(var(--mobile-edge-right) + var(--battle-attack-right) + 78px - var(--mobile-attack-choice-size) / 2);
    bottom: calc(var(--mobile-edge-bottom) + 8px);
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .mobile-attack-choice[aria-pressed="true"] { outline: 2px solid #98d3f2; outline-offset: 2px; background: #1c3548; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #player-hg-button {
    right: calc(var(--mobile-edge-right) + 280px); bottom: calc(var(--mobile-edge-bottom) + 6px);
    width: 48px; height: 48px; min-height: 48px; padding: 5px; border: 0; border-radius: 50%;
    color: var(--battle-label); background: #11171ce8; font: 600 12px/16px "RD Battle Serif", "Microsoft YaHei", serif;
    box-shadow: 0 3px 6px #0006;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #player-hg-button::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--battle-art-control-ring) center / contain no-repeat; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #item-active-dock {
    right: calc(var(--mobile-edge-right) + 340px); bottom: calc(var(--mobile-edge-bottom) + 6px);
    max-width: min(150px, calc(100vw - var(--mobile-edge-left) - var(--mobile-edge-right) - 470px));
    gap: 6px;
  }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #item-active-dock .item-active-button { width: 48px; height: 48px; min-height: 48px; padding: 6px; border: 0; border-radius: 0; background: #11171c; border-image: var(--battle-art-slot) 12 / 5px / 0 stretch; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #item-active-dock .item-active-button img { width: 36px; height: 36px; border-radius: 0; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat :is(#combat-quick-access button, #mobile-menu-open, #mobile-attack, .mobile-attack-choice, #player-hg-button, #item-active-dock button)[data-battle-pressed="true"] { filter: brightness(.72); }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat .command-grid > .cmd-slot[data-battle-pressed="true"]::before { background-image: var(--battle-art-control-ring-pressed); }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat :is(#mobile-attack, .mobile-attack-choice)[data-battle-pressed="true"]::after { background-image: var(--battle-art-control-ring-pressed); }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat :is(.cmd-slot, button):focus-visible { outline: 2px solid #b6e2ff; outline-offset: 3px; }
  :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #mobile-cancel-targeting { top: calc(var(--mobile-edge-top) + 56px); right: calc(var(--mobile-edge-right) + 126px); width: 52px; height: 44px; min-height: 44px; }

  @media (max-height: 380px), (max-width: 700px) {
    :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat {
      --mobile-map-width: 90px; --mobile-joystick-size: 104px; --mobile-skill-size: 48px;
      --mobile-attack-size: 84px; --mobile-attack-choice-size: 44px;
      --battle-attack-right: 62px; --battle-attack-bottom: 62px;
      --battle-skill-0-out: 138px; --battle-skill-1-out: 122px; --battle-skill-1-rise: 60px;
      --battle-skill-2-out: 82px; --battle-skill-2-rise: 114px;
      --battle-skill-3-out: 28px; --battle-skill-3-rise: 136px; --battle-fifth-top: 60px;
    }
    :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #combat-quick-access { gap: 3px; }
    :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #combat-quick-access button { width: 44px; height: 44px; min-height: 44px; font-size: 11px; }
    :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #top-bar { padding: 4px 8px; gap: 6px; max-width: calc(100vw - var(--mobile-edge-left) - var(--mobile-edge-right) - 340px); }
    :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #top-bar .top-wave { font-size: 11px; }
    :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #target-frame-dock { width: 216px; }
    :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #hero-status-hud { width: 220px; }
    :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #hero-status-hud .status-effect { width: 28px; flex-basis: 28px; min-height: 42px; }
    :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #hero-status-hud .status-effect-icon { width: 24px; height: 24px; flex-basis: 24px; }
    :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #mobile-attack small { bottom: 9px; font-size: 12px; }
    :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #player-hg-button { right: calc(var(--mobile-edge-right) + 250px); width: 44px; height: 44px; min-height: 44px; font-size: 11px; }
    :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #item-active-dock { right: calc(var(--mobile-edge-right) + 304px); max-width: min(144px, var(--item-active-max-width, 144px)); }
    :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #item-active-dock .item-active-button { width: 44px; height: 44px; min-height: 44px; padding: 5px; }
    :root[data-battle-art="ready"] body.mobile-layout.mobile-in-combat #item-active-dock .item-active-button img { width: 34px; height: 34px; }
  }
}
