/* Closure integration uses the accepted Ursus shop unit and the current game layout. */
html[data-battle-theme="ac_s_closur"] .gm {
  --closure-u: .0098rem;
  --cp: calc(1rem / 66.6667);
  --mint-400: #59f3fe; --mint-500: #59f3fe; --mint-600: #37c9d4;
  --mint-700: #258a94; --mint-800: #163e49; --mint-900: #101f2d;
  --mint-glow: #59f3fe; --mint-a10: rgba(89,243,254,.10); --mint-a20: rgba(89,243,254,.20); --mint-a35: rgba(89,243,254,.35);
  --text-on-mint: #102333;
}
.battle-theme-picker__swatch--ac_s_closur { color: #59f3fe; background: #34244b; border-color: #e45ac8; }

/* Preserve the current full-width controls zone and actual 3–5 unlocked operator slots. */
html[data-battle-theme="ac_s_closur"] .gm .gm__hud > .shopbar.cshop {
  --cp: calc(var(--closure-u) * 187 / 209);
  left: 2.8rem; right: .08rem; bottom: .04rem; width: auto; height: auto;
  display: flex; flex-direction: column; align-items: stretch; gap: calc(6 * var(--closure-u));
  scale: 1; transform-origin: right bottom; pointer-events: none; font-family: inherit;
}
html[data-battle-theme="ac_s_closur"] .gm .cshop .cshop__row-live {
  position: relative; inset: auto; display: flex; align-items: flex-end;
  padding: 0; gap: calc(6 * var(--closure-u)); background: none; border: 0; box-shadow: none;
  pointer-events: none;
}
html[data-battle-theme="ac_s_closur"] .gm .cshop .cshop__row-live::before { display: none; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .cshop__row-live > * { pointer-events: auto; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .cshop__stock { display: flex; align-items: flex-end; gap: calc(6 * var(--closure-u)); }
html[data-battle-theme="ac_s_closur"] .gm .cshop .shopbar__cards,
html[data-battle-theme="ac_s_closur"] .gm .cshop .shopbar__item { flex: none; display: flex; gap: calc(6 * var(--closure-u)); padding: 0; border: 0; align-items: flex-end; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .is-expanding { overflow: hidden; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .cshop__side-live {
  flex: 1 1 0; min-width: 0; display: flex; flex-wrap: wrap; align-self: stretch; align-items: flex-end;
  justify-content: flex-end; gap: calc(6 * var(--closure-u)); padding: 0 calc(10 * var(--closure-u)) calc(8 * var(--closure-u));
  pointer-events: none;
}
html[data-battle-theme="ac_s_closur"] .gm .cshop .cshop__side-live > * { pointer-events: auto; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .cshop__room-slot { flex: none; position: relative; width: calc(169 * var(--closure-u)); height: calc(196 * var(--closure-u)); pointer-events: none; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .croom { right: calc(-28 * var(--closure-u)); bottom: 0; width: calc(230 * var(--closure-u)); height: calc(200 * var(--closure-u)); }
html[data-battle-theme="ac_s_closur"] .gm .cshop .croom__funds { bottom: calc(177.5 * var(--cp)); }
html[data-battle-theme="ac_s_closur"] .gm .cshop .cshop__tools-live {
  display: flex; flex-wrap: wrap; justify-content: flex-end; align-self: flex-end; align-items: flex-end;
  width: auto; height: auto; gap: calc(6 * var(--closure-u)); position: relative; inset: auto;
}
html[data-battle-theme="ac_s_closur"] .gm .cshop .cshop__tools-live > .shopbar__remain { margin-right: .1rem; font-size: max(10px,.14rem); }
html[data-battle-theme="ac_s_closur"] .gm .cshop .cshop__tools { position: relative; inset: auto; display: flex; align-items: flex-end; gap: calc(6 * var(--closure-u)); width: auto; height: calc(76 * var(--cp)); }
html[data-battle-theme="ac_s_closur"] .gm .cshop .ctool { position: relative; inset: auto; flex: none; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .scard {
  width: calc(161 * var(--cp)); height: calc(209 * var(--cp)); min-width: 0; min-height: 0; flex: none;
}
html[data-battle-theme="ac_s_closur"] .gm .cshop .scard-wrap { display: flex; flex: none; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .scard__bond { background: transparent; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .scard .tier > * { display: none; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .scard__mergetag { left: 0; right: auto; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .clv__xp { left: 10%; right: 10%; top: 58%; color: #fff; text-shadow: 0 1px 3px #17143d; font-size: max(9px,.12rem); text-align: center; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .lvcard__key { z-index: 6; right: 4px; bottom: 1px; font-size: max(7px,.08rem); color: #fff !important; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .croom__hit:focus-visible,
html[data-battle-theme="ac_s_closur"] .gm .cshop button:focus-visible { outline: 2px solid #59f3fe; outline-offset: 2px; }
/* Keep current corner controls at their accepted position and scale. */
html[data-battle-theme="ac_s_closur"] .gm:has(.cshop) .gm__corner { scale: 1; }

@media (orientation: landscape) and (max-height: 600px) and (pointer: coarse) {
  html[data-battle-theme="ac_s_closur"] .gm { --closure-u: min(.0125rem, calc((100vw - var(--sp-corner-width,136px) - 40px) / 1300)); }
  html[data-battle-theme="ac_s_closur"] .gm .gm__hud > .shopbar.cshop { left: calc(var(--sp-corner-width,136px) + 24px); right: 8px; bottom: 4px; max-width: none; }
  html[data-battle-theme="ac_s_closur"] .gm .cshop .cshop__row-live { gap: 3px; overflow: visible; }
  html[data-battle-theme="ac_s_closur"] .gm .cshop .cshop__tools { scale: 1; transform-origin: right bottom; height: auto; }
  html[data-battle-theme="ac_s_closur"] .gm .cshop .ctool { --cp: .49px; width: calc(172 * var(--cp)); height: calc(76 * var(--cp)); min-width: 0; min-height: 0; zoom: .6; }
  html[data-battle-theme="ac_s_closur"] .gm .cshop .ctool--ref { width: calc(168 * var(--cp)); height: calc(72 * var(--cp)); }
  html[data-battle-theme="ac_s_closur"] .gm .cshop .ctool__txt { left: calc(76 * var(--cp)); font-size: calc(18 * var(--cp)); }
  html[data-battle-theme="ac_s_closur"] .gm .cshop .scard__bond { font-size: 8px; }
  html[data-battle-theme="ac_s_closur"] .gm .cshop .croom__fold { min-height: 32px; min-width: 48px; font-size: 11px; }
  html[data-battle-theme="ac_s_closur"] .gm .cshop .croom__funds b { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-battle-theme="ac_s_closur"] .gm .cshop *,
  html[data-battle-theme="ac_s_closur"] .gm .cshop *::before,
  html[data-battle-theme="ac_s_closur"] .gm .cshop *::after { animation: none !important; transition: none !important; }
}

/* Keep the existing topbar columns, spectator/ping controls and extra ready actions. */
html[data-battle-theme="ac_s_closur"] .gm .gtop.gtop--closure {
  grid-template-columns: minmax(0,1fr) 0 minmax(0,1fr);
  --cp: calc(1rem / 66.6667);
}
html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .gtopc-slot {
  position: static; width: 0; height: 0; padding: 0; margin: 0; animation: none; transform: none;
}
html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .gtop__right {
  grid-column: 3; position: static; min-width: 0; width: auto; z-index: 2;
}
html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .gtop__clock {
  position: static; padding-top: calc(162 * var(--cp));
}
html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .gtop__actions { max-width: 100%; flex-wrap: wrap; justify-content: flex-end; }
html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .gtopc__lp .lp { --lp-c: #f6f6ff; }
html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .cfinal.is-still .cfinal__intro,
html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .cfinal.is-still .cfinal__begin { display: none; }
html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .cfinal.is-still .cfinal__expanded,
html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .cfinal.is-still .cfinal__content { animation: none; opacity: 1; visibility: visible; transform: none; }
html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .creadywrap { min-width: 0; max-width: 100%; }
html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .readybtn.cready { --cp: calc(1rem / 66.6667); }
html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .readybtn.cready::after { animation-iteration-count: 1; animation-fill-mode: both; }
html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .readybtn.cready:is(.is-on,:disabled)::after { visibility: hidden; }
html[data-battle-theme="ac_s_closur"] .ctv.is-paused *,
html[data-battle-theme="ac_s_closur"] .ctv.is-paused *::before,
html[data-battle-theme="ac_s_closur"] .ctv.is-paused *::after { animation-play-state: paused; }
html[data-battle-theme="ac_s_closur"] .ctv.is-paused::after {
  content:'已暂停'; position:absolute; right:18%; top:80%; padding:2px 5px;
  color:#e6faff; background:rgba(11,16,35,.85); font-size:max(9px,.12rem); white-space:nowrap;
}
html[data-battle-theme="ac_s_closur"] .spov.spov--closure { --cp: calc(1rem / 66.6667); }

/* Full-window decoration does not intercept the board, dialog or accessibility actions. */
html[data-battle-theme="ac_s_closur"] .mpop.crs,
html[data-battle-theme="ac_s_closur"] .mpop.cturn {
  --cp: min(calc(1rem / 66.6667), calc(100vw / 1280), calc(100svh / 720));
  position:fixed; inset:0; z-index:72; display:flex; align-items:center; justify-content:center;
  padding:0; margin:0; width:auto; height:auto; pointer-events:none;
  background:none; border:0; box-shadow:none; transform:none; isolation:isolate;
}
html[data-battle-theme="ac_s_closur"] .mpop.crs .crs__stage,
html[data-battle-theme="ac_s_closur"] .mpop.cturn .cturn__stage {
  flex:none; width:calc(1280 * var(--cp)); height:calc(720 * var(--cp));
}
html[data-battle-theme="ac_s_closur"] .mpop.crs.is-loading,
html[data-battle-theme="ac_s_closur"] .mpop.cturn.is-loading { visibility:hidden; }
html[data-battle-theme="ac_s_closur"] .mpop.crs.is-loading *,
html[data-battle-theme="ac_s_closur"] .mpop.crs.is-loading *::before,
html[data-battle-theme="ac_s_closur"] .mpop.crs.is-loading *::after { animation-play-state:paused !important; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .ctool kbd {
  position:absolute; right:calc(8 * var(--cp)); bottom:calc(9 * var(--cp));
  font-size:max(7px,.08rem); color:inherit; border-color:currentColor; opacity:.7;
}
html[data-battle-theme="ac_s_closur"] .gm .cshop .croom__hit { pointer-events:auto; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .cshop__room-slot { pointer-events:none; }
html[data-battle-theme="ac_s_closur"] .gm .cshop .cshop__stock { min-width:0; }

/* Portaled battle panels and chat share the theme; settings and ping retain their original colours. */
html[data-battle-theme="ac_s_closur"] body:has(.gm) .sp-overlay-layer:not(:has(.settings-modal)),
html[data-battle-theme="ac_s_closur"] body:has(.gm) .sp-chat--match {
  --mint-400:#59f3fe; --mint-500:#59f3fe; --mint-600:#37c9d4;
  --mint-700:#258a94; --mint-800:#163e49; --mint-900:#101f2d;
  --mint-glow:#59f3fe; --mint-a10:rgba(89,243,254,.1); --mint-a20:rgba(89,243,254,.2);
  --mint-a35:rgba(89,243,254,.35); --text-on-mint:#102333;
}
html[data-battle-theme="ac_s_closur"] body:has(.gm) .ping { --mint-400:#59f4ca; }
html[data-battle-theme="ac_s_closur"] body.east-match-legacy .sp-chat--match .sp-chat__toggle {
  color:#aaf9ff; border-color:#397c89; background:rgba(13,19,39,.96);
}
@media (orientation:landscape) and (max-height:600px) and (pointer:coarse) {
  html[data-battle-theme="ac_s_closur"] .gm .gtop.gtop--closure { --cp: min(calc(1rem / 66.6667), calc((100vw - 230px) / 700)); }
  html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .readybtn.cready { --cp:.53px; min-width:0; min-height:30px; height:30px; font-size:11px; }
  html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .readybtn.cready .readybtn__label { font-size:11px; }
  html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .creadywrap .readywrap__why,
  html[data-battle-theme="ac_s_closur"] .gm .gtop--closure .creadywrap .readywrap__count { font-size:9px; }
}
@media (prefers-reduced-motion:reduce) {
  html[data-battle-theme="ac_s_closur"] .mpop.crs *,
  html[data-battle-theme="ac_s_closur"] .mpop.cturn * { animation:none !important; transition:none !important; }
  html[data-battle-theme="ac_s_closur"] .mpop.crs .crs__glitch,
  html[data-battle-theme="ac_s_closur"] .mpop.crs .crs__sparks,
  html[data-battle-theme="ac_s_closur"] .mpop.cturn .cturn__spark { display:none; }
}

@media (prefers-reduced-motion:reduce) {
  html[data-battle-theme="ac_s_closur"] .mpop.crs .crs__main,
  html[data-battle-theme="ac_s_closur"] .mpop.crs .crs__fig,
  html[data-battle-theme="ac_s_closur"] .mpop.crs .crs__cell,
  html[data-battle-theme="ac_s_closur"] .mpop.cturn .cturn__title,
  html[data-battle-theme="ac_s_closur"] .mpop.cturn .cturn__fig {
    opacity:1; visibility:visible; filter:none; transform:none;
  }
}

/* Reuse the existing unit-action buttons, including prices and refusal states. */
html[data-battle-theme="ac_s_closur"] body:has(.gm) .uframe--closure .uframe__btn--sell,
html[data-battle-theme="ac_s_closur"] body:has(.gm) .uframe--closure .uframe__btn--destroy {
  isolation:isolate;
}
html[data-battle-theme="ac_s_closur"] body:has(.gm) .uframe--closure .uframe__btn--sell::after,
html[data-battle-theme="ac_s_closur"] body:has(.gm) .uframe--closure .uframe__btn--destroy::after {
  content:''; position:absolute; inset:-6px; z-index:-1; pointer-events:none;
  background:var(--closure-asset-img-sell-chess-normal,none) center / contain no-repeat;
}
html[data-battle-theme="ac_s_closur"] body:has(.gm) .uframe--closure .uframe__btn--sell:hover::after { background-image:var(--closure-asset-img-sell-chess-hover,none); }
html[data-battle-theme="ac_s_closur"] body:has(.gm) .uframe--closure .uframe__btn--destroy::after { background-image:var(--closure-asset-img-sell-equip-normal,none); }
html[data-battle-theme="ac_s_closur"] body:has(.gm) .uframe--closure .uframe__btn--destroy:hover::after { background-image:var(--closure-asset-img-sell-equip-hover,none); }
html[data-battle-theme="ac_s_closur"] .stephead.stephead--closure { --cp:calc(1rem / 66.6667); position:relative; min-height:calc(175 * var(--cp)); }
html[data-battle-theme="ac_s_closur"] .stephead--closure .stephead__right { padding-right:calc(190 * var(--cp)); }
html[data-battle-theme="ac_s_closur"] .stephead--closure .ctv { top:calc(-8 * var(--cp)); right:0; }
html[data-battle-theme="ac_s_closur"] .stephead--closure .stephead__center { padding:.08rem .2rem; background:rgba(13,22,45,.85); border-bottom:2px solid #59f3fe; }
@media (orientation:landscape) and (max-height:600px) and (pointer:coarse) {
  html[data-battle-theme="ac_s_closur"] .stephead.stephead--closure { --cp:.55px; }
}
