/* ============================================================
   apps/western-chess.html 样式
   - D1：俱乐部调（深墨绿 + 牙白 + 黄铜金 + 酒红）
   - 棋盘色板 #F0D9B5 / #B58863（F-61 强约束）
   ============================================================ */

:root {
  /* ===== 「Café & Club」俱乐部调 ===== */
  --bg-deep:        #0a1311;                /* 主背景 - 墨绿近黑 */
  --bg-page:        #0f1a18;                /* 页面底色 - 深墨绿 */
  --bg-card-solid:  #16241f;                /* 卡片底 - 深墨绿 */
  --bg-card-elev:   #1c2e26;                /* 卡片抬升 - 中墨绿 */
  --bg-header:      #0a1311;                /* 顶栏/状态条 - 与主背景同色 */
  --bg-felt:        #0e1a16;                /* 棋盘绒布感 */

  /* 文字 */
  --text-primary:   #ece4cf;                /* 牙白 */
  --text-secondary: #c2b89a;                /* 亚麻 */
  --text-muted:     #9aa899;                /* 淡墨绿 */
  --text-on-accent: #0f1a18;                /* 强调色上的文字 */

  /* 强调色 */
  --accent-warm:    #8b2a2a;                /* 酒红/丝绒红 */
  --accent-warm-2:  #5e1a1a;                /* 深酒红 */
  --accent-gold:    #c9a14a;                /* 黄铜金 */
  --accent-gold-2:  #e0bc63;                /* 亮黄铜 */
  --accent-gold-3:  #8a6f2c;                /* 暗黄铜（金属阴影） */
  --accent-emerald: #2d4a3e;                /* 深翡翠 - 选中态 */

  /* 边框 */
  --border-warm:    rgba(201, 161, 74, 0.35);
  --border-soft:    rgba(234, 228, 207, 0.08);
  --border-strong:  rgba(234, 228, 207, 0.18);
  --shadow-warm:    rgba(0, 0, 0, 0.55);

  /* FIDE 标准棋盘色（F-61 强约束，禁止改动） */
  --square-light:   #f0d9b5;
  --square-dark:    #b58863;
  --square-select:  rgba(201, 161, 74, 0.55);
  --square-legal:   rgba(201, 161, 74, 0.45);
  --square-capture: rgba(139, 42, 42, 0.55);
  --square-check:   rgba(139, 42, 42, 0.55);
  --square-last:    rgba(201, 161, 74, 0.30);

  /* D4：俱乐部调字体语义 */
  --font-display: "Cormorant Garamond", "STZhongsong", "Songti SC", "FangSong", serif;   /* 衬线：标题/弹窗 */
  --font-ui:      "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;       /* 无衬线：UI 标签 */
  --font-mono:    "JetBrains Mono", "SF Mono", Consolas, monospace;                      /* 等宽：棋谱/计时 */
}

html, body {
  background:
    /* 左上：吊灯光斑（暖黄铜） */
    radial-gradient(ellipse 900px 500px at 18% -8%, rgba(201, 161, 74, 0.14), transparent 60%),
    /* 右下：壁炉余晖（酒红） */
    radial-gradient(ellipse 700px 400px at 108% 108%, rgba(139, 42, 42, 0.10), transparent 60%),
    /* 中心：桌面聚焦 */
    radial-gradient(ellipse 600px 400px at 50% 35%, rgba(45, 74, 62, 0.18), transparent 65%),
    /* 底色：深墨绿垂直渐变 */
    linear-gradient(180deg, #0f1a18 0%, #0a1311 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100%;
}

/* 极淡的棋盘水印（中心装饰，1% 不透明度） */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(45deg, rgba(234, 228, 207, 0.012) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(234, 228, 207, 0.012) 25%, transparent 25%);
  background-size: 64px 64px;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

/* 顶栏由 topbar.css 提供；本页不重写 */

/* 状态条 */
.wc-status {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-soft);
  padding: 10px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}
.wc-status .pill {
  background: rgba(201, 161, 74, 0.12);
  color: var(--accent-gold-2);
  border: 1px solid rgba(201, 161, 74, 0.40);
  border-radius: 2px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.wc-status .pill.check {
  background: rgba(139, 42, 42, 0.20);
  border-color: rgba(139, 42, 42, 0.65);
  color: #f5d4d4;
  animation: wc-flash 0.9s ease-in-out infinite;
}
.wc-status .pill.thinking {
  background: rgba(201, 161, 74, 0.20);
  border-color: rgba(201, 161, 74, 0.55);
  color: var(--accent-gold-2);
}
.wc-status .pill.over {
  background: rgba(45, 74, 62, 0.30);
  border-color: rgba(45, 74, 62, 0.70);
  color: #c2b89a;
}
@keyframes wc-flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 42, 42, 0.0); }
  50%      { box-shadow: 0 0 16px 4px rgba(139, 42, 42, 0.55); }
}

