/* ==========================================================================================
   battle-theme-iron.css — 战斗主题「乌萨斯齐心团」(ac_n_iron), phase 1: the bottom shop bar.
   Enabled by 设置 → 战斗主题 (js/ui/settings.js sets <html data-battle-theme="ac_n_iron">); the default theme is
   untouched. Art: public/assets/local/battle-themes/ac_n_iron/shop/ (official panel_shop_main /
   autochess_shop_card_item sprites). Sizes follow the official prefab in native pixels (card 155×187, LEVEL 112×188,
   funds poster 169×196 visible, 冻结 / 刷新 144×49) times one unit, --iron-u, so the whole bar scales together.
   Layout: [controls zone (flex, left)] [LEVEL] [3–5 operator slots] [1 item slot] [funds / 收起]. The flexible
   controls zone leaves room for the final 7 positions; new slots appear only when an upgrade opens them.
   ========================================================================================== */

.battle-theme-picker .modal__body { padding: 12px; }
.battle-theme-picker__list { display: grid; gap: 8px; }
.battle-theme-picker__row { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: rgba(15, 22, 21, .72); padding: 5px 8px 5px 5px; }
.battle-theme-picker__row.is-on { border-color: var(--mint-400); }
.battle-theme-picker__choice { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 52px; padding: 4px; border: 0; background: none; color: var(--text-hi); text-align: left; font: inherit; cursor: pointer; touch-action: manipulation; }
.battle-theme-picker__choice:disabled { cursor: default; }
.battle-theme-picker__choice:disabled .battle-theme-picker__swatch { opacity: .5; }
.battle-theme-picker__choice:focus-visible { outline: 2px solid var(--mint-400); outline-offset: 2px; }
.battle-theme-picker__swatch { display: grid; place-items: center; flex: none; width: 42px; height: 42px; color: #d3e6df; background: #24362f; border: 1px solid #849d8c66; }
.battle-theme-picker__swatch--ac_n_iron { color: #BAD7CF; background: #293f36; border-color: #8ca69e; }
.battle-theme-picker__swatch svg { width: 24px; height: 24px; }
.battle-theme-picker__text { display: grid; gap: 4px; flex: 1; min-width: 0; }
.battle-theme-picker__text strong { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.battle-theme-picker__text small { color: var(--text-md); font-size: 12px; line-height: 1.3; }
.battle-theme-picker__row > .btn { flex: none; min-height: 40px; padding: 6px 10px; font-size: 12px; }

html[data-battle-theme="ac_n_iron"] .gm {
  --iron-u: .0098rem;            /* 1 native px; the official card (155 px) ≈ 1.52rem */
  --iron-ink: #241d18;
  --iron-paper: #a39c91;
  --iron-teal: #3f5a5c;
  --iron-mint: #BAD7CF; /* legacy accent alias used by the shop */
  --iron-red: #BAD7CF;
  --iron-gold: #f3c34a;
}

/* ---- bar frame: full width from the left corner to the right edge ---- */
html[data-battle-theme="ac_n_iron"] .gm .gm__hud > .shopbar {
  left: 2.8rem; right: .08rem; bottom: .04rem; align-items: stretch; gap: calc(6 * var(--iron-u));
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar__tools { justify-self: end; justify-content: end; align-self: flex-end; gap: calc(18 * var(--iron-u)) calc(6 * var(--iron-u)); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar__row {
  isolation: isolate; align-items: flex-end; gap: calc(6 * var(--iron-u)); padding: 0 0 calc(2 * var(--iron-u));
  background: none; border: 0; box-shadow: none; pointer-events: none;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar__row > * { pointer-events: auto; }
/* Keep the dark floor on the full screen, outside the movable/scalable shop. */
html[data-battle-theme="ac_n_iron"] .gm .shopbar__row::before { content: none; }
html[data-battle-theme="ac_n_iron"] .gm:has(> .gm__hud > .shopbar)::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(0deg, rgba(10, 6, 4, .78) 0, rgba(10, 6, 4, .42) calc(130.35 * var(--iron-u)), transparent calc(237 * var(--iron-u)));
  pointer-events: none;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar.is-frozen .shopbar__row { border: 0; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar__cards,
html[data-battle-theme="ac_n_iron"] .gm .shopbar__rwcards { gap: calc(6 * var(--iron-u)); align-items: flex-end; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar__item { gap: calc(6 * var(--iron-u)); padding-left: 0; border-left: 0; align-items: flex-end; }

/* ---- controls zone: everything left of the LEVEL card (risk / 献祭, mode actions, the inventory pager) ---- */
html[data-battle-theme="ac_n_iron"] .gm .shopbar__side {
  flex: 1 1 0; min-width: 0; align-self: stretch; display: flex; flex-wrap: wrap-reverse; align-items: flex-end; align-content: flex-start;
  justify-content: flex-end; gap: calc(6 * var(--iron-u)); padding: 0 calc(10 * var(--iron-u)) calc(8 * var(--iron-u)) calc(40 * var(--iron-u));
  pointer-events: none;
}
/* the red banner (official deco_left, 863×112) anchored to the screen's bottom-left corner while the shop is open;
   drawn on the HUD layer before its children, so the corner buttons stay above it */
html[data-battle-theme="ac_n_iron"] .gm .gm__hud:has(> .shopbar)::before {
  content: ''; position: absolute; left: 0; bottom: 0; width: calc(863 * 1.45 * var(--iron-u)); height: calc(112 * 1.45 * var(--iron-u));
  background: var(--iron-asset-shop-back-left, none) left bottom / 100% 100% no-repeat;
  pointer-events: none;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar__side > * { pointer-events: auto; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar__side .shopbar__capacity { grid-column: auto; justify-self: auto; }

/* ---- 剩余可放置角色 ---- */
html[data-battle-theme="ac_n_iron"] .gm .shopbar__remain {
  font-size: .15rem; color: #e9e4da; padding: .03rem .14rem; background: rgba(12, 9, 7, .82); border-left: 0;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar__remain b { color: #fff; font-size: .18rem; }

/* ---- 冻结 / 刷新: the icon is part of the official plate (frozen_bg_* / refresh_bg_*) ---- */
html[data-battle-theme="ac_n_iron"] .gm .toolbtn {
  position: relative; width: calc(144 * var(--iron-u)); height: calc(49 * var(--iron-u)); padding: 0 0 0 calc(62 * var(--iron-u)); gap: 0;
  justify-content: flex-start; border: 0; box-shadow: none; overflow: visible;
  background: var(--iron-asset-shop-frozen-bg-normal, none) 50% 6% / calc(177 / 145 * 100%) calc(81 / 49 * 100%) no-repeat;
  color: #fff; font-size: .17rem; font-weight: 700; letter-spacing: .12em; text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
html[data-battle-theme="ac_n_iron"] .gm .toolbtn__img,
html[data-battle-theme="ac_n_iron"] .gm .toolbtn > .icon { display: none; }
html[data-battle-theme="ac_n_iron"] .gm .toolbtn--ice.is-on,
html[data-battle-theme="ac_n_iron"] .gm .toolbtn--ice.is-on:hover:not(:disabled) {
  background-color: transparent; background-image: var(--iron-asset-shop-frozen-bg-unlock, none); color: #fff; box-shadow: none;
}
html[data-battle-theme="ac_n_iron"] .gm .toolbtn--amber {
  background-image: var(--iron-asset-shop-refresh-bg-normal, none);
  background-position: 50% 6%; background-size: calc(178 / 145 * 100%) calc(83 / 49 * 100%);
  color: #2a1a02; text-shadow: none;
}
html[data-battle-theme="ac_n_iron"] .gm .toolbtn:hover:not(:disabled) { background-color: transparent; filter: brightness(1.1); box-shadow: none; }
html[data-battle-theme="ac_n_iron"] .gm .toolbtn:focus-visible { outline: 2px solid var(--iron-mint); outline-offset: 2px; }
html[data-battle-theme="ac_n_iron"] .gm .toolbtn--ice:disabled { background-image: var(--iron-asset-shop-frozen-bg-disable, none); color: #9a9a9a; }
html[data-battle-theme="ac_n_iron"] .gm .toolbtn--amber:disabled { background-image: var(--iron-asset-shop-refresh-bg-disable, none); color: #9a9a9a; }
/* the refresh cost sits above the plate (official root_cost), the key hint in its corner */
html[data-battle-theme="ac_n_iron"] .gm .toolbtn .hex,
html[data-battle-theme="ac_n_iron"] .gm .toolbtn .toolbtn__free {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -62%);
}
html[data-battle-theme="ac_n_iron"] .gm .toolbtn kbd {
  position: absolute; right: calc(3 * var(--iron-u)); bottom: calc(1 * var(--iron-u)); font-size: .09rem; line-height: 1.2; padding: 0 .02rem;
  background: rgba(0, 0, 0, .35) !important; border-color: rgba(255, 255, 255, .25) !important; color: rgba(255, 255, 255, .75) !important;
}
/* the official loop_btn_refresh_sweep: a slow light sweep across the 刷新 plate */
html[data-battle-theme="ac_n_iron"] .gm .toolbtn--amber:not(:disabled)::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 40%, rgba(255, 246, 214, .55) 50%, transparent 60%) -150% 0 / 250% 100% no-repeat;
  -webkit-mask: linear-gradient(#000, #000); mask: linear-gradient(#000, #000);
  animation: iron-sweep 5s linear infinite;
}
@keyframes iron-sweep { 0%, 70% { background-position: -150% 0; } 100% { background-position: 150% 0; } }

/* ---- operator / item card ---- */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard {
  width: calc(155 * var(--iron-u)); height: calc(187 * var(--iron-u)); border: 0; overflow: hidden;
  background: var(--iron-paper) var(--iron-asset-shop-chess-frame-normal, none) 47% 18% / calc(171 / 154 * 100%) calc(200 / 189 * 100%) no-repeat;
  box-shadow: 0 calc(3 * var(--iron-u)) calc(8 * var(--iron-u)) rgba(0, 0, 0, .55);
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard--t5 { background-image: var(--iron-asset-shop-chess-frame-level-five, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard--t6 { background-image: var(--iron-asset-shop-chess-frame-level-six, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__bg { display: none; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__water { left: calc(-10 * var(--iron-u)); top: calc(28 * var(--iron-u)); width: calc(96 * var(--iron-u)); height: calc(96 * var(--iron-u)); opacity: .2; filter: grayscale(1) brightness(.35); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__art {
  right: 0; height: calc(150 * var(--iron-u)); top: calc(4 * var(--iron-u));
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 96%), linear-gradient(90deg, transparent, #000 38%);
  mask-image: linear-gradient(180deg, #000 62%, transparent 96%), linear-gradient(90deg, transparent, #000 38%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
/* tier: the official chess_level_icon_N plate, top left */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__top { left: calc(4 * var(--iron-u)); right: calc(4 * var(--iron-u)); top: calc(4 * var(--iron-u)); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__top .tier {
  width: calc(48 * var(--iron-u)); height: calc(28 * var(--iron-u)); padding: 0; border: 0; background: transparent center / contain no-repeat;
  font-size: 0; color: transparent; clip-path: none; box-shadow: none;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__top .tier > * { display: none; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard .tier--1 { background-image: var(--iron-asset-shop-chess-level-icon-1, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard .tier--2 { background-image: var(--iron-asset-shop-chess-level-icon-2, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard .tier--3 { background-image: var(--iron-asset-shop-chess-level-icon-3, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard .tier--4 { background-image: var(--iron-asset-shop-chess-level-icon-4, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard .tier--5 { background-image: var(--iron-asset-shop-chess-level-icon-5, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard .tier--6 { background-image: var(--iron-asset-shop-chess-level-icon-6, none); }
/* price: top right, as the official root_cost */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__price,
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__free { left: auto; right: 0; top: 0; transform: none; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__pips { position: absolute; left: 0; top: calc(30 * var(--iron-u)); }
/* name on the teal stripe of the frame; bonds stacked above it */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__body {
  position: absolute; left: 0; right: 0; bottom: calc(23 * var(--iron-u)); flex-direction: column-reverse; gap: calc(3 * var(--iron-u));
  padding: 0; background: none;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__name {
  height: calc(24 * var(--iron-u)); line-height: calc(24 * var(--iron-u)); padding: 0 calc(8 * var(--iron-u));
  font-size: .15rem; letter-spacing: .02em; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__bonds { flex-direction: column; align-items: flex-start; gap: calc(2 * var(--iron-u)); padding: 0 calc(5 * var(--iron-u)); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__bond {
  font-size: max(9px, .11rem); line-height: 1.35; color: #f1ece2; padding: 0 calc(5 * var(--iron-u)) 0 calc(2 * var(--iron-u));
  background: transparent;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__bond .bglyph { width: .14rem; height: .14rem; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__mergetag { left: 0; right: auto; top: calc(50 * var(--iron-u)); }
/* hover / tap */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard:not(.is-disabled):not(.scard--sold):hover {
  transform: translateY(calc(-5 * var(--iron-u))); border: 0; box-shadow: 0 0 0 2px var(--iron-mint), 0 calc(6 * var(--iron-u)) calc(14 * var(--iron-u)) rgba(0, 0, 0, .6);
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard:focus-visible { outline: 2px solid var(--iron-mint); outline-offset: 2px; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard.is-merge { box-shadow: 0 0 0 2px var(--iron-gold), 0 0 calc(14 * var(--iron-u)) rgba(243, 195, 74, .45); }
/* frozen: official state_fx_frozen — a cold wash rising from the bottom, the ice mark above the stripe */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard.is-frozen::after {
  background: linear-gradient(0deg, rgba(126, 206, 236, .72), rgba(126, 206, 236, .28) 38%, rgba(126, 206, 236, .08) 70%, transparent);
  box-shadow: inset 0 0 0 2px rgba(170, 226, 248, .85);
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__ice { bottom: calc(4 * var(--iron-u)); width: calc(28 * var(--iron-u)); height: calc(28 * var(--iron-u)); background: transparent; border: 0; color: #fff; filter: drop-shadow(0 0 3px rgba(126, 206, 236, .9)); }

/* item card: the official group_equip — deco_item behind the icon, no description on the card */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__itemart {
  top: calc(28 * var(--iron-u)); width: calc(93 * var(--iron-u)); height: calc(93 * var(--iron-u));
  background: var(--iron-asset-shop-deco-item, none) center / calc(99 * var(--iron-u)) no-repeat;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__idesc { display: none; }

/* sold / empty / not opened yet: the official card_empty poster */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard--sold {
  background: var(--iron-asset-shop-card-empty, none) 47% 18% / calc(171 / 156 * 100%) calc(200 / 189 * 100%) no-repeat;
  border: 0;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__soldtxt { padding: calc(4 * var(--iron-u)) calc(10 * var(--iron-u)); background: rgba(24, 18, 14, .78); color: #d9d2c6; font-size: .13rem; }
/* Only the growing group clips its incoming card during the one-shot upgrade animation. */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .is-expanding { flex: none; overflow: hidden; }

/* ---- two-tap confirm: the official btn_double_check (Да! / Нет!) over the card ---- */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard.is-armed {
  transform: translateY(calc(-10 * var(--iron-u))) !important;
  box-shadow: 0 0 0 2px var(--iron-mint), 0 calc(8 * var(--iron-u)) calc(18 * var(--iron-u)) rgba(0, 0, 0, .65) !important;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard.is-armed.is-disabled { box-shadow: 0 0 0 2px #8a8a8a, 0 calc(8 * var(--iron-u)) calc(18 * var(--iron-u)) rgba(0, 0, 0, .65) !important; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__confirm {
  top: 0; justify-content: flex-end; padding: 0 0 calc(14 * var(--iron-u)); color: var(--iron-mint);
  background:
    var(--iron-asset-shop-dc-bottom-bar, none) center bottom / 100% calc(17 * var(--iron-u)) no-repeat,
    var(--iron-asset-shop-dc-char, none) calc(50% + 25 * var(--iron-u)) calc(100% - 30 * var(--iron-u)) / calc(104 * var(--iron-u)) auto no-repeat,
    var(--iron-asset-shop-dc-bg-deco, none) calc(50% - 15 * var(--iron-u)) calc(100% - 10 * var(--iron-u)) / calc(125 * var(--iron-u)) auto no-repeat,
    var(--iron-asset-shop-dc-matte, none) center bottom / 100% 100% no-repeat;
  animation: iron-confirm-in .2s ease-out;
}
@keyframes iron-confirm-in { from { opacity: 0; } }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__confirm b { font-size: .16rem; letter-spacing: .16em; padding-left: .16em; text-shadow: 0 0 6px rgba(0, 0, 0, .9); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__confirm small { font-size: .1rem; color: #e9e4da; opacity: .8; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__confirm.is-no {
  color: #ff8a7a;
  background:
    var(--iron-asset-shop-dc-bottom-deco-grey, none) center calc(100% - 4 * var(--iron-u)) / calc(148 * var(--iron-u)) auto no-repeat,
    var(--iron-asset-shop-dc-char-grey, none) calc(50% + 26 * var(--iron-u)) calc(100% - 34 * var(--iron-u)) / calc(107 * var(--iron-u)) auto no-repeat,
    var(--iron-asset-shop-dc-bg-deco-grey, none) calc(50% - 15 * var(--iron-u)) calc(100% - 10 * var(--iron-u)) / calc(125 * var(--iron-u)) auto no-repeat,
    var(--iron-asset-shop-dc-matte-grey, none) center bottom / 100% 100% no-repeat;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__confirm.is-no small { color: #ffc2b8; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar.has-armed .scard:not(.is-armed):not(.scard--sold) { filter: brightness(.7); }

/* ---- LEVEL card: the official group_upgrade (upgrade_normal / _disable / _max, 112×188 visible) ---- */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard {
  --lvimg: var(--iron-asset-shop-upgrade-normal, none);
  width: calc(112 * var(--iron-u)); height: calc(188 * var(--iron-u)); padding: 0; gap: 0; clip-path: none; color: #e7efe9;
  background: var(--lvimg) calc(50% - 7 * var(--iron-u)) 50% / calc(136 * var(--iron-u)) calc(205 * var(--iron-u)) no-repeat;
  justify-content: flex-start; overflow: visible;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard.is-disabled { --lvimg: var(--iron-asset-shop-upgrade-disable, none); background-color: transparent; color: #8e9590; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard.is-max { --lvimg: var(--iron-asset-shop-upgrade-max, none); background-color: transparent; color: #e7efe9; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard:focus-visible { outline: 2px solid var(--iron-mint); outline-offset: 2px; }
/* LEVEL plate, the screen frame with the roman level, the 升级 frame */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard__frame {
  position: absolute; left: 50%; top: calc(94 * var(--iron-u) - 20 * var(--iron-u)); transform: translate(-50%, -50%);
  width: calc(73 * var(--iron-u)); height: calc(80 * var(--iron-u)); padding: 0; border: 0;
  background: var(--iron-asset-shop-frame1-normal, none) center / 100% 100% no-repeat;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard__frame::before,
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard__frame::after { display: none; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard.is-max .lvcard__frame,
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard.is-disabled .lvcard__frame { background: none; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard__micro {
  position: absolute; left: 50%; top: calc(-46 * var(--iron-u)); transform: translateX(-50%);
  width: calc(85 * var(--iron-u)); height: calc(25 * var(--iron-u)); font-size: 0; color: transparent;
  background: var(--iron-asset-shop-level-normal, none) center / contain no-repeat;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard.is-max .lvcard__micro,
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard.is-disabled .lvcard__micro { display: none; } /* the plate is printed on the art */
/* the official leveltext numerals replace the digit */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard__num {
  position: absolute; inset: 0; font-size: 0; color: transparent;
  background: var(--lvnum) center / auto calc(40 * var(--iron-u)) no-repeat;
}
html[data-battle-theme="ac_n_iron"] .gm .lvcard--lv1 { --lvnum: var(--iron-asset-shop-lv-1, none); }
html[data-battle-theme="ac_n_iron"] .gm .lvcard--lv2 { --lvnum: var(--iron-asset-shop-lv-2, none); }
html[data-battle-theme="ac_n_iron"] .gm .lvcard--lv3 { --lvnum: var(--iron-asset-shop-lv-3, none); }
html[data-battle-theme="ac_n_iron"] .gm .lvcard--lv4 { --lvnum: var(--iron-asset-shop-lv-4, none); }
html[data-battle-theme="ac_n_iron"] .gm .lvcard--lv5 { --lvnum: var(--iron-asset-shop-lv-5, none); }
html[data-battle-theme="ac_n_iron"] .gm .lvcard--lv6 { --lvnum: var(--iron-asset-shop-lv-6, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard__label {
  position: absolute; left: 50%; top: calc(94 * var(--iron-u) + 40 * var(--iron-u)); transform: translate(-50%, -50%);
  width: calc(89 * var(--iron-u)); height: calc(41 * var(--iron-u)); display: grid; place-items: center; padding: 0;
  font-size: .15rem; font-weight: 700; letter-spacing: .2em; text-indent: .2em; white-space: nowrap;
  background: var(--iron-asset-shop-frame2-normal, none) center / 100% 100% no-repeat;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard.is-max .lvcard__label,
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard.is-disabled .lvcard__label { background: none; letter-spacing: .06em; text-indent: 0; font-size: .13rem; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard__price { top: calc(-8 * var(--iron-u)); z-index: 2; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard__key {
  right: calc(8 * var(--iron-u)); bottom: calc(10 * var(--iron-u)); font-size: .09rem;
  color: rgba(231, 239, 233, .7) !important; border-color: rgba(231, 239, 233, .25) !important;
}
/* armed (确认升级): the official root_double_check — certain frames, glow, the Cyrillic LEVEL lit */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard.is-armed { background-color: transparent; color: var(--iron-mint); box-shadow: none; animation: none; filter: none; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard.is-armed::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: var(--iron-asset-shop-glow-certain, none) center / calc(87 * var(--iron-u)) calc(149 * var(--iron-u)) no-repeat;
  mix-blend-mode: screen; opacity: .55; animation: iron-glow 1.1s ease-in-out infinite alternate;
}
@keyframes iron-glow { from { opacity: .25; } }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard.is-armed .lvcard__frame { background-image: var(--iron-asset-shop-frame1-certain, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard.is-armed .lvcard__micro { background-image: var(--iron-asset-shop-level-certain, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard.is-armed .lvcard__label {
  background-image: var(--iron-asset-shop-frame2-certain, none); letter-spacing: .04em; text-indent: 0; font-size: .13rem;
}
html[data-battle-theme="ac_n_iron"] .gm .lvcard.is-armed.lvcard--lv1 { --lvnum: var(--iron-asset-shop-upgrade-lv-2, none); }
html[data-battle-theme="ac_n_iron"] .gm .lvcard.is-armed.lvcard--lv2 { --lvnum: var(--iron-asset-shop-upgrade-lv-3, none); }
html[data-battle-theme="ac_n_iron"] .gm .lvcard.is-armed.lvcard--lv3 { --lvnum: var(--iron-asset-shop-upgrade-lv-4, none); }
html[data-battle-theme="ac_n_iron"] .gm .lvcard.is-armed.lvcard--lv4 { --lvnum: var(--iron-asset-shop-upgrade-lv-5, none); }
html[data-battle-theme="ac_n_iron"] .gm .lvcard.is-armed.lvcard--lv5 { --lvnum: var(--iron-asset-shop-upgrade-lv-6, none); }
/* exp mode (舟铲铲之战) shows exp/need in the price hex; nothing to change */

/* ---- funds / 收起: the official PEГЛАМЕНТ poster (btn_big_close, 169×196 visible) ---- */
html[data-battle-theme="ac_n_iron"] .gm .shopbar .funds {
  position: relative; width: calc(169 * var(--iron-u)); height: calc(196 * var(--iron-u)); flex: none; padding: 0; gap: 0; border-left: 0;
  justify-content: flex-start;
  background: var(--iron-asset-shop-btn-big-close, none) calc(50% + 0 * var(--iron-u)) 30% / calc(185 / 169 * 100%) calc(207 / 196 * 100%) no-repeat;
  filter: drop-shadow(0 calc(3 * var(--iron-u)) calc(6 * var(--iron-u)) rgba(0, 0, 0, .5));
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .funds::after { /* the worker (official char) */
  content: ''; position: absolute; right: calc(4 * var(--iron-u)); bottom: calc(24 * var(--iron-u)); width: calc(127 * var(--iron-u)); height: calc(157 * var(--iron-u));
  background: var(--iron-asset-shop-char, none) center / contain no-repeat; pointer-events: none;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .funds__hex {
  position: absolute; z-index: 1; left: 50%; top: calc(2 * var(--iron-u)); transform: translateX(-50%);
  width: auto; height: calc(30 * var(--iron-u)); padding: 0 calc(12 * var(--iron-u)); flex-direction: row; gap: calc(6 * var(--iron-u));
  clip-path: polygon(calc(10 * var(--iron-u)) 0, calc(100% - 10 * var(--iron-u)) 0, 100% 50%, calc(100% - 10 * var(--iron-u)) 100%, calc(10 * var(--iron-u)) 100%, 0 50%);
  background: linear-gradient(180deg, #4a3608, #241802); border: 0;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .funds__hex::before { box-shadow: inset 0 0 0 1px var(--iron-gold); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .funds__coin { width: .2rem; height: .2rem; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .funds__num { font-size: .22rem; color: #ffe08a; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .funds__label { display: none; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .funds__collapse {
  position: absolute; z-index: 1; right: calc(10 * var(--iron-u)); bottom: calc(52 * var(--iron-u));
  padding: calc(2 * var(--iron-u)) calc(10 * var(--iron-u)) calc(2 * var(--iron-u)) calc(14 * var(--iron-u));
  font-size: .15rem; font-weight: 700; letter-spacing: .1em; color: #fff; border: 0; background: rgba(18, 12, 8, .72);
  flex-direction: row-reverse;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar .funds__collapse .icon { width: .12rem; height: .12rem; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .funds__collapse:hover { background: rgba(18, 12, 8, .92); color: var(--iron-mint); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar .funds__collapse:focus-visible { outline: 2px solid var(--iron-mint); outline-offset: 2px; }

/* ---- collapsed: the poster alone, LEVEL screen beside it (official state_able/btn_open) ---- */
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab {
  right: .08rem; bottom: .04rem; padding: 0; gap: 0; border: 0; background: none; align-items: flex-end;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__lv {
  position: relative; width: calc(136 * var(--iron-u)); height: calc(104 * var(--iron-u)); margin: 0 calc(-48 * var(--iron-u)) calc(70 * var(--iron-u)) 0; z-index: 1;
  background: var(--iron-asset-shop-bg-lv, none) center / 100% 100% no-repeat;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__lv i {
  position: absolute; left: 50%; top: 50%; width: calc(71 * var(--iron-u)); height: calc(39 * var(--iron-u)); transform: translate(-46%, -64%);
  background: center / contain no-repeat;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__lv .lv-1 { background-image: var(--iron-asset-shop-lv-1, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__lv .lv-2 { background-image: var(--iron-asset-shop-lv-2, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__lv .lv-3 { background-image: var(--iron-asset-shop-lv-3, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__lv .lv-4 { background-image: var(--iron-asset-shop-lv-4, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__lv .lv-5 { background-image: var(--iron-asset-shop-lv-5, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__lv .lv-6 { background-image: var(--iron-asset-shop-lv-6, none); }
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__funds {
  position: absolute; z-index: 2; right: calc(28 * var(--iron-u)); bottom: calc(166 * var(--iron-u)); padding: 0 calc(10 * var(--iron-u));
  height: calc(28 * var(--iron-u)); background: linear-gradient(180deg, #4a3608, #241802); box-shadow: inset 0 0 0 1px var(--iron-gold);
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__funds .coin-glyph { width: .18rem; height: .18rem; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__funds b { font-size: .2rem; color: #ffe08a; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__btn {
  position: relative; width: calc(169 * var(--iron-u)); height: calc(196 * var(--iron-u)); padding: 0 calc(10 * var(--iron-u)) calc(52 * var(--iron-u)) 0;
  align-items: flex-end; justify-content: flex-end; background: var(--iron-asset-shop-btn-big-close, none) 50% 30% / calc(185 / 169 * 100%) calc(207 / 196 * 100%) no-repeat;
  color: #fff; font-size: .15rem; filter: drop-shadow(0 calc(3 * var(--iron-u)) calc(6 * var(--iron-u)) rgba(0, 0, 0, .5));
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__btn::before {
  content: ''; position: absolute; right: calc(4 * var(--iron-u)); bottom: calc(24 * var(--iron-u)); width: calc(127 * var(--iron-u)); height: calc(157 * var(--iron-u));
  background: var(--iron-asset-shop-char, none) center / contain no-repeat; pointer-events: none;
}
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__btn > * { position: relative; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__btn .icon { transform: none; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__btn:focus-visible { outline: 2px solid var(--iron-mint); outline-offset: 2px; }
html[data-battle-theme="ac_n_iron"] .gm .shopbar-tab__btn { text-shadow: 0 1px 2px #000; }

/* ---- merge reward / special refresh header in the theme's colours ---- */
html[data-battle-theme="ac_n_iron"] .gm .shopbar__reward { border-color: rgba(243, 195, 74, .6); }
html[data-battle-theme="ac_n_iron"] .gm .rwtag { width: calc(90 * var(--iron-u)); height: calc(187 * var(--iron-u)); background: linear-gradient(180deg, rgba(163, 58, 34, .85), rgba(36, 29, 24, .9)); color: #ffe08a; }

/* ---- landscape phones: same layout, the unit shrinks with the bar's room ---- */
@media (pointer: coarse) and (max-height: 600px), (pointer: coarse) and (max-width: 767px) {
  /* Decorative flag belongs to the viewport, outside the inset/movable HUD. */
  html[data-battle-theme="ac_n_iron"] .gm .gm__hud:has(> .shopbar)::before { content: none; }
  html[data-battle-theme="ac_n_iron"] .gm:has(> .gm__hud > .shopbar)::before {
    --iron-flag-u: min(.0125rem, calc((100vw - 176px) / 1300));
    content: ''; position: fixed; left: 0; bottom: 0; z-index: 2;
    width: calc(863 * 1.45 * var(--iron-flag-u)); height: calc(112 * 1.45 * var(--iron-flag-u));
    background: var(--iron-asset-shop-back-left, none) left bottom / 100% 100% no-repeat;
    pointer-events: none;
  }
}

@media (orientation: landscape) and (max-height: 600px) and (pointer: coarse) {
  /* the 7 positions + LEVEL fill the room right of the corner buttons (≈ 1300 native px wide) */
  html[data-battle-theme="ac_n_iron"] .gm { --iron-u: min(.0125rem, calc((100vw - var(--sp-corner-width, 136px) - 40px) / 1300)); }
  html[data-battle-theme="ac_n_iron"] .gm .gm__hud > .shopbar {
    flex-direction: column; align-items: stretch; scale: 1; left: calc(var(--sp-corner-width, 136px) + 24px); right: 8px; bottom: 4px; max-width: none;
  }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar__tools { grid-template-columns: auto auto; gap: 14px 6px; }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar__remain { grid-column: 1 / -1; font-size: 10px; padding: 2px 6px; }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar__remain b { font-size: 12px; }
  /* a 40 px touch height for 冻结 / 刷新, the plate keeps its 144:49 shape */
  html[data-battle-theme="ac_n_iron"] .gm .shopbar__tools .toolbtn {
    min-height: 40px; height: 40px; width: calc(40px * 144 / 49); padding: 0 0 0 calc(40px * 62 / 49); justify-content: flex-start; font-size: 12px; letter-spacing: .08em;
    zoom: .6; /* 冻结 / 刷新 at 60 % on phones (user request 2026-11-11); zoom scales the plate, label, cost and key hint together */
  }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar__tools { gap: 6px 3px; }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar .funds__collapse { min-height: 32px; font-size: 11px; }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar .shopbar__row { padding: 0; gap: 3px; overflow: visible; }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard { width: calc(155 * var(--iron-u)); height: calc(187 * var(--iron-u)); }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard { flex: none; width: calc(112 * var(--iron-u)); min-width: 0; height: calc(188 * var(--iron-u)); }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard__label { font-size: max(10px, .15rem); letter-spacing: .1em; }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar .funds { width: calc(169 * var(--iron-u)); height: calc(196 * var(--iron-u)); padding: 0; }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar .funds__hex { height: calc(30 * var(--iron-u)); }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__body { padding: 0; }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__name { font-size: 10px; }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__bond { font-size: 8px; }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar .scard__bond .bglyph { width: 9px; height: 9px; }
  html[data-battle-theme="ac_n_iron"] .gm .shopbar__cards,
  html[data-battle-theme="ac_n_iron"] .gm .shopbar__item { overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-battle-theme="ac_n_iron"] .gm .toolbtn--amber::after,
  html[data-battle-theme="ac_n_iron"] .gm .shopbar .lvcard.is-armed::after { animation: none; }
}

/* Official bond backgrounds: active/inactive, scoped to this battle theme. */
html[data-battle-theme="ac_n_iron"] .gm .bond .bond__core {
  /* Prefab: 75px plate around a 58px root and a 36px logo. */
  position: relative; isolation: isolate; overflow: visible;
  border-radius: 0; background: none; box-shadow: none;
}
html[data-battle-theme="ac_n_iron"] .gm .bond .bond__core::before {
  content: ''; position: absolute; left: 50%; top: 50%; z-index: -1;
  width: calc(100% * 75 / 58); height: calc(100% * 75 / 58);
  transform: translate(-50%, -50%); pointer-events: none;
  background: var(--iron-asset-hud-bond-bg-inactive, none) center / 100% 100% no-repeat;
}
html[data-battle-theme="ac_n_iron"] .gm .bond.is-active .bond__core::before {
  background-image: var(--iron-asset-hud-bond-bg-active, none);
}
html[data-battle-theme="ac_n_iron"] .gm .bond .bond__icon {
  width: calc(100% * 36 / 58); height: calc(100% * 36 / 58);
}
html[data-battle-theme="ac_n_iron"] .gm .bond__ring circle.on {
  stroke: #fff; filter: drop-shadow(0 0 2px rgba(255,255,255,.8));
}
html[data-battle-theme="ac_n_iron"] .gm .bslot.is-open .bond__core {
  filter: drop-shadow(0 0 .08rem rgba(255,255,255,.8));
}
html[data-battle-theme="ac_n_iron"] .gm__bonds .bond.is-active .bond__glyph { color: #fff; }
html[data-battle-theme="ac_n_iron"] .gm__bonds .bond.is-active .bond__icon { filter: brightness(0) invert(1); }

/* Battle palette: include portaled chat and secondary dialogs, only in battle. */
html[data-battle-theme=ac_n_iron] .gm,
html[data-battle-theme=ac_n_iron] body:has(.gm) .sp-overlay-layer:not(:has(.settings-modal)),
html[data-battle-theme=ac_n_iron] body:has(.gm) .sp-chat--match {
  --mint-400: #BAD7CF;
  --mint-500: #BAD7CF;
  --mint-600: #a4c3ba;
  --mint-glow: #BAD7CF;
  --mint-700: #7f9f94;
  --mint-800: #3b5a50;
  --mint-900: #22382f;
  --mint-a10: rgba(186, 215, 207, .10);
  --mint-a20: rgba(186, 215, 207, .20);
  --mint-a35: rgba(186, 215, 207, .35);
  --text-on-mint: #162b23;
}
html[data-battle-theme=ac_n_iron] body:has(.gm) .ping { --mint-400: #59f4ca; }
html[data-battle-theme=ac_n_iron] body:has(.gm) .sp-chat--match .sp-chat__toggle { color: var(--mint-400); border-color: var(--mint-400); background: linear-gradient(110deg,rgba(22,41,35,.96),rgba(14,23,19,.96)); }
html[data-battle-theme=ac_n_iron] body:has(.gm) .sp-chat--match .sp-chat__toggle:hover { background: #293f36; box-shadow: 0 0 14px rgba(186,215,207,.2); }
html[data-battle-theme=ac_n_iron] body:has(.gm) .sp-overlay-layer:not(:has(.settings-modal)) .modal__box { box-shadow: 0 .3rem .9rem rgba(0,0,0,.65), 0 0 .4rem rgba(186,215,207,.06); }
