:root {
  --bg: #0d0b1a;
  --bg2: #141030;
  --card: #1c1740;
  --card-hover: #241d52;
  --border: #3a2f6b;
  --text: #e8e6ff;
  --muted: #8b86b5;
  --accent: #a855f7;
  --gold: #facc15;
}

/* hidden 属性必须生效：否则被 display:flex 等覆盖后，面板会关不掉 */
[hidden] { display: none !important; }

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

body {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at 20% 0%, var(--bg2), var(--bg) 70%);
  color: var(--text);
  min-height: 100vh;
}

/* ===== 顶栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 11, 26, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 20px;
}
.logo { font-size: 20px; font-weight: 800; color: var(--gold); letter-spacing: 1px; }
.nav { display: flex; gap: 6px; flex: 1; }
.nav-btn {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: all 0.2s;
}
.nav-btn:hover { color: var(--text); background: var(--card); }
.nav-btn.active { color: var(--gold); background: var(--card); border-color: var(--border); }
.player-info { display: flex; align-items: center; gap: 14px; }
.coin { color: var(--gold); font-weight: 600; }
.player-name { color: var(--text); }
.mute-btn {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 9px; font-size: 15px; cursor: pointer;
  line-height: 1; transition: all 0.2s;
}
.mute-btn:hover { background: rgba(255, 255, 255, 0.14); transform: scale(1.08); }

/* ===== 视图 ===== */
.view { display: none; padding: 24px 20px; max-width: 1200px; margin: 0 auto; }
.view.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view-title { font-size: 24px; margin-bottom: 20px; }

