:root {
  --face: #c0c0c0;
  --light: #ffffff;
  --shadow: #808080;
  --dark: #000000;
  --title: #000080;
  --title-text: #ffffff;
  --field: #ffffff;
  --text: #000000;
  --text-disabled: #808080;
  --led: #ff0000;
  --led-dim: #2a0000;
  --good: #008000;
  --bad: #c00000;
  --boss: #7b1fa2;
  --mixed: #0000ff;
  --font: "SimSun", "宋体", "NSimSun", "Microsoft YaHei", Tahoma, sans-serif;
  --font-num: "Tahoma", "Consolas", "SimSun", monospace;
  --ui-scale: 1.18;
  --ease-spring: cubic-bezier(0.22, 1.35, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--face);
  color: var(--text);
  font-family: var(--font);
  font-size: calc(14px * var(--ui-scale));
  line-height: 1.25;
  -webkit-font-smoothing: none;
  font-smooth: never;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

img,
canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

[hidden] {
  display: none !important;
}

/* ---------- 顶层全屏游戏面板（左数值、右地图/商店） ---------- */

.app-shell {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: row;
  gap: calc(8px * var(--ui-scale));
  padding: calc(8px * var(--ui-scale));
  background: var(--face);
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -4px -4px var(--shadow),
    inset 4px 4px var(--face);
}

.app-shell.is-title-mode .sidebar {
  display: none;
}

.app-shell:not(.is-title-mode) .sidebar {
  animation: sidebar-dock-in 0.38s var(--ease-out-expo) both;
}

@keyframes sidebar-dock-in {
  0% {
    opacity: 0;
    transform: translateX(-28px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.app-shell.is-title-mode .board-wrap {
  box-shadow: none;
  padding: 0;
}

#game {
  transition: filter 0.38s var(--ease-out-expo), transform 0.38s var(--ease-out-expo);
}

.app-shell.is-title-mode #game {
  filter: blur(5px) brightness(0.84) contrast(1.06);
  transform: scale(1.03);
}

.app-shell.is-shaking {
  animation: win-shake 0.22s steps(2) 2;
}

@keyframes win-shake {
  0% { translate: 0 0; }
  25% { translate: -5px 3px; }
  50% { translate: 4px -3px; }
  75% { translate: -3px 2px; }
  100% { translate: 0 0; }
}

/* ---------- 左侧数值栏 ---------- */

.sidebar {
  flex: 0 0 clamp(280px, 24.5vw, 396px);
  display: flex;
  flex-direction: column;
  gap: calc(6px * var(--ui-scale));
  padding: calc(8px * var(--ui-scale));
  background: var(--face);
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--shadow),
    inset -4px -4px var(--face),
    inset 4px 4px var(--dark);
  min-height: 0;
  overflow: hidden;
}

.section {
  display: flex;
  flex-direction: column;
  gap: calc(5px * var(--ui-scale));
  padding: calc(6px * var(--ui-scale)) calc(9px * var(--ui-scale));
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--shadow);
}

.level-box {
  padding: calc(6px * var(--ui-scale)) calc(9px * var(--ui-scale));
  background: #b5b5b5;
  transition: background 0.22s ease;
}

.level-box.is-boss-stage {
  background: #c8b6d6;
}

.level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.level-title-wrap {
  display: flex;
  align-items: center;
  gap: calc(7px * var(--ui-scale));
}

.level-row b {
  font-family: var(--font-num);
  font-size: calc(16px * var(--ui-scale));
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.stage-pips {
  display: inline-flex;
  align-items: center;
  gap: calc(4px * var(--ui-scale));
}

.stage-pip {
  width: calc(8px * var(--ui-scale));
  height: calc(8px * var(--ui-scale));
  background: #7c7c7c;
  border: 1px solid #181818;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.22s var(--ease-spring), background 0.2s ease;
}

.stage-pip.is-done {
  background: #009830;
}

.stage-pip.is-current {
  background: #ffcc00;
  transform: scale(1.22);
  box-shadow: 0 0 5px rgba(255, 200, 0, 0.75);
}

.stage-pip.is-boss-pip.is-current {
  background: #b030ff;
  box-shadow: 0 0 6px rgba(176, 48, 255, 0.85);
}

.level-row > span {
  font-family: var(--font-num);
  font-size: calc(14px * var(--ui-scale));
  font-weight: 700;
  color: #181818;
  white-space: nowrap;
}

.boss-banner {
  margin-top: calc(2px * var(--ui-scale));
  padding: calc(3px * var(--ui-scale)) calc(6px * var(--ui-scale));
  background: #4a0e68;
  color: #f8e8ff;
  font-size: calc(11.5px * var(--ui-scale));
  font-weight: 700;
  box-shadow:
    inset -1px -1px var(--light),
    inset 1px 1px var(--dark);
  animation: banner-pulse 1.4s ease-in-out infinite alternate;
}

@keyframes banner-pulse {
  from { filter: brightness(0.96); }
  to   { filter: brightness(1.12); }
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: calc(14px * var(--ui-scale));
}

.section-title small {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: calc(12px * var(--ui-scale));
  color: #282828;
}

/* ---------- 七段数码管得分槽（含辉光、扫描线与达标翡翠态） ---------- */

.led-row {
  display: flex;
  align-items: center;
}

.led-field {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: calc(5px * var(--ui-scale)) calc(8px * var(--ui-scale));
  background: #060202;
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--shadow),
    inset -4px -4px var(--face),
    inset 4px 4px var(--dark);
  overflow: hidden;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.led-field::after {
  content: "";
  position: absolute;
  inset: 3px;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03) 0 1px,
    rgba(0, 0, 0, 0.22) 1px 3px
  );
}

.led-field.is-rolling canvas {
  filter: drop-shadow(0 0 4px rgba(255, 45, 45, 0.72));
}

.led-field.is-reached {
  background: #021205;
}

.led-field.is-reached canvas {
  filter: drop-shadow(0 0 5px rgba(50, 255, 95, 0.65));
}

.led-field.is-surge {
  animation: led-surge-bump 0.26s var(--ease-spring);
}

@keyframes led-surge-bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.028); }
  100% { transform: scale(1); }
}

.digit-strip {
  position: relative;
  z-index: 1;
  display: flex;
  gap: calc(4px * var(--ui-scale));
}

.digit-strip--score {
  width: 100%;
  justify-content: flex-end;
  gap: calc(3px * var(--ui-scale));
}

.digit-strip--score canvas {
  width: calc(20px * var(--ui-scale));
  height: calc(31px * var(--ui-scale));
  display: block;
  transition: filter 0.18s ease;
}

.meter {
  position: relative;
  height: calc(14px * var(--ui-scale));
  padding: 2px;
  background: var(--field);
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--shadow),
    inset -3px -3px var(--face),
    inset 3px 3px var(--dark);
  overflow: hidden;
}

.meter-fill {
  position: relative;
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(
    90deg,
    var(--title) 0 calc(8px * var(--ui-scale)),
    var(--field) calc(8px * var(--ui-scale)) calc(10.5px * var(--ui-scale))
  );
  transition: width 0.24s var(--ease-out-expo);
}

.meter-fill.is-reached {
  background: repeating-linear-gradient(
    90deg,
    #00a838 0 calc(8px * var(--ui-scale)),
    #d8ffd8 calc(8px * var(--ui-scale)) calc(10.5px * var(--ui-scale))
  );
}

.meter-fill.is-reached::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.7) 50%, transparent 100%);
  animation: meter-sheen 1.8s ease-in-out infinite;
}

@keyframes meter-sheen {
  0% { transform: translateX(-110%); }
  65%, 100% { transform: translateX(110%); }
}

/* ---------- 剩余点击进度条（根据剩余步数动态由绿变红 + 低步数急促呼吸） ---------- */

.click-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: calc(2.5px * var(--ui-scale));
  height: calc(15px * var(--ui-scale));
  padding: 2.5px;
  background: var(--field);
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--shadow),
    inset -3px -3px var(--face),
    inset 3px 3px var(--dark);
}

.click-seg {
  height: 100%;
  background: #efefef;
  transform-origin: center;
  transition: background 0.2s ease, transform 0.2s var(--ease-spring), opacity 0.18s ease;
}

.click-seg.is-on {
  background: var(--click-color, #008800);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28);
}

.click-bar.is-low .click-seg.is-on {
  animation: low-click-pulse 0.48s ease-in-out infinite alternate;
}

@keyframes low-click-pulse {
  from { filter: brightness(0.92); transform: scaleY(0.92); }
  to   { filter: brightness(1.22); transform: scaleY(1); }
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(5px * var(--ui-scale));
}

.stat-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: calc(1px * var(--ui-scale));
  padding: calc(5px * var(--ui-scale)) calc(7px * var(--ui-scale));
  background: var(--field);
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--shadow),
    inset -3px -3px var(--face),
    inset 3px 3px var(--dark);
  transition: background 0.2s ease, transform 0.2s var(--ease-spring);
}

.stat b {
  font-family: var(--font-num);
  font-size: calc(15.5px * var(--ui-scale));
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform-origin: left center;
  transition: transform 0.2s var(--ease-spring), color 0.18s ease;
}

.stat span {
  font-size: calc(10.5px * var(--ui-scale));
  font-weight: 700;
  color: #404040;
}

.stat.is-bumping {
  animation: stat-pop 0.24s var(--ease-spring);
}

@keyframes stat-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.stat.is-hot {
  background: #eefbee;
}

.stat.is-hot b {
  color: var(--good);
}

.stat.is-blazing {
  background: #fff7dd;
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px #cc6600,
    inset -3px -3px #ffe088,
    inset 3px 3px #883300;
}

.stat.is-blazing b {
  color: #cc4400;
}

.stat.is-broken {
  animation: combo-shatter 0.3s steps(3);
}

@keyframes combo-shatter {
  0% { transform: translateX(0); background: #ffd6d6; }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); background: var(--field); }
}

.stat--good b {
  color: var(--good);
}

/* ---------- 道具槽（恒定 3 列，超出 6 格自动纵向滚动） ---------- */

.section--slots {
  flex: 0 0 auto;
}

.slot-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(5px * var(--ui-scale));
  max-height: calc(106px * var(--ui-scale));
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 1px;
}

.slot-row::-webkit-scrollbar {
  width: calc(10px * var(--ui-scale));
}

.slot-row::-webkit-scrollbar-track {
  background: #dfdfdf;
  box-shadow: inset 1px 1px 0 var(--shadow);
}

.slot-row::-webkit-scrollbar-thumb {
  background: var(--face);
  box-shadow:
    inset -1px -1px var(--dark),
    inset 1px 1px var(--light),
    inset -2px -2px var(--shadow),
    inset 2px 2px var(--face);
}

.slot {
  position: relative;
  min-height: calc(44px * var(--ui-scale));
  padding: calc(3px * var(--ui-scale)) calc(4px * var(--ui-scale));
  border: 0;
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-align: center;
  font-size: calc(11.5px * var(--ui-scale));
  font-weight: 700;
  color: #555555;
  background: var(--field);
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--shadow),
    inset -3px -3px var(--face),
    inset 3px 3px var(--dark);
  transition: transform 0.18s var(--ease-spring), background 0.15s ease, box-shadow 0.15s ease;
}

.slot > * {
  pointer-events: none;
}

.slot__head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  max-width: 100%;
}

.slot__head canvas {
  width: calc(13px * var(--ui-scale));
  height: calc(13px * var(--ui-scale));
  flex: 0 0 auto;
}

.slot__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot__keycap {
  position: absolute;
  top: 2px;
  right: 3px;
  padding: 0 2px;
  background: rgba(0, 0, 0, 0.08);
  font-family: var(--font-num);
  font-size: calc(8.5px * var(--ui-scale));
  line-height: 1.15;
  color: #484848;
}

.slot.is-filled {
  color: #145a14;
  background: #eef8ee;
}

.slot.is-rarity-rare {
  border-bottom: 2px solid #1a66cc;
}

.slot.is-rarity-epic {
  border-bottom: 2px solid #8e24aa;
  background: #f7eefc;
}

.slot.is-rarity-legendary {
  border-bottom: 2px solid #d48800;
  background: #fff9e6;
}

.slot.is-active-item {
  cursor: grab;
  color: #003380;
  background: #e6f0ff;
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -3px -3px var(--shadow),
    inset 3px 3px var(--face);
}

.slot.is-active-item:hover:not(:disabled) {
  background: #d2e5ff;
  transform: translateY(-2px);
}

.slot.is-active-item:active:not(:disabled) {
  cursor: grabbing;
  transform: translateY(0) scale(0.97);
}

.slot.is-shop-sellable {
  cursor: pointer;
  background: #fff8e6;
  color: #703800;
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -3px -3px var(--shadow),
    inset 3px 3px var(--face);
}

.slot.is-shop-sellable:hover {
  background: #ffe8b8;
  transform: translateY(-2px);
}

.slot.is-sell-armed {
  background: #ffdede !important;
  color: #9e0b0b !important;
  transform: translateY(-3px) scale(1.03);
  z-index: 4;
  box-shadow:
    inset -2px -2px #6e0808,
    inset 2px 2px #ffffff,
    0 3px 0 rgba(120, 0, 0, 0.35);
}

.slot.is-sell-armed small {
  color: #b00000 !important;
  font-weight: 800;
}

.slot__use-btn {
  pointer-events: auto;
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 0 4px;
  border: 1px solid #3c1870;
  background: #6c2bd9;
  color: #ffffff;
  font-family: var(--font);
  font-size: calc(8.5px * var(--ui-scale));
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  z-index: 5;
}

.slot__use-btn:hover {
  background: #8445f5;
}

