/* ==========================================================================
   《次元小丑牌：魔王讨伐战》
   复刻经典纸面扑克牌 + 蓝伤害/红倍率固定牌型卷轴 + Spine 60FPS 对决舞台
   ========================================================================== */

:root {
  --bg-dark: #161118;
  --paper-ivory: #f3ede2;
  --paper-face: #f2d8ce;
  --ink-black: #181311;
  --suit-red: #b92b27;
  --suit-diamond: #c45124;
  --blue-dmg: #1845b8;
  --red-mult: #b31e29;
  --gold-accent: #f59e0b;
  --font-sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "STKaiti", "KaiTi", "Noto Serif SC", "PingFang SC", serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

.hidden {
  display: none !important;
}

html,
body {
  width: 100%;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 25%, #2b1d28 0%, #161118 70%, #0d0a0f 100%);
  color: #f8fafc;
  font-family: var(--font-sans);
  overflow-x: hidden;
}

/* 打击震动 */
@keyframes stageShakeLight {
  0%, 100% { transform: translate3d(0, 0, 0); }
  35% { transform: translate3d(-3px, 1px, 0); }
  70% { transform: translate3d(3px, -1px, 0); }
}
@keyframes stageShakeHeavy {
  0%, 100% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-6px, 3px, 0); }
  65% { transform: translate3d(6px, -3px, 0); }
}
.shake-light { animation: stageShakeLight 0.18s ease; }
.shake-heavy { animation: stageShakeHeavy 0.28s ease; }

/* ================= 顶部极简导航条 ================= */
.alchemist-topbar {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.top-left-group,
.top-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-hud-btn {
  appearance: none;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.icon-hud-btn:hover,
.icon-hud-btn.active {
  background: rgba(245, 158, 11, 0.24);
  border-color: var(--gold-accent);
  color: #fff;
}

.top-stage-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  padding: 6px 16px;
  border-radius: 999px;
}

.act-badge {
  font-size: 12px;
  font-weight: 800;
  color: #38bdf8;
}

.top-stage-pill strong {
  font-size: 14px;
  color: #fff;
}

.boss-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(179, 30, 41, 0.35);
  color: #fca5a5;
}

/* ================= 主舞台单列居中容器 ================= */
.poker-battle-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 4px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 1. 顶部 5 槽位被动小丑牌/遗物栏 */
.joker-top-strip {
  width: 100%;
}

.joker-slots-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 720px) {
  .joker-slots-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.joker-chip-card {
  background: rgba(32, 24, 38, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 7px 10px;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.joker-chip-card.triggered {
  transform: translateY(-4px) scale(1.04);
  border-color: var(--gold-accent);
  background: rgba(245, 158, 11, 0.2);
}

.joker-chip-card.empty-slot {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.28);
  border-style: dashed;
}

.joker-top-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.joker-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.joker-icon-thumb {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.joker-name {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.joker-sell-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #cbd5e1;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
}

.joker-sell-btn:hover {
  background: var(--red-mult);
  color: #fff;
}

.joker-desc {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ================= 2. 角色 VS 魔王 实时 Spine 舞台 + 中央算盘计分器 ================= */
.battle-arena-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.boss-battle-arena {
  position: relative;
  height: 310px;
  border-radius: 18px;
  overflow: hidden;
  background: #120d16;
  border: 2px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.boss-battle-arena .arena-bg-cg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.42) saturate(1.1);
  z-index: 0;
}

.arena-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, transparent 30%, rgba(12, 8, 16, 0.78) 100%),
    linear-gradient(180deg, rgba(12, 8, 16, 0.72) 0%, transparent 40%, rgba(12, 8, 16, 0.88) 100%);
  z-index: 1;
}

.arena-vfx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.arena-boss-hud {
  position: relative;
  z-index: 4;
  padding: 10px 18px 0;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  text-align: center;
}

.arena-boss-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.boss-skull-badge {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
}

.boss-hp-numbers {
  font-size: 13px;
  font-weight: 900;
  color: #fbbf24;
}

.arena-boss-hp-track {
  height: 10px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.arena-boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #f59e0b);
  border-radius: 99px;
  transition: width 0.35s ease;
}

.blind-boss-rule {
  font-size: 11.5px;
  color: #cbd5e1;
  margin-top: 4px;
}

/* 左右角色 + 中央蓝伤害/红倍率算分扇盘 */
.arena-combatants-stage {
  position: relative;
  z-index: 4;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  padding: 0 24px 12px;
}

.combatant-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 250px;
  cursor: pointer;
  position: relative;
}

.spine-rig-canvas {
  width: 240px;
  height: 230px;
  display: none;
  pointer-events: none;
}

.combatant-box.spine-active .spine-rig-canvas {
  display: block;
}

.combatant-box.spine-active .combatant-sprite {
  display: none !important;
}

.combatant-sprite {
  height: 256px;
  max-height: 262px;
  width: auto;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.85));
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2), filter 0.18s ease;
  animation: spriteIdleFloat 2.8s ease-in-out infinite;
}

@keyframes spriteIdleFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

/* 4状态切换物理反馈：攻击冲刺 / 受击震退 / 濒死战损红光脉冲 */
.combatant-box.hero-attacking .combatant-sprite {
  animation: none;
  transform: translateX(42px) scale(1.08) !important;
  filter: drop-shadow(0 0 18px rgba(251, 191, 36, 0.95)) brightness(1.12);
}

.combatant-box.hero-hit .combatant-sprite {
  animation: heroHitShake 0.36s ease;
  filter: drop-shadow(0 0 20px rgba(244, 63, 94, 0.95)) brightness(1.35) sepia(0.25);
}

.combatant-box.hero-critical .combatant-sprite {
  filter: drop-shadow(0 0 14px rgba(244, 63, 94, 0.75));
}

.combatant-box.hero-critical .hero-tag {
  background: linear-gradient(90deg, #9f1239, #e11d48);
  border: 1px solid #fda4af;
  color: #fff;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.6);
}

.combatant-box.boss-damaged .combatant-sprite {
  animation: heroHitShake 0.3s ease;
  filter: brightness(1.85) drop-shadow(0 0 22px #f43f5e);
}

.combatant-box.boss-attacking .combatant-sprite {
  animation: none;
  transform: translateX(-40px) scale(1.08) !important;
  filter: drop-shadow(0 0 20px #e11d48);
}

@keyframes heroHitShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-14px) rotate(-4deg); }
  45% { transform: translateX(10px) rotate(3deg); }
  70% { transform: translateX(-8px) rotate(-2deg); }
}