/* ===== 主界面（炫酷背景） ===== */
#view-home {
  position: relative;
  max-width: none;
  border-radius: 0;
  overflow: hidden;
  min-height: calc(100dvh - 57px);
  background:
    linear-gradient(rgba(13, 11, 26, 0.72), rgba(13, 11, 26, 0.92)),
    url("../assets/home-bg.png") center / cover fixed;
}
/* 动态光斑 */
#view-home::before,
#view-home::after {
  content: "";
  position: absolute;
  width: 460px; height: 460px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
  animation: drift 13s ease-in-out infinite;
}
#view-home::before {
  top: -140px; left: -140px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.9), transparent 70%);
}
#view-home::after {
  bottom: -140px; right: -140px;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.8), transparent 70%);
  animation-delay: -6.5s;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(70px, 50px) scale(1.18); }
}
.home-hero {
  position: relative; z-index: 1;
  max-width: 1080px; margin: 12px auto 28px;
  text-align: center; padding: 64px 20px;
  background: rgba(13, 11, 26, 0.42);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.hero-title h1 { font-size: 56px; color: var(--gold); text-shadow: 0 0 30px rgba(250,204,21,0.4); }
.hero-sub { color: var(--muted); margin: 8px 0 24px; font-size: 16px; }
.hero-menu { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-btn {
  padding: 14px 32px; font-size: 16px; font-weight: 700;
  border: none; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(168,85,247,0.4); }
.hero-btn.secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.home-news {
  position: relative; z-index: 1;
  max-width: 1080px; margin: 0 auto;
  background: rgba(28, 23, 64, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px; padding: 20px 24px;
}
.home-news h2 { font-size: 18px; margin-bottom: 12px; color: var(--gold); }
.home-news li { margin: 6px 0; color: var(--muted); }
.home-news b { color: var(--text); }

/* ===== 图鉴 ===== */
.roster-tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.tab-btn {
  padding: 10px 22px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--muted); cursor: pointer; font-size: 15px; font-weight: 600;
}
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.char-panel { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.char-header { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.char-avatar {
  width: 72px; height: 72px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 40px; background: linear-gradient(135deg, var(--c1), var(--c2));
  overflow: hidden; position: relative;
}
.char-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.char-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.char-header h3 { font-size: 22px; }
.char-header small { color: var(--muted); font-size: 14px; margin-left: 6px; }
.char-tags { display: flex; gap: 6px; margin: 8px 0; }
.char-tags span {
  font-size: 12px; padding: 3px 10px; border-radius: 20px;
  background: rgba(255,255,255,0.08); color: var(--muted);
}
.char-hp { color: var(--gold); font-weight: 700; }
.char-desc { color: var(--muted); margin-bottom: 16px; line-height: 1.6; }
.char-panel h4 { margin: 10px 0; color: var(--gold); }

/* ===== 卡牌 ===== */
.card-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.card {
  width: 200px; height: 300px; perspective: 800px; cursor: pointer;
}
.card-frame {
  width: 100%; height: 100%;
  border-radius: 14px; padding: 10px;
  background: linear-gradient(160deg, var(--card-color), #0d0b1a);
  border: 2px solid var(--type-color, #888);
  display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.card:hover .card-frame {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px var(--type-color);
}
.card-top { display: flex; justify-content: space-between; align-items: center; }
.card-cost, .card-cd {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  background: var(--type-color); color: #fff;
}
.card-cd { background: rgba(0,0,0,0.5); font-size: 10px; }
.card-art {
  flex: 1; margin: 8px 0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 48px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}
.card-name { font-weight: 800; text-align: center; font-size: 16px; }
.card-type { text-align: center; font-size: 12px; color: var(--type-color); font-weight: 700; margin: 2px 0; }
.card-desc {
  font-size: 11px; color: var(--muted); text-align: center; line-height: 1.4;
  overflow: hidden; flex: 1;
}
.card-stats { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-top: 6px; }
.card-dmg { color: #f87171; }
.card-cooldown { color: var(--muted); }

/* ===== 商店 ===== */
.shop-balance { margin-bottom: 18px; color: var(--muted); }
.shop-balance b { color: var(--gold); font-size: 18px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.shop-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; text-align: center; transition: transform 0.2s;
}
.shop-item:hover { transform: translateY(-4px); border-color: var(--c); }
.shop-icon { font-size: 40px; margin-bottom: 10px; }
.shop-icon.char-icon {
  width: 72px; height: 72px; margin: 0 auto 10px;
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(135deg, var(--c), #111);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; justify-content: center;
}
.shop-icon.char-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-item h4 { margin-bottom: 6px; }
.shop-desc { font-size: 12px; color: var(--muted); min-height: 32px; margin-bottom: 12px; }
.buy-btn {
  width: 100%; padding: 10px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, var(--c), var(--c)); color: #fff;
  font-weight: 700; cursor: pointer; transition: opacity 0.2s;
}
.buy-btn:hover { opacity: 0.9; }
.buy-btn:disabled { opacity: 0.5; cursor: default; }

/* ===== PVP ===== */
.pvp-select { margin-bottom: 20px; }
.pvp-select label { display: block; margin-bottom: 10px; color: var(--muted); }
.pvp-char-select { display: flex; gap: 12px; flex-wrap: wrap; }
.pvp-char {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 24px; border-radius: 14px; border: 2px solid var(--border);
  background: var(--card); color: var(--text); cursor: pointer; transition: all 0.2s;
}
.pvp-char:hover { border-color: var(--c); transform: translateY(-3px); }
.pvp-char .avatar {
  font-size: 34px; width: 48px; height: 48px; border-radius: 12px;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.pvp-char .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pvp-char small { color: var(--muted); }
/* 未解锁角色：灰暗锁定样式 */
.pvp-char.locked {
  position: relative; filter: grayscale(0.9) brightness(0.6);
  border-style: dashed; border-color: var(--muted); cursor: pointer;
}
.pvp-char.locked:hover { transform: translateY(-3px); border-color: var(--gold); filter: grayscale(0.6) brightness(0.8); }
.char-lock {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0, 0, 0, 0.75); color: var(--gold);
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--gold); letter-spacing: 0.5px;
}
.lock-tip { display: block; margin-top: 4px; font-size: 11px; color: var(--gold); }
.char-unlock {
  display: inline-block; margin-bottom: 10px; font-size: 13px; font-weight: 700;
  color: var(--gold); background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 14px;
}

.pvp-arena { margin-top: 20px; }
.hidden { display: none !important; }
.pvp-enemy, .pvp-me { display: flex; justify-content: center; }
.enemy-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 18px; min-width: 260px;
}
.enemy-card .avatar {
  font-size: 30px; width: 44px; height: 44px; border-radius: 10px;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.enemy-card .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hpbar { flex: 1; height: 12px; background: rgba(255,255,255,0.1); border-radius: 6px; overflow: hidden; }
.hpbar-fill {
  width: 100%; height: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80); border-radius: 6px;
  transition: width 0.4s;
}
.hp-num { font-size: 12px; color: var(--muted); }
.pvp-center { margin: 16px auto; max-width: 500px; }
.pvp-log {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 12px; max-height: 92px; overflow-y: auto;
  font-size: 12px; flex: 0 0 auto;
}
.pvp-log p { margin: 2px 0; color: var(--muted); }
.log-placeholder { color: var(--muted); text-align: center; }

.pvp-me { margin-top: 12px; }
.me-card { border-color: var(--accent); }

.pvp-hand {
  display: flex; gap: 8px; justify-content: flex-start; align-items: flex-end;
  flex-wrap: nowrap; overflow-x: auto;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03); border: 1px dashed var(--border); border-radius: 12px;
  flex: 0 0 auto;
}
/* 手牌居中，但溢出时可从左侧滚动（避免 justify-content:center 把左侧卡牌挤到滚动区外，导致最左边的普攻看不见） */
.pvp-hand .hand-slot:first-child { margin-left: auto; }
.pvp-hand .hand-slot:last-child { margin-right: auto; }
.card.played { animation: playedAnim 0.6s ease; }
@keyframes playedAnim {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-40px) scale(1.2); opacity: 0.9; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.pvp-actions { text-align: center; margin-top: 16px; }
.pvp-end {
  padding: 12px 40px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), #f59e0b); color: #1a1a1a;
  font-weight: 800; font-size: 15px; cursor: pointer;
}

@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; justify-content: space-between; }
  .nav-btn { flex: 1; padding: 8px 4px; font-size: 12px; }
  .card-grid { justify-content: center; }
  .hero-title h1 { font-size: 40px; }
}

/* ===== AI 对战准备 ===== */
.ai-prep { display: flex; flex-direction: column; align-items: center; padding: 30px 0; gap: 18px; }
.ai-prep-label { color: var(--muted); font-size: 15px; }
.ai-prep-note { color: var(--muted); font-size: 13px; }
.pvp-char.active { border-color: var(--gold); box-shadow: 0 0 20px rgba(250,204,21,0.25); }
.match-start-btn {
  padding: 14px 54px; font-size: 17px; font-weight: 800; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.match-start-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(168,85,247,0.4); }
.match-start-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ===== 战斗（全屏自适应，我方左上 / 敌方右上） ===== */
#view-pvp {
  position: relative;
  height: calc(100dvh - 57px);
  padding: 8px 14px;
  overflow: hidden;
}
#view-pvp.active { display: flex; }
.battle-arena {
  flex: 1; width: 100%; min-width: 0; max-width: 1100px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 8px; min-height: 0;
}
.battle-round {
  text-align: center; font-size: 15px; font-weight: 700;
  color: var(--gold); padding: 4px 0; flex: 0 0 auto;
}
.battle-board {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: 10px; align-items: center;
}
.arena-side { display: flex; min-width: 0; }
.me-side { justify-content: flex-start; }
.foe-side { justify-content: flex-end; }
.arena-side .battle-char { width: 100%; }
.battle-char {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; min-width: 0;
}
.battle-char.me-battle { border-color: var(--accent); }
.battle-info { flex: 1; min-width: 0; }
.battle-info b { font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.battle-info small { color: var(--muted); font-size: 11px; }
.battle-vs {
  font-size: 26px; font-weight: 900; color: var(--gold);
  text-shadow: 0 0 14px rgba(250,204,21,0.6);
}
.buff-row { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; min-height: 16px; }
.buff-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 10px;
  background: rgba(255,255,255,0.08); color: var(--text);
}

/* 小头像 */
.mini-avatar {
  width: 46px; height: 46px; border-radius: 12px; overflow: hidden; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: linear-gradient(135deg, var(--card-hover), var(--bg2));
  border: 1px solid var(--border);
}
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.arena-side .hpbar { height: 10px; margin: 4px 0; }
.arena-side .hp-num { font-size: 11px; }

/* 窄屏：纵向排列，保证放得下 */
@media (max-width: 760px) {
  .battle-board {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "me foe" "stage stage";
    align-items: stretch;
  }
  .me-side { grid-area: me; }
  .foe-side { grid-area: foe; }
  .arena-stage { grid-area: stage; height: auto; min-height: 150px; }
  .stage-side { width: 96px; }
  .stage-side .card { width: 96px; height: 136px; }
  .hand-slot .card { width: 96px; height: 136px; }

  /* 缩小战斗区各元素，给手牌留出空间 */
  .battle-char { padding: 6px 8px; gap: 6px; }
  .mini-avatar { width: 34px; height: 34px; font-size: 18px; }
  .battle-info b { font-size: 12px; }
  .battle-info small { font-size: 9px; }
  .battle-vs { font-size: 20px; }
  .arena-side .hpbar { height: 7px; margin: 3px 0; }
  .arena-side .hp-num { font-size: 10px; }
  .battle-round { font-size: 13px; padding: 2px 0; }
  .battle-arena { gap: 4px; }
  .pvp-log { max-height: 56px; font-size: 11px; padding: 5px 10px; }
  #view-pvp { padding: 6px 8px; }
}

/* 手牌状态 */
.hand-slot { position: relative; flex: 0 0 auto; }
.hand-slot .card { width: 118px; height: 168px; }
.hand-slot .card-frame { font-size: 11px; padding: 6px; }
.hand-slot .card-art { font-size: 24px; margin: 5px 0; }
.hand-slot .card-desc { font-size: 8px; }
.hand-slot .card-name { font-size: 12px; }
.hand-slot .card-top .card-cost, .hand-slot .card-cd { width: 22px; height: 22px; font-size: 12px; }
.hand-slot .card-stats { font-size: 10px; margin-top: 4px; }
.card.playable .card-frame {
  cursor: pointer; box-shadow: 0 0 14px var(--type-color);
  animation: playablePulse 1.6s ease-in-out infinite;
}
@keyframes playablePulse {
  0%, 100% { box-shadow: 0 0 8px var(--type-color); }
  50% { box-shadow: 0 0 20px var(--type-color); }
}
.card.on-cd .card-frame { filter: grayscale(0.7) brightness(0.6); }
.card.locked .card-frame { filter: grayscale(1) brightness(0.4); border-style: dashed; }
.card.used .card-frame { filter: grayscale(1) brightness(0.5); border-style: dashed; opacity: 0.7; }
.cd-badge {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 8px;
  background: rgba(0,0,0,0.75); color: #fff; pointer-events: none;
}
.cd-badge.locked-badge { background: #3b82f6; }
.cd-badge.used-badge { background: #6b7280; }

.pvp-empty { text-align: center; padding: 60px 0; color: var(--muted); display: flex; flex-direction: column; gap: 18px; align-items: center; }

/* ===== 出牌舞台（中间栏） ===== */
.arena-stage {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 12px 14px; min-height: 0; height: 100%;
  background: rgba(255,255,255,0.03); border: 1px dashed var(--border);
  border-radius: 14px;
}
.stage-side {
  width: 128px; min-height: 170px; display: flex; align-items: center; justify-content: center;
  position: relative; perspective: 600px;
}
/* 联机 Boss：队友 + 我的出牌放两行 */
.stage-col {
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.stage-col .stage-side { min-height: 0; }
.stage-side.ally .stage-empty {
  border-color: rgba(139, 92, 246, 0.45); color: #c4b5fd;
}
.stage-side .card { width: 128px; height: 178px; margin: 0; }
.stage-side .card-frame { padding: 7px; font-size: 11px; }
.stage-side .card-art { font-size: 26px; }
.stage-side .card-name { font-size: 12px; }
.stage-side .card-desc { font-size: 8px; }
.stage-side .card-top .card-cost, .stage-side .card-cd { width: 22px; height: 22px; font-size: 12px; }
.stage-empty {
  color: var(--muted); font-size: 12px; opacity: 0.6;
  border: 1px dashed rgba(255,255,255,0.15); border-radius: 10px;
  padding: 10px 14px;
}
.stage-vs {
  font-size: 24px; font-weight: 900; color: var(--gold);
  text-shadow: 0 0 16px rgba(250,204,21,0.6);
  animation: stageVsPulse 1.6s ease-in-out infinite;
}
@keyframes stageVsPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.15); opacity: 1; }
}
.card.stage-pop { animation: stagePop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes stagePop {
  0% { transform: rotateY(90deg) scale(0.4); opacity: 0; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

/* ===== 游戏名 & 无星头像 ===== */
.logo { display: flex; align-items: center; gap: 8px; }
.logo-avatar {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--gold); box-shadow: 0 0 10px rgba(250,204,21,0.4);
}
.hero-logo img {
  width: 96px; height: 96px; border-radius: 24px; object-fit: cover;
  border: 3px solid var(--gold); box-shadow: 0 0 40px rgba(168,85,247,0.6);
  margin-bottom: 12px; animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ===== 战斗特效 ===== */
#view-pvp { position: relative; }
.float-dmg {
  position: absolute; z-index: 60; pointer-events: none;
  font-size: 26px; font-weight: 900; color: #ff6b6b;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  animation: floatUp 1.1s ease-out forwards;
}
@keyframes floatUp {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  15% { transform: translateY(-8px) scale(1.3); opacity: 1; }
  100% { transform: translateY(-70px) scale(1); opacity: 0; }
}
.hit-shake { animation: hitShake 0.45s ease; }
@keyframes hitShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 2px); }
  40% { transform: translate(6px, -2px); }
  60% { transform: translate(-4px, -1px); }
  80% { transform: translate(4px, 1px); }
}
.hit-flash { animation: hitFlash 0.5s ease; }
@keyframes hitFlash {
  0%, 100% { filter: brightness(1); }
  30% { filter: brightness(2.2) saturate(0.3); }
}
.attack-flash { animation: attackFlash 0.55s ease; }
@keyframes attackFlash {
  0%, 100% { box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
  30% { box-shadow: 0 0 30px 10px rgba(255,255,255,0.85), 0 0 60px var(--type-color, #fff); transform: scale(1.08); }
}
.shockwave {
  position: absolute; z-index: 55; pointer-events: none;
  top: 50%; left: 50%; width: 40px; height: 40px;
  border: 6px solid var(--sw, #fbbf24); border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: shockExpand 0.7s ease-out forwards;
}
@keyframes shockExpand {
  0% { width: 40px; height: 40px; opacity: 1; }
  100% { width: 900px; height: 900px; opacity: 0; }
}

/* 无星界：紫星连线切割屏幕 */
.wuxing-jie { position: absolute; inset: 0; z-index: 58; pointer-events: none; overflow: hidden; }
.wx-flash {
  position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.55), rgba(240, 171, 252, 0.15) 60%, transparent 78%);
  animation: wxFlash 0.65s ease-out forwards;
}
@keyframes wxFlash {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}
.wx-dot {
  position: absolute; border-radius: 50%;
  background: #e9d5ff;
  box-shadow: 0 0 14px #c084fc, 0 0 30px #a855f7;
  animation: wxDot 0.9s ease-out forwards;
}
@keyframes wxDot {
  0% { transform: scale(0); opacity: 0; }
  30% { transform: scale(1.8); opacity: 1; }
  100% { transform: scale(0.3); opacity: 0; }
}
.wx-beam {
  position: absolute; left: -10%; top: 0; width: 120%; height: 3px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.15) 18%, #c084fc 38%, #ffffff 50%, #c084fc 62%, rgba(168, 85, 247, 0.15) 82%, transparent);
  box-shadow: 0 0 5px 1px #c084fc, 0 0 16px 1px rgba(168, 85, 247, 0.9);
  animation: wxBeam 0.35s ease-in forwards;
}
.wx-beam.reverse { animation-name: wxBeamRev; animation-delay: 0.25s; }
.wx-beam.vertical {
  left: 50%; top: -10%; width: 3px; height: 120%;
  background: linear-gradient(180deg, transparent, rgba(168, 85, 247, 0.15) 18%, #c084fc 38%, #ffffff 50%, #c084fc 62%, rgba(168, 85, 247, 0.15) 82%, transparent);
  box-shadow: 0 0 5px 1px #c084fc, 0 0 16px 1px rgba(168, 85, 247, 0.9);
  animation-name: wxBeamH;
}
.wx-beam.vertical.reverse { animation-name: wxBeamHRev; }
@keyframes wxBeam {
  0% { transform: translateY(-8%); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(108vh); opacity: 1; }
}
@keyframes wxBeamRev {
  0% { transform: translateY(108vh); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-8%); opacity: 1; }
}
@keyframes wxBeamH {
  0% { transform: translateX(-8%); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateX(108vw); opacity: 1; }
}
@keyframes wxBeamHRev {
  0% { transform: translateX(108vw); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateX(-8%); opacity: 1; }
}

/* 无星本体：画面中央现身 */
.wx-caster {
  position: absolute; left: 50%; top: 50%;
  width: 120px; height: 120px;
  transform: translate(-50%, -50%) scale(0.2);
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(168, 85, 247, 0.9);
  box-shadow:
    0 0 30px rgba(168, 85, 247, 0.85),
    0 0 90px rgba(168, 85, 247, 0.5),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
  animation: wxCaster 1.9s ease-out forwards;
  z-index: 4;
}
.wx-caster img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes wxCaster {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
  14% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(0.7); opacity: 0; }
}
/* 紫焰巨手：无星从中央伸出手撕裂次元 */
.wx-hand {
  position: absolute; left: 50%; top: 50%;
  width: 260px; height: 260px;
  transform: translate(-50%, -50%) scale(0.25);
  filter: drop-shadow(0 0 25px rgba(168, 85, 247, 0.95)) drop-shadow(0 0 70px rgba(168, 85, 247, 0.6));
  animation: wxHand 1.7s ease-out forwards;
  z-index: 5;
}
.wx-hand img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(1.3) contrast(1.05);
}
@keyframes wxHand {
  0% { transform: translate(-50%, -50%) scale(0.25); opacity: 0.5; }
  12% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  32% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  62% { transform: translate(-50%, -50%) scale(2.6); opacity: 0.95; }
  100% { transform: translate(-50%, -50%) scale(4.6); opacity: 0; }
}
/* 撕裂光刃：交叉划开的次元裂缝 */
.wx-split {
  position: absolute; left: 50%; top: 50%;
  width: 130vmax; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9) 30%, #c084fc 50%, rgba(255, 255, 255, 0.9) 70%, transparent);
  box-shadow: 0 0 18px #c084fc, 0 0 50px #a855f7;
  animation: wxSplit 0.8s ease-in-out forwards;
  opacity: 0;
  z-index: 6;
}
@keyframes wxSplit {
  0% { transform: translate(-50%, -50%) rotate(var(--wx-sa, 0deg)) scaleX(0); opacity: 0; }
  30% { transform: translate(-50%, -50%) rotate(var(--wx-sa, 0deg)) scaleX(1); opacity: 1; }
  70% { transform: translate(-50%, -50%) rotate(calc(var(--wx-sa, 0deg) + 14deg)) scaleX(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(calc(var(--wx-sa, 0deg) + 14deg)) scaleX(1); opacity: 0; }
}

/* 小叶大剑：红蓝利刃沿对角线劈开屏幕（破坏性割裂） */
.dajian-fx { position: absolute; inset: 0; z-index: 58; pointer-events: none; overflow: hidden; }
.dj-flash {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 32% 42%, rgba(239, 68, 68, 0.5), transparent 55%),
    radial-gradient(circle at 68% 58%, rgba(59, 130, 246, 0.5), transparent 55%);
  animation: djFlash 0.6s ease-out forwards;
}
@keyframes djFlash {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}
/* 玻璃崩裂白闪：裂缝炸开瞬间的强闪 */
.dj-pop {
  position: absolute; inset: 0;
  background: #fff;
  animation: djPop 0.3s steps(2, end) forwards;
  opacity: 0;
}
@keyframes djPop {
  0% { opacity: 0; }
  25% { opacity: 0.9; }
  50% { opacity: 0; }
  75% { opacity: 0.6; }
  100% { opacity: 0; }
}
/* 全屏震动：刀刃劈入时的强烈冲击 */
.dj-shake { position: absolute; inset: 0; animation: djShake 0.6s ease; }
@keyframes djShake {
  0%, 100% { transform: translate(0, 0); }
  12% { transform: translate(-7px, 3px); }
  28% { transform: translate(6px, -3px); }
  44% { transform: translate(-5px, 2px); }
  60% { transform: translate(5px, -2px); }
  78% { transform: translate(-3px, 1px); }
}
/* 主刀光：沿对角线的利刃，尖端朝右，斜劈而过 */
.dj-blade {
  position: absolute; left: 0;
  width: 150vw; height: 9px;
  transform: translateY(-50%) rotate(var(--dj-rot, 45deg));
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.12) 18%, #ffffff 52%, #fecaca 78%, #ef4444 100%);
  clip-path: polygon(0 28%, 72% 0, 100% 50%, 72% 100%, 0 72%);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6), 0 0 34px 4px rgba(239, 68, 68, 0.8);
  animation: djBlade 0.4s ease-in forwards;
  opacity: 0;
}
@keyframes djBlade {
  0% { transform: translateY(-50%) rotate(var(--dj-rot, 45deg)) translateX(-150vw); opacity: 0; }
  6% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateY(-50%) rotate(var(--dj-rot, 45deg)) translateX(30vw); opacity: 0; }
}
/* 主裂痕：沿对角线撕开的锯齿裂缝（红蓝渐变） */
.dj-crack {
  position: absolute; left: 0;
  width: 150vw; height: 7px;
  transform: translateY(-50%) rotate(var(--dj-rot, 45deg));
  background: linear-gradient(90deg, #ef4444 0%, #fca5a5 22%, #ffffff 50%, #bfdbfe 78%, #3b82f6 100%);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7), 0 0 26px 2px rgba(239, 68, 68, 0.7), 0 0 26px 2px rgba(59, 130, 246, 0.7);
  transform-origin: left center;
  animation: djCrack 0.55s ease-out forwards;
  opacity: 0;
  clip-path: polygon(
    0% 50%, 3% 28%, 6% 62%, 9% 38%, 12% 72%, 15% 32%, 18% 56%, 21% 22%,
    24% 66%, 27% 42%, 30% 78%, 33% 28%, 36% 60%, 39% 38%, 42% 70%, 45% 30%,
    48% 58%, 51% 20%, 54% 64%, 57% 40%, 60% 74%, 63% 26%, 66% 60%, 69% 36%,
    72% 70%, 75% 30%, 78% 56%, 81% 24%, 84% 66%, 87% 40%, 90% 72%, 93% 32%,
    96% 60%, 100% 50%
  );
}
@keyframes djCrack {
  0% { transform: translateY(-50%) rotate(var(--dj-rot, 45deg)) scaleX(0); opacity: 0; }
  15% { opacity: 1; }
  55% { transform: translateY(-50%) rotate(var(--dj-rot, 45deg)) scaleX(1); opacity: 1; }
  100% { transform: translateY(-50%) rotate(var(--dj-rot, 45deg)) scaleX(1.05); opacity: 0; }
}
/* 分支裂痕：主裂缝上岔开的第二道裂纹，让破坏感更强 */
.dj-crack.branch {
  width: 55vw; height: 4px;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5), 0 0 18px 1px rgba(239, 68, 68, 0.5), 0 0 18px 1px rgba(59, 130, 246, 0.5);
}
/* 碎片：玻璃碎块沿裂痕迸出（带旋转的三角碎片） */
.dj-frag {
  position: absolute;
  animation: djFrag 0.65s ease-out forwards;
  opacity: 0;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}