.slot__ed {
  font-size: calc(8.5px * var(--ui-scale));
  font-weight: 700;
  line-height: 1.1;
  padding: 0 3px;
  border-radius: 1px;
}

/* 四种小丑牌式附魔：槽位视觉 */
.slot.is-ed-foil {
  background: linear-gradient(135deg, #d6ebff 0%, #f8fcff 45%, #a9d2ff 100%);
  color: #0b3a75;
}

.slot.is-ed-foil .slot__ed {
  background: #1b64b8;
  color: #f0f8ff;
}

.slot.is-ed-holo {
  background: linear-gradient(135deg, #d6fcff 0%, #f7dcff 50%, #c8f6ff 100%);
  color: #4a1068;
}

.slot.is-ed-holo .slot__ed {
  background: #8e1ca8;
  color: #dcffff;
}

.slot.is-ed-polychrome {
  background: linear-gradient(128deg, #ffe0e0 0%, #fff4c6 30%, #d8ffe6 60%, #dceeff 82%, #f5daff 100%);
  color: #4a1c00;
}

.slot.is-ed-polychrome .slot__ed {
  background: linear-gradient(90deg, #c62828, #ad1457, #4527a0);
  color: #fffbe6;
}

.slot.is-ed-negative {
  background: linear-gradient(145deg, #101624 0%, #1d2840 55%, #0c101b 100%);
  color: #aef4ff;
  box-shadow:
    inset -2px -2px #4fd8ff,
    inset 2px 2px #263654,
    inset -3px -3px #090d16,
    inset 3px 3px #60e6ff;
}

.slot.is-ed-negative small,
.slot.is-ed-negative .slot__keycap {
  color: #88e8ff;
}

.slot.is-ed-negative .slot__ed {
  background: #062b38;
  color: #7df4ff;
  border: 1px solid #48d8f0;
}

.slot.is-aiming {
  background: #fff2a6;
  color: #804000;
  outline: 2px dashed #cc6600;
  outline-offset: -3px;
  animation: slot-aim-pulse 0.65s ease-in-out infinite alternate;
}

@keyframes slot-aim-pulse {
  from { transform: translateY(-1px) scale(1.01); }
  to   { transform: translateY(-3px) scale(1.05); }
}

.slot.is-proc {
  z-index: 6;
  animation: slot-joker-proc 0.38s var(--ease-spring);
}

@keyframes slot-joker-proc {
  0%   { transform: scale(1) rotate(0deg); filter: brightness(1); }
  32%  { transform: translateY(-5px) scale(1.16) rotate(-3.5deg); filter: brightness(1.22); }
  65%  { transform: translateY(-1px) scale(1.04) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
}

.slot.is-catch {
  animation: slot-catch-pop 0.34s var(--ease-spring);
}

@keyframes slot-catch-pop {
  0%   { transform: scale(0.86); }
  50%  { transform: scale(1.14); background: #d6ffd6; }
  100% { transform: scale(1); }
}

.slot-proc-badge {
  position: absolute;
  left: 50%;
  top: -4px;
  transform: translate(-50%, -100%);
  padding: 1px 5px;
  background: #102410;
  color: #7dff7d;
  border: 1px solid #44dd44;
  font-family: var(--font-num);
  font-size: calc(10px * var(--ui-scale));
  font-weight: 700;
  white-space: nowrap;
  z-index: 15;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
  animation: proc-badge-float 0.68s var(--ease-out-expo) forwards;
}

@keyframes proc-badge-float {
  0%   { opacity: 0; transform: translate(-50%, -40%) scale(0.7); }
  22%  { opacity: 1; transform: translate(-50%, -115%) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -185%) scale(0.96); }
}

.slot.is-depleted {
  color: #777777;
  background: #dcdcdc;
  cursor: default;
}

.slot small {
  font-family: var(--font-num);
  font-size: calc(9.5px * var(--ui-scale));
  font-weight: 700;
  color: #333333;
}

.slot.is-locked {
  background:
    repeating-linear-gradient(
      -45deg,
      #a8a8a8 0 5px,
      #b2b2b2 5px 10px
    );
  color: #5c5c5c;
}

/* ---------- 道具槽下方的关卡操作区（重新开始本局游戏 + 提前结算） ---------- */

.stage-actions {
  display: flex;
  flex-direction: column;
  gap: calc(5px * var(--ui-scale));
}

/* ---------- 中下部自适应图鉴区：本关可能出现的雷 ---------- */

.section--mine-pool {
  flex: 1 1 0;
  min-height: calc(78px * var(--ui-scale));
  overflow: hidden;
}

.mine-pool-list {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(4px * var(--ui-scale));
  background-color: #f6f6f4;
  background-image: radial-gradient(#dcdcd8 1px, transparent 1px);
  background-size: 8px 8px;
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--shadow),
    inset -3px -3px var(--face),
    inset 3px 3px var(--dark);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: calc(4px * var(--ui-scale));
}

.mine-pool-list.is-spacious {
  grid-template-columns: 1fr;
}

.mine-chip__sub {
  display: none;
  font-size: calc(10.5px * var(--ui-scale));
  font-weight: 400;
  color: #4a4a4a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mine-pool-list.is-spacious .mine-chip {
  padding: calc(5px * var(--ui-scale)) calc(7px * var(--ui-scale));
}

.mine-pool-list.is-spacious .mine-chip__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
}

.mine-pool-list.is-spacious .mine-chip__sub {
  display: block;
}

.mine-pool-list:not(.is-spacious) .mine-chip__body {
  flex: 1 1 auto;
  min-width: 0;
}

.mine-pool-list::-webkit-scrollbar {
  width: calc(12px * var(--ui-scale));
}

.mine-pool-list::-webkit-scrollbar-track {
  background: #dfdfdf;
  box-shadow: inset 1px 1px 0 var(--shadow);
}

.mine-pool-list::-webkit-scrollbar-thumb {
  background: var(--face);
  box-shadow:
    inset -1px -1px var(--dark),
    inset 1px 1px var(--light),
    inset -2px -2px var(--shadow),
    inset 2px 2px var(--face);
}

.mine-chip {
  display: flex;
  align-items: center;
  gap: calc(5px * var(--ui-scale));
  padding: calc(3.5px * var(--ui-scale)) calc(5px * var(--ui-scale));
  background: #f3f5f3;
  border-left: 3px solid var(--good);
  box-shadow:
    inset -1px -1px var(--shadow),
    inset 1px 1px var(--light);
  cursor: help;
  min-width: 0;
  transition: background 0.14s ease, transform 0.14s var(--ease-spring);
}

.mine-chip > * {
  pointer-events: none;
}

.mine-chip:hover {
  background: #e2f4e2;
  transform: translateX(2px);
}

.mine-chip--bad {
  background: #fbf1f1;
  border-left-color: var(--bad);
}

.mine-chip--bad:hover {
  background: #ffe0e0;
}

.mine-chip--boss {
  grid-column: 1 / -1;
  background: #f5ecfb;
  border-left-color: var(--boss);
}

.mine-chip--boss:hover {
  background: #ead6fa;
}

.mine-chip canvas {
  width: calc(16px * var(--ui-scale));
  height: calc(16px * var(--ui-scale));
  flex: 0 0 auto;
}

.mine-chip__info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}

.mine-chip__name {
  font-size: calc(11.5px * var(--ui-scale));
  font-weight: 700;
  color: #181818;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mine-chip__tag {
  font-family: var(--font-num);
  font-size: calc(10px * var(--ui-scale));
  font-weight: 700;
  color: #006800;
  flex: 0 0 auto;
}

.mine-chip--bad .mine-chip__tag {
  color: var(--bad);
}

.mine-chip--boss .mine-chip__tag {
  color: var(--boss);
}

/* ---------- 左侧栏最底部常驻区（游戏速度 + 设置） ---------- */

.sidebar-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: calc(5px * var(--ui-scale));
}

/* ---------- 右侧主区域（棋盘 Canvas 或内嵌商店） ---------- */

.board-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 4px;
  background: var(--face);
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--shadow),
    inset -4px -4px var(--face),
    inset 4px 4px var(--dark);
  overflow: hidden;
  position: relative;
}

#game {
  display: block;
  flex: 0 0 auto;
  touch-action: none;
}

/* ---------- 关卡开场战术横条 & 长连锁 HUD 胶囊 ---------- */

.stage-intro-banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 16%;
  z-index: 25;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.stage-intro-inner {
  min-width: min(86%, calc(420px * var(--ui-scale)));
  padding: calc(10px * var(--ui-scale)) calc(24px * var(--ui-scale));
  background: linear-gradient(90deg, #071330 0%, #0d2b6b 50%, #071330 100%);
  color: #ffffff;
  border-top: 2px solid #7cc4ff;
  border-bottom: 2px solid #000000;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 0 rgba(0, 0, 0, 0.42);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  animation: stage-banner-sweep 1.05s var(--ease-out-expo) forwards;
}

.stage-intro-banner.is-boss .stage-intro-inner {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(140, 20, 190, 0.22) 0 10px,
      rgba(40, 5, 65, 0.22) 10px 20px
    ),
    linear-gradient(90deg, #240636 0%, #5c1084 50%, #240636 100%);
  border-top-color: #ea80fc;
}

@keyframes stage-banner-sweep {
  0% {
    opacity: 0;
    transform: translateY(14px) scaleX(0.88);
  }
  18% {
    opacity: 1;
    transform: translateY(0) scaleX(1);
  }
  76% {
    opacity: 1;
    transform: translateY(0) scaleX(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-12px) scaleX(0.96);
  }
}

.stage-intro-eyebrow {
  font-family: var(--font-num);
  font-size: calc(11px * var(--ui-scale));
  font-weight: 700;
  letter-spacing: 2px;
  color: #9ad0ff;
}

.stage-intro-banner.is-boss .stage-intro-eyebrow {
  color: #f3b8ff;
}

.stage-intro-title {
  font-size: calc(18px * var(--ui-scale));
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffff66;
  text-shadow: 2px 2px 0 #000000;
}

.chain-hud-pill {
  position: absolute;
  top: calc(10px * var(--ui-scale));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: calc(8px * var(--ui-scale));
  padding: calc(4px * var(--ui-scale)) calc(12px * var(--ui-scale));
  background: #102010;
  color: #88ff88;
  border: 1px solid #38c838;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
  font-family: var(--font-num);
  font-size: calc(12px * var(--ui-scale));
  font-weight: 700;
  pointer-events: none;
  animation: pill-pop-in 0.18s var(--ease-spring);
}

.chain-hud-pill small {
  font-family: var(--font);
  font-size: calc(10.5px * var(--ui-scale));
  color: #d8ffd8;
  opacity: 0.85;
}

.chain-hud-pill.is-boosting {
  background: #2c1e00;
  color: #ffe066;
  border-color: #ffaa00;
}

@keyframes pill-pop-in {
  from { opacity: 0; transform: translate(-50%, -8px) scale(0.9); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ---------- 右侧内嵌轮末商店 ---------- */

.shop-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px * var(--ui-scale));
}

.shop-window {
  width: min(100%, calc(760px * var(--ui-scale)));
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: var(--face);
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -4px -4px var(--shadow),
    inset 4px 4px var(--face),
    8px 8px 0 rgba(0, 0, 0, 0.32);
  animation: shop-stage-enter 0.28s var(--ease-spring);
}

@keyframes shop-stage-enter {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.shop-stage-body {
  display: flex;
  flex-direction: column;
  gap: calc(14px * var(--ui-scale));
  padding: calc(16px * var(--ui-scale));
}

.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px * var(--ui-scale)) calc(14px * var(--ui-scale));
  background: #102010;
  color: #a0ffa0;
  font-size: calc(14.5px * var(--ui-scale));
  font-weight: 700;
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--dark);
}

.shop-cards-grid {
  display: grid;
  grid-template-columns: repeat(var(--shelf-cols, 3), minmax(0, 1fr));
  gap: calc(10px * var(--ui-scale));
}

.shop-lower-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(10px * var(--ui-scale));
  align-items: stretch;
}

/* ---------- 道具包与本轮特批券等宽 3 列对齐 ---------- */
.shop-packs-grid {
  display: contents;
}

.pack-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: calc(5px * var(--ui-scale));
  min-height: calc(136px * var(--ui-scale));
  padding: calc(10px * var(--ui-scale));
  border: 0;
  background: linear-gradient(160deg, #4a3a6a 0%, #2e2444 100%);
  color: #f0e6ff;
  font-family: var(--font);
  cursor: pointer;
  box-shadow:
    inset -2px -2px #1a1428,
    inset 2px 2px #6a5a8a,
    inset -4px -4px #241c38,
    inset 4px 4px #3a2e56;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}

.pack-card:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow:
    inset -2px -2px #1a1428,
    inset 2px 2px #8a7aaa,
    inset -4px -4px #241c38,
    inset 4px 4px #3a2e56,
    0 6px 0 rgba(0, 0, 0, 0.35);
}

.pack-card:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6) brightness(0.7);
}