.combatant-tag {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
}

/* 中央算盘扇面：牌型名称 + 蓝底伤害 × 红底倍率 (复刻参考图样式) */
.center-abacus-hud {
  background: rgba(20, 15, 24, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 10px 18px;
  min-width: 240px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  margin-bottom: 12px;
}

.abacus-hand-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.synergy-tier {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
}

.synergy-name {
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.5px;
}

.abacus-Dual-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.brush-pill {
  min-width: 84px;
  padding: 6px 14px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.14s ease;
}

.brush-pill.bump {
  transform: scale(1.14);
}

.brush-pill.blue-damage {
  background: var(--blue-dmg);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.3);
}

.brush-pill.red-mult {
  background: var(--red-mult);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.3);
}

.brush-pill .well-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.82);
}

.brush-pill .well-value {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
}

.abacus-mult-x {
  font-size: 18px;
  font-weight: 900;
  color: #cbd5e1;
}

.abacus-total-line {
  font-size: 12px;
  color: #cbd5e1;
}

.abacus-total-line strong {
  font-size: 16px;
  color: #fbbf24;
}

/* ================= 全屏大立绘 + 背后巨型海报文字 插屏特写 (攻击前奥义 & 濒死爆衣破防 Cut-in) ================= */
.arena-cutin-banner {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: radial-gradient(circle at 50% 50%, rgba(124, 45, 18, 0.88) 0%, rgba(10, 6, 18, 0.94) 100%);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: cutinBannerLifecycle 1.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.arena-cutin-banner.mode-critical {
  background: radial-gradient(circle at 50% 50%, rgba(190, 18, 60, 0.9) 0%, rgba(20, 5, 28, 0.96) 100%);
}

.arena-cutin-banner.mode-boss {
  background: radial-gradient(circle at 50% 50%, rgba(107, 33, 168, 0.92) 0%, rgba(15, 5, 24, 0.96) 100%);
}

.arena-cutin-banner.mode-boss .cutin-badge {
  background: #c084fc;
  color: #181311;
}

.arena-cutin-banner.mode-boss .cutin-skill-tag {
  -webkit-text-stroke: 2.5px rgba(216, 180, 254, 0.88);
  text-shadow: 0 0 42px rgba(168, 85, 247, 0.85);
}

.cutin-slash-bg {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cutin-speedlines {
  position: absolute;
  inset: -20%;
  background: repeating-linear-gradient(
    -14deg,
    rgba(255, 255, 255, 0.07) 0px,
    rgba(255, 255, 255, 0.07) 4px,
    transparent 4px,
    transparent 20px
  );
  z-index: 1;
  pointer-events: none;
}

/* 文字层在人物正背后 (z-index: 2)，超大号海报字横跨整个画面！ */
.cutin-Copy-box {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}

.cutin-badge {
  position: absolute;
  top: 12px;
  left: 18px;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 99px;
  background: #fde047;
  color: #181311;
  letter-spacing: 1.5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.arena-cutin-banner.mode-critical .cutin-badge {
  background: #fb7185;
  color: #fff;
}

/* 人物背后的超巨型招式/爆衣大字 */
.cutin-skill-tag {
  font-size: 86px;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.24);
  -webkit-text-stroke: 2.5px rgba(253, 224, 71, 0.72);
  text-shadow: 0 0 36px rgba(251, 191, 36, 0.55);
  letter-spacing: 6px;
  white-space: nowrap;
  transform: rotate(-4deg) translateY(-10px);
  user-select: none;
}

.arena-cutin-banner.mode-critical .cutin-skill-tag {
  -webkit-text-stroke: 2.5px rgba(253, 164, 175, 0.8);
  text-shadow: 0 0 42px rgba(244, 63, 94, 0.75);
}

/* 人物主视觉层 (z-index: 3)：100%无裁切全身立绘自然放大，头肩手完整无切边，占满画面主视觉！ */
.cutin-portrait-img {
  position: relative;
  z-index: 3;
  height: 142%;
  width: auto;
  object-fit: contain;
  object-position: top center;
  transform: translateY(16%);
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.92));
  animation: cutinPortraitZoom 1.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 台词字幕条贴在底部边缘 (z-index: 4) */
.cutin-quote-line {
  position: absolute;
  bottom: 10px;
  z-index: 5;
  font-size: 13.5px;
  font-weight: 800;
  color: #fef3c7;
  background: rgba(12, 8, 18, 0.84);
  padding: 5px 18px;
  border-radius: 99px;
  border: 1.5px solid rgba(253, 224, 71, 0.65);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.75);
}

@keyframes cutinBannerLifecycle {
  0% { opacity: 0; transform: scale(1.06); }
  12% { opacity: 1; transform: scale(1); }
  85% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.98); }
}

@keyframes cutinPortraitZoom {
  0% { transform: translateY(28%) scale(0.92); }
  18% { transform: translateY(16%) scale(1.02); }
  100% { transform: translateY(14%) scale(1.06); }
}

.ssr-flash-burst {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.55), transparent 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 8;
}

.ssr-flash-burst.active {
  animation: flashBurst 0.5s ease-out;
}

@keyframes flashBurst {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}

.floating-popups-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25;
}

.score-pop-chip {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 15px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 8px;
  color: #fff;
  animation: popUpFade 0.8s ease-out forwards;
  white-space: nowrap;
}

.score-pop-chip.type-pixels { background: var(--blue-dmg); }
.score-pop-chip.type-mult { background: var(--red-mult); }
.score-pop-chip.type-xmult { background: #d97706; font-size: 17px; }

@keyframes popUpFade {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.85); }
  25% { opacity: 1; transform: translate(-50%, -14px) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -36px) scale(0.95); }
}

/* 主角专属被动天赋 + 主动战技栏 (单局锁定 1 名出战女主) */
.hero-skill-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 14px;
  border-radius: 12px;
  background: rgba(20, 15, 28, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.28);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.hero-passive-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #e2e8f0;
}