.dj-frag.red { background: #fca5a5; box-shadow: 0 0 6px 1px #ef4444; }
.dj-frag.blue { background: #bfdbfe; box-shadow: 0 0 6px 1px #3b82f6; }
@keyframes djFrag {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--dj-dx), var(--dj-dy)) rotate(var(--dj-r, 0deg)) scale(0); opacity: 0; }
}
/* 小康黑洞：小康在画面中央施展黑洞，吞噬一切 */
.heitong-fx { position: absolute; inset: 0; z-index: 58; pointer-events: none; overflow: hidden; }
.ht-veil {
  position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(30, 3, 44, 0.65) 0%, rgba(12, 2, 26, 0.92) 55%, rgba(0, 0, 0, 0.98) 100%);
  animation: htVeil 1.9s ease-in-out forwards;
}
@keyframes htVeil {
  0% { opacity: 0; }
  12% { opacity: 1; }
  82% { opacity: 1; }
  100% { opacity: 0; }
}
.ht-hole {
  position: absolute; top: 50%; left: 50%;
  width: 360px; height: 360px;
  transform: translate(-50%, -50%) rotate(0deg);
  border-radius: 50%;
  background:
    radial-gradient(circle, #000 0%, #000 20%, transparent 22%),
    conic-gradient(from 0deg, #7c3aed, #f97316, #facc15, #a855f7, #7c3aed);
  -webkit-mask: radial-gradient(circle, transparent 20%, #000 21%, #000 32%, transparent 34%);
  mask: radial-gradient(circle, transparent 20%, #000 21%, #000 32%, transparent 34%);
  filter: blur(0.6px);
  animation: htHole 1.9s ease-in-out forwards;
  z-index: 2;
}
@keyframes htHole {
  0% { transform: translate(-50%, -50%) scale(0.05) rotate(0deg); opacity: 0; }
  18% { transform: translate(-50%, -50%) scale(0.8) rotate(45deg); opacity: 1; }
  55% { transform: translate(-50%, -50%) scale(1.05) rotate(180deg); opacity: 1; }
  82% { transform: translate(-50%, -50%) scale(1) rotate(270deg); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(0.6) rotate(330deg); opacity: 0; }
}
.ht-ring {
  position: absolute; top: 50%; left: 50%;
  width: 120px; height: 120px;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(249, 115, 22, 0.75);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(249, 115, 22, 0.6), inset 0 0 24px rgba(168, 85, 247, 0.45);
  animation: htRing 1.9s ease-out forwards;
  z-index: 2;
}
@keyframes htRing {
  0% { width: 40px; height: 40px; opacity: 0; }
  15% { opacity: 1; }
  70% { width: 520px; height: 520px; opacity: 0.6; }
  100% { width: 560px; height: 560px; opacity: 0; }
}
.ht-caster {
  position: absolute; left: 8%; bottom: 9%;
  width: 120px; height: 120px;
  transform: scale(0.15);
  transform-origin: center bottom;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(249, 115, 22, 0.85);
  box-shadow:
    0 0 24px rgba(249, 115, 22, 0.7),
    0 0 70px rgba(168, 85, 247, 0.55),
    inset 0 0 30px rgba(0, 0, 0, 0.55);
  animation: htCaster 1.9s ease-out forwards;
  z-index: 3;
}
.ht-caster img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes htCaster {
  0% { transform: scale(0.15); opacity: 0; }
  15% { transform: scale(1); opacity: 1; }
  45% { transform: scale(1.12); opacity: 1; }
  78% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}
.ht-part {
  position: absolute;
  transform: translate(-50%, -50%) rotate(0deg);
  border-radius: 50%;
  background: #e9d5ff;
  box-shadow: 0 0 10px #a855f7, 0 0 22px #7c3aed;
  animation: htPart 1.4s ease-in forwards;
  opacity: 0;
  z-index: 4;
}
.ht-part.orange {
  background: #fdba74;
  box-shadow: 0 0 10px #f97316, 0 0 22px #f97316;
}
@keyframes htPart {
  0% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  60% { opacity: 0.85; }
  100% {
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0) rotate(var(--ht-r, 180deg));
    opacity: 0;
  }
}
.ht-shake { position: absolute; inset: 0; animation: htShake 0.9s ease; }
@keyframes htShake {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-6px, 3px); }
  25% { transform: translate(5px, -3px); }
  40% { transform: translate(-4px, 2px); }
  55% { transform: translate(3px, -2px); }
  70% { transform: translate(-2px, 1px); }
}
/* 决战阶段横幅：血线告急，一击定胜负 */
.showdown-banner {
  position: absolute; top: 38%; left: 50%;
  transform: translate(-50%, -50%) scale(1.6);
  z-index: 70; text-align: center; pointer-events: none;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.92), rgba(59, 130, 246, 0.92));
  color: #fff; padding: 18px 36px; border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.4), 0 0 60px rgba(239, 68, 68, 0.6), 0 0 60px rgba(59, 130, 246, 0.6);
  font-size: 30px; font-weight: 900; letter-spacing: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  animation: showdownBanner 2.6s ease forwards;
}
.showdown-banner span {
  display: block; font-size: 14px; font-weight: 600;
  letter-spacing: 2px; margin-top: 8px; opacity: 0.95;
}
@keyframes showdownBanner {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}
.hand-slot .card.card-flyout {
  animation: cardFlyOut 0.5s cubic-bezier(0.55, -0.2, 0.65, 0.4) forwards;
}
@keyframes cardFlyOut {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-140px) scale(0.35) rotate(-8deg); opacity: 0; }
}

