:root {
  /* 宣纸浅色基调（登录/大厅/弹窗） */
  --paper: #efe4cc;
  --paper-2: #e5d6b6;
  --panel: #f3ebd8;
  --panel-2: #e8dabb;
  --bg: #efe4cc;
  --text: #2b2117;
  --ink: #2b2117;
  --muted: #7c6a4f;
  --border: #b9985a;
  --border-strong: #8a6d3b;
  --accent: #b8332a;       /* 朱砂红，主强调/印章 */
  --vermilion: #b8332a;
  --gold: #a8842c;         /* 描金 */
  --danger: #9e2b25;
  --ok: #4a7c3f;
  /* 浅底五行色（深版，保证对比） */
  --el-金: #c9a227;
  --el-木: #2f9e54;
  --el-水: #1f7fc4;
  --el-火: #d83a2b;
  --el-土: #8a5a2b;
  /* 深色漆器棋盘（战斗区） */
  --board: #1e160e;
  --board-panel: #2a2014;
  --board-panel-2: #342716;
  --board-border: #b9985a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  color: var(--ink);
  font-family: "STKaiti", "KaiTi", "楷体", "STSong", "SimSun", serif;
  font-size: 15px;
  min-height: 100vh;
  background-color: #efe4cc;
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(43,33,23,0.18), transparent 42%),
    radial-gradient(ellipse at 100% 0%, rgba(43,33,23,0.18), transparent 42%),
    radial-gradient(ellipse at 0% 100%, rgba(43,33,23,0.2), transparent 45%),
    radial-gradient(ellipse at 100% 100%, rgba(43,33,23,0.2), transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(247,239,216,0.5), transparent 70%),
    repeating-linear-gradient(0deg, rgba(120,98,62,0.04) 0px, rgba(120,98,62,0.04) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(120,98,62,0.035) 0px, rgba(120,98,62,0.035) 1px, transparent 1px, transparent 4px);
  background-attachment: fixed;
}
#app { min-height: 100vh; display: flex; flex-direction: column; }
button {
  background: linear-gradient(180deg, #f3ebd8, #e3d2ab);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  letter-spacing: 1px;
  box-shadow: inset 0 0 0 1px rgba(247,239,216,0.5);
  transition: all 0.12s;
}
button:hover:not(:disabled) { border-color: var(--vermilion); color: var(--vermilion); box-shadow: inset 0 0 0 1px var(--gold); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.primary {
  background: linear-gradient(180deg, #c8463c, #a82a22);
  color: #f6ecd2; border: 1px solid var(--gold);
  font-weight: bold; letter-spacing: 3px;
  box-shadow: inset 0 0 0 1px rgba(247,239,216,0.35), 0 1px 4px rgba(120,40,30,0.4);
}
button.primary:hover:not(:disabled) { filter: brightness(1.08); color: #fff6e0; }
button.danger { border-color: var(--danger); color: var(--danger); }
input, select {
  background: #faf3e2;
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 15px;
  font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--vermilion); box-shadow: 0 0 0 1px var(--gold); }
h1, h2, h3 { font-weight: 600; font-family: "STZhongsong", "STSong", "SimSun", serif; letter-spacing: 2px; }
.muted { color: var(--muted); font-size: 12px; }

/* 登录牌匾标题「五行对决」 */
.center-page .panel h2 {
  text-align: center;
  background: linear-gradient(180deg, #c8463c, #a82a22);
  color: #f6ecd2;
  font-family: "STZhongsong","STSong","SimSun",serif;
  font-size: 30px; letter-spacing: 10px; font-weight: 700;
  padding: 14px 8px; margin: 4px 0 6px; border-radius: 4px;
  border: 1px solid var(--gold);
  box-shadow: inset 0 0 0 2px rgba(247,239,216,0.4), inset 0 0 0 3px rgba(168,132,44,0.6), 0 3px 10px rgba(80,30,20,0.4);
  text-shadow: 0 1px 2px rgba(80,20,15,0.6);
}

/* ── 通用面板 ── */
.center-page { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.panel {
  position: relative;
  background: linear-gradient(180deg, #f6efdd, #ece0c2);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 26px;
  box-shadow:
    inset 0 0 0 1px var(--gold),
    inset 0 0 0 5px #f6efdd,
    inset 0 0 0 6px rgba(168,132,44,0.45),
    0 8px 28px rgba(60,40,20,0.28);
}
/* 四角如意云纹 */
.panel::before, .panel::after {
  content: ""; position: absolute; width: 22px; height: 22px; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'><path d='M2 20 Q2 2 20 2' fill='none' stroke='%23a8842c' stroke-width='1.4'/><path d='M6 20 Q6 6 20 6' fill='none' stroke='%23b8332a' stroke-width='1.2'/><circle cx='4' cy='4' r='1.6' fill='%23b8332a'/></svg>");
  background-size: contain; background-repeat: no-repeat;
}
.panel::before { top: 8px; left: 8px; }
.panel::after { top: 8px; right: 8px; transform: scaleX(-1); }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row label { color: var(--muted); font-size: 13px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── 五行颜色 ── */
.el-金 { color: var(--el-金); }
.el-木 { color: var(--el-木); }
.el-水 { color: var(--el-水); }
.el-火 { color: var(--el-火); }
.el-土 { color: var(--el-土); }
.bd-金 { border-color: var(--el-金) !important; }
.bd-木 { border-color: var(--el-木) !important; }
.bd-水 { border-color: var(--el-水) !important; }
.bd-火 { border-color: var(--el-火) !important; }
.bd-土 { border-color: var(--el-土) !important; }

/* ── 卡牌 ── */
.card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 86px;
  height: 122px;
  background: linear-gradient(160deg, #f7efda 0%, #ecdcb8 100%);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 6px 6px 44px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.12s, box-shadow 0.12s;
  user-select: none;
  box-shadow: inset 0 0 0 1px var(--gold), inset 0 0 0 3px #f7efda, 0 2px 6px rgba(60,40,20,0.3);
  color: var(--ink);
}
.card:hover { transform: translateY(-10px); z-index: 5; box-shadow: inset 0 0 0 1px var(--gold), inset 0 0 0 3px #f7efda, 0 8px 18px rgba(60,40,20,0.5); }
.card.selected { transform: translateY(-14px); box-shadow: inset 0 0 0 2px var(--vermilion), inset 0 0 0 4px #f7efda, 0 8px 18px rgba(60,40,20,0.5); }
.card.negative { background: linear-gradient(160deg, #d9c3a0 0%, #b89a6e 100%); border-color: #7a4a3a; }
.free-sheng {
  font-size: 12px; color: #7e3ff2; font-family: "STKaiti","KaiTi",serif;
  background: #f3eafe; border: 1px solid #b388ff; border-radius: 10px;
  padding: 1px 10px;
}
/* 相生临时变属性: 紫罗兰描边 + 流光，提示离开手牌即还原 */
.card.shifted {
  border-color: #7e3ff2 !important;
  box-shadow: inset 0 0 0 1px #b388ff, inset 0 0 0 3px #f7efda, 0 0 12px rgba(126,63,242,0.55);
}
.card.shifted::before {
  content: "生"; position: absolute; top: 2px; right: 3px; z-index: 3;
  font-size: 11px; color: #7e3ff2; font-family: "STKaiti","KaiTi",serif;
  background: #f3eafe; border: 1px solid #b388ff; border-radius: 50%;
  width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
}
.card .cost {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d04a3e, #9e2b22);
  color: #f6ecd2; border: 1px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: bold;
  box-shadow: 0 1px 3px rgba(80,20,15,0.5);
}
.card .cname { position: relative; z-index: 2; text-align: center; font-size: 14px; margin-top: 4px; font-weight: 600; font-family: "STZhongsong","SimSun",serif; }
.card .celem { position: relative; z-index: 2; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 26px; line-height: 1; opacity: 0.85; font-family: "STKaiti","KaiTi",serif; }
.card.mini { width: 60px; height: 84px; padding-bottom: 32px; }
.card.mini .cname { font-size: 11px; }
.card.mini .celem { font-size: 18px; }

/* ── 五行卡牌：底部花纹（内联SVG）+ 元素色身 ── */
.card[class*="bd-"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 32px;
  z-index: 1; pointer-events: none; opacity: 0.82;
  background-repeat: repeat-x; background-position: bottom center; background-size: auto 32px;
}
.card.mini[class*="bd-"]::after { height: 22px; background-size: auto 22px; }

.bd-金 { background: linear-gradient(160deg, #fbf3d8 0%, #f0e3b8 100%); }
.bd-木 { background: linear-gradient(160deg, #eef7ea 0%, #d8ecd0 100%); }
.bd-水 { background: linear-gradient(160deg, #e9f3fb 0%, #cfe4f5 100%); }
.bd-火 { background: linear-gradient(160deg, #fceee9 0%, #f6d8cd 100%); }
.bd-土 { background: linear-gradient(160deg, #f5ecdc 0%, #e6d2b2 100%); }

/* 金 · 回纹（雷纹方折） */
.bd-金::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='34' viewBox='0 0 28 34'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='2'%3E%3Cpath d='M2 32 V18 H10 V24 H6 V20'/%3E%3Cpath d='M16 32 V18 H24 V24 H20 V20'/%3E%3Cpath d='M0 14 H28'/%3E%3C/g%3E%3C/svg%3E");
}
/* 木 · 藤蔓（单道波浪 + 不规则长出的叶） */
.bd-木::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='34' viewBox='0 0 60 34'%3E%3Cpath d='M0 26 C6 26 9 15 16 16 C23 17 26 9 33 12 C40 15 44 24 50 21 C55 19 56 26 60 26' fill='none' stroke='%232f9e54' stroke-width='2.5' stroke-linecap='round'/%3E%3Cg fill='%232f9e54' opacity='0.9'%3E%3Cpath d='M0 0 C-3 -3 -3 -8 0 -11 C3 -8 3 -3 0 0 Z' transform='translate(16 16) rotate(-25) scale(0.9)'/%3E%3Cpath d='M0 0 C-3 -3 -3 -8 0 -11 C3 -8 3 -3 0 0 Z' transform='translate(24 13) rotate(-55) scale(0.7)'/%3E%3Cpath d='M0 0 C-3 -3 -3 -8 0 -11 C3 -8 3 -3 0 0 Z' transform='translate(33 12) rotate(15) scale(1.15)'/%3E%3Cpath d='M0 0 C-3 -3 -3 -8 0 -11 C3 -8 3 -3 0 0 Z' transform='translate(42 17) rotate(50) scale(0.8)'/%3E%3Cpath d='M0 0 C-3 -3 -3 -8 0 -11 C3 -8 3 -3 0 0 Z' transform='translate(50 21) rotate(120) scale(0.65)'/%3E%3C/g%3E%3C/svg%3E");
}
/* 水 · 水波 */
.bd-水::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='34' viewBox='0 0 32 34'%3E%3Cg fill='none' stroke='%231f7fc4' stroke-width='2'%3E%3Cpath d='M0 28 Q8 20 16 28 T32 28'/%3E%3Cpath d='M0 22 Q8 14 16 22 T32 22' opacity='0.7'/%3E%3Cpath d='M0 16 Q8 8 16 16 T32 16' opacity='0.45'/%3E%3C/g%3E%3C/svg%3E");
}
/* 火 · 火焰波浪（红焰底 + 橙焰峰） */
.bd-火::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='34' viewBox='0 0 30 34'%3E%3Cpath d='M0 34 L0 24 Q3 11 8 21 Q10 13 15 6 Q20 13 22 21 Q27 11 30 24 L30 34 Z' fill='%23d83a2b' opacity='0.9'/%3E%3Cpath d='M0 34 L0 27 Q4 19 8 26 Q11 18 15 14 Q19 18 22 26 Q26 19 30 27 L30 34 Z' fill='%23f4a83a' opacity='0.92'/%3E%3C/svg%3E");
}
/* 土 · 山峦 */
.bd-土::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cpath d='M0 34 L10 16 L17 26 L24 12 L34 34 Z' fill='%238a5a2b' opacity='0.85'/%3E%3Cpath d='M10 16 L13 21 L7 21 Z M24 12 L28 19 L20 19 Z' fill='%23f5ecdc' opacity='0.7'/%3E%3C/svg%3E");
}

/* ── 战斗布局（明亮宣纸棋盘 + 四周暗角聚光） ── */
.battle {
  flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 14px; max-height: 100vh;
  /* 浅底覆盖：面板/边框/强调 */
  --panel: #f3ebd8;
  --panel-2: #e8dabb;
  --border: #b9985a;
  --text: #2b2117;
  --muted: #7c6a4f;
  --accent: #b8332a;
  /* 战斗区五行用深版（浅底高对比） */
  --el-金: #c9a227;
  --el-木: #2f9e54;
  --el-水: #1f7fc4;
  --el-火: #d83a2b;
  --el-土: #8a5a2b;
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 65% at 50% 45%, #f6efdd 0%, #ecdfc1 55%, transparent 100%),
    radial-gradient(ellipse at 0% 0%, rgba(43,33,23,0.32), transparent 38%),
    radial-gradient(ellipse at 100% 0%, rgba(43,33,23,0.32), transparent 38%),
    radial-gradient(ellipse at 0% 100%, rgba(43,33,23,0.36), transparent 42%),
    radial-gradient(ellipse at 100% 100%, rgba(43,33,23,0.36), transparent 42%),
    linear-gradient(160deg, #e8dabb, #ddcaa3);
  border: 1px solid var(--gold);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(168,132,44,0.45), inset 0 0 90px rgba(60,40,18,0.5);
}
.boss-bar {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(180deg, #f6efdd, #e7d6b2); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 10px 16px; box-shadow: inset 0 0 0 1px rgba(168,132,44,0.35);
}
.boss-bar.targetable, .ally.targetable { outline: 2px dashed var(--vermilion); cursor: pointer; }
.boss-bar.picked, .minion.picked, .ally.me { outline: 2px solid var(--vermilion); }

/* 顶部一排: Boss栏 + 小怪血条 + 退出按钮 */
.top-row { display: flex; align-items: stretch; gap: 10px; }
.top-row .boss-bar { flex: 1 1 480px; min-width: 480px; }
.top-row .boss-bar .hpbar { min-width: 280px; max-width: none; height: 20px; }
.top-actions { display: flex; flex-direction: column; gap: 6px; margin-left: auto; align-self: center; }

/* 小怪血条（Boss 右侧一排） */
.minion-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; flex: 0 1 auto; }
.minion {
  display: flex; align-items: center; gap: 8px; min-width: 180px;
  background: linear-gradient(180deg, #f1e7cf, #e3d1ac); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 6px 10px; box-shadow: inset 0 0 0 1px rgba(168,132,44,0.3);
}
.minion.targetable { outline: 2px dashed var(--vermilion); cursor: pointer; }
.minion.acting { box-shadow: 0 0 0 2px var(--gold); }
.minion.dead { opacity: 0.4; }
.minion .avatar { width: 34px; height: 34px; font-size: 15px; }
.minion-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.minion-info b { font-size: 13px; }
.hpbar.mini { height: 8px; max-width: 120px; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--panel-2); border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.hpbar { flex: 1; max-width: 420px; height: 16px; background: #d8c8a4; border-radius: 8px; overflow: hidden; border: 1px solid rgba(138,109,59,0.5); }
.hpbar > div { height: 100%; background: linear-gradient(90deg, #a82a22, #d6402e); transition: width 0.3s; }
.statuses { display: flex; gap: 4px; flex-wrap: wrap; }
.status-chip {
  font-size: 11px; padding: 2px 6px; border-radius: 4px; cursor: help;
  background: var(--panel-2); border: 1px solid var(--border);
}
.status-chip.buff { border-color: #4a7c3f; color: #2f6b2a; }
.status-chip.debuff { border-color: #c0392b; color: #a82a22; }
.pz-skill-name { cursor: help; }

/* 悬浮提示 */
.tooltip {
  position: fixed; z-index: 300; max-width: 280px; pointer-events: none;
  background: linear-gradient(180deg, #f6efdd, #e8dabb); border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 8px 10px; font-size: 12px; line-height: 1.5; color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(168,132,44,0.4), 0 6px 20px rgba(60,40,20,.4); opacity: 0; transition: opacity .12s;
}
.tooltip.show { opacity: 1; }
.tooltip > div:first-child { font-weight: bold; margin-bottom: 2px; color: var(--vermilion); }
.tooltip > div:not(:first-child) { color: var(--muted); }


.battle-mid { flex: 1; display: flex; gap: 8px; min-height: 0; }
.allies { width: 180px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.ally {
  background: linear-gradient(180deg, #f4ead2, #e6d5b1); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 8px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: inset 0 0 0 1px rgba(168,132,44,0.25);
}
.ally.me { border-color: var(--vermilion); box-shadow: inset 0 0 0 1px var(--gold); }
.ally.dead { opacity: 0.4; }
.ally .hpbar { height: 10px; max-width: none; }
.ally-head { display: flex; align-items: center; gap: 8px; }
.ally-head .avatar { width: 32px; height: 32px; font-size: 14px; }

/* ── 中央对战台（最亮，聚光焦点） ── */
.arena {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background:
    radial-gradient(ellipse at 50% 50%, #fbf5e6 0%, #f2e8cf 70%, #ead9b6 100%);
  border: 1px solid var(--gold); border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(168,132,44,0.4), inset 0 0 28px rgba(255,247,224,0.6), 0 0 24px rgba(168,132,44,0.25);
  overflow: hidden;
}
.arena-side {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; padding: 12px;
  position: relative;
}
.arena-boss { background: linear-gradient(180deg, rgba(184,51,42,0.08), transparent); }
.arena-player { background: linear-gradient(0deg, rgba(74,124,63,0.08), transparent); }
.arena-label {
  position: absolute; top: 8px; left: 14px;
  color: var(--gold); font-size: 13px; letter-spacing: 3px;
  font-family: "STZhongsong","SimSun",serif; opacity: 0.95;
}
.arena-divider {
  height: 0; border-top: 1px dashed rgba(168,132,44,0.6);
  margin: 0 24px; position: relative;
}
.arena-divider span {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: #fbf5e6; border: 1px solid var(--gold); color: var(--vermilion);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.arena-plays {
  display: flex; flex-direction: row; flex-wrap: wrap; gap: 12px;
  max-height: 100%; overflow-y: auto; padding: 4px 8px;
  align-items: flex-start; justify-content: center;
}
.arena-play {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: rgba(168,132,44,0.08); border: 1px solid rgba(168,132,44,0.35);
  border-radius: 8px; padding: 8px 10px; flex: 0 0 auto;
}
.arena-skill { text-align: center; }
.arena-skill .pz-skill-name { font-size: 17px; }
.arena-empty { font-size: 13px; letter-spacing: 2px; opacity: 0.5; }
.pz-cards { display: flex; align-items: center; gap: 6px; }
.pz-cards .card.mini { cursor: default; }
.pz-cards .card.mini:hover { transform: translateY(-6px); }

.side-panel { width: 200px; display: flex; flex-direction: column; gap: 8px; }
.turn-panel {
  background: linear-gradient(180deg, #f4ead2, #e6d5b1); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: inset 0 0 0 1px rgba(168,132,44,0.3);
}
.initiative-list { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.initiative-list .cur { color: var(--vermilion); font-weight: bold; }
.log-panel {
  flex: 1; background: linear-gradient(180deg, #f4ead2, #e6d5b1); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 8px; overflow-y: auto; font-size: 12px; color: var(--muted);
  display: flex; flex-direction: column-reverse; min-height: 80px;
  box-shadow: inset 0 0 0 1px rgba(168,132,44,0.3);
}
.log-panel div { padding: 1px 0; }

/* ── 底部三段控制栏：牌库 | 居中手牌 | 弃牌堆 ── */
.action-bar { display: flex; gap: 12px; align-items: flex-end; }
.pile-col { flex-shrink: 0; display: flex; align-items: flex-end; }
.center-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.pile {
  width: 86px; height: 122px; border: 2px dashed var(--border-strong); border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; color: var(--border-strong); flex-shrink: 0;
  background: rgba(168,132,44,0.12);
}
.pile:hover { border-color: var(--vermilion); color: var(--vermilion); }
.ap-row { display: flex; align-items: center; gap: 10px; justify-content: center; width: 100%; }
.ap-pips { display: flex; gap: 4px; }
.ap-pip { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #d8584d, var(--vermilion)); box-shadow: 0 0 4px rgba(184,51,42,0.5); }
.ap-pip.spent { background: #d8c8a4; border: 1px solid var(--border-strong); box-shadow: none; }

/* 手牌：水平居中、向上升起 */
.hand {
  display: flex; gap: 8px; justify-content: center; align-items: flex-end;
  overflow-x: auto; overflow-y: visible; padding: 24px 8px 6px; min-height: 152px; width: 100%;
}
.hand .card { transition: transform 0.14s, box-shadow 0.14s; }
.hand .card:hover { transform: translateY(-18px); }
.hand .card.selected { transform: translateY(-22px); }

.skill-bar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; justify-content: center; width: 100%; max-width: 100%; }
.skill-btn {
  background: linear-gradient(180deg, #f4ead2, #e6d5b1); border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 6px 10px; cursor: pointer; flex-shrink: 0; min-width: 110px; text-align: left;
  color: var(--ink); box-shadow: inset 0 0 0 1px rgba(168,132,44,0.3);
}
.skill-btn:hover { border-color: var(--vermilion); }
.skill-btn.selected { border-color: var(--vermilion); box-shadow: 0 0 0 1px var(--vermilion); }
.skill-btn.unusable { opacity: 0.45; }
.skill-btn { position: relative; }
.skill-btn .cd-overlay {
  position: absolute; inset: 0; border-radius: 6px;
  background: rgba(43,33,23,0.62); color: #f6ecd2;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: bold; pointer-events: none;
  font-family: "STZhongsong","SimSun",serif;
}
.skill-btn .sname { font-weight: 600; }
.skill-btn .scost { font-size: 11px; color: var(--muted); }

/* 技能选择（减冷却）弹窗 */
.skill-select { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; min-width: 280px; }
.skill-select-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; cursor: pointer;
}
.skill-select-row:hover { border-color: var(--accent); }
.skill-select-row.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.action-hint {
  background: var(--panel-2); border: 1px solid var(--accent); border-radius: 6px;
  padding: 8px 12px; display: flex; gap: 12px; align-items: center;
}

/* ── 弹窗 ── */
.modal-mask {
  position: fixed; inset: 0; background: rgba(30,16,8,0.78);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  backdrop-filter: blur(2px);
}
.modal {
  background: linear-gradient(180deg, #f6efdd, #ece0c2); border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 22px; max-width: 760px; max-height: 84vh; overflow-y: auto;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--gold), inset 0 0 0 5px #f6efdd, inset 0 0 0 6px rgba(168,132,44,0.4), 0 12px 40px rgba(40,20,10,0.5);
}
.modal h3 { margin-bottom: 12px; color: var(--vermilion); }
.modal .cards-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }

/* ── 格挡弹窗 ── */
.block-banner {
  text-align: center; font-size: 22px; font-weight: bold; letter-spacing: 4px;
  color: var(--vermilion); padding: 8px 0 4px; margin-bottom: 6px;
  border-bottom: 2px solid var(--gold);
  font-family: "STZhongsong","STSong","SimSun",serif;
}
.block-info {
  display: flex; align-items: baseline; justify-content: center; gap: 2px;
  font-size: 16px; margin: 8px 0; flex-wrap: wrap;
}
.block-dmg { font-size: 15px; }
.block-reduction {
  text-align: center; font-size: 14px; padding: 4px 12px; margin: 4px 0;
  background: rgba(74,124,63,0.12); border: 1px solid var(--ok); border-radius: 4px;
  color: var(--ok); font-weight: bold;
}

/* ── 通用全屏蒙版提示（showOverlay 使用） ── */
.overlay-mask {
  position: fixed; inset: 0;
  background: rgba(30,16,8,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  pointer-events: none;
}
.overlay-content {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  animation: overlay-pulse 1.2s ease-in-out infinite;
}
.overlay-icon { font-size: 48px; line-height: 1; }
.overlay-text {
  font-size: 22px; font-weight: bold; color: #f6ecd2; letter-spacing: 4px;
  font-family: "STZhongsong","STSong","SimSun",serif;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.overlay-sub { font-size: 14px; color: rgba(246,236,210,0.7); letter-spacing: 2px; }
@keyframes overlay-pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* ── 目标选择 ── */
.target-order-bar {
  display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 0; margin-bottom: 6px;
}
.target-order-chip {
  font-size: 12px; padding: 2px 8px; border-radius: 4px;
  background: rgba(184,51,42,0.12); border: 1px solid var(--vermilion); color: var(--vermilion);
  font-weight: bold;
}
.target-order-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--vermilion); color: #f6ecd2; font-size: 12px; font-weight: bold;
  flex-shrink: 0;
}
/* ── GM 赋予弹窗: grid + 筛选 + 预览 ── */
.grant-modal { width: 660px; max-width: 86vw; }
.filt-bar { display: flex; gap: 6px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.filt-btn {
  font-size: 13px; padding: 3px 12px; border-radius: 4px; cursor: pointer;
  background: var(--paper-2); border: 1px solid var(--border); color: var(--ink);
}
.filt-btn.on { background: var(--vermilion); color: #f6efdd; border-color: var(--border-strong); }
.grant-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  max-height: 54vh; overflow-y: auto; padding: 2px;
}
.grant-cell {
  position: relative; padding: 8px 8px 7px; border-radius: 6px; cursor: pointer;
  background: linear-gradient(180deg, #f6efdd, #e9dcbe); border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(168,132,44,0.25); transition: transform .08s, box-shadow .08s;
}
.grant-cell:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(40,20,10,0.3); }
.grant-cell.sel { border-color: var(--vermilion); box-shadow: inset 0 0 0 2px var(--vermilion); }
.grant-cell.owned { opacity: 0.55; cursor: default; }
.grant-cell.owned:hover { transform: none; box-shadow: inset 0 0 0 1px rgba(168,132,44,0.25); }
.gc-name { font-weight: bold; font-size: 14px; margin-bottom: 4px; }
.gc-tag { font-size: 12px; }
.gc-badge {
  position: absolute; top: 5px; right: 6px; font-size: 11px; padding: 1px 6px; border-radius: 8px;
  background: rgba(138,109,59,0.8); color: #f6efdd;
}
.gc-badge.sel { background: var(--vermilion); }
.gc-step { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.gc-step .step {
  width: 24px; height: 24px; padding: 0; font-size: 16px; line-height: 1; border-radius: 4px;
  border: 1px solid var(--border); background: var(--paper-2); color: var(--ink); cursor: pointer;
}
.gc-cnt { flex: 1; text-align: center; font-weight: bold; }

/* ── 特效层 ── */
#fx-root { position: fixed; inset: 0; z-index: 150; pointer-events: none; }
#fx-root canvas { width: 100% !important; height: 100% !important; }
@keyframes fx-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.fx-shake { animation: fx-shake 0.3s; }

/* ── Toast ── */
#toast-root { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: linear-gradient(180deg, #f6efdd, #e8dabb); border: 1px solid var(--danger); color: var(--ink);
  border-radius: 4px; padding: 8px 18px; animation: fadeout 3s forwards;
  box-shadow: inset 0 0 0 1px rgba(168,132,44,0.4), 0 4px 14px rgba(40,20,10,0.4);
}
.toast.info { border-color: var(--gold); }
@keyframes fadeout { 0%,80% { opacity: 1; } 100% { opacity: 0; } }

/* ── 大厅 ── */
.lobby { flex: 1; display: flex; gap: 16px; padding: 20px; align-items: flex-start; flex-wrap: wrap; }
.lobby .panel { min-width: 320px; }
.char-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.char-card {
  background: linear-gradient(180deg, #f4ead2, #e6d5b1); border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 12px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(168,132,44,0.3);
}
.char-card:hover { border-color: var(--vermilion); }
.char-card.selected { border-color: var(--vermilion); box-shadow: inset 0 0 0 1px var(--gold), 0 0 0 1px var(--vermilion); }
.deck-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.deck-row .num { width: 40px; text-align: center; }
.counter-btn { width: 26px; height: 26px; padding: 0; }
.player-row {
  background: linear-gradient(180deg, #f4ead2, #e6d5b1); border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 10px; margin-bottom: 10px; box-shadow: inset 0 0 0 1px rgba(168,132,44,0.25);
}
.roots-grid { display: flex; gap: 6px; margin: 6px 0; }
.roots-grid input { width: 44px; text-align: center; }
.room-code {
  font-size: 40px; letter-spacing: 10px; color: var(--vermilion); text-align: center; font-weight: bold;
  font-family: "STZhongsong","STSong","SimSun",serif; text-shadow: 0 1px 0 rgba(168,132,44,0.5);
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; border-bottom: 2px solid var(--gold);
  background: linear-gradient(180deg, #c8463c, #a82a22); color: #f6ecd2;
  box-shadow: 0 2px 8px rgba(80,30,20,0.35);
}
.topbar h1, .topbar h2, .topbar h3 { color: #f6ecd2; letter-spacing: 4px; }

/* ── 天赋选择 ── */
.talent-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-width: 480px; }
.talent-card {
  background: linear-gradient(180deg, #f4ead2, #e6d5b1); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(168,132,44,0.2);
}
.talent-card:hover { border-color: var(--gold); }
.talent-card.selected { border-color: var(--vermilion); box-shadow: inset 0 0 0 1px var(--gold), 0 0 0 1px var(--vermilion); }

/* ── 天赋技能按钮 ── */
.skill-btn.talent-btn { border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(168,132,44,0.4); }
.skill-btn.talent-btn .sname { color: var(--gold); }
.skill-btn.passive { opacity: 0.55; cursor: default; }
.skill-btn.passive:hover { border-color: var(--gold); }

/* ── 元素选择器 ── */
.element-pick-grid { display: flex; gap: 16px; justify-content: center; margin: 20px 0; }
.element-pick {
  width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: bold; cursor: pointer; border: 2px solid var(--border);
  transition: transform 0.15s, box-shadow 0.15s;
}
.element-pick:hover { transform: scale(1.12); box-shadow: 0 0 12px rgba(168,132,44,0.5); }
.element-pick.el-金 { background: rgba(201,162,39,0.15); color: var(--el-金); border-color: var(--el-金); }
.element-pick.el-木 { background: rgba(47,158,84,0.15); color: var(--el-木); border-color: var(--el-木); }
.element-pick.el-水 { background: rgba(31,127,196,0.15); color: var(--el-水); border-color: var(--el-水); }
.element-pick.el-火 { background: rgba(216,58,43,0.15); color: var(--el-火); border-color: var(--el-火); }
.element-pick.el-土 { background: rgba(138,90,43,0.15); color: var(--el-土); border-color: var(--el-土); }

/* ── Boss 技能编辑器 ── */
.sk-list-item { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.sk-list-item:hover { border-color: var(--accent); }
.sk-list-item.active { border-color: var(--gold); background: rgba(168,132,44,0.1); }
.sk-preview-row { margin: 6px 0 12px; display: flex; align-items: center; gap: 6px; }
.sk-chip { padding: 2px 10px; border-radius: 12px; border: 1px solid var(--gold); color: var(--gold); font-size: 12px; }
.sk-section { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 14px; }
.sk-section-title { font-weight: bold; margin-bottom: 10px; }
.sk-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.sk-field { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.sk-flabel { color: var(--muted, #888); font-size: 11px; }
.sk-cc-grid { display: flex; gap: 6px; }
.sk-cc-grid label { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sk-effects { display: flex; flex-direction: column; gap: 8px; }
.sk-effect { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; background: rgba(255,255,255,0.02); }
.sk-effect-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.sk-effect-head b { font-size: 12px; }
.sk-effect-head select { flex: 0 0 auto; }
.sk-effect-fields { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.sk-scale-list { display: flex; flex-direction: column; gap: 4px; }
.sk-scale-items { display: flex; flex-direction: column; gap: 4px; }
.sk-scale-item { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; border-left: 2px solid var(--gold); padding-left: 8px; }
.sk-hook { border-left: 2px solid var(--accent); padding-left: 10px; }

/* ── 蓄能角标 ── */
.charge-badge {
  position: absolute; top: 2px; right: 2px; z-index: 3;
  background: var(--gold); color: #1a1410; font-size: 11px; font-weight: bold;
  padding: 0 5px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  pointer-events: none; line-height: 14px;
}
.skill-btn { position: relative; }