.passive-tag {
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.22);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.45);
  white-space: nowrap;
}

.hero-active-skill-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 99px;
  background: linear-gradient(90deg, #9333ea 0%, #e11d48 100%);
  border: 1.5px solid #fda4af;
  color: #fff;
  font-size: 12.5px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.45);
  transition: transform 0.14s ease, filter 0.14s ease;
  white-space: nowrap;
}

.hero-active-skill-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.15);
}

.hero-active-skill-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.skill-charges {
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 11px;
  color: #fde047;
}

/* ================= 3. 高质感实体纹理扑克牌手牌区 ================= */
.classic-poker-hand-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 8px;
}

.poker-hand-fan {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 12px 6px;
  max-width: 100%;
  overflow-x: auto;
}

/* 实体羊皮纸描金底图扑克牌 (blank_card_number.webp) */
.classic-playing-card {
  position: relative;
  width: 116px;
  height: 170px;
  border-radius: 10px;
  background-color: var(--paper-ivory);
  background-image: url("../../assets/alchemist/cards/blank_card_number.webp");
  background-size: 100% 100%;
  background-position: center;
  border: 2.5px solid #2b2118;
  box-shadow:
    -5px 8px 16px rgba(0, 0, 0, 0.65),
    inset 0 0 0 1.5px rgba(217, 167, 74, 0.45);
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  transition: transform 0.16s cubic-bezier(0.2, 0.85, 0.25, 1), box-shadow 0.16s ease;
}

.classic-playing-card + .classic-playing-card {
  margin-left: -10px;
}

/* 人头牌 (J, Q, K, A) 采用皇家鎏金浮雕扑克牌底图 (blank_card_royal.webp) */
.classic-playing-card.is-face-card {
  background-image: url("../../assets/alchemist/cards/blank_card_royal.webp");
  background-size: 100% 100%;
  border-color: #5c3a1e;
  box-shadow:
    -5px 8px 16px rgba(0, 0, 0, 0.68),
    inset 0 0 0 2px rgba(245, 158, 11, 0.55);
}

/* 当被 BOSS 技能翻转盖住时：正面隐藏，显示华丽深渊扑克牌背 (card_back_abyss.webp)！ */
.classic-playing-card.is-facedown {
  background-image: url("../../assets/alchemist/cards/card_back_abyss.webp") !important;
  background-size: 100% 100% !important;
  border-color: #a855f7;
  box-shadow:
    -5px 8px 18px rgba(0, 0, 0, 0.8),
    0 0 12px rgba(168, 85, 247, 0.45),
    inset 0 0 0 1.5px rgba(251, 191, 36, 0.65);
  animation: flipFaceDownAnim 0.42s cubic-bezier(0.2, 0.85, 0.3, 1);
}

.classic-playing-card.is-facedown.selected {
  border-color: #fde047;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.78), 0 0 0 2.5px #fbbf24;
}

.facedown-seal-badge {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 10, 28, 0.88);
  border: 1px solid rgba(216, 180, 254, 0.75);
  color: #f3e8ff;
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
  z-index: 5;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.7);
}

@keyframes flipFaceDownAnim {
  0% { transform: rotateY(180deg) scale(1.06); }
  50% { transform: rotateY(90deg) scale(1.12); }
  100% { transform: rotateY(0deg) scale(1); }
}

.classic-playing-card:hover {
  transform: translateY(-10px);
  z-index: 15;
}

.classic-playing-card.selected {
  transform: translateY(-24px);
  border-color: #d97706;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.7), 0 0 0 2px #fbbf24;
  z-index: 20;
}

/* 左上角：大号点数 + 花色 (内缩于描金内框内侧，不压金边) */
.poker-corner-tl {
  position: absolute;
  top: 12px;
  left: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.95;
  z-index: 3;
}

.poker-rank-num {
  font-size: 27px;
  font-weight: 900;
  font-family: "Georgia", "Times New Roman", serif;
  letter-spacing: -1px;
}

.poker-suit-small {
  font-size: 21px;
  margin-top: 2px;
}

/* 花色颜色：黑桃/梅花为浓墨黑，红心为朱砂红，方片为橘红 */
.classic-playing-card.suit-spade .poker-corner-tl,
.classic-playing-card.suit-spade .poker-big-pip,
.classic-playing-card.suit-club .poker-corner-tl,
.classic-playing-card.suit-club .poker-big-pip {
  color: var(--ink-black);
}

.classic-playing-card.suit-heart .poker-corner-tl,
.classic-playing-card.suit-heart .poker-big-pip {
  color: var(--suit-red);
}

.classic-playing-card.suit-diamond .poker-corner-tl,
.classic-playing-card.suit-diamond .poker-big-pip {
  color: var(--suit-diamond);
}

/* 数字牌 (2~10)：大花色置于羊皮纸内框内部，绝不压住底部描金边框、也不被右侧叠牌遮挡 */
.poker-big-pip {
  position: absolute;
  right: 18px;
  bottom: 16px;
  font-size: 64px;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.14));
}

/* 人头牌 (J, Q, K)：经典上下对称双头宫廷扑克牌面插画居中铺满内框 */
.poker-face-portrait {
  position: absolute;
  left: 28px;
  top: 12px;
  right: 10px;
  bottom: 12px;
  width: calc(100% - 38px);
  height: calc(100% - 24px);
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
  border: 1px solid rgba(180, 130, 50, 0.55);
  z-index: 2;
  pointer-events: none;
}

/* 扑克牌边缘古风小缺口装饰 (复刻参考图1纸牌边沿缺口质感) */
.classic-playing-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(24, 19, 17, 0.18);
  border-radius: 5px;
  pointer-events: none;
  z-index: 4;
}

/* ================= 5 颗红心生命/出牌次数条 (复刻参考图1) ================= */
.hearts-life-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 2px 0;
}