.pack-card--standard {
  background: linear-gradient(160deg, #3c4c68 0%, #243044 100%);
  color: #e8f1ff;
  box-shadow:
    inset -2px -2px #141c28,
    inset 2px 2px #667b9e,
    inset -4px -4px #1d2636,
    inset 4px 4px #314059;
}

.pack-card--rare {
  background: linear-gradient(160deg, #1e56a0 0%, #123366 100%);
  color: #eaf6ff;
  box-shadow:
    inset -2px -2px #0a1e3d,
    inset 2px 2px #5ea4ff,
    inset -4px -4px #102a54,
    inset 4px 4px #2466bd;
}

.pack-card--epic {
  background: linear-gradient(155deg, #6a249c 0%, #3d1261 62%, #592652 100%);
  color: #fff2cc;
  box-shadow:
    inset -2px -2px #220838,
    inset 2px 2px #e0a8ff,
    inset -4px -4px #300d4d,
    inset 4px 4px #8838bf;
}

.pack-card.is-opened {
  background: linear-gradient(160deg, #2a2038 0%, #1a1428 100%);
  cursor: default;
}

.pack-card b {
  font-size: calc(14px * var(--ui-scale));
  letter-spacing: 1px;
}

.pack-card small {
  font-size: calc(11px * var(--ui-scale));
  opacity: 0.85;
}

.pack-card__price {
  margin-top: calc(4px * var(--ui-scale));
  padding: calc(2px * var(--ui-scale)) calc(8px * var(--ui-scale));
  background: rgba(0, 0, 0, 0.35);
  font-size: calc(11px * var(--ui-scale));
  font-weight: 700;
}

/* 开包弹层挂载在右侧 #boardWrap 内，绝不遮挡左侧道具栏与消耗品栏！ */
.pack-pick-layer {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(12px * var(--ui-scale));
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(2px);
}

.deck-modal-layer {
  z-index: 52;
}

.pack-pick-panel {
  display: flex;
  flex-direction: column;
  gap: calc(12px * var(--ui-scale));
  padding: calc(18px * var(--ui-scale));
  background: var(--face);
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -4px -4px var(--shadow),
    inset 4px 4px var(--face),
    0 12px 0 rgba(0, 0, 0, 0.4);
}

.pack-pick-panel h3 {
  margin: 0;
  font-size: calc(14px * var(--ui-scale));
  text-align: center;
}

.pack-pick-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(calc(136px * var(--ui-scale)), 1fr));
  gap: calc(10px * var(--ui-scale));
  max-width: min(94vw, calc(760px * var(--ui-scale)));
}

.pack-pick-options:has(> :nth-child(3):last-child) {
  grid-template-columns: repeat(3, minmax(calc(146px * var(--ui-scale)), 1fr));
}

.item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: calc(8px * var(--ui-scale));
  min-height: calc(182px * var(--ui-scale));
  padding: calc(14px * var(--ui-scale)) calc(10px * var(--ui-scale));
  border: 0;
  background: var(--face);
  font-family: var(--font);
  cursor: pointer;
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -4px -4px var(--shadow),
    inset 4px 4px var(--face);
  transition: transform 0.2s var(--ease-spring), background 0.15s ease, box-shadow 0.2s ease;
}

@keyframes shop-card-deal {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.9) rotateX(18deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
  }
}

.item-card--rare:not(:disabled) {
  background: #c5cedc;
}

.item-card--epic:not(:disabled) {
  background: #d3c6de;
}

.item-card--legendary:not(:disabled) {
  background: #dcd2b8;
}

.item-card > * {
  pointer-events: none;
}

.item-card canvas {
  width: calc(36px * var(--ui-scale));
  height: calc(36px * var(--ui-scale));
  transition: transform 0.22s var(--ease-spring);
}

.item-card:hover:not(:disabled) {
  background: #d6d6d6;
  transform: translateY(-5px);
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -4px -4px var(--shadow),
    inset 4px 4px var(--face),
    0 6px 0 rgba(0, 0, 0, 0.35);
}

.item-card:hover:not(:disabled) canvas {
  transform: scale(1.14) rotate(-4deg);
}

.item-card:active:not(:disabled) {
  transform: translateY(-1px) scale(0.98);
}

.item-card:disabled {
  color: #777777;
  cursor: default;
  opacity: 0.78;
}

.item-card b {
  font-size: calc(15px * var(--ui-scale));
}

.item-card small {
  font-size: calc(12px * var(--ui-scale));
  color: #242424;
  text-align: center;
  line-height: 1.32;
}

.item-card__price {
  padding: 2px 10px;
  background: #142614;
  color: #90ff90;
  border: 1px solid #2e6b2e;
  font-family: var(--font-num);
  font-size: calc(12.5px * var(--ui-scale));
}

.item-card:disabled .item-card__price {
  background: #9a9a9a;
  color: #3e3e3e;
  border-color: #666666;
}

.item-rarity {
  font-size: calc(11px * var(--ui-scale));
  font-weight: 700;
  padding: 2px 8px;
}

.item-rarity--common {
  background: #d8d8d8;
  color: #202020;
}

.item-rarity--rare {
  background: #cce4ff;
  color: #0044aa;
}

.item-rarity--epic {
  background: #f0d8ff;
  color: #6a1b9a;
}

.item-rarity--legendary {
  background: #fff0b8;
  color: #995500;
}

.item-card__tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.item-edition {
  font-size: calc(10.5px * var(--ui-scale));
  font-weight: 700;
  padding: 2px 6px;
}

.item-edition--foil {
  background: #1558a8;
  color: #f0f8ff;
}

.item-edition--holo {
  background: #8818a4;
  color: #dcffff;
}

.item-edition--polychrome {
  background: linear-gradient(90deg, #c62828, #ad1457, #4527a0);
  color: #fffbe6;
}

.item-edition--negative {
  background: #081824;
  color: #7df4ff;
  border: 1px solid #48d8f0;
}

/* 商店 / 开包单卡附魔流光视觉 */
.item-card.is-ed-foil:not(:disabled) {
  background: linear-gradient(135deg, #cde5ff 0%, #f6fbff 46%, #9ac8ff 100%);
}

.item-card.is-ed-holo:not(:disabled) {
  background: linear-gradient(135deg, #ccfaff 0%, #f5d6ff 50%, #bff4ff 100%);
}

.item-card.is-ed-polychrome:not(:disabled) {
  background: linear-gradient(128deg, #ffdcdc 0%, #fff2be 28%, #d4ffe4 56%, #d8ecff 80%, #f2d4ff 100%);
}

.item-card.is-ed-negative:not(:disabled) {
  background: linear-gradient(145deg, #101624 0%, #1d2942 55%, #0b0f1a 100%);
  color: #dffaff;
  box-shadow:
    inset -2px -2px #4fd8ff,
    inset 2px 2px #263654,
    inset -4px -4px #090d16,
    inset 4px 4px #56e2ff;
}

.item-card.is-ed-negative:not(:disabled) small {
  color: #b5e8f7;
}

.item-card.is-ed-negative:not(:disabled) b {
  color: #ffffff;
}

.shop-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(10px * var(--ui-scale));
  background: var(--field);
  border: 2px dashed #808080;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.18s var(--ease-spring);
}

.shop-drop-zone.is-drag-over {
  background: #fff4c8;
  border-color: #cc6600;
  transform: scale(1.015);
}

.shop-drop-zone b {
  font-size: calc(14px * var(--ui-scale));
  color: #603000;
}

.shop-drop-zone span {
  font-size: calc(12px * var(--ui-scale));
  color: #505050;
}

.shop-footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(12px * var(--ui-scale));
}

/* ---------- 拖拽物理倾斜卡片 & 零延迟战术悬浮卡 & 跨 DOM 飞卡特效 ---------- */

.drag-ghost {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  transform: translate(-50%, -122%) rotate(var(--drag-tilt, 0deg)) scale(1.04);
  padding: calc(6px * var(--ui-scale)) calc(11px * var(--ui-scale));
  background: #ffffd8;
  color: #000000;
  border: 2px solid #000000;
  font-size: calc(13px * var(--ui-scale));
  font-weight: 700;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    6px 8px 0 rgba(0, 0, 0, 0.42);
  white-space: nowrap;
  transition: transform 0.06s linear;
}

.ui-tooltip {
  position: fixed;
  z-index: 4600;
  pointer-events: none;
  max-width: calc(310px * var(--ui-scale));
  display: flex;
  align-items: center;
  gap: calc(10px * var(--ui-scale));
  padding: calc(7px * var(--ui-scale)) calc(9px * var(--ui-scale));
  background: #ffffe1;
  color: #000000;
  border: 1px solid #000000;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    4px 4px 0 rgba(0, 0, 0, 0.45);
  animation: tooltip-pop 0.11s var(--ease-out-expo);
}

@keyframes tooltip-pop {
  from { opacity: 0; transform: translateY(3px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ui-tooltip__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ui-tooltip__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ui-tooltip__head b {
  font-size: calc(13px * var(--ui-scale));
  color: #000000;
}

.ui-tooltip__tag {
  padding: 1px 5px;
  font-family: var(--font-num);
  font-size: calc(10px * var(--ui-scale));
  font-weight: 700;
  background: #e4e4d0;
  border: 1px solid #808070;
  color: #202020;
  white-space: nowrap;
}

.ui-tooltip__tag.is-good {
  background: #dcf5dc;
  border-color: #2e8b2e;
  color: #006400;
}

.ui-tooltip__tag.is-bad {
  background: #ffe0e0;
  border-color: #b83030;
  color: #a00000;
}

.ui-tooltip__tag.is-boss {
  background: #f0dcfb;
  border-color: #7b1fa2;
  color: #601080;
}

.ui-tooltip__desc {
  font-size: calc(11.5px * var(--ui-scale));
  line-height: 1.35;
  color: #222222;
}

.ui-tooltip__foot {
  margin-top: 2px;
  padding-top: 3px;
  border-top: 1px dotted #999988;
  font-size: calc(10.5px * var(--ui-scale));
  font-weight: 700;
  color: #004499;
}

.ui-tooltip__matrix {
  width: calc(56px * var(--ui-scale));
  height: calc(56px * var(--ui-scale));
  flex: 0 0 auto;
  background: #bdbdbd;
  border: 1px solid #404040;
  box-shadow: inset 1px 1px 0 #808080;
}

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 950;
  pointer-events: none;
  overflow: hidden;
}

.flying-card {
  position: fixed;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #eef8ee;
  border: 2px solid #000000;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
  font-size: calc(12px * var(--ui-scale));
  font-weight: 700;
  color: #104810;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  transition:
    left 0.36s var(--ease-out-expo),
    top 0.36s cubic-bezier(0.2, 1.2, 0.35, 1),
    transform 0.36s var(--ease-out-expo),
    opacity 0.36s ease;
}

/* ---------- 95 按钮 ---------- */

.btn {
  min-width: calc(84px * var(--ui-scale));
  height: calc(38px * var(--ui-scale));
  padding: 0 calc(12px * var(--ui-scale));
  border: 0;
  background: var(--face);
  font-family: var(--font);
  font-size: calc(14px * var(--ui-scale));
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -4px -4px var(--shadow),
    inset 4px 4px var(--face);
}

.btn:hover:not(:disabled) {
  background: #cbcbcb;
}

.btn:active:not(:disabled),
.btn.is-pressed {
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--dark),
    inset -4px -4px var(--face),
    inset 4px 4px var(--shadow);
  padding-top: 2px;
  padding-left: calc(14px * var(--ui-scale));
}

.btn:focus-visible {
  outline: 1px dotted var(--dark);
  outline-offset: -5px;
}

.btn:disabled {
  color: var(--text-disabled);
  text-shadow: 1px 1px 0 var(--light);
  cursor: default;
}

.btn--wide {
  width: 100%;
}

.btn--primary-95 {
  height: calc(42px * var(--ui-scale));
  font-size: calc(15px * var(--ui-scale));
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -4px -4px var(--shadow),
    inset 4px 4px var(--face),
    0 0 0 1px var(--dark);
}

.btn--default {
  font-weight: 700;
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -4px -4px var(--shadow),
    inset 4px 4px var(--face),
    0 0 0 1px var(--dark);
}

.btn.is-ready-settle:not(:disabled) {
  background: #d8f8dc;
  color: #005814;
  box-shadow:
    inset -2px -2px #00420e,
    inset 2px 2px #ffffff,
    inset -4px -4px #52b868,
    inset 4px 4px #b8ecc0,
    0 0 0 1px #005814;
  animation: settle-ready-breathe 1.3s ease-in-out infinite alternate;
}

.btn.is-ready-settle:hover:not(:disabled) {
  background: #c2f4ca;
}

@keyframes settle-ready-breathe {
  from { filter: brightness(0.98); }
  to   { filter: brightness(1.07); }
}

.mc-title-screen {
  transition: opacity 0.28s var(--ease-out-expo), transform 0.28s var(--ease-out-expo);
}

.mc-title-screen.is-leaving {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

/* ==========================================================================
   Minecraft 风格开始界面 + 全屏子菜单（能力升级单列 / 设置）
   ========================================================================== */

.mc-title-screen {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.mc-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(16, 16, 16, 0.16) 0%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
  transition: background 0.2s ease;
}

.mc-title-screen.is-subscreen .mc-backdrop {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.82) 100%);
}

.mc-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(28px * var(--ui-scale));
  width: min(92vw, calc(460px * var(--ui-scale)));
}

.mc-logo-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

#mcLogoCanvas {
  width: min(94vw, calc(620px * var(--ui-scale)));
  height: auto;
  aspect-ratio: 820 / 204;
  display: block;
}

.mc-splash {
  position: absolute;
  right: calc(-18px * var(--ui-scale));
  bottom: calc(10px * var(--ui-scale));
  color: #ffff55;
  font-family: var(--font);
  font-size: calc(18px * var(--ui-scale));
  font-weight: 700;
  text-shadow: 2px 2px 0 #3f3f00;
  transform: rotate(-18deg);
  animation: mc-pulse 0.58s ease-in-out infinite alternate;
  white-space: nowrap;
  pointer-events: none;
}

@keyframes mc-pulse {
  from { transform: rotate(-18deg) scale(0.95); }
  to   { transform: rotate(-18deg) scale(1.07); }
}

.mc-menu {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: calc(11px * var(--ui-scale));
}

.mc-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(12px * var(--ui-scale));
  width: 100%;
}