/* 信息条（三栏：白方棋钟 / 黄铜难度拨盘 / 黑方棋钟） */
.wc-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  max-width: 560px;
  margin: 20px auto 0;
  padding: 0 16px;
}

/* ===== 棋钟本体 ===== */
.wc-clock {
  position: relative;
  background:
    linear-gradient(180deg, #2a1810 0%, #3a2218 50%, #1f120a 100%);
  border: 1px solid var(--accent-gold-3);
  border-radius: 3px;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(201, 161, 74, 0.35),
    inset 0 -2px 0 rgba(0, 0, 0, 0.55);
  transition: transform 0.25s ease, box-shadow 0.3s ease;
  color: #f4ecd8;
}
/* 顶部冠饰（棋子小剪影） */
.clock-crown {
  width: 20px;
  height: 20px;
  color: var(--accent-gold-2);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6));
}
.clock-crown svg { width: 100%; height: 100%; }
.clock-side-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--accent-gold-2);
  text-transform: uppercase;
  margin-top: -2px;
}
.clock-body {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
.clock-face {
  flex: 1;
  position: relative;
  background:
    radial-gradient(ellipse at center top, rgba(201, 161, 74, 0.12), transparent 70%),
    linear-gradient(180deg, #0a0a08 0%, #1a1410 100%);
  border: 1px solid var(--accent-gold-3);
  border-radius: 2px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.8),
    inset 0 0 0 1px rgba(201, 161, 74, 0.15);
  overflow: hidden;
}
/* 棋钟顶部红色"将死旗" */
.clock-flag {
  position: absolute;
  top: 3px;
  width: 10px;
  height: 3px;
  background: linear-gradient(180deg, #c0392b, #8b2a2a);
  border-radius: 1px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
  opacity: 0.85;
  left: 50%;
  transform: translateX(-50%);
}
.clock-time {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: #f4ecd8;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-top: 3px;
  text-shadow: 0 0 8px rgba(244, 236, 216, 0.25);
}
.clock-unit {
  font-size: 7px;
  letter-spacing: 0.32em;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
}
/* 右侧大金属按钮（白方按下/黑方 AI 思考中） */
.clock-button {
  width: 28px;
  background:
    radial-gradient(circle at 30% 30%, #e0bc63 0%, #c9a14a 30%, #8a6f2c 70%, #5a4520 100%);
  border: 1px solid var(--accent-gold-3);
  border-radius: 2px;
  cursor: not-allowed;
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 0 rgba(0, 0, 0, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.5);
}
.clock-button:disabled {
  filter: brightness(0.7) saturate(0.6);
}
.clock-foot {
  font-size: 7px;
  letter-spacing: 0.28em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
  min-height: 9px;
}

/* 当前执方 = active：表盘切换为"亮态" */
.wc-clock.active {
  transform: translateY(-3px);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.7),
    0 0 0 1px var(--accent-gold-2),
    0 0 26px rgba(201, 161, 74, 0.35),
    inset 0 1px 0 rgba(224, 188, 99, 0.45);
}
.wc-clock.active .clock-face {
  background:
    radial-gradient(ellipse at center top, rgba(244, 236, 216, 0.18), transparent 70%),
    linear-gradient(180deg, #2a2a1c 0%, #1a1a10 100%);
  border-color: var(--accent-gold);
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(201, 161, 74, 0.45),
    0 0 16px rgba(201, 161, 74, 0.35);
}
.wc-clock.active .clock-time {
  color: #fff;
  text-shadow:
    0 0 14px rgba(224, 188, 99, 0.7),
    0 0 28px rgba(201, 161, 74, 0.4);
}
.wc-clock.active .clock-flag {
  background: linear-gradient(180deg, #e74c3c, #c0392b);
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.8);
  animation: wc-clock-pulse 1s ease-in-out infinite;
}
.wc-clock.active .clock-button {
  background:
    radial-gradient(circle at 30% 30%, #f4d078 0%, #e0bc63 30%, #c9a14a 70%, #8a6f2c 100%);
  cursor: pointer;
  filter: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -3px 0 rgba(0, 0, 0, 0.35),
    0 4px 10px rgba(201, 161, 74, 0.55);
}
@keyframes wc-clock-pulse {
  0%, 100% { transform: translateX(-50%) scaleY(1); opacity: 0.85; }
  50%      { transform: translateX(-50%) scaleY(1.25); opacity: 1; }
}

/* ===== 黄铜难度拨盘 ===== */
.wc-dial {
  position: relative;
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.dial-cap {
  height: 10px;
  background:
    linear-gradient(180deg, var(--accent-gold-2) 0%, var(--accent-gold) 50%, var(--accent-gold-3) 100%);
  border: 1px solid var(--accent-gold-3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.dial-cap:first-child { border-radius: 6px 6px 0 0; border-bottom: none; }
.dial-cap:last-of-type { border-radius: 0 0 6px 6px; border-top: none; }
.dial-screw {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #e8d088 0%, #c9a14a 45%, #6a5020 80%, #2a1c08 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.6);
  position: relative;
}
.dial-screw::before {
  content: '';
  position: absolute;
  inset: 1px;
  background:
    linear-gradient(135deg, transparent 45%, rgba(0,0,0,0.5) 50%, transparent 55%);
  border-radius: 50%;
}
.dial-body {
  flex: 1;
  background:
    linear-gradient(180deg, var(--accent-gold-3) 0%, var(--accent-gold) 50%, var(--accent-gold-3) 100%);
  border-left: 1px solid var(--accent-gold-3);
  border-right: 1px solid var(--accent-gold-3);
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.45),
    inset 0 -2px 4px rgba(0, 0, 0, 0.45);
}
.dial-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.3);
  opacity: 0.5;
  transition: opacity 0.2s, background 0.2s;
}
.dial-row.active {
  opacity: 1;
  background:
    linear-gradient(180deg, #fff7d4 0%, #f4d078 50%, #c9a14a 100%);
  border-color: var(--accent-gold-3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 2px 6px rgba(0, 0, 0, 0.4);
}
.dial-piece {
  width: 16px;
  height: 16px;
  color: var(--accent-gold-3);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.4));
  flex-shrink: 0;
}
.dial-row.active .dial-piece {
  color: var(--text-on-accent);
}
.dial-row svg { width: 100%; height: 100%; }
.dial-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--accent-gold-2);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: not-allowed;
  padding: 0;
  text-align: left;
  font-family: inherit;
}
.dial-row.active .dial-btn {
  color: var(--text-on-accent);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}
.dial-label {
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
  font-size: 8px;
  letter-spacing: 0.28em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
  font-weight: 600;
}

/* 中等屏幕：拨盘更窄，时钟数字略小 */
@media (max-width: 760px) {
  .wc-info { max-width: 100%; gap: 10px; }
  .wc-clock { padding: 6px 8px 8px; }
  .clock-time { font-size: 18px; }
  .clock-button { width: 22px; }
  .wc-dial { width: 64px; }
}
/* 小屏：棋钟与拨盘堆叠 */
@media (max-width: 600px) {
  .wc-info {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
  }
  .wc-info .wc-clock:nth-child(3) { grid-column: 1 / 2; grid-row: 2 / 3; }
  .wc-info .wc-dial { grid-column: 2 / 3; grid-row: 2 / 3; width: auto; align-self: center; }
  .wc-info .wc-clock:nth-child(1) { grid-column: 1 / 3; grid-row: 1 / 2; }
  .dial-label { display: none; }
}

/* 棋盘主区 */
.wc-main {
  /* 主区宽度：跟随棋盘尺寸自适应，超大屏 1300px 上限 */
  width: 100%;
  max-width: 1300px;
  margin: 20px auto 0;
  padding: 0 16px;
  display: grid;
  /* 棋盘列 = 自适应 1fr，侧栏列固定 320px */
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: center;
  justify-content: center;
}
/* 棋盘外框：宽度按高度比例 1:1 限制 + 黄铜边框（合并为单一块） */
.wc-board-wrap {
  /* 关键：棋盘 = min(列宽, 视口高度-260, 720px)
     - 720px 是国际象棋对局"舒适尺寸"上限
     - 视口高度保证 1:1 比例下棋盘不超出视口
     - 列宽保证棋盘不会撑爆侧栏 */
  width: 100%;
  max-width: min(100%, calc(100vh - 260px), 720px);
  justify-self: end;
  position: relative;
  aspect-ratio: 1 / 1;
  background:
    /* 黄铜金属渐变（边框） */
    linear-gradient(135deg, var(--accent-gold-3) 0%, var(--accent-gold) 35%, var(--accent-gold-2) 50%, var(--accent-gold) 65%, var(--accent-gold-3) 100%);
  border-radius: 3px;
  padding: 14px;
  box-shadow:
    /* 桌沿悬浮阴影 */
    0 28px 70px rgba(0, 0, 0, 0.75),
    0 12px 28px rgba(0, 0, 0, 0.55),
    /* 黄铜内边光 */
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 0 rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.4s;
}
/* 1080p+ 超大屏：棋盘略放大但不超过 760px */
@media (min-height: 1100px) {
  .wc-board-wrap { max-width: min(100%, calc(100vh - 260px), 760px); }
}
/* 移动端：棋盘单列，上限 600px 居中 */
@media (max-width: 880px) {
  .wc-main { grid-template-columns: 1fr; }
  .wc-board-wrap { max-width: min(100%, calc(100vh - 380px), 600px); justify-self: center; }
}
/* 木纹绒布内核（介于黄铜边框与棋盘之间） */
.wc-board-wrap::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 2px;
  background:
    /* 木纹纹理：多层细线条 */
    repeating-linear-gradient(92deg,
      rgba(0,0,0,0.08) 0px,
      rgba(0,0,0,0.08) 1px,
      transparent 1px,
      transparent 5px),
    repeating-linear-gradient(95deg,
      rgba(255,255,255,0.04) 0px,
      rgba(255,255,255,0.04) 1px,
      transparent 1px,
      transparent 11px),
    /* 暗木纹底色 */
    linear-gradient(180deg, #2a1810 0%, #3a2218 50%, #1f120a 100%);
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(201, 161, 74, 0.25);
  pointer-events: none;
  z-index: 0;
}
/* 棋盘本体提到木纹之上 */
.wc-board-wrap > .wc-board { position: relative; z-index: 1; }
/* 4 个角的黄铜铆钉 */
.wc-board-wrap::after {
  content: '';
  position: absolute;
  inset: 7px;
  pointer-events: none;
  background:
    radial-gradient(circle 5px at 0 0, var(--accent-gold-2) 0%, var(--accent-gold) 45%, var(--accent-gold-3) 70%, transparent 75%),
    radial-gradient(circle 5px at 100% 0, var(--accent-gold-2) 0%, var(--accent-gold) 45%, var(--accent-gold-3) 70%, transparent 75%),
    radial-gradient(circle 5px at 0 100%, var(--accent-gold-2) 0%, var(--accent-gold) 45%, var(--accent-gold-3) 70%, transparent 75%),
    radial-gradient(circle 5px at 100% 100%, var(--accent-gold-2) 0%, var(--accent-gold) 45%, var(--accent-gold-3) 70%, transparent 75%);
  z-index: 2;
}

.wc-board-wrap.thinking {
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.75),
    0 0 0 1px var(--accent-gold-2),
    0 0 44px rgba(201, 161, 74, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.wc-board-wrap.stage-win {
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(45, 74, 62, 0.95),
    0 0 44px rgba(45, 74, 62, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.wc-board-wrap.stage-lose {
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(139, 42, 42, 0.95),
    0 0 44px rgba(139, 42, 42, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.wc-board-wrap.stage-draw {
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.75),
    0 0 0 1px var(--accent-gold),
    0 0 44px rgba(201, 161, 74, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.wc-board-wrap.stage-check {
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(139, 42, 42, 0.98),
    0 0 56px rgba(139, 42, 42, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  animation: wc-check-pulse 1s ease-in-out infinite;
}
@keyframes wc-check-pulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.15); }
}

/* 棋盘本体：8×8 grid */
.wc-board {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border-radius: 6px;
  overflow: hidden;
  user-select: none;
}
.wc-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.wc-cell.light { background: var(--square-light); }
.wc-cell.dark  { background: var(--square-dark); }
.wc-cell.selected {
  background: var(--square-select) !important;
}
.wc-cell.legal::after {
  content: '';
  position: absolute;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: var(--square-legal);
  box-shadow:
    0 0 12px rgba(201, 161, 74, 0.85),
    0 0 4px rgba(255, 247, 212, 0.6);
  pointer-events: none;
  animation: wc-legal-breathe 2.2s ease-in-out infinite;
}
@keyframes wc-legal-breathe {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 8px rgba(201, 161, 74, 0.55),
      0 0 2px rgba(255, 247, 212, 0.4);
  }
  50% {
    transform: scale(1.35);
    box-shadow:
      0 0 18px rgba(224, 188, 99, 1),
      0 0 6px rgba(255, 247, 212, 0.8);
  }
}
.wc-cell.capture::after {
  width: 88%;
  height: 88%;
  border-radius: 50%;
  background: transparent;
  border: 4px solid var(--square-capture);
  box-shadow:
    0 0 14px rgba(139, 42, 42, 0.65),
    inset 0 0 8px rgba(139, 42, 42, 0.35);
  animation: wc-capture-breathe 1.6s ease-in-out infinite;
}
@keyframes wc-capture-breathe {
  0%, 100% {
    transform: scale(1);
    border-width: 4px;
    box-shadow:
      0 0 10px rgba(139, 42, 42, 0.5),
      inset 0 0 4px rgba(139, 42, 42, 0.25);
  }
  50% {
    transform: scale(0.92);
    border-width: 5px;
    box-shadow:
      0 0 22px rgba(231, 76, 60, 0.85),
      inset 0 0 12px rgba(231, 76, 60, 0.45);
  }
}
.wc-cell.legal.castle::after {
  width: 70%;
  height: 70%;
  border-radius: 4px;
  background: rgba(201, 161, 74, 0.20);
  border: 2px dashed rgba(201, 161, 74, 0.85);
  animation: wc-castle-breathe 2.2s ease-in-out infinite;
}
@keyframes wc-castle-breathe {
  0%, 100% {
    transform: scale(1);
    border-color: rgba(201, 161, 74, 0.7);
  }
  50% {
    transform: scale(1.08);
    border-color: rgba(224, 188, 99, 1);
  }
}
.wc-cell.last-move-from, .wc-cell.last-move-to {
  box-shadow: inset 0 0 0 3px rgba(245, 158, 11, 0.6);
}
.wc-cell.in-check {
  background: radial-gradient(circle, var(--square-check) 0%, transparent 70%) !important;
  animation: wc-check-cell 1s ease-in-out infinite;
}
@keyframes wc-check-cell {
  0%, 100% { background-color: inherit; }
  50%      { background-color: var(--square-check); }
}

/* 棋子（SVG sprite via <use>） */
.wc-piece {
  display: block;
  width: 86%;
  height: 86%;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
  z-index: 2;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6))
          drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
  pointer-events: none;  /* 点击交给 cell，避免 SVG 内部路径事件冲突 */
}
.wc-piece svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.wc-piece.white { color: #f4ecd8; }
.wc-piece.black { color: #1a1410; }
.wc-piece.moving {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  /* 中段抬升：cubic-bezier(0.34, 1.4, 0.64, 1) 上扬 - 控制"拿起-放下" */
  transform: translateY(-4px);
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.75))
          drop-shadow(0 0 6px rgba(201, 161, 74, 0.5));
  transition: left 0.38s cubic-bezier(0.34, 1.4, 0.64, 1),
              top  0.38s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.wc-cell .wc-piece.selected {
  transform: scale(1.18) translateY(-4px);
  filter: drop-shadow(0 0 14px var(--accent-gold-2))
          drop-shadow(0 6px 12px rgba(0, 0, 0, 0.65));
  animation: wc-piece-selected-pulse 1.6s ease-in-out infinite;
}
@keyframes wc-piece-selected-pulse {
  0%, 100% {
    transform: scale(1.18) translateY(-4px);
    filter: drop-shadow(0 0 12px var(--accent-gold-2))
            drop-shadow(0 6px 12px rgba(0, 0, 0, 0.65));
  }
  50% {
    transform: scale(1.22) translateY(-6px);
    filter: drop-shadow(0 0 22px var(--accent-gold-2))
            drop-shadow(0 0 8px rgba(224, 188, 99, 0.8))
            drop-shadow(0 6px 12px rgba(0, 0, 0, 0.65));
  }
}

/* 侧栏 */
.wc-side {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-soft);
  border-top: 2px solid var(--accent-gold-3);
  border-radius: 2px;
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-family: var(--font-ui);
}
/* 侧栏标题：衬线小型大写（报刊小标） */
.wc-side h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-style: italic;
  font-weight: 600;
  color: var(--accent-gold-2);
  letter-spacing: 0.08em;
  text-transform: none;
  margin: 0 0 2px;
  padding: 0 0 6px;
  border-bottom: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
/* 标题右侧的小标签（英文 uppercase 等宽） */
.wc-side h3::after {
  content: attr(data-en);
  font-family: var(--font-ui);
  font-size: 9px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--text-muted);
  text-transform: uppercase;
  flex: 1;
  text-align: right;
  padding-bottom: 2px;
}
/* 标题下方细分隔线 */
.wc-side h3 + * { position: relative; }
/* stats/棋谱 区段：标题下方加一条细分隔线 */
.wc-side .stats,
.wc-side .wc-moves {
  border-top: 1px solid var(--border-soft);
  padding-top: 12px;
}

.wc-side .stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.wc-side .stat {
  background: rgba(15, 26, 24, 0.5);
  border: 1px solid var(--border-soft);
  border-left: 2px solid var(--accent-gold-3);
  border-radius: 2px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wc-side .stat .k {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.wc-side .stat .v {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

/* 棋谱列表（报纸印刷感） */
.wc-moves {
  max-height: 280px;
  overflow-y: auto;
  background:
    /* 极淡的横线纸张纹 */
    repeating-linear-gradient(180deg,
      transparent 0px,
      transparent 27px,
      rgba(234, 228, 207, 0.025) 27px,
      rgba(234, 228, 207, 0.025) 28px),
    rgba(15, 26, 24, 0.55);
  border: 1px solid var(--border-soft);
  border-radius: 2px;
  padding: 12px 14px 14px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.85;
  color: var(--text-primary);
  scrollbar-width: thin;
  scrollbar-color: var(--accent-gold-3) transparent;
}
.wc-moves::-webkit-scrollbar { width: 6px; }
.wc-moves::-webkit-scrollbar-thumb { background: var(--accent-gold-3); border-radius: 3px; }
.wc-moves::-webkit-scrollbar-track { background: transparent; }
/* 空白态：居中 + 衬线斜体（俱乐部感） */
.wc-moves:empty::before {
  content: 'The board awaits its first move.';
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--text-muted);
  display: block;
  text-align: center;
  padding: 48px 0;
  letter-spacing: 0.04em;
}
/* 走子配对：左列回合号 + 右列两走 */
.wc-moves .pair {
  display: grid;
  grid-template-columns: 32px 1fr 1fr;
  align-items: baseline;
  gap: 6px;
  padding: 0;
  border-bottom: 1px dashed rgba(234, 228, 207, 0.04);
}
.wc-moves .pair:last-child { border-bottom: none; }
.wc-moves .pair .num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-align: right;
}
.wc-moves .pair .mv {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.wc-moves .pair .mv:last-child { text-align: left; padding-left: 6px; }
/* AI 走子用斜体（教练笔记感） */
.wc-moves .pair .mv.ai {
  font-style: italic;
  color: var(--text-secondary);
}
.wc-moves .pair .mv.win {
  color: var(--accent-gold-2);
  font-weight: 700;
}
.wc-moves .pair .mv.win::after {
  content: ' †';
  font-size: 11px;
  vertical-align: super;
  color: var(--accent-gold-2);
  font-weight: 400;
}

/* 操作按钮 */
.wc-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* ===== 黄铜金属铭牌按钮（默认 = 次要） ===== */
.wc-btn {
  position: relative;
  flex: 1 1 auto;
  min-width: 90px;
  border: 1px solid var(--accent-gold-3);
  background:
    /* 顶部金属高光 */
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 30%),
    /* 主底色 */
    linear-gradient(180deg, #2a3a30 0%, #1c2e26 100%);
  color: var(--accent-gold-2);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 11px;
  padding: 11px 14px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.4, 0.64, 1),
              box-shadow 0.22s ease,
              color 0.2s;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(201, 161, 74, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.45);
}
/* 扫光层：hover 时一道斜向高光从左扫到右 */
.wc-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.18) 48%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0.18) 52%,
    transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}