/* ===== 胜负播报 ===== */
.gameover-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 8, 22, 0.75); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.35s ease;
}
.gameover-overlay.show { opacity: 1; }
.gameover-box {
  width: 380px; max-width: 90vw; text-align: center;
  padding: 44px 30px; border-radius: 24px;
  background: linear-gradient(160deg, var(--card), var(--bg2));
  border: 2px solid var(--border);
  transform: scale(0.7); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.gameover-overlay.show .gameover-box { transform: scale(1); }
.gameover-box.win { border-color: var(--gold); box-shadow: 0 0 50px rgba(250,204,21,0.35); }
.gameover-box.lose { border-color: #ef4444; box-shadow: 0 0 50px rgba(239,68,68,0.3); }
.gameover-box.draw { border-color: var(--muted); }
.gameover-box .go-emoji {
  font-size: 72px; animation: goBounce 1s ease-in-out infinite;
}
@keyframes goBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-14px) scale(1.12); }
}
.gameover-box h2 {
  font-size: 42px; margin: 12px 0 10px; letter-spacing: 8px;
}
.gameover-box.win h2 { color: var(--gold); text-shadow: 0 0 30px rgba(250,204,21,0.6); }
.gameover-box.lose h2 { color: #ef4444; text-shadow: 0 0 30px rgba(239,68,68,0.6); }
.gameover-box.draw h2 { color: var(--muted); }
.gameover-box p { color: var(--muted); line-height: 1.8; margin-bottom: 24px; }
.reward-num {
  color: var(--gold); font-size: 22px; font-weight: 900;
  text-shadow: 0 0 16px rgba(250,204,21,0.6);
  animation: goBounce 0.9s ease-in-out infinite;
}
.go-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* 金币跳动 */
.coin-pop { animation: coinPop 0.6s ease; }
@keyframes coinPop {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.5); color: #fff; }
}