.heart-gem {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.heart-gem.active {
  color: #e11d48;
  transform: scale(1);
}

.heart-gem.spent {
  opacity: 0.22;
  filter: grayscale(1);
  transform: scale(0.86);
}

/* ================= 底部操作栏 (道具球 + 出牌/弃牌 + 铜钱与牌盒 44/52) ================= */
.poker-bottom-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.bottom-left-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-orb-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-orb-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.tool-orb-btn.suggest {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fde68a;
}

.bottom-center-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.poker-main-btn {
  appearance: none;
  border-radius: 999px;
  padding: 11px 28px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.poker-main-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}

.poker-main-btn.discard {
  background: #334155;
}

.poker-main-btn.discard:hover:not(:disabled) {
  background: #475569;
  transform: translateY(-2px);
}

.poker-main-btn.play {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: #fbbf24;
  padding: 11px 36px;
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.45);
}

.poker-main-btn.play:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(220, 38, 38, 0.65);
}

/* 右下角：铜钱圆盘 + 扑克牌盒 (44/52) */
.bottom-right-deck {
  display: flex;
  align-items: center;
  gap: 14px;
}

.coin-orb-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle, #1e3a2f 0%, #0f221b 100%);
  border: 2px solid #34d399;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.coin-orb-badge .orb-icon {
  font-size: 16px;
  line-height: 1;
}

.coin-orb-badge strong {
  font-size: 14px;
  font-weight: 900;
  color: #fbbf24;
}

.deck-box-btn {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 68px;
  border-radius: 12px;
  background: linear-gradient(180deg, #b91c1c 0%, #7f1d1d 100%);
  border: 2.5px solid #fbbf24;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease;
}

.deck-box-btn:hover {
  transform: translateY(-4px) scale(1.04);
}

.deck-box-graphic {
  font-size: 24px;
  line-height: 1;
}

.deck-box-btn strong {
  font-size: 13px;
  font-weight: 900;
  color: #fde68a;
  margin-top: 2px;
}

/* ================= 弹窗 1：三标签「牌型 / 完整 / 剩余」卷轴弹窗 (1:1 复刻参考图2) ================= */
.cyber-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(8, 6, 12, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.scroll-book-modal {
  width: min(560px, 95vw);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 顶部三个斜角书签页签：牌型 | 完整 | 剩余 */
.scroll-tabs-row {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-left: 18px;
  margin-bottom: -3px;
  z-index: 2;
}

.scroll-tab {
  appearance: none;
  padding: 10px 26px 8px;
  border-radius: 12px 18px 0 0;
  background: #bdb8b0;
  border: 3px solid #181311;
  border-bottom: none;
  color: #181311;
  font-size: 18px;
  font-weight: 900;
  font-family: var(--font-serif);
  cursor: pointer;
  transition: all 0.15s ease;
}

.scroll-tab.active {
  background: linear-gradient(180deg, #f3c66f 0%, #d99b38 100%);
  padding-top: 13px;
}

/* 灰白宣纸卷轴主体框 */
.scroll-paper-frame {
  width: 100%;
  background: #d8d4cd;
  background-image: radial-gradient(circle at 50% 30%, #e5e2dc 0%, #cfc9c0 100%);
  border: 4px solid #181311;
  border-radius: 8px;
  padding: 14px 16px 20px;
  color: #181311;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
  max-height: 76vh;
  overflow-y: auto;
}

.scroll-hands-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.scroll-hands-table thead th {
  background: #b5b0a8;
  color: #4a453e;
  font-size: 14px;
  font-weight: 800;
  padding: 7px 6px;
}

.scroll-hands-table tbody tr {
  border-bottom: 1px solid rgba(24, 19, 17, 0.1);
}

.scroll-hands-table td {
  padding: 8px 6px;
  font-size: 17px;
  font-weight: 900;
}

.hand-lv-cell {
  color: #fff;
  text-shadow:
    -1.5px -1.5px 0 #181311,
     1.5px -1.5px 0 #181311,
    -1.5px  1.5px 0 #181311,
     1.5px  1.5px 0 #181311;
}

.hand-name-cell {
  color: #181311;
  font-family: var(--font-serif);
  font-size: 19px;
}

.hand-name-cell small {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  color: #57524a;
  font-weight: 700;
}

/* 蓝底毛笔伤害块 & 红底毛笔倍率块 (1:1 复刻参考图2) */
.table-brush-dmg {
  display: inline-block;
  min-width: 68px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--blue-dmg);
  color: #fff;
  font-weight: 900;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.table-brush-mult {
  display: inline-block;
  min-width: 64px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--red-mult);
  color: #fff;
  font-weight: 900;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.hand-count-cell {
  color: #fff;
  text-shadow:
    -1.5px -1.5px 0 #181311,
     1.5px -1.5px 0 #181311,
    -1.5px  1.5px 0 #181311,
     1.5px  1.5px 0 #181311;
}

/* 完整牌组 / 剩余牌堆 52 张微缩扑克网格 */
.deck-suit-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
}

.suit-row-cards,
.deck-mini-cards {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 4px;
}

@media (max-width: 520px) {
  .suit-row-cards,
  .deck-mini-cards {
    grid-template-columns: repeat(7, 1fr);
  }
}

.deck-suit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 800;
  margin-bottom: 4px;
}

.mini-deck-card {
  background: var(--paper-ivory);
  border: 1.5px solid #181311;
  border-radius: 4px;
  padding: 4px 2px;
  text-align: center;
  font-weight: 900;
  font-size: 12px;
  line-height: 1.1;
}

.mini-deck-card.red,
.mini-deck-card.suit-heart { color: var(--suit-red); }
.mini-deck-card.suit-diamond { color: var(--suit-diamond); }
.mini-deck-card.black,
.mini-deck-card.suit-spade,
.mini-deck-card.suit-club { color: var(--ink-black); }
.mini-deck-card.drawn,
.mini-deck-card.is-drawn {
  opacity: 0.25;
  filter: grayscale(1);
}

.scroll-close-hint {
  margin-top: 14px;
  appearance: none;
  background: none;
  border: none;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

/* ================= 其他通用弹窗 (商店 / CG 图鉴 / 结算) ================= */
.cyber-modal {
  background: #1e1824;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  width: min(920px, 95vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.modal-header h2 {
  font-size: 18px;
  color: #fff;
}

.modal-close-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: 99px;
  font-weight: 700;
  cursor: pointer;
}

.shop-wallet-badge {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid var(--gold-accent);
  padding: 5px 14px;
  border-radius: 99px;
  font-size: 14px;
}

.shop-wallet-badge strong {
  color: #fbbf24;
  font-size: 18px;
}

.shop-reward-summary {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

.shop-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 720px) {
  .shop-sections-grid { grid-template-columns: 1fr; }
}

.shop-column {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shop-col-header h3 {
  font-size: 14px;
  color: #fbbf24;
}

.shop-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 9px 12px;
}

.shop-item-info.with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-mod-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
}

.shop-item-info h4 {
  font-size: 13px;
  color: #fff;
}

.shop-item-info p {
  font-size: 11.5px;
  color: #94a3b8;
}

.buy-pill-btn {
  appearance: none;
  background: #fbbf24;
  border: none;
  color: #181311;
  font-weight: 900;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
}

.buy-pill-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 12px;
}

.gallery-cg-tile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}