.wc-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  color: var(--accent-gold-2);
  box-shadow:
    inset 0 1px 0 rgba(224, 188, 99, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 6px 18px rgba(201, 161, 74, 0.35),
    0 0 0 1px rgba(201, 161, 74, 0.25);
}
.wc-btn:hover:not(:disabled)::before {
  transform: translateX(100%);
}
.wc-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.5),
    inset 0 -1px 0 rgba(201, 161, 74, 0.2),
    0 1px 2px rgba(0, 0, 0, 0.45);
  transition-duration: 0.08s;
}
.wc-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
/* ===== 主按钮（黄铜主色） ===== */
.wc-btn.primary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 35%),
    linear-gradient(180deg, var(--accent-gold-2) 0%, var(--accent-gold) 50%, var(--accent-gold-3) 100%);
  color: var(--text-on-accent);
  border-color: var(--accent-gold-3);
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 0 rgba(0, 0, 0, 0.35),
    0 3px 10px rgba(201, 161, 74, 0.4);
}
.wc-btn.primary:hover:not(:disabled) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, transparent 40%),
    linear-gradient(180deg, #f4d884 0%, var(--accent-gold-2) 50%, var(--accent-gold) 100%);
  color: #1a1410;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3),
    0 8px 22px rgba(201, 161, 74, 0.55),
    0 0 0 1px rgba(224, 188, 99, 0.5);
}
.wc-btn.primary:active:not(:disabled) {
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.45),
    inset 0 -1px 0 rgba(255, 255, 255, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.4);
}
/* ===== 危险按钮（酒红战旗） ===== */
.wc-btn.danger {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 30%),
    linear-gradient(180deg, var(--accent-warm) 0%, var(--accent-warm-2) 100%);
  color: #f4ecd8;
  border-color: var(--accent-warm-2);
  box-shadow:
    inset 0 1px 0 rgba(244, 236, 216, 0.2),
    inset 0 -2px 0 rgba(0, 0, 0, 0.45),
    0 3px 10px rgba(139, 42, 42, 0.35);
  /* 古典战旗：微倾斜 */
  transform: rotate(-0.4deg);
}
.wc-btn.danger:hover:not(:disabled) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 30%),
    linear-gradient(180deg, #b03434 0%, #7e2020 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(244, 236, 216, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4),
    0 8px 22px rgba(139, 42, 42, 0.55),
    0 0 0 1px rgba(231, 76, 60, 0.4);
  transform: rotate(-0.4deg) translateY(-2px);
}
.wc-btn.danger:active:not(:disabled) {
  transform: rotate(-0.4deg) translateY(0);
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.5),
    inset 0 -1px 0 rgba(244, 236, 216, 0.2),
    0 1px 2px rgba(0, 0, 0, 0.4);
}
/* 危险按钮顶部装饰：棋盘图标 16px（投降语义） */
.wc-btn.danger::after {
  content: '⚑';
  margin-right: 6px;
  font-size: 13px;
  opacity: 0.85;
}