/* ===== 手机竖屏：整体 UI 缩小，手牌 5 张一屏内可见 ===== */
@media (max-width: 480px) {
  /* 顶栏 */
  .topbar-inner { padding: 6px 8px; gap: 8px; }
  .logo { font-size: 15px; }
  .logo-avatar { width: 22px; height: 22px; }
  .coin { font-size: 12px; }
  .player-info { gap: 8px; }
  .player-name { font-size: 12px; }
  .mute-btn { padding: 2px 7px; font-size: 13px; }
  .nav-btn { padding: 6px 2px; font-size: 11px; }

  /* 通用视图 */
  .view { padding: 12px 10px; }
  .view-title { font-size: 18px; margin-bottom: 12px; }

  /* 主界面 */
  .home-hero { padding: 26px 12px; margin: 8px auto 16px; }
  .hero-logo img { width: 64px; height: 64px; }
  .hero-title h1 { font-size: 30px; }
  .hero-sub { font-size: 12px; margin: 6px 0 16px; }
  .hero-btn { padding: 10px 18px; font-size: 14px; }
  .home-news { padding: 12px 14px; }
  .home-news h2 { font-size: 15px; }
  .home-news li { font-size: 12px; }

  /* 图鉴 */
  .roster-tabs { gap: 6px; margin-bottom: 12px; }
  .tab-btn { padding: 7px 14px; font-size: 13px; }
  .char-panel { padding: 14px; }
  .char-header { gap: 12px; margin-bottom: 10px; }
  .char-avatar { width: 52px; height: 52px; font-size: 28px; border-radius: 12px; }
  .char-header h3 { font-size: 17px; }
  .char-header small { font-size: 12px; }
  .char-desc { font-size: 13px; }
  .char-tags span { font-size: 11px; padding: 2px 8px; }

  /* 选角 */
  .pvp-char { padding: 10px 14px; }
  .pvp-char .avatar { width: 38px; height: 38px; font-size: 26px; }

  /* 商店 */
  .shop-item { padding: 14px; }
  .shop-icon { font-size: 30px; margin-bottom: 8px; }
  .shop-icon.char-icon { width: 52px; height: 52px; }
  .shop-desc { font-size: 11px; min-height: 28px; }

  /* 战斗 */
  #view-pvp { padding: 4px 6px; }
  .battle-char { padding: 5px 6px; gap: 5px; }
  .mini-avatar { width: 28px; height: 28px; font-size: 15px; border-radius: 8px; }
  .battle-info b { font-size: 11px; }
  .battle-info small { font-size: 8px; }
  .arena-side .hpbar { height: 6px; margin: 2px 0; }
  .arena-side .hp-num { font-size: 9px; }
  .battle-round { font-size: 12px; }
  .battle-vs { font-size: 18px; }
  .battle-board { gap: 4px; }
  .arena-stage { gap: 4px; min-height: 108px; padding: 4px 6px; }
  .stage-side { width: 62px; min-height: 96px; }
  .stage-side .card, .hand-slot .card { width: 62px; height: 90px; }
  .stage-side .card-frame, .hand-slot .card-frame {
    padding: 3px; border-radius: 8px; border-width: 1px;
  }
  .stage-side .card-art, .hand-slot .card-art { font-size: 14px; margin: 2px 0; }
  .stage-side .card-name, .hand-slot .card-name { font-size: 8px; }
  .stage-side .card-type, .hand-slot .card-type { font-size: 7px; margin: 1px 0; }
  .stage-side .card-desc, .hand-slot .card-desc { font-size: 5.5px; line-height: 1.25; }
  .stage-side .card-top .card-cost, .stage-side .card-cd,
  .hand-slot .card-top .card-cost, .hand-slot .card-cd { width: 14px; height: 14px; font-size: 8px; }
  .stage-side .card-stats, .hand-slot .card-stats { font-size: 7px; margin-top: 2px; }
  .pvp-log { max-height: 48px; font-size: 10px; padding: 4px 8px; border-radius: 8px; }
  .pvp-hand { gap: 4px; padding: 4px 6px; border-radius: 8px; }

  /* 结算弹窗 */
  .gameover-box { padding: 30px 18px; }
  .gameover-box .go-emoji { font-size: 52px; }
  .gameover-box h2 { font-size: 30px; letter-spacing: 5px; }
  .reward-num { font-size: 18px; }

  /* 在线对战 */
  .online-box { padding: 16px 14px; }
  .online-nick { flex-direction: column; align-items: stretch; gap: 6px; }
  .room-code b { font-size: 32px; letter-spacing: 8px; }
  .pick-avatar { width: 54px; height: 54px; font-size: 24px; border-radius: 12px; }
  .pick-slot { padding: 12px 6px; gap: 6px; }
  .pick-vs { font-size: 18px; }
}

/* ===== 在线对战 ===== */
.online-box {
  max-width: 540px; margin: 0 auto; padding: 22px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.online-nick { display: flex; align-items: center; gap: 10px; }
.online-nick label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.online-nick input {
  flex: 1; padding: 8px 12px; font-size: 14px; color: var(--text);
  background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 8px; outline: none;
}
.online-nick input:focus { border-color: var(--accent); }
.online-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.online-btns .hero-btn { margin: 0; }
.online-status {
  font-size: 13px; color: var(--muted); line-height: 1.7;
  background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05);
  padding: 12px 14px; border-radius: 10px; text-align: center;
}
.join-input { display: flex; gap: 8px; align-items: center; }
.join-input input {
  flex: 1; padding: 8px 12px; font-size: 16px; letter-spacing: 4px; text-align: center;
  color: var(--text); background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 8px; outline: none;
}
.join-input input:focus { border-color: var(--accent); }
.room-code { text-align: center; padding: 8px 0; }
.room-code div { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.room-code b {
  font-size: 42px; letter-spacing: 12px; color: var(--accent);
  background: rgba(0,0,0,0.3); border: 1px dashed var(--border); border-radius: 12px;
  padding: 6px 18px 6px 26px; display: inline-block;
}

/* 在线选角 */
.pick-grid { display: flex; align-items: stretch; gap: 10px; max-width: 560px; margin: 0 auto 16px; }
.pick-slot {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 10px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 14px;
}
.pick-label { font-size: 12px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-avatar {
  width: 70px; height: 70px; border-radius: 16px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); background: rgba(255,255,255,0.06);
}
.pick-avatar .char-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.pick-avatar span { font-size: 32px; }
.pick-slot b { font-size: 15px; }
.pick-vs { align-self: center; font-size: 22px; font-weight: 800; color: var(--accent); }
.online-chars {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  max-width: 560px; margin: 0 auto 12px;
}
.online-chars .pvp-char { min-width: 150px; }
.online-chars .pvp-char.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,196,0,0.25);
}

/* 出牌倒计时 */
.turn-timer {
  margin-left: 8px; font-size: 12px; color: var(--muted);
  background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 8px; white-space: nowrap;
}
.turn-timer.urgent {
  color: #fff; background: rgba(239,68,68,0.85); border-color: #ef4444;
  animation: timer-pulse 1s infinite;
}
@keyframes timer-pulse { 50% { opacity: 0.55; } }