.gallery-cg-tile.locked .tile-thumb img {
  filter: brightness(0.2) blur(5px) grayscale(0.8);
}

.tile-thumb {
  position: relative;
  height: 125px;
}

.tile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-rarity {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fbbf24;
  color: #181311;
}

.tile-caption {
  padding: 8px 10px;
}

.tile-caption h4 {
  font-size: 12px;
  color: #fff;
}

.tile-caption p {
  display: none;
}

.lightbox-body {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
}

@media (max-width: 720px) {
  .lightbox-body { grid-template-columns: 1fr; }
}

.lightbox-img-wrap {
  border-radius: 12px;
  overflow: hidden;
  background: #0d0a0f;
  max-height: 420px;
}

.lightbox-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.run-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.run-stat-box {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.run-stat-box span {
  font-size: 12px;
  color: #94a3b8;
  display: block;
}

.run-stat-box strong {
  font-size: 22px;
  color: #fbbf24;
}

/* 失败结算：红色警示边框 + 止步关卡横跨整行 */
#runEndModal.is-defeat .run-end-card {
  border-color: rgba(248, 113, 113, 0.75);
  box-shadow: 0 0 32px rgba(220, 38, 38, 0.35);
}

#runEndModal.is-defeat #runEndTitle {
  color: #fca5a5;
}

.run-stat-box.stat-wide {
  grid-column: span 2;
}

#runEndModal.is-defeat .run-stat-box.stat-wide strong,
#runEndModal.is-defeat .run-stat-box.stat-wide + .run-stat-box strong {
  color: #f87171;
}

@media (max-width: 520px) {
  .run-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .run-stat-box {
    padding: 8px;
  }

  .run-stat-box strong {
    font-size: 16px;
  }
}

.run-end-footer,
.shop-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.deck-cardback-thumb {
  width: 28px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(251, 191, 36, 0.75);
  box-shadow: 2px -2px 0 #3b0764, 4px -4px 6px rgba(0, 0, 0, 0.65);
}

/* ================= 6. 本局唯一出战女主选择弹窗 (Hero Select Modal) ================= */
.hero-select-modal-card {
  max-width: 960px;
  width: 95vw;
}

.hero-select-subtitle {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 14px;
}

.hero-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 14px;
  max-height: 68vh;
  overflow-y: auto;
  padding-right: 4px;
}

.hero-select-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: all 0.16s ease;
}

.hero-select-card:hover,
.hero-select-card.selected-hero {
  background: rgba(245, 158, 11, 0.14);
  border-color: #fbbf24;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
}

.hero-select-thumb {
  width: 78px;
  height: 108px;
  object-fit: contain;
  object-position: bottom center;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.2), rgba(0, 0, 0, 0.45));
  border-radius: 10px;
  flex-shrink: 0;
}

.hero-select-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hero-select-info h3 {
  font-size: 15px;
  font-weight: 900;
  color: #fde047;
}

.hero-skill-line {
  font-size: 11.5px;
  color: #e2e8f0;
  line-height: 1.35;
}

.hero-skill-line strong {
  color: #38bdf8;
}

.hero-skill-line.active-line strong {
  color: #fb7185;
}

/* ================= 7. 极简无字图标栏 + 大幅角色立绘 + 右上角钱币牌型 ================= */
/* 顶部 5 槽位道具栏：平时仅显示纯图标，鼠标悬浮显示名称与说明 */
.joker-slots-row {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.joker-chip-card.icon-only-slot {
  position: relative;
  width: 54px;
  height: 54px;
  min-height: 54px;
  padding: 4px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 20, 36, 0.9);
  border: 1.5px solid rgba(251, 191, 36, 0.38);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.joker-chip-card.icon-only-slot.empty-slot {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(20, 15, 26, 0.55);
}

.empty-plus {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.22);
}

.joker-only-icon {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.joker-hover-pop {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 230px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(16, 12, 24, 0.96);
  border: 1.5px solid rgba(251, 191, 36, 0.65);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.85);
  z-index: 120;
  text-align: left;
  pointer-events: auto;
}

.joker-chip-card.icon-only-slot:hover .joker-hover-pop {
  display: block;
}

.joker-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.joker-pop-head strong {
  font-size: 12.5px;
  color: #fde047;
}

.joker-pop-desc {
  font-size: 11.5px;
  color: #e2e8f0;
  line-height: 1.4;
}

/* ================= 8. 全屏沉浸式战斗舞台 + 扑克牌直接叠放在全屏画面上方 ================= */
body {
  overflow: hidden !important;
}

.alchemist-topbar {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  height: 48px !important;
  padding: 0 16px !important;
  z-index: 60 !important;
  background: rgba(12, 8, 18, 0.9) !important;
  backdrop-filter: blur(8px);
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
}