.mc-btn {
  height: calc(46px * var(--ui-scale));
  padding: 0 calc(14px * var(--ui-scale));
  border: 2px solid #000000;
  background-color: #8b8b8b;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0.14) 100%),
    repeating-conic-gradient(#8b8b8b 0 25%, #828282 0 50%);
  background-size: 100% 100%, 8px 8px;
  color: #ffffff;
  font-family: var(--font);
  font-size: calc(16px * var(--ui-scale));
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 #202020;
  cursor: pointer;
  box-shadow:
    inset 2px 2px 0 #c6c6c6,
    inset -2px -3px 0 #555555,
    0 4px 0 rgba(0, 0, 0, 0.38);
}

.mc-btn:hover:not(:disabled) {
  background-color: #7c89a6;
  background-image:
    linear-gradient(180deg, rgba(160, 190, 255, 0.25) 0%, rgba(40, 60, 120, 0.25) 100%),
    repeating-conic-gradient(#7d8bb0 0 25%, #7380a3 0 50%);
  border-color: #ffffff;
  color: #ffffa0;
  box-shadow:
    inset 2px 2px 0 #bcc8e6,
    inset -2px -3px 0 #465070,
    0 4px 0 rgba(0, 0, 0, 0.45);
}

.mc-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow:
    inset 2px 2px 0 #465070,
    inset -2px -2px 0 #bcc8e6,
    0 2px 0 rgba(0, 0, 0, 0.35);
}

.mc-btn:disabled {
  background-color: #464646;
  background-image: none;
  color: #a0a0a0;
  text-shadow: 1px 1px 0 #181818;
  box-shadow:
    inset 2px 2px 0 #5c5c5c,
    inset -2px -3px 0 #2b2b2b;
  cursor: default;
}

.mc-subscreen {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(36px * var(--ui-scale)) 0 calc(46px * var(--ui-scale));
}

.mc-sub-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(8px * var(--ui-scale));
}

.mc-sub-title {
  color: #ffffff;
  font-size: calc(24px * var(--ui-scale));
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #282828;
}

.mc-sub-subtitle {
  color: #ffff55;
  font-size: calc(16px * var(--ui-scale));
  font-weight: 700;
  text-shadow: 2px 2px 0 #3f3f00;
}

.mc-sub-body {
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: calc(16px * var(--ui-scale)) 0;
  padding: calc(20px * var(--ui-scale)) 0;
  background: rgba(0, 0, 0, 0.45);
  border-top: 2px solid rgba(0, 0, 0, 0.85);
  border-bottom: 2px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 6px 12px rgba(0, 0, 0, 0.55),
    inset 0 -6px 12px rgba(0, 0, 0, 0.55);
}

/* 能力升级：单列居中排列 */
.mc-options-single {
  width: min(92vw, calc(540px * var(--ui-scale)));
  display: flex;
  flex-direction: column;
  gap: calc(11px * var(--ui-scale));
}

/* 设置页：双列排列 */
.mc-options-grid {
  width: min(92vw, calc(700px * var(--ui-scale)));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(14px * var(--ui-scale)) calc(18px * var(--ui-scale));
}

.mc-btn--span2 {
  grid-column: 1 / -1;
}

.mc-btn.is-diff-easy {
  color: #a8ffbe;
}

.mc-btn.is-diff-hard {
  color: #ffb0b0;
}

.mc-seed-box {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: calc(12px * var(--ui-scale));
  padding: calc(10px * var(--ui-scale)) calc(14px * var(--ui-scale));
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid #555555;
  color: #ffffff;
  font-weight: 700;
}

.mc-seed-input {
  flex: 1 1 auto;
  height: calc(36px * var(--ui-scale));
  padding: 0 10px;
  background: #000000;
  border: 2px solid #a0a0a0;
  color: #ffff55;
  font-family: var(--font-num);
  font-size: calc(15px * var(--ui-scale));
  font-weight: 700;
}

.mc-seed-input:disabled {
  background: #181818;
  border-color: #666666;
  color: #cccccc;
}

.mc-sub-footer {
  display: flex;
  justify-content: center;
  gap: calc(14px * var(--ui-scale));
  width: 100%;
}

.mc-btn--done {
  width: min(44vw, calc(320px * var(--ui-scale)));
}

/* ==========================================================================
   游戏内过关 / 失败结算弹窗
   ========================================================================== */

.title-bar {
  height: calc(28px * var(--ui-scale));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 0 10px;
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  color: var(--title-text);
}

.title-bar.is-win {
  background: linear-gradient(90deg, #005818 0%, #009830 100%);
}

.title-bar.is-boss {
  background: linear-gradient(90deg, #4a0e68 0%, #8e24aa 100%);
}

.title-bar.is-lose {
  background: linear-gradient(90deg, #780000 0%, #c81010 100%);
}

.title-bar__text {
  font-weight: 700;
  font-size: calc(14px * var(--ui-scale));
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 #000000;
}

.title-bar__controls {
  display: flex;
  gap: 2px;
}

.title-btn {
  width: calc(20px * var(--ui-scale));
  height: calc(18px * var(--ui-scale));
  display: grid;
  place-items: center;
  background: var(--face);
  border: 0;
  padding: 0;
  cursor: pointer;
  box-shadow:
    inset -1px -1px var(--dark),
    inset 1px 1px var(--light),
    inset -2px -2px var(--shadow),
    inset 2px 2px var(--face);
}

.dialog-layer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 200;
}

.dialog-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  animation: fade-backdrop 0.18s ease-out;
}

@keyframes fade-backdrop {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.dialog {
  position: relative;
  width: min(calc(520px * var(--ui-scale)), calc(100vw - 28px));
  padding: 4px;
  background: var(--face);
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -4px -4px var(--shadow),
    inset 4px 4px var(--face),
    8px 8px 0 rgba(0, 0, 0, 0.55);
  animation: dialog-pop 0.22s cubic-bezier(0.2, 1.25, 0.4, 1);
}

@keyframes dialog-pop {
  0% {
    transform: scale(0.82) translateY(16px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.dialog-body {
  display: flex;
  gap: calc(14px * var(--ui-scale));
  padding: calc(14px * var(--ui-scale)) calc(16px * var(--ui-scale)) calc(10px * var(--ui-scale));
}

.dialog-body.is-stage-layout .dialog-icon {
  display: none;
}

.dialog-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
}

.dialog-icon canvas {
  width: 36px;
  height: 36px;
}

.dialog-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: calc(10px * var(--ui-scale));
}

.dialog-actions {
  display: flex;
  justify-content: center;
  gap: calc(10px * var(--ui-scale));
  padding: 6px calc(16px * var(--ui-scale)) calc(14px * var(--ui-scale));
}

/* ---------- 结算面板 ---------- */

.settle-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(12px * var(--ui-scale));
  padding: calc(10px * var(--ui-scale)) calc(14px * var(--ui-scale));
  background: #141c14;
  color: #ffffff;
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--dark),
    inset -4px -4px var(--shadow),
    inset 4px 4px #050805;
}

.settle-banner--lose {
  background: #241010;
}

.settle-banner--boss {
  background: #221030;
}

.settle-banner-left {
  display: flex;
  align-items: center;
  gap: calc(12px * var(--ui-scale));
}

.settle-banner-left canvas {
  width: calc(40px * var(--ui-scale));
  height: calc(40px * var(--ui-scale));
  flex: 0 0 auto;
}

.settle-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settle-eyebrow {
  font-family: var(--font-num);
  font-size: calc(11px * var(--ui-scale));
  font-weight: 700;
  color: #a8c8a8;
  letter-spacing: 1px;
}

.settle-banner--lose .settle-eyebrow {
  color: #e09898;
}

.settle-headline {
  font-size: calc(20px * var(--ui-scale));
  font-weight: 700;
  color: #ffff55;
  text-shadow: 2px 2px 0 #000000;
}

.settle-banner--lose .settle-headline {
  color: #ff6868;
}

.settle-stamp {
  padding: calc(4px * var(--ui-scale)) calc(10px * var(--ui-scale));
  border: 2px solid #55ff55;
  background: rgba(0, 128, 0, 0.28);
  color: #88ff88;
  font-family: var(--font-num);
  font-size: calc(13px * var(--ui-scale));
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 #000000;
  transform: rotate(-4deg);
  animation: stamp-slam 0.28s cubic-bezier(0.18, 1.4, 0.4, 1) 0.08s backwards;
}

.settle-stamp--lose {
  border-color: #ff5555;
  background: rgba(160, 0, 0, 0.28);
  color: #ff9999;
}

@keyframes stamp-slam {
  0% {
    transform: scale(2.1) rotate(-14deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(-4deg);
    opacity: 1;
  }
}

.settle-score-box {
  display: flex;
  flex-direction: column;
  gap: calc(7px * var(--ui-scale));
  padding: calc(10px * var(--ui-scale)) calc(12px * var(--ui-scale));
  background: #080808;
  color: #ffffff;
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--shadow),
    inset -4px -4px var(--face),
    inset 4px 4px var(--dark);
}

.settle-score-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.settle-score-label {
  font-size: calc(13px * var(--ui-scale));
  font-weight: 700;
  color: #b0b0b0;
}

.settle-score-numbers {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: "Courier New", "Consolas", monospace;
}

.settle-score-big {
  font-size: calc(28px * var(--ui-scale));
  font-weight: 700;
  color: #55ff55;
  text-shadow: 0 0 8px rgba(60, 255, 60, 0.45);
}

.settle-score-big.is-lose {
  color: #ff4444;
  text-shadow: 0 0 8px rgba(255, 50, 50, 0.45);
}

.settle-score-target {
  font-size: calc(16px * var(--ui-scale));
  font-weight: 700;
  color: #909090;
}

.settle-bar {
  height: calc(16px * var(--ui-scale));
  padding: 2px;
  background: #1c1c1c;
  border: 1px solid #444444;
}

.settle-bar-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    90deg,
    #00cc44 0 calc(8px * var(--ui-scale)),
    #007722 calc(8px * var(--ui-scale)) calc(11px * var(--ui-scale))
  );
  transition: width 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.settle-bar-fill.is-lose {
  background: repeating-linear-gradient(
    90deg,
    #dd2222 0 calc(8px * var(--ui-scale)),
    #771111 calc(8px * var(--ui-scale)) calc(11px * var(--ui-scale))
  );
}

.settle-receipt {
  display: flex;
  flex-direction: column;
  gap: calc(6px * var(--ui-scale));
  padding: calc(10px * var(--ui-scale)) calc(12px * var(--ui-scale));
  background: var(--field);
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--shadow),
    inset -3px -3px var(--face),
    inset 3px 3px var(--dark);
}

.receipt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(5px * var(--ui-scale)) calc(8px * var(--ui-scale));
  background: #efefef;
  border-left: 4px solid var(--good);
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.2, 1.2, 0.4, 1);
}

.receipt-row.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.receipt-row--boss {
  background: #f5e8ff;
  border-left-color: var(--boss);
}

.receipt-row--lose {
  background: #fff0f0;
  border-left-color: var(--bad);
}

.receipt-row--total {
  margin-top: 2px;
  padding: calc(7px * var(--ui-scale)) calc(10px * var(--ui-scale));
  background: #122212;
  color: #ffffff;
  border-left: 4px solid #55ff55;
}

.receipt-name {
  font-size: calc(13px * var(--ui-scale));
  font-weight: 700;
  color: #202020;
}

.receipt-row--total .receipt-name {
  color: #d0f0d0;
}

.receipt-val {
  font-family: var(--font-num);
  font-size: calc(15px * var(--ui-scale));
  font-weight: 700;
  color: var(--good);
}

.receipt-row--boss .receipt-val {
  color: var(--boss);
}

.receipt-row--lose .receipt-val {
  color: var(--bad);
}

.receipt-row--total .receipt-val {
  font-size: calc(18px * var(--ui-scale));
  color: #ffff55;
}

.receipt-val.is-bumping {
  animation: coin-bump 0.24s ease-out;
}

@keyframes coin-bump {
  0% { transform: scale(1); }
  50% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

.settle-meta-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: calc(8px * var(--ui-scale));
}

.settle-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: calc(6px * var(--ui-scale)) calc(8px * var(--ui-scale));
  background: #dcdcdc;
  box-shadow:
    inset -1px -1px var(--light),
    inset 1px 1px var(--shadow);
}

.settle-chip span {
  font-size: calc(11px * var(--ui-scale));
  color: #484848;
  font-weight: 700;
}

.settle-chip b {
  font-family: var(--font-num);
  font-size: calc(14px * var(--ui-scale));
  color: #101010;
}

/* ==========================================================================
   首次游玩实操式新手引导（固定第 1 关 → 过关 → 进商店买首件道具）
   ========================================================================== */

.tutorial-layer {
  position: fixed;
  inset: 0;
  z-index: 260;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.tutorial-layer[hidden] {
  display: none !important;
}

.tutorial-layer.is-waiting-anim {
  opacity: 0;
}

.tutorial-layer.is-complete {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.56);
}

.tutorial-layer.is-complete .tutorial-spotlight {
  display: none;
}

.tutorial-spotlight {
  position: fixed;
  border: 3px solid #ffe066;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.58),
    0 0 18px rgba(255, 224, 102, 0.85),
    inset 0 0 10px rgba(255, 224, 102, 0.5);
  pointer-events: none;
  transition:
    left 0.2s var(--ease-out-expo),
    top 0.2s var(--ease-out-expo),
    width 0.2s var(--ease-out-expo),
    height 0.2s var(--ease-out-expo);
  animation: tutorial-spot-pulse 1.1s ease-in-out infinite alternate;
}