/* ===== 对局聊天面板 ===== */
.chat-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 999;
  font-family: inherit;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.chat-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  font-size: 22px; cursor: pointer; position: relative;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #2b2440, #1a1530);
  color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: transform 0.2s, background 0.2s;
}
.chat-toggle:hover {
  transform: scale(1.06);
  background: linear-gradient(135deg, #3a3058, #241c40);
}
.chat-badge {
  display: none; position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box;
  align-items: center; justify-content: center;
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 10px; border: 2px solid #1a1530;
}
.chat-box {
  display: none; flex-direction: column;
  width: 280px; height: 340px;
  background: rgba(15,12,25,0.94); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; font-size: 13px; font-weight: 700; color: var(--gold);
  background: rgba(255,255,255,0.04); border-bottom: 1px solid var(--border);
}
.chat-close {
  background: none; border: none; color: var(--muted); font-size: 14px;
  cursor: pointer; padding: 2px 6px; border-radius: 6px; line-height: 1;
}
.chat-close:hover { color: var(--text); background: rgba(255,255,255,0.1); }
.chat-msgs {
  flex: 1; overflow-y: auto; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.chat-empty { color: var(--muted); font-size: 12px; text-align: center; margin: 20px 0; }
.chat-msg {
  display: flex; flex-direction: column; gap: 2px; max-width: 85%;
  align-self: flex-start;
}
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-name { font-size: 10px; color: var(--muted); }
.chat-text {
  font-size: 13px; line-height: 1.45; word-break: break-word;
  padding: 6px 10px; border-radius: 10px;
  background: rgba(255,255,255,0.08); color: var(--text);
  border-top-left-radius: 2px;
}
.chat-msg.mine .chat-text {
  background: linear-gradient(135deg, var(--gold), #b8860b);
  color: #1a1530; font-weight: 600;
  border-top-left-radius: 10px; border-top-right-radius: 2px;
}
.chat-input-row {
  display: flex; gap: 8px; padding: 10px;
  border-top: 1px solid var(--border); background: rgba(255,255,255,0.03);
}
.chat-input-row input {
  flex: 1; min-width: 0; padding: 8px 10px; font-size: 13px;
  background: rgba(0,0,0,0.35); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; outline: none;
  font-family: inherit;
}
.chat-input-row input:focus { border-color: var(--gold); }
.chat-send {
  padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), #b8860b);
  color: #1a1530; border: none; border-radius: 8px; transition: filter 0.2s;
}
.chat-send:hover { filter: brightness(1.1); }

@media (max-width: 640px) {
  .chat-panel { right: 10px; bottom: 10px; }
  .chat-box { width: min(280px, calc(100vw - 40px)); height: 300px; }
}

/* ================= Boss 讨伐 ================= */
.nav-btn.boss { color: #fda4af; }
.nav-btn.boss:hover,
.nav-btn.boss.active { border-color: #f43f5e; color: #fff; box-shadow: 0 0 12px rgba(244,63,94,0.4); }
.boss-menu-btn {
  background: linear-gradient(135deg, #3b0f16, #581c87) !important;
  border-color: #be123c !important; color: #fecdd3 !important;
  box-shadow: 0 0 16px rgba(190,18,60,0.35);
}

.boss-story {
  display: flex; gap: 16px; align-items: center;
  background: linear-gradient(135deg, rgba(30,10,20,0.55), rgba(20,8,40,0.55));
  border: 1px solid rgba(190,18,60,0.35);
  border-radius: 16px; padding: 16px 18px; margin: 0 0 18px;
  max-width: 620px; margin-left: auto; margin-right: auto; text-align: left;
}
.boss-story-avatar {
  width: 92px; height: 92px; flex-shrink: 0; border-radius: 50%;
  border: 3px solid rgba(244,63,94,0.8);
  box-shadow: 0 0 24px rgba(244,63,94,0.5), 0 0 70px rgba(88,28,135,0.5);
}
.boss-story-text { flex: 1; font-size: 13px; line-height: 1.7; color: var(--muted); }
.boss-story-text b { color: #fda4af; }
.boss-story-quote {
  margin: 8px 0 0; font-size: 16px; font-weight: 800; text-align: right;
  color: #fecdd3; letter-spacing: 2px; text-shadow: 0 0 12px rgba(244,63,94,0.8);
}

.boss-mode-tabs {
  display: flex; gap: 10px; justify-content: center; margin: 0 0 16px;
}
.boss-mode-tabs .tab-btn {
  padding: 10px 22px; font-size: 14px; font-weight: 700; cursor: pointer;
  background: rgba(255,255,255,0.05); color: var(--muted);
  border: 1px solid var(--border); border-radius: 12px; transition: all 0.2s;
  font-family: inherit;
}
.boss-mode-tabs .tab-btn.active {
  background: linear-gradient(135deg, #7f1d1d, #4c1d95);
  color: #fff; border-color: #f43f5e; box-shadow: 0 0 12px rgba(244,63,94,0.35);
}

.boss-pick-row {
  display: flex; align-items: stretch; justify-content: center; gap: 14px;
  margin: 12px auto 18px; max-width: 460px;
}
.boss-pick-slot {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 10px;
}
.pick-label { font-size: 12px; color: var(--muted); }
.pick-vs { align-self: center; font-size: 24px; font-weight: 800; color: #f43f5e; }
.boss-pick-slot .pick-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid rgba(244,63,94,0.6);
}
.boss-pick-slot b { font-size: 14px; color: var(--text); }

.boss-char-grid {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  max-width: 640px; margin: 0 auto 14px;
}
.boss-char-grid .pvp-char { min-width: 150px; }
.boss-char-grid .pvp-char.picked {
  border-color: #f43f5e; box-shadow: 0 0 0 2px rgba(244,63,94,0.35);
}

.battle-reserve-bar {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  margin-top: 10px; font-size: 12px; color: var(--muted);
  background: rgba(255,255,255,0.04); border: 1px dashed var(--border);
  border-radius: 10px; padding: 5px 14px; width: fit-content; margin-left: auto; margin-right: auto;
}
.battle-reserve-bar b { color: var(--gold); }
.battle-reserve-bar .mini-avatar.sm { width: 26px; height: 26px; border-radius: 50%; }

/* ===== Boss 出场特效：无星被黑雾包裹变身 ===== */
.boss-intro {
  position: absolute; inset: 0; z-index: 90; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.bi-fog {
  position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.92) 75%);
  animation: biFog 1.2s ease-out forwards;
}
.bi-caster {
  position: relative; width: 150px; height: 150px; border-radius: 50%;
  overflow: hidden; z-index: 2;
  border: 3px solid rgba(168,85,247,0.9);
  box-shadow: 0 0 40px rgba(168,85,247,0.8), 0 0 130px rgba(88,28,135,0.6);
  transform: scale(0.4); opacity: 0;
  animation: biCaster 1.1s ease-out forwards;
}
.bi-caster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bi-shout {
  position: absolute; left: 0; right: 0; text-align: center; top: 70%;
  font-size: 30px; font-weight: 900; color: #fda4af; letter-spacing: 8px;
  text-shadow: 0 0 18px rgba(244,63,94,0.9), 0 0 55px rgba(0,0,0,0.9);
  opacity: 0; z-index: 3;
}
.bi-flash { position: absolute; inset: 0; background: #fff; opacity: 0; z-index: 1; }
.boss-intro.transform .bi-fog { animation: biFogDark 1.6s ease-in-out forwards; }
.boss-intro.transform .bi-caster { animation: biShake 1.5s ease-in-out; }
.boss-intro.transform .bi-caster.evil {
  border-color: rgba(244,63,94,0.95);
  box-shadow: 0 0 55px rgba(244,63,94,0.95), 0 0 170px rgba(0,0,0,0.95);
  animation: biEvil 0.6s ease-out forwards;
}
.boss-intro.transform .bi-shout { animation: biShout 1.4s ease-out 0.9s forwards; }
.boss-intro.transform .bi-flash { animation: biFlash 0.5s ease-out 1.9s forwards; }
@keyframes biFog { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes biFogDark { 0% { opacity: 1; } 100% { opacity: 1; } }
@keyframes biCaster {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes biShake {
  0%,100% { transform: scale(1) rotate(0deg); }
  15% { transform: scale(1.06) rotate(-5deg); }
  30% { transform: scale(1.12) rotate(5deg); }
  45% { transform: scale(0.98) rotate(-4deg); }
  60% { transform: scale(1.1) rotate(4deg); }
  80% { transform: scale(1) rotate(-2deg); }
}
@keyframes biEvil { 0% { transform: scale(1); } 100% { transform: scale(1.32); } }
@keyframes biShout {
  0% { opacity: 0; transform: scale(0.6); }
  30% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes biFlash { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: 0; } }

/* ===== 换人接力特效 ===== */
.swap-fx {
  position: absolute; inset: 0; z-index: 88; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.sf-fade { position: absolute; inset: 0; background: rgba(0,0,0,0.75); animation: sfFade 0.3s ease-out; }
.sf-card {
  position: relative; display: flex; align-items: center; gap: 18px;
  background: rgba(15,10,25,0.85); border: 2px solid var(--gold);
  border-radius: 18px; padding: 16px 26px;
  box-shadow: 0 0 40px rgba(255,196,0,0.35);
  animation: sfCard 0.5s ease-out;
}
.sf-avatar { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; border: 3px solid var(--border); }
.sf-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sf-avatar.old { filter: grayscale(1) brightness(0.6); opacity: 0.5; transform: scale(0.85); }
.sf-avatar.new { border-color: var(--gold); box-shadow: 0 0 18px rgba(255,196,0,0.5); }
.sf-arrow { font-size: 34px; font-weight: 900; color: var(--gold); }
.sf-name { font-size: 18px; font-weight: 800; color: var(--gold); text-shadow: 0 0 12px rgba(255,196,0,0.6); }
@keyframes sfFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sfCard { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ===== 匿名变身：白眼 → 红眼，浑身被火焰包裹 ===== */
.niming-fx {
  position: absolute; inset: 0; z-index: 95; pointer-events: none; overflow: hidden;
  background: radial-gradient(circle at 50% 55%, rgba(120,20,30,0.45), rgba(0,0,0,0.88));
}
.nr-flash { position: absolute; inset: 0; background: #f97316; opacity: 0; animation: nrFlash 1s ease-out forwards; }
@keyframes nrFlash { 0% { opacity: 0; } 25% { opacity: 0.85; } 100% { opacity: 0; } }
.nr-caster {
  position: absolute; left: 50%; top: 52%; transform: translate(-50%,-50%) scale(1);
  width: min(46vw, 210px); height: min(46vw, 210px); border-radius: 50%; overflow: hidden;
  border: 4px solid rgba(251,146,60,0.7);
  box-shadow: 0 0 45px rgba(249,115,22,0.8), 0 0 90px rgba(239,68,68,0.45);
}
.nr-caster .nr-face { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.25s, filter 0.25s, transform 0.25s; }
.nr-caster .nr-face.normal { opacity: 1; filter: brightness(1); transform: scale(1); }
.nr-caster .nr-face.rage { opacity: 0; filter: brightness(1.35) saturate(1.45); transform: scale(1.18); }
.nr-caster.transform .nr-face.normal { opacity: 0; filter: brightness(2.4) saturate(0); transform: scale(1.06); }
.nr-caster.transform .nr-face.rage { opacity: 1; }
/* 红眼红光：浮现于双眼位置 */
.nr-eyes {
  position: absolute; inset: 0; opacity: 0; mix-blend-mode: screen; transition: opacity 0.3s;
  background:
    radial-gradient(circle at 38% 42%, rgba(248,113,113,0.95) 0%, transparent 24%),
    radial-gradient(circle at 62% 42%, rgba(248,113,113,0.95) 0%, transparent 24%);
}
.nr-caster.transform .nr-eyes { opacity: 1; animation: nrEyeGlow 0.85s ease-in-out infinite; }
@keyframes nrEyeGlow {
  0%,100% { filter: drop-shadow(0 0 6px #ef4444); }
  50% { filter: drop-shadow(0 0 20px #f97316); }
}
/* 浑身火焰：从角色脚下向上升腾 */
.nr-flames { position: absolute; inset: 0; }
.nr-flame {
  position: absolute; bottom: -34px;
  border-radius: 50% 50% 45% 55% / 60% 45% 55% 40%;
  background: linear-gradient(180deg, #fde047, #f97316 55%, rgba(153,27,27,0.78));
  animation: nrFlame 1.25s ease-out infinite; opacity: 0;
}
@keyframes nrFlame {
  0% { opacity: 0; transform: translateY(0) scale(0.5); }
  15% { opacity: 0.95; }
  100% { opacity: 0; transform: translateY(-280px) translateX(var(--nr-drift, 0px)) scale(1.2); }
}
/* 变身字幕 */
.nr-title {
  position: absolute; left: 50%; bottom: 16%; transform: translateX(-50%) scale(0.4);
  color: #fbbf24; font-size: clamp(26px, 6vw, 38px); font-weight: 900; letter-spacing: 8px;
  text-shadow: 0 0 18px rgba(249,115,22,0.95), 0 0 44px rgba(239,68,68,0.85);
  opacity: 0; white-space: nowrap; animation: nrTitle 0.5s 0.85s cubic-bezier(0.2,1.6,0.4,1) forwards;
}
@keyframes nrTitle { 0% { opacity: 0; transform: translateX(-50%) scale(0.4); } 100% { opacity: 1; transform: translateX(-50%) scale(1); } }

/* ===== 万棱碎镜：可怖无星出现在屏幕下方，屏幕碎裂 ===== */
.wlsj-fx { position: absolute; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.wlsj-boss {
  position: absolute; left: 50%; bottom: -42%;
  transform: translateX(-50%); width: min(85vw, 360px);
  border-radius: 50% 50% 0 0; overflow: hidden; z-index: 2;
  border: 3px solid rgba(168,85,247,0.85);
  box-shadow: 0 0 60px rgba(168,85,247,0.9), 0 -20px 90px rgba(88,28,135,0.7);
  animation: wlsjRise 1.15s ease-out forwards;
}
.wlsj-boss img { width: 100%; display: block; object-fit: cover; }
@keyframes wlsjRise {
  0% { bottom: -45%; }
  60% { bottom: 4%; }
  100% { bottom: 0; }
}
.wlsj-cracks {
  position: absolute; inset: 0; z-index: 3; opacity: 0;
  background:
    linear-gradient(35deg, transparent 46%, rgba(255,255,255,0.9) 48%, rgba(255,255,255,0.9) 50%, transparent 52%),
    linear-gradient(-40deg, transparent 46%, rgba(255,255,255,0.9) 48%, rgba(255,255,255,0.9) 50%, transparent 52%),
    linear-gradient(80deg, transparent 46%, rgba(255,255,255,0.7) 48%, rgba(255,255,255,0.7) 50%, transparent 52%),
    linear-gradient(15deg, transparent 46%, rgba(255,255,255,0.5) 48%, rgba(255,255,255,0.5) 50%, transparent 52%);
  background-size: 26% 100%, 30% 100%, 22% 100%, 34% 100%;
  background-position: 12% 0, 62% 0, 84% 0, 38% 0;
  animation: wlsjCrack 0.55s ease-out 0.2s forwards;
}
@keyframes wlsjCrack { 0% { opacity: 0; } 100% { opacity: 1; } }
.wlsj-flash { position: absolute; inset: 0; background: #e9d5ff; opacity: 0; z-index: 4; animation: wlsjFlash 0.55s ease-out forwards; }
@keyframes wlsjFlash { 0% { opacity: 0; } 25% { opacity: 0.85; } 100% { opacity: 0; } }

/* ===== 无上幽虚：黑紫幽雾包裹 ===== */
.wsyx-fx { position: absolute; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.wsyx-mist {
  position: absolute; left: 50%; top: 50%;
  width: 70vmax; height: 70vmax; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(17,0,35,0) 0%, rgba(17,0,35,0.9) 70%);
  animation: wsyxMist 1.1s ease-out forwards;
}
.wsyx-ring {
  position: absolute; left: 50%; top: 50%;
  width: 60px; height: 60px; transform: translate(-50%, -50%);
  border: 4px solid #a855f7; border-radius: 50%;
  box-shadow: 0 0 24px #a855f7, 0 0 70px #6b21a8;
  animation: wsyxRing 1.1s ease-out forwards;
}
@keyframes wsyxMist { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes wsyxRing {
  0% { width: 40px; height: 40px; opacity: 0; }
  30% { opacity: 1; }
  100% { width: 130vmax; height: 130vmax; opacity: 0; }
}

/* ===== 真空衍气：可怖无星黑绿色气罩 ===== */
.zkyq-fx { position: absolute; inset: 0; z-index: 70; pointer-events: none; }
.zkyq-aura {
  position: absolute; right: 8%; top: 12%;
  width: 150px; height: 150px; border-radius: 50%;
  border: 3px dashed rgba(74,222,128,0.8);
  box-shadow: 0 0 30px rgba(74,222,128,0.5), inset 0 0 30px rgba(74,222,128,0.25);
  animation: zkyqSpin 1.3s ease-out forwards;
}
.zkyq-num {
  position: absolute; right: 10%; top: 30%; font-size: 26px; font-weight: 900;
  color: #4ade80; text-shadow: 0 0 16px rgba(74,222,128,0.9);
  animation: zkyqNum 1.3s ease-out forwards;
}
@keyframes zkyqSpin { 0% { transform: scale(0.3) rotate(0deg); opacity: 0; } 40% { opacity: 1; } 100% { transform: scale(2) rotate(120deg); opacity: 0; } }
@keyframes zkyqNum { 0% { transform: scale(0.4); opacity: 0; } 30% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

/* ===== 人负：吸血紫红能量 ===== */
.renfu-fx { position: absolute; inset: 0; z-index: 70; pointer-events: none; }
.rf-beams {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 65%, rgba(244,63,94,0.5) 0%, transparent 18%),
    radial-gradient(circle at 78% 22%, rgba(190,18,60,0.6) 0%, transparent 22%);
  animation: rfBeams 1.1s ease-out forwards;
}
.rf-blood {
  position: absolute; left: 50%; top: 40%; font-size: 60px;
  filter: drop-shadow(0 0 20px rgba(244,63,94,0.9));
  animation: rfBlood 1.1s ease-out forwards;
}
@keyframes rfBeams { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
@keyframes rfBlood {
  0% { transform: translate(-50%, 20px) scale(0.4); opacity: 0; }
  35% { transform: translate(-50%, 0) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -60px) scale(0.6); opacity: 0; }
}

/* ===== 第零次元：次元扭曲 ===== */
.dlwy-fx { position: absolute; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.dlwy-ripple {
  position: absolute; left: 50%; top: 50%;
  width: 80px; height: 80px; transform: translate(-50%, -50%);
  border: 3px solid #c084fc; border-radius: 50%;
  box-shadow: 0 0 30px #a855f7, inset 0 0 30px #a855f7;
  animation: dlwyRipple 1.2s ease-out forwards;
}
.dlwy-grid {
  position: absolute; inset: 0; opacity: 0;
  background:
    linear-gradient(90deg, rgba(168,85,247,0.35) 1px, transparent 1px),
    linear-gradient(0deg, rgba(168,85,247,0.35) 1px, transparent 1px);
  background-size: 44px 44px;
  animation: dlwyGrid 0.7s ease-out forwards;
}
@keyframes dlwyRipple { 0% { width: 40px; height: 40px; opacity: 0; } 30% { opacity: 1; } 100% { width: 130vmax; height: 130vmax; opacity: 0; } }
@keyframes dlwyGrid { 0% { opacity: 0; transform: scale(1.4); } 100% { opacity: 1; transform: scale(1); } }

/* ===== 格斗对战 ===== */
.fight-lobby { max-width: 900px; margin: 0 auto; padding: 24px 16px; text-align: center; }
.fight-hero h2 { font-size: 34px; color: #fff; margin: 8px 0 4px; text-shadow: 0 0 24px rgba(168,85,247,.6); }
.fight-sub { color: #b6a9e0; margin: 0 0 28px; }
.fight-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.fight-mode-btn {
  background: linear-gradient(160deg, rgba(40,30,70,.9), rgba(20,15,40,.95));
  border: 1px solid #4c3f6b; border-radius: 16px; color: #fff;
  padding: 26px 18px; cursor: pointer; transition: all .2s;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.fight-mode-btn:hover { transform: translateY(-4px); border-color: #a855f7; box-shadow: 0 10px 30px rgba(168,85,247,.35); }
.fm-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.fm-name { display: block; font-size: 20px; font-weight: 700; }
.fm-desc { display: block; font-size: 13px; color: #b6a9e0; margin-top: 6px; }
.fight-tips { margin-top: 30px; text-align: left; background: rgba(20,15,40,.6); border: 1px solid #2a2140; border-radius: 12px; padding: 14px 18px; color: #c9bfe8; font-size: 13px; line-height: 1.9; }
.fight-tips b { color: #facc15; }

/* 选角 */
.fight-pick { max-width: 960px; margin: 0 auto; padding: 16px; }
.fight-pick h3 { text-align: center; color: #fff; margin: 6px 0 18px; font-size: 24px; }
.pick-row { display: flex; gap: 16px; align-items: stretch; }
.pick-side { flex: 1; }
.pick-vs { align-self: center; font-size: 30px; font-weight: 900; color: #a855f7; text-shadow: 0 0 14px rgba(168,85,247,.8); }
.pick-slot {
  display: flex; align-items: center; gap: 12px;
  background: rgba(20,15,40,.7); border: 1px solid #4c3f6b; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 12px; min-height: 64px;
}
.pick-label { font-size: 12px; color: #b6a9e0; background: #2a2140; padding: 3px 8px; border-radius: 8px; white-space: nowrap; }
.pick-avatar { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: #2a2140; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.pick-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pick-name { font-size: 18px; font-weight: 700; color: #fff; }
.pick-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.pick-card {
  background: rgba(30,22,55,.9); border: 1px solid #3a2f5e; border-radius: 12px;
  padding: 10px 6px; text-align: center; cursor: pointer; transition: all .15s; color: #fff;
}
.pick-card:hover:not(:disabled) { transform: translateY(-3px); border-color: #facc15; }
.pick-card:disabled { opacity: .55; cursor: default; }
.pick-card.locked { opacity: .45; }
.pick-card-avatar {
  width: 56px; height: 56px; margin: 0 auto 6px; border-radius: 50%; overflow: hidden;
  border: 2px solid; display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.pick-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pick-card-name { font-weight: 700; font-size: 15px; }
.pick-card-tags { font-size: 11px; color: #b6a9e0; margin: 3px 0; }
.pick-card-hp { font-size: 12px; color: #f87171; }
.pick-actions { display: flex; justify-content: center; gap: 14px; margin-top: 20px; }
.pick-actions .btn { font-size: 16px; padding: 10px 26px; border-radius: 10px; }

/* 舞台 */
.fight-stage { position: relative; max-width: 1340px; margin: 0 auto; }
.fight-stage canvas { width: 100%; height: auto; display: block; border-radius: 14px; border: 2px solid #3a2f5e; box-shadow: 0 12px 40px rgba(0,0,0,.5); filter: brightness(1.12) saturate(1.06); }
.f-pad { position: absolute; bottom: 10px; left: 10px; display: flex; gap: 14px; align-items: flex-end; z-index: 5; }
.f-pad.right { left: auto; right: 10px; flex-direction: row-reverse; }
.f-pad button {
  border: none; border-radius: 50%; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none; touch-action: none;
  transition: transform .08s;
}
.f-pad button.active { transform: scale(1.12); filter: brightness(1.4); }
.f-pad-dir { display: flex; align-items: center; justify-content: center; }
/* 虚拟摇杆（八方向，支持斜跳） */
/* 半透明避免遮挡角色，操作时恢复不透明 */
.f-joy, .f-atk { opacity: .48; transition: opacity .12s ease, transform .08s; }
.f-joy.active, .f-atk.active, .f-pad button.active { opacity: 1; }
/* 长时间无操作：再淡一档，把画面让出来 */
.f-pad.idle .f-joy, .f-pad.idle .f-atk { opacity: .26; }
.f-pad.idle .f-joy.active, .f-pad.idle .f-atk.active, .f-pad.idle .f-pad button.active { opacity: 1; }

.f-joy {
  position: relative;
  width: 106px;
  height: 106px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, rgba(46,32,84,.78), rgba(14,10,28,.85));
  border: 2px solid rgba(168,85,247,.45);
  box-shadow: inset 0 0 18px rgba(0,0,0,.55), 0 4px 14px rgba(0,0,0,.4);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.f-joy::after {
  content: "";
  position: absolute;
  left: 24%;
  top: 24%;
  right: 24%;
  bottom: 24%;
  border-radius: 50%;
  border: 1px dashed rgba(168,85,247,.3);
}
.f-joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50px;
  height: 50px;
  margin: -25px 0 0 -25px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ddd6fe, #7c3aed 72%);
  border: 2px solid rgba(233,213,255,.85);
  box-shadow: 0 3px 10px rgba(0,0,0,.5);
  pointer-events: none;
  will-change: transform;
}
.f-joy-knob:not(.active) { transition: transform .12s ease-out; }
.f-joy-knob.active {
  background: radial-gradient(circle at 38% 32%, #fce7f3, #c026d3 72%);
  border-color: #fff;
}
/* 技能键：大招独占最上一排，轻/重/特/闪 一排 */
.f-pad-btns { display: grid; grid-template-columns: repeat(4, auto); gap: 8px; justify-items: center; }
.f-atk { position: relative; width: 56px; height: 56px; padding: 0; font-size: 15px; font-weight: 700; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.f-skill-icon { width: 40px; height: 40px; display: block; pointer-events: none; }
/* 大招：独占一排放最上面，做成宽胶囊最醒目 */
.f-ult {
  grid-row: 1; grid-column: 1 / -1; justify-self: center;
  width: 156px; height: 64px; border-radius: 32px;
}
.f-ult .f-skill-icon { width: 48px; height: 48px; }
.f-ult::after {
  content: "绝";
  position: absolute; right: 14px; bottom: 8px;
  font-size: 13px; font-weight: 900; color: rgba(255,255,255,.92);
  text-shadow: 0 1px 3px rgba(0,0,0,.65); pointer-events: none;
}
.f-dodge { justify-self: center; }
/* 可蓄力技能的角标 */
.f-charge-tag {
  position: absolute; right: -5px; top: -5px;
  background: #facc15; color: #111827;
  font-size: 11px; font-weight: 900; line-height: 15px;
  border-radius: 6px; padding: 0 4px;
  border: 1px solid rgba(0,0,0,.35);
  pointer-events: none;
}
.f-light { background: #ef4444; }
.f-heavy { background: #f97316; }
.f-special { background: #22c55e; }
.f-ult { background: #a855f7; }
.f-dodge { background: #38bdf8; }
.fight-overlay {
  position: absolute; inset: 0; z-index: 10; border-radius: 14px;
  background: rgba(8,5,20,.72); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
}
/* 竖屏提示横屏（格斗视图、手机端） */
.rotate-tip { display: none; }
@media (max-width: 900px) and (orientation: portrait) {
  .rotate-tip {
    display: flex;
    position: fixed; inset: 0; z-index: 999;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    align-items: center; justify-content: center;
    flex-direction: column; gap: 14px;
    color: #e8e6ff; text-align: center; padding: 24px;
  }
  .rotate-icon { font-size: 62px; animation: rotateHint 1.8s ease-in-out infinite; }
  .rotate-text { font-size: 19px; font-weight: 800; }
  .rotate-sub { font-size: 13px; color: #9fb3d1; }
  /* 强制横屏：系统转不过来时，直接把格斗画面旋转 90° 铺满屏幕 */
  .fight-stage {
    position: fixed !important;
    top: 50%; left: 50%;
    width: 100vh !important;
    height: 100vw !important;
    max-width: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
    z-index: 100;
    background: #0d0b1a;
  }
  .fight-stage canvas { width: 100% !important; height: 100% !important; object-fit: contain; }
  /* 已经强制横屏，不再提示 */
  .rotate-tip { display: none !important; }
}
@keyframes rotateHint {
  0%, 40% { transform: rotate(0deg); }
  60%, 100% { transform: rotate(90deg); }
}
/* 手机端单人模式：技能键固定在屏幕最右侧，摇杆留左下 */
@media (max-width: 900px) {
  .f-pad-btns.far-right { position: fixed; right: 8px; bottom: 18px; z-index: 20; }
}
/* 横屏手机（高度小）按键同样用紧凑尺寸，避免占掉太多画面 */
@media (max-height: 480px) {
  .f-pad-btns { gap: 6px; }
  .f-atk { width: 50px; height: 50px; }
  .f-skill-icon { width: 36px; height: 36px; }
  .f-ult { width: 138px; height: 58px; border-radius: 29px; }
  .f-ult .f-skill-icon { width: 42px; height: 42px; }
}
.f-ko { font-size: 52px; font-weight: 900; text-shadow: 0 0 30px rgba(255,71,87,.8); animation: fKo 0.5s ease-out; }
@keyframes fKo { 0% { transform: scale(2.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.f-result-actions { display: flex; gap: 14px; }
.net-wait { text-align: center; padding: 40px 0; color: #b6a9e0; }
.net-wait-spin {
  width: 46px; height: 46px; margin: 0 auto 16px; border-radius: 50%;
  border: 4px solid #3a2f5e; border-top-color: #a855f7;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .pick-row { flex-direction: column; }
  .pick-vs { font-size: 22px; }
  .f-pad { bottom: 6px; left: 6px; }
  .f-pad.right { right: 6px; }
  .f-atk { width: 40px; height: 40px; font-size: 13px; }
  .f-skill-icon { width: 26px; height: 26px; }
  .f-pad-btns { gap: 6px; }
  .f-atk { width: 50px; height: 50px; }
  .f-skill-icon { width: 36px; height: 36px; }
  .f-ult { width: 138px; height: 58px; }
  .f-ult .f-skill-icon { width: 42px; height: 42px; }
  .f-joy { width: 88px; height: 88px; }
  .f-joy-knob { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
  .f-ko { font-size: 36px; }
}