.top-left-group,
.top-stage-pill,
.top-right-group {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

.icon-hud-btn,
.top-coin-pill,
.act-badge,
.boss-tag {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1.2 !important;
  padding: 5px 12px !important;
}

.poker-battle-main {
  position: fixed !important;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw !important;
  max-width: none !important;
  height: calc(100vh - 48px) !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* 战斗画面铺满整个屏幕，去掉小框 */
.battle-arena-wrapper {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
}

.boss-battle-arena {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

/* 右上角悬浮 5 个纯图标道具槽 */
.top-hearts-and-relics {
  position: fixed !important;
  top: 56px;
  right: 20px;
  left: auto;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.top-hearts-bar,
.joker-slots-row {
  pointer-events: auto;
}

.top-hearts-bar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 0 4px !important;
  background: rgba(24, 14, 30, 0.85);
  padding: 4px 11px;
  border-radius: 99px;
  border: 1px solid rgba(244, 63, 94, 0.5);
}

.top-hearts-bar .heart-gem {
  font-size: 17px;
}

/* 顶部中央 BOSS 血条悬浮在全屏顶部正中央 */
.arena-boss-hud {
  position: relative;
  z-index: 30;
  padding-top: 12px !important;
  max-width: 560px !important;
  margin: 0 auto;
  pointer-events: none;
}

/* 左右角色巨幅全身立绘铺在全屏左右两侧，中央算分框悬浮于屏幕中上方 */
.arena-combatants-stage {
  position: absolute !important;
  inset: 0 !important;
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  padding: 0 3vw 0 !important;
  pointer-events: none;
}

.combatant-box {
  height: 84vh !important;
  justify-content: flex-end;
  pointer-events: auto;
  padding-bottom: 12px;
}

.combatant-sprite {
  height: 80vh !important;
  max-height: 82vh !important;
  width: auto;
  object-fit: contain;
  object-position: bottom center;
  transform-origin: bottom center;
  filter: drop-shadow(0 16px 36px rgba(0, 0, 0, 0.92));
}

.combatant-tag {
  position: absolute;
  bottom: 24px;
  z-index: 18;
  font-size: 13px !important;
  padding: 4px 16px !important;
  background: rgba(12, 8, 20, 0.86) !important;
  border: 1px solid rgba(251, 191, 36, 0.55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.75);
}

/* 中央计分框悬浮在手牌正上方、屏幕中上部，完全无遮挡 */
.center-abacus-hud {
  align-self: flex-start !important;
  margin-top: 14vh !important;
  margin-bottom: 0 !important;
  padding: 12px 24px !important;
  background: rgba(16, 11, 24, 0.86) !important;
  backdrop-filter: blur(8px);
  border: 2px solid rgba(251, 191, 36, 0.42) !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.78) !important;
  position: relative;
  z-index: 22;
  pointer-events: auto;
}

/* 8 张扑克手牌 + 出牌/弃牌按钮 直接叠放在全屏战斗舞台正下方中央 */
.classic-poker-hand-section {
  position: fixed !important;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 32 !important;
  width: auto;
  max-width: 96vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px !important;
  padding: 0 !important;
  pointer-events: none;
}

.poker-hand-fan,
.poker-bottom-bar {
  pointer-events: auto;
}

/* 角色与 BOSS 实时语音台词气泡 */
.combatant-speech-bubble {
  position: absolute;
  top: 6vh;
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  max-width: 280px;
  padding: 8px 15px;
  border-radius: 14px;
  background: rgba(18, 13, 28, 0.95);
  border: 1.5px solid #fde047;
  color: #fef9c3;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.38;
  text-align: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.88);
  z-index: 45;
  pointer-events: none;
  animation: speechPopIn 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.combatant-speech-bubble.boss-bubble {
  border-color: #f43f5e;
  color: #ffe4e6;
}

@keyframes speechPopIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.9); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* 鼠标悬浮在主角身上显示被动技能卡片 */
.combatant-hover-card {
  display: none;
  position: absolute;
  bottom: 66px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 11, 22, 0.96);
  border: 1.5px solid rgba(251, 191, 36, 0.75);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.88);
  z-index: 60;
  text-align: left;
  pointer-events: none;
}

.combatant-box:hover .combatant-hover-card {
  display: block;
}

.hover-card-title {
  font-size: 12px;
  font-weight: 900;
  color: #fde047;
  margin-bottom: 4px;
}

.combatant-hover-card p {
  font-size: 11.5px;
  color: #f1f5f9;
  line-height: 1.38;
}

/* 右上角铜钱与牌型按钮 */
.top-coin-pill {
  padding: 4px 11px !important;
  font-size: 13px !important;
  border-radius: 99px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde047;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.top-synergy-btn strong {
  color: #fde047;
  margin-left: 3px;
}

/* 底部操作栏居中排布 */
.poker-bottom-bar.centered-only {
  justify-content: center !important;
}

/* ================= 9. 全屏虚化店铺背景 + 框外巨幅老板娘芙莉莲 + 黄金宝箱货架 ================= */
.above-cards-relics {
  pointer-events: auto;
  margin-bottom: -8px;
  z-index: 38;
}

.above-cards-relics .joker-hover-pop {
  top: auto !important;
  bottom: calc(100% + 10px) !important;
}

.joker-chip-card.icon-only-slot {
  width: 72px !important;
  height: 72px !important;
  min-height: 72px !important;
  padding: 4px !important;
  border-radius: 14px !important;
}

/* 全屏商店场景：铺满 100vw x 100vh */
.fullscreen-shop-scene {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100 !important;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 20px 3.5vw 20px 0 !important;
  overflow: hidden;
  background: #0d0814 !important;
}

.fullscreen-shop-scene.hidden {
  display: none !important;
}

/* 1. 全屏店铺背景（加景深虚化） */
.shop-blurred-store-bg {
  position: absolute;
  inset: -24px;
  background-image: url("../../assets/alchemist/shop_interior_bg.webp?v=19");
  background-size: cover;
  background-position: center;
  filter: blur(7px) brightness(0.68) saturate(1.15);
  transform: scale(1.06);
  z-index: 1;
  pointer-events: none;
}

/* 2. 左侧：完全脱离边框、到大腿的大幅半身像老板娘芙莉莲 */
.shopkeeper-free-stage {
  position: fixed;
  left: -1vw;
  bottom: 0;
  width: 46vw;
  height: 98vh;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.shopkeeper-fullpage-img {
  height: 90vh;
  max-height: 92vh;
  width: auto;
  max-width: 48vw;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 22px 48px rgba(0, 0, 0, 0.94));
  transform-origin: bottom center;
  animation: shopkeeperBreath 3.5s ease-in-out infinite;
}

@keyframes shopkeeperBreath {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.01); }
}

.shopkeeper-dialogue-bubble {
  position: absolute;
  top: 6vh;
  left: 16vw;
  width: min(32vw, 390px);
  background: rgba(18, 12, 28, 0.94);
  backdrop-filter: blur(8px);
  border: 2px solid #fde047;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85);
  z-index: 30;
  pointer-events: auto;
}