.tutorial-spotlight::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px dashed rgba(255, 236, 130, 0.9);
  pointer-events: none;
}

@keyframes tutorial-spot-pulse {
  from {
    border-color: #ffd43b;
    box-shadow:
      0 0 0 9999px rgba(0, 0, 0, 0.58),
      0 0 12px rgba(255, 212, 59, 0.65),
      inset 0 0 6px rgba(255, 212, 59, 0.35);
  }
  to {
    border-color: #fff3a0;
    box-shadow:
      0 0 0 9999px rgba(0, 0, 0, 0.58),
      0 0 24px rgba(255, 243, 160, 0.95),
      inset 0 0 12px rgba(255, 243, 160, 0.65);
  }
}

.tutorial-card {
  position: fixed;
  pointer-events: auto;
  width: min(calc(370px * var(--ui-scale)), calc(100vw - 24px));
  padding: 4px;
  background: var(--face);
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -4px -4px var(--shadow),
    inset 4px 4px var(--face),
    8px 8px 0 rgba(0, 0, 0, 0.55);
  transition: left 0.2s var(--ease-out-expo), top 0.2s var(--ease-out-expo);
}

.tutorial-card.is-nudge {
  animation: tutorial-card-nudge 0.28s steps(3);
}

@keyframes tutorial-card-nudge {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-6px); }
  50%  { transform: translateX(6px); }
  75%  { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

.tutorial-card__body {
  display: flex;
  flex-direction: column;
  gap: calc(6px * var(--ui-scale));
  padding: calc(12px * var(--ui-scale)) calc(14px * var(--ui-scale)) calc(8px * var(--ui-scale));
}

.tutorial-card__body b {
  font-size: calc(15px * var(--ui-scale));
  color: #101010;
}

.tutorial-card__body p {
  margin: 0;
  font-size: calc(12.5px * var(--ui-scale));
  line-height: 1.48;
  color: #222222;
}

.tutorial-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: calc(8px * var(--ui-scale));
  padding: calc(6px * var(--ui-scale)) calc(14px * var(--ui-scale)) calc(12px * var(--ui-scale));
}

/* ==========================================================================
   v5.0 新增：消耗品槽（2 格）、我的雷组栏、雷系等级条、拖拽调序、五大卡包、优惠券专柜与雷组透视/改造弹窗
   ========================================================================== */

.slot.is-filled {
  cursor: grab;
}

.slot.is-filled:active {
  cursor: grabbing;
}

.slot.is-drag-target {
  outline: 2px dashed #1558a8;
  outline-offset: -3px;
  background: #dceeff !important;
  transform: scale(1.03);
}

.section--cons {
  flex: 0 0 auto;
}

.cons-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(5px * var(--ui-scale));
  max-height: calc(54px * var(--ui-scale));
  overflow-y: auto;
  overflow-x: hidden;
}

.cons-slot {
  position: relative;
  min-height: calc(40px * var(--ui-scale));
  padding: calc(3px * var(--ui-scale)) calc(4px * var(--ui-scale));
  border: 0;
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-align: center;
  font-size: calc(11px * var(--ui-scale));
  font-weight: 700;
  color: #555555;
  background: var(--field);
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--shadow),
    inset -3px -3px var(--face),
    inset 3px 3px var(--dark);
}

.cons-slot.is-filled {
  cursor: pointer;
  color: #20123a;
  background: #f3ecff;
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -3px -3px var(--shadow),
    inset 3px 3px var(--face);
  transition: transform 0.16s var(--ease-spring), background 0.15s ease;
}

.cons-slot.is-filled:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #e7d8ff;
}

.cons-slot--star.is-filled {
  background: #e3f6ff;
  color: #08334a;
}

.cons-slot--spectral.is-filled {
  background: #e0ecff;
  color: #0d2558;
}

.cons-slot.is-ed-negative {
  background: #121826 !important;
  color: #8af4ff !important;
}

.cons-slot.is-sell-armed {
  background: #ffdede !important;
  color: #9e0b0b !important;
}

.section--deck {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: calc(5px * var(--ui-scale));
}

.deck-open-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(5px * var(--ui-scale)) calc(8px * var(--ui-scale));
  background: #1a2d1a;
  color: #b8ffb8;
  box-shadow:
    inset -2px -2px #091209,
    inset 2px 2px #4c7c4c,
    inset -3px -3px #122012,
    inset 3px 3px #315431;
}

.deck-open-btn:hover {
  background: #243d24;
}

.deck-open-btn b {
  font-family: var(--font-num);
  font-size: calc(11px * var(--ui-scale));
  color: #ffd866;
}

.family-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(4px * var(--ui-scale));
}

.family-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(2px * var(--ui-scale)) calc(5px * var(--ui-scale));
  background: var(--field);
  font-size: calc(10.5px * var(--ui-scale));
  font-weight: 700;
  color: #202020;
  box-shadow:
    inset -1px -1px var(--light),
    inset 1px 1px var(--shadow);
}

.family-chip.is-upgraded {
  background: #e6f7ff;
  color: #004488;
}

.family-chip b {
  font-family: var(--font-num);
  color: #0058a8;
}

/* 商店：五大类卡包配色 + 本轮优惠券专柜 + 已售空态 */
.item-card.is-sold-out {
  background: #b6b6b6;
  color: #626262;
  cursor: default;
  justify-content: center;
  box-shadow:
    inset 2px 2px var(--shadow),
    inset -2px -2px var(--light);
}

.item-rarity--tarot {
  background: #ebd8ff;
  color: #5b1890;
}

.item-rarity--star {
  background: #d2f3ff;
  color: #005580;
}

.item-rarity--spectral {
  background: #d6e4ff;
  color: #103488;
}

.item-rarity--mine {
  background: #d8f5d8;
  color: #125812;
}

.item-card--soul:not(:disabled) {
  background: linear-gradient(135deg, #241046 0%, #4b1d8c 48%, #103c68 100%) !important;
  color: #ffffff !important;
  box-shadow:
    inset -2px -2px #7df9ff,
    inset 2px 2px #f0abfc,
    0 0 16px rgba(168, 85, 247, 0.65);
}

.item-card--soul:not(:disabled) small {
  color: #e0f2fe !important;
}

.pack-card--mine {
  background: linear-gradient(160deg, #1b5e20 0%, #0d3612 100%);
  color: #e6ffe8;
}

.pack-card--tarot {
  background: linear-gradient(160deg, #5b2182 0%, #311048 100%);
  color: #f8e8ff;
}

.pack-card--star {
  background: linear-gradient(160deg, #0b5a7a 0%, #063246 100%);
  color: #dff7ff;
}

.pack-card--spectral {
  background: linear-gradient(155deg, #1e3a8a 0%, #3b0764 60%, #0f172a 100%);
  color: #bae6fd;
}

.shop-voucher-box {
  display: flex;
  align-items: stretch;
}

.voucher-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(4px * var(--ui-scale));
  padding: calc(10px * var(--ui-scale));
  border: 0;
  font-family: var(--font);
  cursor: pointer;
  background: linear-gradient(160deg, #6e470b 0%, #3e2604 100%);
  color: #fff5d6;
  box-shadow:
    inset -2px -2px #241500,
    inset 2px 2px #ffd166,
    inset -4px -4px #382102,
    inset 4px 4px #8c5c12;
  transition: transform 0.18s var(--ease-spring);
}

.voucher-card:hover:not(:disabled) {
  transform: translateY(-3px);
}

.voucher-card:disabled {
  cursor: default;
  filter: grayscale(0.55) brightness(0.78);
}

.voucher-card__tag {
  font-size: calc(10px * var(--ui-scale));
  padding: 1px 6px;
  background: rgba(255, 215, 100, 0.2);
  color: #ffd86b;
  font-weight: 700;
}

.voucher-card b {
  font-size: calc(13.5px * var(--ui-scale));
}

.voucher-card small {
  font-size: calc(11px * var(--ui-scale));
  color: #ffeab3;
  text-align: center;
  line-height: 1.3;
}

.pack-pick-options {
  grid-template-columns: repeat(auto-fit, minmax(calc(138px * var(--ui-scale)), 1fr));
  width: min(92vw, calc(780px * var(--ui-scale)));
}

/* 我的雷组（Mine Deck）查看与选雷改造弹窗 */
.deck-modal-panel {
  width: min(94vw, calc(820px * var(--ui-scale)));
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  gap: calc(10px * var(--ui-scale));
  padding: calc(14px * var(--ui-scale));
  background: var(--face);
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -4px -4px var(--shadow),
    inset 4px 4px var(--face),
    0 12px 0 rgba(0, 0, 0, 0.45);
}

.deck-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.deck-modal-head h3 {
  margin: 0;
  font-size: calc(15px * var(--ui-scale));
}

.deck-modal-sub {
  font-size: calc(12px * var(--ui-scale));
  color: #262626;
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(116px * var(--ui-scale)), 1fr));
  gap: calc(7px * var(--ui-scale));
  overflow-y: auto;
  max-height: 58vh;
  padding: calc(6px * var(--ui-scale));
  background: #b8b8b8;
  box-shadow:
    inset 2px 2px var(--dark),
    inset -2px -2px var(--light);
}

.deck-mine-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: calc(7px * var(--ui-scale)) calc(5px * var(--ui-scale));
  border: 0;
  font-family: var(--font);
  background: #f5fbf5;
  color: #143c14;
  text-align: center;
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light);
}

.deck-mine-card.is-bad {
  background: #fff0f0;
  color: #880000;
}

.deck-mine-card.is-selectable {
  cursor: pointer;
}

.deck-mine-card.is-selectable:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #fffbe0;
}

.deck-mine-card.is-selected {
  background: #ffe898 !important;
  outline: 2px solid #cc5500;
  transform: translateY(-3px);
}

.deck-mine-card:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.deck-mine-card b {
  font-size: calc(11.5px * var(--ui-scale));
}

.deck-mine-card small {
  font-size: calc(10px * var(--ui-scale));
  color: #444444;
  line-height: 1.22;
}

.deck-mine-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
}

.deck-badge {
  font-size: calc(9.5px * var(--ui-scale));
  font-weight: 700;
  padding: 0 4px;
  color: #ffffff;
  background: #335577;
}

.deck-sel-order {
  position: absolute;
  top: 3px;
  right: 3px;
  padding: 0 5px;
  background: #cc4400;
  color: #ffffff;
  font-size: calc(10px * var(--ui-scale));
  font-weight: 800;
}

.deck-modal-actions {
  display: flex;
  justify-content: center;
  gap: calc(10px * var(--ui-scale));
}

/* ==========================================================================
   v5.0 第二批 & 视觉对齐润色：
   1. 左侧栏严格等高栅格与底部 2×2 对齐控制区
   2. 小丑牌式点击弹出操作窗（#slotActionPopover：查看说明 + 使用 / 出售）
   3. 商店 3 列等宽对齐与贴纸徽章（焊死 / 限时 / 征用 / 免费空投）
   4. 三关预览选择界面（#blindStage：小关 / 大关 / Boss 关 + 跳过拿章）
   5. 出战整备页（#mcDeployView：8 名排雷兵 + 8 阶军衔）
   ========================================================================== */

.soldier-rank-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 2px;
  font-size: calc(11px * var(--ui-scale));
  font-weight: 700;
  color: #242424;
}

.soldier-rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.soldier-rank-pill canvas {
  width: calc(13px * var(--ui-scale));
  height: calc(13px * var(--ui-scale));
}

.rank-mini-tag {
  padding: 1px 6px;
  font-size: calc(10px * var(--ui-scale));
  font-weight: 800;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

.slot {
  height: calc(48px * var(--ui-scale));
  min-height: calc(48px * var(--ui-scale));
}

.slot.is-filled {
  cursor: pointer;
}

.slot.is-popover-open,
.cons-slot.is-popover-open {
  outline: 2px solid #0044aa;
  outline-offset: -2px;
  transform: translateY(-2px);
}

.slot.is-boss-banned,
.slot.is-perished {
  background: repeating-linear-gradient(-45deg, #d8c8c8 0 6px, #e8dede 6px 12px) !important;
  color: #7a2020 !important;
  opacity: 0.86;
}

.slot__sub-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  max-width: 100%;
}

.slot__sticker,
.item-sticker {
  font-size: calc(8.5px * var(--ui-scale));
  font-weight: 700;
  line-height: 1.15;
  padding: 0 3px;
}

.item-sticker {
  font-size: calc(10px * var(--ui-scale));
  padding: 1px 5px;
}

.slot__sticker--eternal,
.item-sticker--eternal {
  background: #2b2f3a;
  color: #f1f5f9;
}

.slot__sticker--perish,
.item-sticker--perish {
  background: #9a3412;
  color: #ffedd5;
}

.slot__sticker--rental,
.item-sticker--rental {
  background: #854d0e;
  color: #fef9c3;
}

.slot__sticker--banned {
  background: #991b1b;
  color: #ffffff;
}

.cons-slot {
  height: calc(44px * var(--ui-scale));
  min-height: calc(44px * var(--ui-scale));
}

.section--deck {
  flex: 0 0 auto;
}

.sidebar-bottom-pad {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: calc(5px * var(--ui-scale));
}

.stage-actions,
.sidebar-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(5px * var(--ui-scale));
}

.stage-actions .btn,
.sidebar-actions .btn {
  min-height: calc(31px * var(--ui-scale));
  padding: calc(4px * var(--ui-scale)) calc(6px * var(--ui-scale));
  font-size: calc(12px * var(--ui-scale));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 商店 3 列严格对齐 */
.shop-voucher-box {
  display: contents;
}

.voucher-card {
  min-height: calc(136px * var(--ui-scale));
  justify-content: space-between;
  padding: calc(10px * var(--ui-scale));
}

.pack-card__tag {
  font-size: calc(10px * var(--ui-scale));
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 700;
}

.shop-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: calc(10px * var(--ui-scale));
  padding-top: calc(2px * var(--ui-scale));
}