/* ===== 终局弹窗 ===== */
.wc-modal-mask {
  position: fixed; inset: 0;
  background: rgba(10, 19, 17, 0.78);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.wc-modal-mask.show { display: flex; opacity: 1; }
.wc-modal {
  background:
    /* 顶部黄铜光带 */
    linear-gradient(180deg, rgba(201, 161, 74, 0.08) 0%, transparent 40%),
    linear-gradient(180deg, #1c2e26 0%, #16241f 100%);
  border: 1px solid var(--accent-gold-3);
  border-top: 3px solid var(--accent-gold);
  border-radius: 2px;
  padding: 28px 28px 26px;
  min-width: 340px;
  max-width: 480px;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(201, 161, 74, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  position: relative;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.5, 0.64, 1),
    opacity 0.35s ease;
}
.wc-modal-mask.show .wc-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
/* 俱乐部勋章 */
.wc-medal {
  width: 80px;
  height: 80px;
  margin: 0 auto 6px;
  filter: drop-shadow(0 4px 12px rgba(201, 161, 74, 0.5))
          drop-shadow(0 0 24px rgba(201, 161, 74, 0.25));
  animation: wc-medal-enter 0.7s cubic-bezier(0.34, 1.5, 0.64, 1) 0.15s both;
}
.wc-medal.lose {
  filter: drop-shadow(0 4px 12px rgba(139, 42, 42, 0.5));
  animation: wc-medal-enter 0.7s cubic-bezier(0.34, 1.5, 0.64, 1) 0.15s both,
             wc-medal-shake 0.4s ease-in-out 1s;
}
.wc-medal.draw {
  filter: drop-shadow(0 4px 12px rgba(154, 168, 153, 0.5));
  animation: wc-medal-enter 0.7s cubic-bezier(0.34, 1.5, 0.64, 1) 0.15s both;
}
.wc-medal svg { width: 100%; height: 100%; }
@keyframes wc-medal-enter {
  0%   { transform: translateY(-30px) rotate(-15deg) scale(0.4); opacity: 0; }
  60%  { transform: translateY(4px) rotate(5deg) scale(1.1); opacity: 1; }
  100% { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
}
@keyframes wc-medal-shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  25%      { transform: translateX(-2px) rotate(-3deg); }
  75%      { transform: translateX(2px) rotate(3deg); }
}
.wc-modal .badge {
  position: absolute;
  top: -14px; right: 24px;
  background: linear-gradient(180deg, var(--accent-gold-2) 0%, var(--accent-gold) 50%, var(--accent-gold-3) 100%);
  color: var(--text-on-accent);
  padding: 6px 14px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(201, 161, 74, 0.4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}
.wc-modal h2 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  font-style: italic;
  margin: 4px 0 6px;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  line-height: 1.15;
}
.wc-modal h2.win  { color: var(--accent-gold-2); }
.wc-modal h2.lose { color: #e8a8a8; }
.wc-modal h2.draw { color: var(--text-secondary); }
.wc-modal .sub { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; letter-spacing: 0.06em; font-family: var(--font-ui); }
/* 比分/数据：报纸风格 */
.wc-modal .result {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 22px;
  text-align: left;
}
.wc-modal .result .r {
  background: rgba(15, 26, 24, 0.5);
  border: 1px solid var(--border-soft);
  border-left: 2px solid var(--accent-gold-3);
  border-radius: 2px;
  padding: 9px 11px;
}
.wc-modal .result .r .k { font-size: 9px; color: var(--text-muted); letter-spacing: 0.22em; text-transform: uppercase; font-family: var(--font-ui); font-weight: 600; }
.wc-modal .result .r .v { font-size: 16px; font-weight: 700; color: var(--text-primary); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.wc-modal .actions { display: flex; gap: 8px; justify-content: center; }

/* ===== Toast（金属条 + 滑动入场） ===== */
.wc-toast {
  position: fixed; top: 24px; left: 50%;
  background:
    linear-gradient(180deg, rgba(201, 161, 74, 0.15) 0%, transparent 50%),
    rgba(10, 19, 17, 0.96);
  color: var(--accent-gold-2);
  padding: 11px 22px;
  border-radius: 2px;
  border: 1px solid rgba(201, 161, 74, 0.5);
  border-top: 2px solid var(--accent-gold-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-ui);
  opacity: 0;
  transform: translateX(-50%) translateY(-30px);
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.34, 1.5, 0.64, 1);
  z-index: 200;
  pointer-events: none;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.6),
    0 0 16px rgba(201, 161, 74, 0.25);
}
.wc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 升变选择面板（F-73） ===== */
.wc-promo-mask {
  position: fixed; inset: 0;
  background: rgba(10, 19, 17, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.wc-promo-mask.show { display: flex; opacity: 1; }
.wc-promo {
  background:
    linear-gradient(180deg, rgba(201, 161, 74, 0.08) 0%, transparent 40%),
    linear-gradient(180deg, #1c2e26 0%, #16241f 100%);
  border: 1px solid var(--accent-gold-3);
  border-top: 3px solid var(--accent-gold);
  border-radius: 2px;
  padding: 28px 32px 30px;
  text-align: center;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(201, 161, 74, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.5, 0.64, 1),
    opacity 0.3s ease;
}
.wc-promo-mask.show .wc-promo {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.wc-promo h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  margin: 0 0 6px;
}
.wc-promo h3::after {
  content: 'PROMOTION';
  display: block;
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--text-muted);
  margin-top: 4px;
}
.wc-promo .choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.wc-promo .choice {
  position: relative;
  width: 84px;
  height: 96px;
  border: 1px solid var(--border-soft);
  border-radius: 2px;
  background: rgba(15, 26, 24, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1),
              border-color 0.2s, background 0.2s, box-shadow 0.25s;
  box-shadow:
    inset 0 1px 0 rgba(201, 161, 74, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4);
}
/* 升变按钮扫光 */
.wc-promo .choice::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.2) 48%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0.2) 52%,
    transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}
.wc-promo .choice:hover {
  border-color: var(--accent-gold);
  background: rgba(201, 161, 74, 0.1);
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(224, 188, 99, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 8px 20px rgba(201, 161, 74, 0.35);
}
.wc-promo .choice:hover::before { transform: translateX(100%); }
.wc-promo .choice:active {
  transform: translateY(-1px);
  transition-duration: 0.08s;
}
/* SVG 棋子（升变面板） */
.wc-promo .choice .promo-piece {
  width: 52px !important;
  height: 52px !important;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6));
}
.wc-promo .choice .lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-ui);
}
.wc-promo .choice:hover .lbl {
  color: var(--accent-gold-2);
}