.shopkeeper-name-tag {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 900;
  color: #181311;
  background: linear-gradient(90deg, #fde047, #f59e0b);
  padding: 3px 12px;
  border-radius: 99px;
  margin-bottom: 6px;
}

.shopkeeper-dialogue-bubble p {
  font-size: 13.5px;
  color: #fef9c3;
  line-height: 1.48;
  font-weight: 700;
}

/* 3. 右侧：完整无裁切的四边雕金宝箱内胆（外侧黑边已彻底抠除为透明，宝物也抠除黑底直接摆在红色天鹅绒上！） */
.treasure-chest-modal {
  position: relative;
  z-index: 20;
  width: 56vw !important;
  max-width: 810px !important;
  max-height: 92vh !important;
  overflow-y: auto;
  background-color: transparent !important;
  background-image: url("../../assets/alchemist/treasure_chest_panel.webp?v=26") !important;
  background-size: 100% 100% !important;
  background-position: center !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.92));
  padding: 46px 56px 40px !important;
}

.treasure-chest-lid-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.treasure-chest-lid-bar .shop-reward-summary {
  margin: 0 !important;
  padding: 5px 14px !important;
  font-size: 12.5px !important;
  background: rgba(15, 6, 12, 0.68) !important;
  border-radius: 99px !important;
  border: none !important;
}

.shop-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.shop-header-right .shop-wallet-badge,
.shop-header-right .tool-orb-btn {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

/* 商店内已装备宝物一键出售条 */
.shop-owned-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(14, 6, 12, 0.62);
  padding: 8px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.owned-strip-label {
  font-size: 12px;
  font-weight: 800;
  color: #e2e8f0;
  white-space: nowrap;
}

.shop-owned-relics-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.owned-empty-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.shop-owned-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(24, 14, 30, 0.9);
  padding: 4px 8px 4px 5px;
  border-radius: 99px;
}

.shop-owned-chip img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
}

.owned-chip-name {
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
}

.shop-sell-chip-btn {
  appearance: none;
  border: none;
  border-radius: 99px;
  background: rgba(225, 29, 72, 0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  cursor: pointer;
}

.shop-sell-chip-btn:hover {
  background: #f43f5e;
}

.shopkeeper-shelves {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shop-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* 去掉外层小卡片框，让宝物图标直接摆在天鹅绒软垫上 */
.shop-visual-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  transition: transform 0.16s ease;
}

.shop-visual-card:hover {
  transform: translateY(-6px) scale(1.04);
}

.shop-visual-card.is-sold {
  opacity: 0.42;
  filter: grayscale(0.6);
}

.shop-card-icon-frame {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 18px;
  overflow: visible;
  border: none !important;
  background: transparent !important;
}

/* ================= 白 / 蓝 / 紫 / 红 四档品质配色系统（无黑底，直接散发柔和品质光晕） ================= */
.rarity-frame-white {
  background: radial-gradient(circle, rgba(248, 250, 252, 0.22) 0%, transparent 72%) !important;
  box-shadow: none !important;
}

.rarity-frame-blue {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.34) 0%, transparent 72%) !important;
  box-shadow: none !important;
}

.rarity-frame-purple {
  background: radial-gradient(circle, rgba(192, 132, 252, 0.42) 0%, transparent 72%) !important;
  box-shadow: none !important;
}

.rarity-frame-red {
  background: radial-gradient(circle, rgba(251, 113, 133, 0.5) 0%, transparent 72%) !important;
  box-shadow: none !important;
}

.joker-chip-card.rarity-white {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.75), 0 0 0 2px rgba(226, 232, 240, 0.72) !important;
  border-color: transparent !important;
}

.joker-chip-card.rarity-blue {
  box-shadow: 0 8px 22px rgba(56, 189, 248, 0.35), 0 0 0 2px #38bdf8 !important;
  border-color: transparent !important;
}

.joker-chip-card.rarity-purple {
  box-shadow: 0 8px 24px rgba(192, 132, 252, 0.42), 0 0 0 2.5px #c084fc !important;
  border-color: transparent !important;
}

.joker-chip-card.rarity-red {
  box-shadow: 0 10px 28px rgba(251, 113, 133, 0.55), 0 0 0 2.5px #fb7185 !important;
  border-color: transparent !important;
}

.shop-big-item-img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.85));
}

.shop-rarity-tag,
.rarity-pill {
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 99px;
  line-height: 1.2;
}

.shop-rarity-tag {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 4;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.75);
}

.pill-white {
  background: #e2e8f0;
  color: #0f172a;
}

.pill-blue {
  background: #0284c7;
  color: #f0f9ff;
}

.pill-purple {
  background: #9333ea;
  color: #faf5ff;
}

.pill-red {
  background: #e11d48;
  color: #fff1f2;
}