.shop-footer-actions .btn {
  min-width: calc(128px * var(--ui-scale));
  min-height: calc(34px * var(--ui-scale));
  font-weight: 700;
}

.pack-pick-panel {
  max-width: min(96%, calc(750px * var(--ui-scale)));
  max-height: 94%;
  overflow-y: auto;
}

.pack-pick-options {
  grid-template-columns: repeat(auto-fit, minmax(calc(132px * var(--ui-scale)), 1fr));
  width: min(88vw, calc(710px * var(--ui-scale)));
}

.deck-modal-panel {
  width: min(96%, calc(760px * var(--ui-scale)));
  max-height: 92%;
}

/* ---------- 小丑牌式点击操作浮窗（#slotActionPopover） ---------- */
.slot-popover {
  position: fixed;
  z-index: 4500;
  width: calc(246px * var(--ui-scale));
  display: flex;
  flex-direction: column;
  gap: calc(8px * var(--ui-scale));
  padding: calc(10px * var(--ui-scale));
  background: #fffdf4;
  color: #141414;
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -4px -4px var(--shadow),
    inset 4px 4px #ede8d5,
    6px 6px 0 rgba(0, 0, 0, 0.42);
  animation: slot-pop-in 0.14s var(--ease-spring);
}

@keyframes slot-pop-in {
  from { opacity: 0; transform: translateX(-6px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.slot-popover__head {
  display: flex;
  align-items: center;
  gap: calc(8px * var(--ui-scale));
}

.slot-popover__head canvas {
  width: calc(28px * var(--ui-scale));
  height: calc(28px * var(--ui-scale));
  flex: 0 0 auto;
}

.slot-popover__title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.slot-popover__title-wrap b {
  font-size: calc(14px * var(--ui-scale));
  color: #101010;
}

.slot-popover__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.slot-popover__desc {
  font-size: calc(12px * var(--ui-scale));
  line-height: 1.42;
  color: #242424;
  padding: calc(6px * var(--ui-scale)) calc(8px * var(--ui-scale));
  background: #f4f0e0;
  box-shadow:
    inset 1px 1px var(--shadow),
    inset -1px -1px var(--light);
}

.slot-popover__actions {
  display: flex;
  gap: calc(6px * var(--ui-scale));
}

.slot-popover__actions .btn {
  flex: 1 1 0;
  min-height: calc(30px * var(--ui-scale));
  font-weight: 700;
  font-size: calc(12px * var(--ui-scale));
}

.btn--use-cons {
  background: #1d4ed8;
  color: #ffffff;
}

.btn--use-cons:hover:not(:disabled) {
  background: #2563eb;
}

.btn--sell-red {
  background: #b91c1c;
  color: #ffffff;
}

.btn--sell-red:hover:not(:disabled) {
  background: #dc2626;
}

.btn--use-cons:disabled,
.btn--sell-red:disabled {
  background: #b8b8b8;
  color: #666666;
}

/* ---------- 三关选择界面（#blindStage：小关 / 大关 / Boss 关） ---------- */
.blind-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(14px * var(--ui-scale));
}

.blind-window {
  width: min(100%, calc(780px * var(--ui-scale)));
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: var(--face);
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -4px -4px var(--shadow),
    inset 4px 4px var(--face),
    8px 8px 0 rgba(0, 0, 0, 0.34);
  animation: shop-stage-enter 0.25s var(--ease-spring);
}

.blind-stage-body {
  display: flex;
  flex-direction: column;
  gap: calc(12px * var(--ui-scale));
  padding: calc(14px * var(--ui-scale));
}

.blind-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(8px * var(--ui-scale)) calc(12px * var(--ui-scale));
  background: #0d1f38;
  color: #cfe8ff;
  font-size: calc(13px * var(--ui-scale));
  font-weight: 700;
  box-shadow:
    inset -2px -2px var(--light),
    inset 2px 2px var(--dark);
}

.blind-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(10px * var(--ui-scale));
  align-items: stretch;
}

.blind-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: calc(10px * var(--ui-scale));
  padding: calc(12px * var(--ui-scale));
  background: #dfdfdf;
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -4px -4px var(--shadow),
    inset 4px 4px var(--face);
  transition: transform 0.2s var(--ease-spring), opacity 0.2s ease;
}

.blind-card.is-active {
  background: #f6f9ff;
  transform: translateY(-4px);
  box-shadow:
    inset -2px -2px #0b3578,
    inset 2px 2px #ffffff,
    inset -4px -4px #2a65c0,
    inset 4px 4px #dcebff,
    0 6px 0 rgba(0, 0, 0, 0.28);
}

.blind-card.is-boss.is-active {
  background: #fbf3ff;
  box-shadow:
    inset -2px -2px #4a0e68,
    inset 2px 2px #ffffff,
    inset -4px -4px #8e24aa,
    inset 4px 4px #f3dcff,
    0 6px 0 rgba(0, 0, 0, 0.3);
}

.blind-card.is-done {
  opacity: 0.62;
  background: #c8d4c8;
}

.blind-card.is-locked {
  opacity: 0.78;
}

.blind-card__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(4px * var(--ui-scale));
  text-align: center;
}

.blind-card__status {
  font-size: calc(10.5px * var(--ui-scale));
  font-weight: 700;
  padding: 1px 8px;
  background: #334155;
  color: #ffffff;
}

.blind-card.is-active .blind-card__status {
  background: #1d4ed8;
}

.blind-card.is-boss .blind-card__status {
  background: #6b21a8;
}

.blind-card.is-done .blind-card__status {
  background: #15803d;
}

.blind-card__title {
  font-size: calc(17px * var(--ui-scale));
  font-weight: 800;
  color: #111827;
}

.blind-card.is-boss .blind-card__title {
  color: #581c87;
}

.blind-goal-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: calc(8px * var(--ui-scale));
  background: #141c26;
  color: #ffffff;
  box-shadow:
    inset 2px 2px #000000,
    inset -2px -2px #475569;
}

.blind-goal-box small {
  font-size: calc(10.5px * var(--ui-scale));
  color: #94a3b8;
}

.blind-goal-box b {
  font-family: var(--font-num);
  font-size: calc(18px * var(--ui-scale));
  color: #fde047;
}

.blind-goal-box span {
  font-size: calc(11px * var(--ui-scale));
  color: #86efac;
  font-weight: 700;
}

.blind-feature-box {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: calc(4px * var(--ui-scale));
  padding: calc(8px * var(--ui-scale));
  background: #fffbeb;
  border: 1px solid #d97706;
  text-align: center;
}

.blind-feature-box--boss {
  background: #faf5ff;
  border-color: #9333ea;
}

.blind-feature-box--safe {
  background: #ecfdf5;
  border-color: #16a34a;
}

.blind-feature-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: calc(12px * var(--ui-scale));
  font-weight: 800;
  color: #92400e;
}

.blind-feature-box--boss .blind-feature-head {
  color: #6b21a8;
}

.blind-feature-box p {
  margin: 0;
  font-size: calc(11.5px * var(--ui-scale));
  line-height: 1.38;
  color: #1f2937;
}

.blind-card__actions {
  display: flex;
  flex-direction: column;
  gap: calc(6px * var(--ui-scale));
}

.blind-card__actions .btn {
  width: 100%;
  min-height: calc(33px * var(--ui-scale));
  font-weight: 800;
  font-size: calc(12.5px * var(--ui-scale));
}

.btn--skip-tag {
  background: #fef3c7;
  color: #92400e;
}

.btn--skip-tag:hover:not(:disabled) {
  background: #fde68a;
}

/* ---------- 出战整备页（#mcDeployView：8 名排雷兵 + 8 阶军衔） ---------- */
.mc-deploy-screen {
  width: min(94vw, calc(840px * var(--ui-scale)));
}

.mc-deploy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mc-deploy-unlock-btn {
  width: auto !important;
  min-width: calc(130px * var(--ui-scale));
  height: calc(32px * var(--ui-scale)) !important;
  padding: 0 calc(12px * var(--ui-scale));
  font-size: calc(12px * var(--ui-scale)) !important;
}

.mc-deploy-body {
  display: flex;
  flex-direction: column;
  gap: calc(12px * var(--ui-scale));
}

.deploy-section {
  display: flex;
  flex-direction: column;
  gap: calc(6px * var(--ui-scale));
  padding: calc(10px * var(--ui-scale));
  background: rgba(15, 20, 30, 0.78);
  border: 2px solid #4b5563;
}

.deploy-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f8fafc;
  font-size: calc(13.5px * var(--ui-scale));
}

.deploy-section__head span {
  font-size: calc(11.5px * var(--ui-scale));
  color: #fde047;
}

.deploy-soldiers-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: calc(8px * var(--ui-scale));
}

.soldier-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(4px * var(--ui-scale));
  padding: calc(8px * var(--ui-scale)) calc(6px * var(--ui-scale));
  border: 2px solid #64748b;
  background: #1e293b;
  color: #f1f5f9;
  font-family: var(--font);
  cursor: pointer;
  text-align: center;
  transition: transform 0.16s var(--ease-spring), border-color 0.15s ease, background 0.15s ease;
}

.soldier-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #93c5fd;
  background: #27354d;
}

.soldier-card.is-selected {
  border-color: #facc15;
  background: #2e3b23;
  box-shadow: 0 0 0 1px #facc15, inset 0 0 12px rgba(250, 204, 21, 0.22);
}

.soldier-card:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.soldier-card canvas {
  width: calc(28px * var(--ui-scale));
  height: calc(28px * var(--ui-scale));
}

.soldier-card b {
  font-size: calc(12.5px * var(--ui-scale));
  color: #ffffff;
}

.soldier-card small {
  font-size: calc(10.5px * var(--ui-scale));
  line-height: 1.28;
  color: #cbd5e1;
}

.deploy-ranks-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: calc(6px * var(--ui-scale));
}

.rank-pill-btn {
  padding: calc(6px * var(--ui-scale)) calc(4px * var(--ui-scale));
  border: 2px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  font-family: var(--font);
  font-size: calc(12px * var(--ui-scale));
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring), border-color 0.15s ease;
}

.rank-pill-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.rank-pill-btn.is-selected {
  border-color: #facc15;
  transform: translateY(-2px);
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.45);
}

.rank-pill-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.deploy-rank-desc {
  padding: calc(7px * var(--ui-scale)) calc(10px * var(--ui-scale));
  background: rgba(0, 0, 0, 0.45);
  border-left: 3px solid #facc15;
  color: #fef9c3;
  font-size: calc(12px * var(--ui-scale));
  line-height: 1.4;
}

.mc-btn--start-go {
  background: #2f6f31 !important;
  color: #ffffff !important;
}

.mc-btn--start-go:hover:not(:disabled) {
  background: #3b873e !important;
}

/* ==========================================================================
   v5.0 第三批：蓝框底分×红框倍率碰撞、卡牌3D倾斜与附魔流光、全图鉴馆、高光战报卡
   ========================================================================== */

.sidebar {
  gap: calc(4.5px * var(--ui-scale));
  padding: calc(7px * var(--ui-scale));
}

.sidebar > .section {
  gap: calc(4px * var(--ui-scale));
  padding: calc(5px * var(--ui-scale)) calc(8px * var(--ui-scale));
}

/* ---------- 左侧：小丑牌式「蓝框底分 × 红框倍率」跳字碰撞条 ---------- */
.chips-mult-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: calc(5px * var(--ui-scale));
}

.cm-box {
  position: relative;
  height: calc(26px * var(--ui-scale));
  padding: 0 calc(7px * var(--ui-scale));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(4px * var(--ui-scale));
  overflow: hidden;
  transition: transform 0.16s var(--ease-spring), filter 0.16s ease, box-shadow 0.16s ease;
}