/* 返回链接 */
.wc-back {
  display: inline-block;
  margin: 12px 0 0 24px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s;
}
.wc-back::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent-gold);
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform 0.25s, background 0.2s;
}
.wc-back:hover { color: var(--accent-gold-2); }
.wc-back:hover::after { transform: scaleX(1); background: var(--accent-gold-2); }

/* 调试面板 */
.wc-debug {
  margin-top: 8px;
  background: rgba(15, 26, 24, 0.55);
  border: 1px solid var(--border-soft);
  border-radius: 2px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.wc-debug summary { cursor: pointer; letter-spacing: 0.12em; text-transform: uppercase; }
.wc-debug pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-all; }

/* 粒子炸开（将死特效：8 颗金属碎片） */
.wc-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
/* 金属碎片：4px 黄铜色菱形 + 旋转 + 黄铜光晕 */
.wc-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background:
    linear-gradient(135deg, var(--accent-gold-2) 0%, var(--accent-gold) 50%, var(--accent-gold-3) 100%);
  box-shadow:
    0 0 12px rgba(224, 188, 99, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: rotate(45deg);
  animation: wc-p 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  --dx: 0;
  --dy: 0;
}
@keyframes wc-p {
  0% {
    transform: rotate(45deg) scale(0.3);
    opacity: 0;
  }
  15% {
    transform: rotate(135deg) scale(1.4);
    opacity: 1;
  }
  100% {
    transform: rotate(var(--rot, 540deg)) scale(0.4);
    opacity: 0;
  }
}