.text-white { color: #f8fafc !important; }
.text-blue { color: #7dd3fc !important; }
.text-purple { color: #d8b4fe !important; }
.text-red { color: #fda4af !important; }

.shop-big-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-item-short-name {
  font-size: 15px;
  font-weight: 900;
  margin-top: 2px;
}

.shop-item-short-desc {
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.35;
  min-height: 32px;
}



/* ================= 10. 💡提示按钮 + 点按弹出说明卡片 + 窄屏 (≤720px) 适配 ================= */
.poker-main-btn.hint {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fde68a;
}

.poker-main-btn.hint:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.34);
  transform: translateY(-2px);
}

/* 手牌溢出时：safe center 保证最左侧的牌也能滚动到；不支持 safe 的浏览器用首尾 auto 外边距兜底居中 */
.poker-hand-fan {
  justify-content: flex-start;
  justify-content: safe center;
}

.poker-hand-fan > .classic-playing-card:first-child {
  margin-left: auto;
}

.poker-hand-fan > .classic-playing-card:last-child {
  margin-right: auto;
}

/* 触屏/窄屏点按切换的说明卡片（桌面端仍为鼠标悬浮） */
.joker-chip-card.icon-only-slot.pop-open .joker-hover-pop {
  display: block;
}

.combatant-box.show-passive .combatant-hover-card {
  display: block;
}

@media (max-width: 720px) {
  /* 顶部状态栏：不再裁切右侧按钮，改为可横向滑动 */
  .alchemist-topbar {
    justify-content: flex-start !important;
    gap: 6px;
    padding: 0 8px !important;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .alchemist-topbar::-webkit-scrollbar {
    display: none;
  }

  .top-left-group,
  .top-stage-pill,
  .top-right-group {
    flex-shrink: 0;
    gap: 5px !important;
  }

  .icon-hud-btn,
  .top-coin-pill,
  .act-badge,
  .boss-tag {
    padding: 4px 8px !important;
    font-size: 11.5px !important;
  }

  .top-stage-pill {
    padding: 4px 10px;
  }

  .top-hearts-bar .heart-gem {
    font-size: 14px;
  }

  /* 手牌区铺满屏宽，便于横向滑动 */
  .classic-poker-hand-section {
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: 100vw;
    bottom: 8px;
  }

  .poker-hand-fan {
    width: 100%;
    padding: 16px 8px 4px;
  }

  .classic-playing-card {
    width: 62px;
    height: 92px;
    border-width: 2px;
    border-radius: 7px;
  }

  .classic-playing-card + .classic-playing-card {
    margin-left: -12px;
  }

  .classic-playing-card:hover {
    transform: translateY(-5px);
  }

  .classic-playing-card.selected {
    transform: translateY(-14px);
  }

  .poker-corner-tl {
    top: 5px;
    left: 6px;
  }

  .poker-rank-num {
    font-size: 16px;
  }

  .poker-suit-small {
    font-size: 12px;
    margin-top: 0;
  }

  .poker-big-pip {
    right: 6px;
    bottom: 5px;
    font-size: 32px;
  }

  .poker-face-portrait {
    left: 18px;
    top: 6px;
    width: calc(100% - 24px);
    height: calc(100% - 12px);
  }

  .poker-chip-tag {
    font-size: 9px;
  }

  .facedown-seal-badge {
    font-size: 8.5px;
    padding: 1px 4px;
    bottom: 5px;
  }

  .bottom-center-actions {
    gap: 8px;
  }

  .poker-main-btn,
  .poker-main-btn.play {
    padding: 9px 14px;
    font-size: 13px;
  }

  .joker-chip-card.icon-only-slot {
    width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
  }

  .joker-slots-row {
    gap: 8px;
  }
}

/* 选中但不计分的陪打牌：半透明 + 「不计分」角标 */
.classic-playing-card.selected.non-scoring {
  opacity: 0.55;
  filter: saturate(0.5);
}

.classic-playing-card.selected.non-scoring::after {
  content: '不计分';
  position: absolute;
  inset: auto;
  border: none;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  font-size: 10px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(15, 10, 25, 0.85);
  color: #e2e8f0;
  white-space: nowrap;
  pointer-events: none;
  z-index: 6;
}

/* ================= 11. 首次「边做边学」新手引导：聚光灯 + 一句短提示 + 手指 ================= */
.tut-layer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
}

.tut-spot {
  position: fixed;
  border-radius: 14px;
  box-shadow: 0 0 0 200vmax rgba(6, 4, 10, 0.72);
  border: 3px solid var(--gold-accent);
  animation: tutSpotPulse 1.2s ease-in-out infinite;
}

@keyframes tutSpotPulse {
  0%, 100% { outline: 0 solid rgba(245, 158, 11, 0.55); outline-offset: 0; }
  50% { outline: 8px solid rgba(245, 158, 11, 0); outline-offset: 6px; }
}

.tut-bubble {
  position: fixed;
  pointer-events: none;
  max-width: min(320px, calc(100vw - 16px));
  padding: 10px 16px;
  border-radius: 14px;
  background: #fff7e6;
  color: #2b1608;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: tutBubbleIn 0.25s ease;
}

@keyframes tutBubbleIn {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.tut-hand {
  position: fixed;
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6));
  animation: tutHandTap 1s ease-in-out infinite;
}

.tut-hand.flip {
  animation-name: tutHandTapDown;
}

@keyframes tutHandTap {
  0%, 100% { transform: translateY(10px); }
  50% { transform: translateY(0) scale(0.92); }
}

@keyframes tutHandTapDown {
  0%, 100% { transform: rotate(180deg) translateY(10px); }
  50% { transform: rotate(180deg) translateY(0) scale(0.92); }
}

.tut-layer.is-info .tut-hand {
  display: none;
}

/* 位置算好之前先隐藏，避免首帧闪在左上角 */
.tut-layer:not(.ready) .tut-spot,
.tut-layer:not(.ready) .tut-bubble,
.tut-layer:not(.ready) .tut-hand,
.tut-layer.tut-waiting .tut-spot,
.tut-layer.tut-waiting .tut-bubble,
.tut-layer.tut-waiting .tut-hand {
  visibility: hidden;
}

.tut-text {
  display: block;
}

/* 「跳过教程」做成气泡里的一个小链接，不占屏幕角落、不挡按钮 */
.tut-skip {
  display: block;
  margin: 4px auto 0;
  pointer-events: auto;
  appearance: none;
  background: none;
  border: none;
  color: #8a6a4a;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  cursor: pointer;
  text-decoration: underline;
}

/* 引导中禁用悬浮说明卡，避免挡住聚光目标 */
body.tut-running .combatant-hover-card,
body.tut-running .joker-hover-pop {
  display: none !important;
}

/* ================= 12. 「玩法说明」速查卡（只列要点，不自动弹出） ================= */
.howto-modal-card {
  width: min(460px, 95vw);
}

.howto-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  line-height: 1.45;
  color: #e2e8f0;
}

.howto-list li {
  padding-left: 1.2em;
  position: relative;
}

.howto-list li::before {
  content: '•';
  position: absolute;
  left: 0.2em;
  color: var(--gold-accent);
}

.howto-list b {
  color: #fde68a;
}

.howto-footer {
  display: flex;
  justify-content: center;
}

/* 窄屏：中间算分框原先被两侧立绘挤出屏幕，改为两侧列可收缩，保证算分框与魔物都在可视区 */
@media (max-width: 720px) {
  .arena-combatants-stage {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    padding: 0 4px !important;
  }

  .combatant-box {
    min-width: 0;
  }

  .combatant-tag {
    white-space: nowrap;
  }
}