.cm-box--chips {
  background: linear-gradient(180deg, #1b65d6 0%, #0f449c 100%);
  color: #ffffff;
  box-shadow:
    inset -1.5px -1.5px #072357,
    inset 1.5px 1.5px #6db1ff,
    0 1px 0 rgba(0, 0, 0, 0.25);
}

.cm-box--mult {
  background: linear-gradient(180deg, #d62828 0%, #961212 100%);
  color: #ffffff;
  box-shadow:
    inset -1.5px -1.5px #520707,
    inset 1.5px 1.5px #ff8585,
    0 1px 0 rgba(0, 0, 0, 0.25);
}

.cm-box__lbl {
  font-size: calc(10px * var(--ui-scale));
  font-weight: 700;
  opacity: 0.86;
  white-space: nowrap;
}

.cm-box__val {
  font-family: var(--font-num);
  font-size: calc(14px * var(--ui-scale));
  font-weight: 800;
  letter-spacing: 0.3px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-cross {
  font-family: var(--font-num);
  font-size: calc(14px * var(--ui-scale));
  font-weight: 900;
  color: #242424;
  line-height: 1;
  min-width: calc(14px * var(--ui-scale));
  text-align: center;
  transition: transform 0.16s var(--ease-spring), color 0.16s ease;
}

.cm-box--mult.is-hot {
  background: linear-gradient(180deg, #ea580c 0%, #b91c1c 100%);
  box-shadow:
    inset -1.5px -1.5px #571206,
    inset 1.5px 1.5px #fdba74,
    0 0 6px rgba(234, 88, 12, 0.45);
}

.cm-box--mult.is-blazing {
  background: linear-gradient(180deg, #f59e0b 0%, #dc2626 58%, #991b1b 100%);
  animation: cm-flame-pulse 0.52s ease-in-out infinite alternate;
}

@keyframes cm-flame-pulse {
  from {
    filter: brightness(0.98);
    box-shadow:
      inset -1.5px -1.5px #571206,
      inset 1.5px 1.5px #fde047,
      0 0 5px rgba(245, 158, 11, 0.55);
  }
  to {
    filter: brightness(1.14);
    box-shadow:
      inset -1.5px -1.5px #571206,
      inset 1.5px 1.5px #fef08a,
      0 0 11px rgba(251, 191, 36, 0.85);
  }
}

.chips-mult-row.is-colliding .cm-box--chips {
  animation: cm-slam-right 0.3s var(--ease-spring);
}

.chips-mult-row.is-colliding .cm-box--mult {
  animation: cm-slam-left 0.3s var(--ease-spring);
}

.chips-mult-row.is-colliding .cm-cross {
  color: #d97706;
  animation: cm-cross-spark 0.3s var(--ease-spring);
}

@keyframes cm-slam-right {
  0%   { transform: translateX(0) scale(1); }
  36%  { transform: translateX(5px) scale(1.08); filter: brightness(1.22); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes cm-slam-left {
  0%   { transform: translateX(0) scale(1); }
  36%  { transform: translateX(-5px) scale(1.08); filter: brightness(1.22); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes cm-cross-spark {
  0%   { transform: scale(1) rotate(0deg); }
  40%  { transform: scale(1.42) rotate(12deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.chips-mult-row.is-plasma .cm-box--chips,
.chips-mult-row.is-plasma .cm-box--mult {
  background: linear-gradient(135deg, #7c3aed 0%, #0891b2 100%) !important;
  box-shadow:
    inset -1.5px -1.5px #2e1065,
    inset 1.5px 1.5px #a5f3fc,
    0 0 8px rgba(124, 58, 237, 0.65) !important;
}

.chips-mult-row.is-plasma .cm-cross {
  color: #7c3aed;
}

.chips-mult-row.is-bad-hit {
  animation: combo-shatter 0.28s steps(3);
}

/* ---------- 卡牌轻微呼吸浮动 + 鼠标跟随 3D 倾斜反光 + 4阶附魔流光 ---------- */
@keyframes card-idle-float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -2.5px; }
}

.shop-cards-grid .item-card:not(.is-sold-out),
.pack-pick-options .item-card,
.pack-card:not(.is-opened),
.voucher-card {
  animation: card-idle-float 3.2s ease-in-out calc(var(--card-idx, 0) * -0.55s) infinite;
}

.shop-cards-grid .item-card:disabled,
.pack-pick-options .item-card:disabled,
.pack-card:disabled,
.voucher-card:disabled {
  animation-play-state: paused;
  translate: 0 0;
}

.item-card.is-dealing,
.pack-card.is-dealing,
.voucher-card.is-dealing {
  animation:
    shop-card-deal 0.28s var(--ease-spring) calc(var(--card-idx, 0) * 55ms) backwards,
    card-idle-float 3.2s ease-in-out calc(0.32s + var(--card-idx, 0) * 0.4s) infinite;
}

.shop-cards-grid .item-card:hover,
.pack-pick-options .item-card:hover,
.pack-card:hover,
.voucher-card:hover {
  translate: 0 0;
}

.is-3d-tilt {
  transform: perspective(560px) translateY(-4px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) scale(1.025) !important;
  transition: transform 0.07s ease-out, box-shadow 0.16s ease !important;
  z-index: 4;
}

.item-card.is-3d-tilt::before,
.pack-card.is-3d-tilt::before,
.voucher-card.is-3d-tilt::before,
.collection-card.is-3d-tilt::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    circle at var(--glare-x, 50%) var(--glare-y, 20%),
    rgba(255, 255, 255, 0.34) 0%,
    rgba(255, 255, 255, 0.08) 34%,
    transparent 68%
  );
}

.item-card,
.pack-card,
.voucher-card,
.slot.is-ed-foil,
.slot.is-ed-holo,
.slot.is-ed-polychrome,
.slot.is-ed-negative {
  overflow: hidden;
}

.item-card.is-ed-foil:not(:disabled)::after,
.slot.is-ed-foil::after {
  content: "";
  position: absolute;
  inset: -40% -80%;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 38%,
    rgba(255, 255, 255, 0.62) 48%,
    rgba(147, 197, 253, 0.45) 52%,
    transparent 62%
  );
  animation: ed-shimmer-sweep 3.2s ease-in-out infinite;
}

.item-card.is-ed-holo:not(:disabled)::after,
.slot.is-ed-holo::after {
  content: "";
  position: absolute;
  inset: -40% -80%;
  pointer-events: none;
  background: linear-gradient(
    122deg,
    transparent 34%,
    rgba(34, 211, 238, 0.36) 44%,
    rgba(244, 114, 182, 0.42) 50%,
    rgba(168, 85, 247, 0.34) 56%,
    transparent 66%
  );
  animation: ed-shimmer-sweep 2.6s linear infinite;
}

.item-card.is-ed-polychrome:not(:disabled),
.slot.is-ed-polychrome {
  background-size: 200% 200%;
  animation: ed-poly-bg 4s ease-in-out infinite alternate;
}

.item-card.is-ed-polychrome:not(:disabled)::after,
.slot.is-ed-polychrome::after {
  content: "";
  position: absolute;
  inset: -40% -80%;
  pointer-events: none;
  background: linear-gradient(
    118deg,
    transparent 32%,
    rgba(251, 113, 133, 0.32) 42%,
    rgba(250, 204, 21, 0.36) 48%,
    rgba(74, 222, 128, 0.32) 54%,
    rgba(96, 165, 250, 0.34) 60%,
    transparent 68%
  );
  animation: ed-shimmer-sweep 2.9s ease-in-out infinite;
}

.item-card.is-ed-negative:not(:disabled)::after,
.slot.is-ed-negative::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(56, 189, 248, 0.16) 50%,
    transparent 100%
  );
  animation: ed-neg-scan 2.4s ease-in-out infinite alternate;
}

@keyframes ed-shimmer-sweep {
  0%   { transform: translateX(-46%) rotate(6deg); }
  62%, 100% { transform: translateX(46%) rotate(6deg); }
}

@keyframes ed-poly-bg {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

@keyframes ed-neg-scan {
  0%   { opacity: 0.35; transform: translateY(-35%); }
  100% { opacity: 0.9; transform: translateY(35%); }
}

/* ---------- 全图鉴馆（#mcCollectionView）与将军金星勋章 ---------- */
.mc-collection-screen {
  width: min(95vw, calc(890px * var(--ui-scale)));
}

.collection-head-left {
  display: flex;
  align-items: center;
  gap: calc(10px * var(--ui-scale));
  flex-wrap: wrap;
}

.collection-progress-pill {
  padding: calc(3px * var(--ui-scale)) calc(10px * var(--ui-scale));
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid #facc15;
  color: #fde047;
  font-family: var(--font-num);
  font-size: calc(12px * var(--ui-scale));
  font-weight: 800;
}

.mc-collection-body {
  display: flex;
  flex-direction: column;
  gap: calc(10px * var(--ui-scale));
}

.collection-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: calc(6px * var(--ui-scale));
}

.collection-tab-btn {
  padding: calc(7px * var(--ui-scale)) calc(4px * var(--ui-scale));
  border: 2px solid #475569;
  background: #1e293b;
  color: #cbd5e1;
  font-family: var(--font);
  font-size: calc(12px * var(--ui-scale));
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.14s var(--ease-spring), border-color 0.14s ease, background 0.14s ease;
}

.collection-tab-btn small {
  font-family: var(--font-num);
  font-size: calc(10px * var(--ui-scale));
  color: #94a3b8;
}

.collection-tab-btn:hover {
  border-color: #93c5fd;
  background: #27354d;
}

.collection-tab-btn.is-active {
  border-color: #facc15;
  background: #2c3824;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.35);
}

.collection-tab-btn.is-active small {
  color: #fde047;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: calc(8px * var(--ui-scale));
  max-height: min(55vh, calc(400px * var(--ui-scale)));
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(8px * var(--ui-scale));
  background: rgba(11, 15, 25, 0.82);
  border: 2px solid #4b5563;
}

.collection-grid::-webkit-scrollbar {
  width: calc(12px * var(--ui-scale));
}

.collection-grid::-webkit-scrollbar-track {
  background: #111827;
}

.collection-grid::-webkit-scrollbar-thumb {
  background: #475569;
  border: 2px solid #1e293b;
}

.collection-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: calc(5px * var(--ui-scale));
  min-height: calc(122px * var(--ui-scale));
  padding: calc(9px * var(--ui-scale)) calc(7px * var(--ui-scale));
  background: #e9ecf2;
  color: #111827;
  box-shadow:
    inset -2px -2px var(--dark),
    inset 2px 2px var(--light),
    inset -3px -3px var(--shadow),
    inset 3px 3px #f8fafc;
  text-align: center;
  overflow: hidden;
  cursor: default;
  transition: transform 0.16s var(--ease-spring);
}

.collection-card--rare { background: #dbeafe; }
.collection-card--epic { background: #f3e8ff; }
.collection-card--legendary { background: #fef3c7; }
.collection-card--bad { background: #fee2e2; }
.collection-card--boss { background: #f3e8ff; }

.collection-card.is-undiscovered {
  background: #1e293b;
  color: #64748b;
  box-shadow:
    inset -2px -2px #0f172a,
    inset 2px 2px #334155;
}

.collection-card canvas {
  width: calc(28px * var(--ui-scale));
  height: calc(28px * var(--ui-scale));
  flex: 0 0 auto;
}

.collection-card__qmark {
  width: calc(28px * var(--ui-scale));
  height: calc(28px * var(--ui-scale));
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  border: 1px dashed #475569;
  color: #94a3b8;
  font-family: var(--font-num);
  font-size: calc(15px * var(--ui-scale));
  font-weight: 900;
}

.collection-card b {
  font-size: calc(12.5px * var(--ui-scale));
  line-height: 1.2;
}

.collection-card small {
  font-size: calc(10.5px * var(--ui-scale));
  line-height: 1.3;
  color: #334155;
}

.collection-card.is-undiscovered small {
  color: #64748b;
}

.collection-card__top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
}

.gold-star-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px;
  background: #334155;
  color: #fde047;
  font-size: calc(9.5px * var(--ui-scale));
  font-weight: 800;
  border: 1px solid #94a3b8;
}

.gold-star-badge--general {
  background: linear-gradient(90deg, #b45309 0%, #eab308 50%, #b45309 100%);
  color: #1c1917;
  border-color: #fef08a;
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.7);
}

/* ---------- 结算高光战报卡与一键复制种子 ---------- */
.run-highlight-card {
  display: flex;
  flex-direction: column;
  gap: calc(7px * var(--ui-scale));
  padding: calc(9px * var(--ui-scale)) calc(11px * var(--ui-scale));
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  border: 2px solid #475569;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.12);
}

.run-highlight-card--victory {
  border-color: #eab308;
  background: linear-gradient(180deg, #172033 0%, #262114 100%);
}

.rhc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(8px * var(--ui-scale));
  flex-wrap: wrap;
}

.rhc-mvp {
  display: flex;
  align-items: center;
  gap: calc(7px * var(--ui-scale));
  min-width: 0;
}

.rhc-mvp canvas {
  width: calc(24px * var(--ui-scale));
  height: calc(24px * var(--ui-scale));
  flex: 0 0 auto;
}

.rhc-mvp-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.rhc-mvp-text small {
  font-size: calc(10px * var(--ui-scale));
  color: #fde047;
  font-weight: 700;
}

.rhc-mvp-text b {
  font-size: calc(12px * var(--ui-scale));
  color: #ffffff;
}

.rhc-seed-bar {
  display: inline-flex;
  align-items: center;
  gap: calc(5px * var(--ui-scale));
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #64748b;
}

.rhc-seed-bar span {
  font-family: var(--font-num);
  font-size: calc(11px * var(--ui-scale));
  color: #cbd5e1;
}

.seed-copy-btn {
  padding: 1px 7px;
  border: 1px solid #93c5fd;
  background: #1d4ed8;
  color: #ffffff;
  font-family: var(--font);
  font-size: calc(10.5px * var(--ui-scale));
  font-weight: 700;
  cursor: pointer;
}

.seed-copy-btn:hover {
  background: #2563eb;
}

.seed-copy-btn.is-copied {
  background: #15803d;
  border-color: #86efac;
}

.rhc-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: calc(5px * var(--ui-scale));
}

.rhc-stat {
  padding: calc(4px * var(--ui-scale)) calc(5px * var(--ui-scale));
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-align: center;
}

.rhc-stat span {
  font-size: calc(9.5px * var(--ui-scale));
  color: #94a3b8;
}

.rhc-stat b {
  font-family: var(--font-num);
  font-size: calc(12px * var(--ui-scale));
  color: #f8fafc;
}

.rhc-loadout {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 2px;
  border-top: 1px dashed rgba(148, 163, 184, 0.3);
}

.rhc-item-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: calc(10.5px * var(--ui-scale));
  color: #e2e8f0;
}

/* ==========================================================================
   v6.0 第二批：战术挑战页、独立荣誉勋墙、局内解锁横幅、Boss压迫氛围与超标烈焰演出
   ========================================================================== */

.slot--itemless-ban {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(36px * var(--ui-scale));
  background: #2b1d1d;
  color: #fca5a5;
  font-weight: 700;
  font-size: calc(11.5px * var(--ui-scale));
  letter-spacing: 0.5px;
  box-shadow: inset 2px 2px #0f0707, inset -2px -2px #5c3a3a;
}

/* 战术挑战双栏选关界面 */
.mc-challenge-body {
  display: grid;
  grid-template-columns: minmax(calc(220px * var(--ui-scale)), 0.95fr) minmax(0, 1.35fr);
  gap: calc(12px * var(--ui-scale));
  min-height: calc(340px * var(--ui-scale));
  max-height: 62vh;
}

@media (max-width: 720px) {
  .mc-challenge-body {
    grid-template-columns: 1fr;
    max-height: 66vh;
  }
}

.challenge-list {
  display: flex;
  flex-direction: column;
  gap: calc(5px * var(--ui-scale));
  overflow-y: auto;
  padding: calc(6px * var(--ui-scale));
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid #334155;
}

.challenge-row-btn {
  display: flex;
  align-items: center;
  gap: calc(8px * var(--ui-scale));
  padding: calc(7px * var(--ui-scale)) calc(9px * var(--ui-scale));
  border: 2px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  font-family: var(--font);
  font-size: calc(12.5px * var(--ui-scale));
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}

.challenge-row-btn:hover {
  background: #283548;
  border-color: #94a3b8;
}

.challenge-row-btn.is-selected {
  background: linear-gradient(90deg, #7c2d12 0%, #451a03 100%);
  border-color: #fbbf24;
  color: #fef9c3;
}

.challenge-row-btn.is-cleared {
  border-color: #eab308;
}

.challenge-row-btn__num {
  font-family: var(--font-num);
  font-size: calc(11px * var(--ui-scale));
  color: #94a3b8;
  min-width: calc(22px * var(--ui-scale));
}

.challenge-row-btn.is-selected .challenge-row-btn__num {
  color: #fde047;
}

.challenge-row-btn b {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.challenge-row-btn__star {
  color: #facc15;
  font-size: calc(13px * var(--ui-scale));
  text-shadow: 0 1px 0 #000;
}

.challenge-detail {
  display: flex;
  flex-direction: column;
  gap: calc(12px * var(--ui-scale));
  padding: calc(16px * var(--ui-scale));
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 17, 36, 0.92) 100%);
  border: 2px solid #64748b;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06);
  overflow-y: auto;
}

.challenge-detail__head {
  display: flex;
  align-items: center;
  gap: calc(12px * var(--ui-scale));
  padding-bottom: calc(10px * var(--ui-scale));
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.challenge-detail__head canvas {
  width: calc(36px * var(--ui-scale));
  height: calc(36px * var(--ui-scale));
  flex: 0 0 auto;
}

.challenge-detail__titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.challenge-detail__titles b {
  font-size: calc(17px * var(--ui-scale));
  color: #fef08a;
}

.challenge-status-badge {
  align-self: flex-start;
  padding: 1px 8px;
  font-size: calc(10.5px * var(--ui-scale));
  font-weight: 700;
  background: #334155;
  color: #cbd5e1;
}

.challenge-status-badge.is-done {
  background: #854d0e;
  color: #fef08a;
  border: 1px solid #facc15;
}

.challenge-detail__rule {
  font-size: calc(13.5px * var(--ui-scale));
  line-height: 1.55;
  color: #f8fafc;
  padding: calc(10px * var(--ui-scale));
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid #f59e0b;
}

.challenge-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: calc(6px * var(--ui-scale));
}

.challenge-spec-pill {
  padding: 3px 9px;
  font-size: calc(11.5px * var(--ui-scale));
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
}

/* 独立荣誉勋墙（20 枚荣誉勋章） */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(168px * var(--ui-scale)), 1fr));
  gap: calc(9px * var(--ui-scale));
  overflow-y: auto;
  max-height: 60vh;
  padding: calc(4px * var(--ui-scale));
}

.ach-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(5px * var(--ui-scale));
  padding: calc(10px * var(--ui-scale)) calc(8px * var(--ui-scale));
  text-align: center;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid #475569;
  color: #e2e8f0;
  transition: transform 0.15s;
}

.ach-card.is-unlocked {
  background: linear-gradient(160deg, #422006 0%, #1e1b4b 100%);
  border-color: #facc15;
  box-shadow: inset 0 0 12px rgba(250, 204, 21, 0.18);
}

.ach-card.is-unlocked:hover {
  transform: translateY(-2px);
}

.ach-card.is-locked {
  opacity: 0.72;
}

.ach-card.is-locked canvas {
  filter: grayscale(1) brightness(0.68);
}

.ach-card__top {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.ach-card__badge {
  font-size: calc(9.5px * var(--ui-scale));
  font-weight: 700;
  padding: 1px 6px;
  background: #334155;
  color: #94a3b8;
}

.ach-card.is-unlocked .ach-card__badge {
  background: #ca8a04;
  color: #fffbeb;
}

.ach-card__medal {
  width: calc(40px * var(--ui-scale));
  height: calc(40px * var(--ui-scale));
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.ach-card.is-unlocked .ach-card__medal {
  border-color: #fde047;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.26) 0%, rgba(0, 0, 0, 0.4) 75%);
}

.ach-card b {
  font-size: calc(12.5px * var(--ui-scale));
  color: #fef08a;
}

.ach-card.is-locked b {
  color: #cbd5e1;
}

.ach-card small {
  font-size: calc(10.8px * var(--ui-scale));
  color: #cbd5e1;
  line-height: 1.32;
}

/* 局内右上角即时荣誉勋章解锁弹出横幅 */
.ach-toast-host {
  position: fixed;
  top: calc(14px * var(--ui-scale));
  right: calc(14px * var(--ui-scale));
  z-index: 9600;
  display: flex;
  flex-direction: column;
  gap: calc(8px * var(--ui-scale));
  pointer-events: none;
}

.ach-toast {
  display: flex;
  align-items: center;
  gap: calc(10px * var(--ui-scale));
  min-width: calc(230px * var(--ui-scale));
  max-width: calc(320px * var(--ui-scale));
  padding: calc(9px * var(--ui-scale)) calc(12px * var(--ui-scale));
  background: linear-gradient(135deg, #451a03 0%, #1e1b4b 100%);
  color: #fffbeb;
  border: 2px solid #facc15;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.5), 0 0 18px rgba(250, 204, 21, 0.35);
  animation: ach-toast-in 0.32s cubic-bezier(0.2, 1.25, 0.4, 1) both;
}

.ach-toast.is-hiding {
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes ach-toast-in {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ach-toast__icon {
  flex: 0 0 auto;
  width: calc(34px * var(--ui-scale));
  height: calc(34px * var(--ui-scale));
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 204, 21, 0.18);
  border: 1px solid #fde047;
}

.ach-toast__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ach-toast__eyebrow {
  font-size: calc(9.5px * var(--ui-scale));
  font-weight: 800;
  color: #fde047;
  letter-spacing: 0.6px;
}

.ach-toast__body b {
  font-size: calc(13px * var(--ui-scale));
  color: #ffffff;
}

.ach-toast__body small {
  font-size: calc(10.5px * var(--ui-scale));
  color: #fef3c7;
}

/* Boss 关全局压迫视觉氛围与得分超标烈焰演出 */
.app-shell.is-boss-atmosphere .board-wrap {
  box-shadow: inset 0 0 28px rgba(136, 19, 55, 0.38);
}

.app-shell.is-boss-atmosphere .level-box {
  background: linear-gradient(180deg, #f3e5f5 0%, #e1bee7 100%);
}

@keyframes blazing-fire-pulse {
  0%, 100% {
    box-shadow:
      inset -2px -2px var(--dark),
      inset 2px 2px #fde047,
      0 0 10px rgba(249, 115, 22, 0.45);
  }
  50% {
    box-shadow:
      inset -2px -2px var(--dark),
      inset 2px 2px #fffbeb,
      0 0 18px rgba(239, 68, 68, 0.72);
  }
}

.score-section.is-blazing {
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  animation: blazing-fire-pulse 1.1s ease-in-out infinite;
}

.score-section.is-blazing .cm-box--chips {
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.65), inset 0 0 6px rgba(191, 219, 254, 0.5);
}

.score-section.is-blazing .cm-box--mult {
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.75), inset 0 0 6px rgba(254, 240, 138, 0.55);
}

.score-section.is-blazing .meter-fill.is-reached {
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 50%, #fde047 100%);
}

.score-section.is-supernova {
  background: linear-gradient(180deg, #fef3c7 0%, #fecdd3 100%);
}

.score-section.is-supernova .led-field {
  box-shadow:
    inset 2px 2px #000000,
    inset -2px -2px #fde047,
    0 0 14px rgba(245, 158, 11, 0.68);
}

/* ---------- 触屏控制条 / 移动抽屉 / 大棋盘缩放导航 ---------- */

#game {
  touch-action: none;
}

.mobile-drawer-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  background: var(--title);
  color: var(--title-text);
  box-shadow:
    inset -1px -1px var(--dark),
    inset 1px 1px var(--light);
}

.mobile-drawer-bar b {
  font-size: 13px;
  letter-spacing: 0.5px;
}

.touch-controls {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 60;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px;
  background: rgba(192, 192, 192, 0.94);
  box-shadow:
    inset -1px -1px var(--dark),
    inset 1px 1px var(--light),
    inset -2px -2px var(--shadow),
    0 2px 8px rgba(0, 0, 0, 0.35);
}

.touch-zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.touch-btn {
  min-height: 28px;
  padding: 3px 8px;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.touch-btn.is-flag-mode {
  background: #ffe0e0;
  color: #8b0000;
  border-color: #a00000;
}

.touch-btn--drawer.is-active {
  background: #d8e6ff;
  color: #000080;
}

/* ---------- 移动端 / 窄屏响应式适配 (<= 900px) ---------- */

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
    height: 100dvh;
    padding: 4px;
    gap: 4px;
  }

  .app-shell:not(.is-title-mode) .sidebar:not(.is-drawer-open) {
    flex: 0 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    animation: none;
    overflow: visible;
  }

  .app-shell .sidebar:not(.is-drawer-open) .level-box {
    grid-column: 1 / -1;
    padding: 4px 7px;
    gap: 3px;
  }

  .app-shell .sidebar:not(.is-drawer-open) .score-section,
  .app-shell .sidebar:not(.is-drawer-open) .click-section {
    padding: 4px 6px;
    gap: 3px;
  }

  .app-shell .sidebar:not(.is-drawer-open) .led-row {
    gap: 4px;
  }

  .app-shell .sidebar:not(.is-drawer-open) .chips-mult-row {
    padding: 2px 4px;
  }

  .app-shell .sidebar:not(.is-drawer-open) .stat-grid--3 {
    gap: 3px;
  }

  .app-shell .sidebar:not(.is-drawer-open) .section--slots,
  .app-shell .sidebar:not(.is-drawer-open) .section--cons,
  .app-shell .sidebar:not(.is-drawer-open) .section--deck,
  .app-shell .sidebar:not(.is-drawer-open) .sidebar-bottom-pad {
    display: none;
  }

  .sidebar.is-drawer-open {
    position: fixed;
    inset: 0;
    z-index: 4200;
    width: 100vw;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    overflow-y: auto;
    animation: none;
  }

  .sidebar.is-drawer-open .mobile-drawer-bar {
    display: flex;
    flex: 0 0 auto;
  }

  .sidebar.is-drawer-open .level-box,
  .sidebar.is-drawer-open .score-section,
  .sidebar.is-drawer-open .click-section {
    display: none;
  }

  .board-wrap {
    flex: 1 1 auto;
    min-height: 0;
    padding: 2px;
  }

  .touch-controls {
    right: 6px;
    left: 6px;
    bottom: 6px;
    justify-content: space-between;
  }

  .touch-btn {
    min-height: 32px;
    padding: 4px 9px;
  }

  .blind-stage,
  .shop-stage {
    padding: 4px;
  }

  .blind-stage-body,
  .shop-stage-body {
    overflow-y: auto;
    max-height: calc(100dvh - 140px);
    padding: 8px;
    padding-bottom: 52px;
  }

  .blind-cards-grid {
    grid-template-columns: 1fr;
  }

  .shop-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-lower-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-voucher-box {
    grid-column: 1 / -1;
  }

  .pack-pick-options,
  .pack-pick-options:has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(94vw, 520px);
  }

  .mc-subscreen {
    padding: 10px 8px;
  }

  .deploy-soldiers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deploy-ranks-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 58dvh;
  }

  .dialog {
    width: calc(100vw - 16px);
    max-height: 92dvh;
  }

  .dialog-body {
    max-height: 70dvh;
    overflow-y: auto;
    padding: 10px;
  }
}

/* 横屏手机端（高度受限）：左侧精简并排，避免压缩棋盘高度 */
@media (max-height: 540px) and (pointer: coarse) {
  .app-shell:not(.is-title-mode) {
    flex-direction: row;
  }

  .app-shell:not(.is-title-mode) .sidebar:not(.is-drawer-open) {
    flex: 0 0 212px;
    width: 212px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .app-shell .sidebar:not(.is-drawer-open) .level-box,
  .app-shell .sidebar:not(.is-drawer-open) .score-section,
  .app-shell .sidebar:not(.is-drawer-open) .click-section {
    display: flex;
  }

  .app-shell .sidebar:not(.is-drawer-open) .section--slots,
  .app-shell .sidebar:not(.is-drawer-open) .section--cons,
  .app-shell .sidebar:not(.is-drawer-open) .section--deck,
  .app-shell .sidebar:not(.is-drawer-open) .sidebar-bottom-pad {
    display: none;
  }

  .touch-controls {
    left: auto;
    right: 6px;
    bottom: 6px;
  }
}