/* 棋盘慢镜（将死瞬间）：1.06x 缩放再回弹 */
.wc-board-wrap.checkmate-flash {
  animation: wc-board-zoom 0.9s cubic-bezier(0.34, 1.5, 0.64, 1);
}
@keyframes wc-board-zoom {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* 被将死方国王：抖动 + 灰化 */
.wc-piece.lost {
  animation: wc-king-shake 0.5s ease-in-out 2, wc-king-fade 1.2s ease-in forwards;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7))
          grayscale(0.8) brightness(0.6);
}
@keyframes wc-king-shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20%      { transform: translateX(-3px) rotate(-2deg); }
  40%      { transform: translateX(3px) rotate(2deg); }
  60%      { transform: translateX(-2px) rotate(-1deg); }
  80%      { transform: translateX(2px) rotate(1deg); }
}
@keyframes wc-king-fade {
  0%   { opacity: 1; }
  100% { opacity: 0.45; }
}

/* ===== 无障碍：尊重系统的 prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  .wc-piece,
  .wc-piece.selected,
  .wc-cell.legal::after,
  .wc-cell.capture::after,
  .wc-cell.legal.castle::after,
  .wc-piece.moving,
  .wc-board-wrap,
  .wc-clock,
  .wc-btn,
  .wc-btn::before,
  .wc-particle,
  .wc-clock.active .clock-flag,
  .wc-modal-mask,
  .wc-modal,
  .wc-promo-mask,
  .wc-promo,
  .wc-medal,
  .wc-toast,
  .wc-promo .choice,
  .wc-promo .choice::before {
    animation: none !important;
    transition: none !important;
  }
  .wc-cell.legal::after { transform: scale(1); }
  .wc-cell.capture::after { transform: scale(1); }
  .wc-piece.selected { transform: scale(1.1) translateY(-2px); }
  .wc-modal,
  .wc-promo { transform: none; opacity: 1; }
  .wc-toast { transform: translateX(-50%); }
}