/* ============================================================
   拾光游戏厅 · 国际象棋 chess.css
   前缀 .ch- ：木纹棋盘 / 内联 SVG 棋子容器 / 侧栏 / 升变与终局弹窗
   ============================================================ */

/* ---------------- 整体 ---------------- */
.ch-wrap {
  width: min(100%, 1180px);
  margin: 0 auto;
}

.ch-layout { align-items: start; }

.ch-stage {
  padding: clamp(12px, 1.8vw, 26px);
}

.ch-stage-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* 隐藏的内联 SVG 定义（六种棋子 × 双色） */
.ch-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ---------------- 玩家条 ---------------- */
.ch-player {
  width: 100%;
  max-width: 620px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid rgba(198, 160, 90, .2);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(0, 0, 0, .16)),
    linear-gradient(150deg, #2c2118, #1c1510);
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 185, .07),
    0 3px 8px rgba(0, 0, 0, .25);
  transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.ch-player.is-active {
  border-color: rgba(230, 201, 130, .5);
  background:
    linear-gradient(180deg, rgba(230, 201, 130, .07), rgba(0, 0, 0, .14)),
    linear-gradient(150deg, #33261a, #211810);
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 195, .1),
    0 0 18px rgba(198, 160, 90, .1),
    0 3px 8px rgba(0, 0, 0, .28);
}
.ch-player-seal {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(198, 160, 90, .3);
  background: radial-gradient(circle at 40% 30%, rgba(198, 160, 90, .18), rgba(0, 0, 0, .22));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.ch-player-seal .ch-piece { width: 23px; height: 23px; }
.ch-player-name { display: flex; flex-direction: column; line-height: 1.16; min-width: 0; }
.ch-player-name b {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .13em;
  color: #e8d7b4;
}
.ch-player-name small {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .15em;
  color: rgba(198, 160, 90, .42);
}
.ch-player-tag {
  margin-left: auto;
  padding: 2px 9px;
  border: 1px solid rgba(198, 160, 90, .22);
  border-radius: 2px;
  color: rgba(239, 225, 196, .44);
  font-size: 9.5px;
  letter-spacing: .08em;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.ch-player.is-active .ch-player-tag {
  color: #2a1c0c;
  border-color: var(--brass-hi);
  background: linear-gradient(180deg, #e9d091, #c6a05a);
  font-weight: 700;
}
.ch-player.is-check .ch-player-tag {
  color: #f6d3cb;
  border-color: rgba(178, 58, 43, .65);
  background: rgba(178, 58, 43, .26);
}

/* ---------------- 棋盘外框 ---------------- */
.ch-board-frame {
  position: relative;
  width: 100%;
  max-width: 620px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 20px;
  padding: clamp(10px, 1.6vw, 16px);
  border: 1px solid rgba(198, 160, 90, .26);
  border-radius: 5px;
  background:
    linear-gradient(150deg, rgba(255, 228, 178, .1), transparent 42%),
    repeating-linear-gradient(92deg, rgba(28, 15, 7, .24) 0 2px, rgba(255, 225, 175, .014) 2px 6px, transparent 6px 23px),
    linear-gradient(160deg, #4c3020 0%, #33200f 62%, #24150a 100%);
  box-shadow:
    0 18px 38px rgba(0, 0, 0, .48),
    inset 0 1px 0 rgba(255, 228, 180, .12),
    inset 0 0 46px rgba(0, 0, 0, .34);
}
.ch-board-frame::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(198, 160, 90, .18);
  border-radius: 2px;
  pointer-events: none;
}
.ch-ranks {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-rows: repeat(8, minmax(0, 1fr));
  align-items: stretch;
}
.ch-files {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
}
.ch-ranks span,
.ch-files span {
  display: grid;
  place-items: center;
  color: rgba(198, 160, 90, .5);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .04em;
  line-height: 1;
  user-select: none;
}

/* ---------------- 棋盘 ---------------- */
.ch-board {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  border-radius: 2px;
  overflow: hidden;
  background: #2a1a0d;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .55),
    0 0 0 3px rgba(198, 160, 90, .17),
    0 14px 30px rgba(0, 0, 0, .5);
  touch-action: manipulation;
}
.ch-board::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  box-shadow:
    inset 0 0 26px rgba(0, 0, 0, .26),
    inset 0 1px 0 rgba(255, 240, 210, .12);
}

.ch-sq {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: box-shadow .16s ease;
}
.ch-sq--light {
  background:
    linear-gradient(155deg, rgba(255, 250, 232, .46), transparent 48%),
    repeating-linear-gradient(84deg, rgba(126, 88, 42, .035) 0 1px, transparent 1px 11px),
    repeating-linear-gradient(6deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 17px),
    linear-gradient(150deg, #f0dfba 0%, #e6cda1 58%, #d8bd8e 100%);
}
.ch-sq--dark {
  background:
    linear-gradient(155deg, rgba(255, 232, 190, .1), transparent 48%),
    repeating-linear-gradient(84deg, rgba(30, 15, 6, .1) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(4deg, rgba(0, 0, 0, .045) 0 1px, transparent 1px 19px),
    linear-gradient(150deg, #90613a 0%, #7b4f2d 58%, #674127 100%);
}
.ch-sq--light::before,
.ch-sq--dark::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 -1px 0 rgba(0, 0, 0, .1);
}
.ch-sq--light::before { background: linear-gradient(180deg, rgba(255, 255, 255, .06), transparent 30%); }
.ch-sq--dark::before { background: linear-gradient(180deg, rgba(255, 235, 200, .05), transparent 34%); }

/* 棋子容器 */
.ch-sq-piece {
  position: absolute;
  inset: 1% 2% 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: transform .15s ease, filter .15s ease;
}
.ch-sq-piece .ch-piece {
  width: 100%;
  height: 100%;
  display: block;
}
.ch-piece--w { filter: drop-shadow(0 2px 1.4px rgba(38, 19, 3, .5)); }
.ch-piece--b { filter: drop-shadow(0 2px 1.6px rgba(0, 0, 0, .6)) drop-shadow(0 0 1px rgba(255, 236, 200, .3)); }

/* ---------------- 高亮与标记 ---------------- */
.ch-sq--last { box-shadow: inset 0 0 0 2px rgba(198, 160, 90, .38); }
.ch-sq--last::before { background: rgba(230, 201, 130, .2); }
.ch-sq--sel {
  z-index: 3;
  box-shadow: inset 0 0 0 2px rgba(240, 209, 132, .95), inset 0 0 20px rgba(230, 201, 130, .38);
}
.ch-sq--sel .ch-sq-piece {
  transform: translateY(-4%) scale(1.05);
  filter: drop-shadow(0 0 9px rgba(230, 201, 130, .5));
}
.ch-sq--check {
  z-index: 2;
  box-shadow: inset 0 0 0 2px rgba(178, 58, 43, .85), inset 0 0 22px rgba(178, 58, 43, .5);
}
.ch-sq--check .ch-sq-piece { filter: drop-shadow(0 0 8px rgba(210, 84, 62, .75)); }

.ch-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 27%;
  height: 27%;
  transform: translate(-50%, -50%) scale(.6);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
.ch-sq--move .ch-mark {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  background: radial-gradient(circle at 38% 32%, rgba(70, 46, 20, .9), rgba(34, 20, 8, .82));
  box-shadow: 0 0 0 1px rgba(240, 214, 158, .5), 0 2px 4px rgba(0, 0, 0, .35);
}
.ch-sq--capture .ch-mark {
  opacity: 1;
  width: 82%;
  height: 82%;
  transform: translate(-50%, -50%) scale(1);
  background: none;
  border: 3px solid rgba(178, 58, 43, .55);
  box-shadow: 0 0 14px rgba(178, 58, 43, .32), inset 0 0 14px rgba(178, 58, 43, .22);
}
.ch-board--locked .ch-sq { cursor: default; }

/* ---------------- 侧栏 ---------------- */
.ch-side { gap: 11px; }
.ch-card { padding: 14px 15px 13px; }
.ch-card .panel-heading { margin-bottom: 9px; }

.ch-status-main { display: flex; align-items: center; gap: 11px; }
.ch-turn-piece {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(109, 76, 38, .34);
  background: radial-gradient(circle at 40% 30%, rgba(255, 252, 238, .85), rgba(222, 200, 160, .45));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 3px 8px rgba(70, 45, 20, .16);
}
.ch-turn-piece .ch-piece { width: 33px; height: 33px; }
.ch-status-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ch-status-text b {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #3d2913;
}
.ch-status-text small {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .1em;
  color: rgba(81, 55, 26, .48);
}

.ch-alert {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 9px;
  padding: 6px 9px;
  border: 1px solid rgba(109, 76, 38, .24);
  border-radius: 2px;
  background: rgba(255, 250, 236, .34);
  color: #59432a;
  font-size: 10.5px;
  line-height: 1.55;
}
.ch-alert[hidden] { display: none; }
.ch-alert b { flex: 0 0 auto; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; }
.ch-alert span { color: rgba(72, 50, 26, .68); }
.ch-alert.is-check {
  border-color: rgba(178, 58, 43, .42);
  background: rgba(178, 58, 43, .09);
  color: #7d2a20;
}
.ch-alert.is-check span { color: rgba(125, 42, 32, .8); }
.ch-alert.is-over {
  border-color: rgba(143, 113, 60, .42);
  background: rgba(198, 160, 90, .16);
  color: #5a3f1d;
}
.ch-alert.is-info { border-color: rgba(147, 116, 64, .3); }

.ch-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 9px;
}
.ch-stat {
  padding: 4px 2px 5px;
  text-align: center;
  border: 1px solid rgba(109, 76, 38, .16);
  border-radius: 2px;
  background: rgba(255, 250, 236, .32);
}
.ch-stat b {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.2;
  color: #4a331d;
}
.ch-stat small {
  display: block;
  margin-top: 1px;
  font-size: 7.5px;
  letter-spacing: .06em;
  color: rgba(81, 55, 26, .5);
  white-space: nowrap;
}

.ch-last {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed rgba(109, 76, 38, .2);
  font-size: 9.5px;
  line-height: 1.6;
  color: rgba(72, 50, 26, .62);
  font-family: var(--font-mono);
  letter-spacing: .01em;
  min-height: 29px;
}

.ch-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.ch-actions .btn {
  width: 100%;
  justify-content: center;
  min-height: 33px;
  padding: 6px 6px;
  font-size: 11px;
  letter-spacing: .04em;
}
/* 纸张上的按钮：黄铜主按钮 + 描边危险按钮 */
.paper-card .ch-actions .btn-primary {
  color: #2b1c0c;
  border-color: #e8cd8f;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .28), transparent 42%),
    linear-gradient(180deg, #ddc083, #b8923f);
  box-shadow: inset 0 1px 0 rgba(255, 250, 225, .6), 0 2px 0 rgba(107, 81, 36, .4);
  text-shadow: 0 1px 0 rgba(255, 247, 220, .4);
}
.paper-card .ch-actions .btn-primary:hover {
  color: #23170a;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .36), transparent 42%),
    linear-gradient(180deg, #e9cf94, #c49d4b);
}
.paper-card .ch-actions .btn-danger {
  color: #8a3529;
  border-color: rgba(178, 58, 43, .4);
  background: linear-gradient(180deg, #f7ebd2, #e9d6b2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 0 rgba(104, 72, 35, .18);
}
.paper-card .ch-actions .btn-danger:hover {
  color: #6d2418;
  background: linear-gradient(180deg, #f5e0c4, #e6cba6);
  border-color: rgba(178, 58, 43, .62);
}

.ch-hint {
  margin-top: 8px;
  font-size: 9.5px;
  line-height: 1.65;
  color: rgba(81, 55, 26, .52);
  letter-spacing: .02em;
}

/* ---------------- 行棋记录 ---------------- */
.ch-move-scroll {
  max-height: 168px;
  overflow-y: auto;
  margin: 0 -6px;
  padding: 0 6px 2px;
  scroll-behavior: smooth;
}
.ch-moves-empty {
  padding: 14px 4px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.7;
  color: rgba(81, 55, 26, .46);
}
.ch-move-line {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) minmax(0, 1fr);
  gap: 3px;
  align-items: center;
  padding: 2px 0;
  border-bottom: 1px dashed rgba(109, 76, 38, .13);
}
.ch-move-line:last-child { border-bottom: 0; }
.ch-move-no {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
  text-align: right;
  color: rgba(81, 55, 26, .42);
  padding-right: 2px;
}
.ch-move {
  min-height: 19px;
  padding: 1px 5px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.45;
  color: #4a331d;
  letter-spacing: .01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-move.is-last {
  background: rgba(198, 160, 90, .3);
  box-shadow: inset 0 0 0 1px rgba(109, 76, 38, .22);
  font-weight: 700;
  color: #3a2712;
}
.ch-move--empty { color: transparent; }

.ch-captured-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(95, 64, 30, .16);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: .12em;
  color: #6a4c26;
}
.ch-captured-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(109, 76, 38, .22), transparent);
}
.ch-captured { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.ch-captured-row { display: flex; align-items: center; gap: 7px; min-height: 22px; }
.ch-captured-row b {
  flex: 0 0 46px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .04em;
  color: rgba(72, 50, 26, .66);
}
.ch-captured-tray { display: flex; align-items: center; flex-wrap: wrap; gap: 0; min-height: 20px; }
.ch-captured-tray .ch-mini { width: 22px; height: 22px; margin-right: -3px; flex: 0 0 auto; }
.ch-captured-tray .ch-mini:last-child { margin-right: 0; }
.ch-captured-tray .ch-none { font-size: 9.5px; color: rgba(81, 55, 26, .3); }

/* ---------------- 规则 ---------------- */
.ch-rules-details summary { font-size: 12px; }
.ch-rules-details summary .ph-en {
  margin-left: auto;
  margin-right: 9px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: .14em;
  color: rgba(98, 67, 31, .4);
}
.ch-rules-details .rule-list { max-height: 216px; }
.ch-rule-list li { line-height: 1.75; }

/* ---------------- 升变弹窗 ---------------- */
.ch-promo-modal { width: min(100%, 430px); }
.ch-promo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.ch-promo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px 7px;
  border: 1px solid rgba(109, 76, 38, .38);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .5), transparent 46%),
    linear-gradient(180deg, #f6e9cc, #e2cca3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 2px 0 rgba(104, 72, 35, .22);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.ch-promo-btn .ch-piece { width: 48px; height: 48px; filter: drop-shadow(0 2px 2px rgba(60, 38, 12, .28)); }
.ch-promo-btn span { font-size: 11.5px; font-weight: 600; color: #4a331d; letter-spacing: .06em; }
.ch-promo-btn em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .12em;
  color: rgba(91, 64, 32, .45);
}
.ch-promo-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(109, 76, 38, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 5px 12px rgba(80, 52, 22, .2);
}
.ch-promo-btn:active { transform: translateY(1px); }
.ch-promo-hint {
  margin-top: 11px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.6;
  color: rgba(81, 55, 26, .58);
}

/* ---------------- 终局弹窗 ---------------- */
.ch-result-modal { width: min(100%, 440px); }
.ch-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 2px 0 4px;
  text-align: center;
}
.ch-result-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 68px;
  height: 68px;
  padding: 0 8px;
  border-radius: 50%;
  border: 1px solid rgba(109, 76, 38, .32);
  background: radial-gradient(circle at 42% 30%, rgba(255, 252, 236, .9), rgba(226, 205, 166, .42));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 7px 16px rgba(70, 45, 20, .16);
}
.ch-result-seal .ch-result-piece { width: 46px; height: 46px; }
.ch-result-seal .ch-result-piece + .ch-result-piece { width: 36px; height: 36px; margin-left: -6px; }
.ch-result-headline {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .12em;
  color: #4a331d;
}
.ch-result-detail { font-size: 11.5px; line-height: 1.75; color: rgba(72, 50, 26, .7); max-width: 320px; }
.ch-result-meta {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  color: rgba(81, 55, 26, .44);
}

/* ---------------- 动效 ---------------- */
@media (prefers-reduced-motion: no-preference) {
  .ch-sq:active .ch-sq-piece { transform: translateY(1px) scale(.985); }
  .ch-sq--sel:active .ch-sq-piece { transform: translateY(-1%) scale(1.01); }
  .ch-sq-piece.is-placed { animation: ch-placed .3s cubic-bezier(.2, .8, .3, 1); }
  .ch-sq--bad { animation: ch-shake .32s ease; }
  .ch-sq--check { animation: ch-check-glow 1.5s ease-in-out infinite; }
  .ch-player.is-check .ch-player-tag { animation: ch-tag-pulse 1.3s ease-in-out infinite; }
  .ch-sq--move .ch-mark { animation: ch-dot-in .16s ease both; }
  .ch-sq--capture .ch-mark { animation: ch-dot-in .16s ease both; }
  .ch-sq--sel { animation: ch-sel-pulse 1.9s ease-in-out infinite; }
}

@keyframes ch-sel-pulse {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(240, 209, 132, .9), inset 0 0 18px rgba(230, 201, 130, .3); }
  50% { box-shadow: inset 0 0 0 2px rgba(250, 226, 160, 1), inset 0 0 26px rgba(230, 201, 130, .5); }
}
@keyframes ch-placed {
  0% { transform: translateY(-7%) scale(1.1); opacity: .55; }
  62% { transform: translateY(1%) scale(.99); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes ch-shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-3px); }
  46% { transform: translateX(3px); }
  72% { transform: translateX(-2px); }
}
@keyframes ch-check-glow {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(178, 58, 43, .8), inset 0 0 18px rgba(178, 58, 43, .38); }
  50% { box-shadow: inset 0 0 0 2px rgba(214, 92, 70, .95), inset 0 0 28px rgba(178, 58, 43, .62); }
}
@keyframes ch-tag-pulse {
  0%, 100% { opacity: .72; }
  50% { opacity: 1; }
}
@keyframes ch-dot-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 悬停抬升：仅精确指针设备 */
@media (hover: hover) and (pointer: fine) {
  .ch-sq:hover .ch-sq-piece { transform: translateY(-3%); filter: drop-shadow(0 4px 3px rgba(30, 15, 2, .4)); }
  .ch-sq--sel:hover .ch-sq-piece { transform: translateY(-5%) scale(1.05); filter: drop-shadow(0 0 10px rgba(230, 201, 130, .55)); }
  .ch-board--locked .ch-sq:hover .ch-sq-piece { transform: none; filter: none; }
  .ch-sq--move:hover .ch-mark {
    background: radial-gradient(circle at 38% 32%, rgba(104, 72, 32, .95), rgba(48, 28, 10, .9));
    box-shadow: 0 0 0 1px rgba(255, 228, 168, .8), 0 3px 7px rgba(0, 0, 0, .4);
  }
  .ch-sq--capture:hover .ch-mark { border-color: rgba(210, 84, 62, .85); box-shadow: 0 0 18px rgba(178, 58, 43, .5); }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .ch-player, .ch-board-frame { max-width: 580px; }
}

@media (max-width: 900px) {
  .ch-player, .ch-board-frame { max-width: 620px; }
  .ch-move-scroll { max-height: 150px; }
  .ch-rules-details .rule-list { max-height: 190px; }
}

@media (max-width: 600px) {
  .ch-stage { padding: 8px; }
  .ch-stage-inner { gap: 7px; }
  .ch-board-frame {
    grid-template-columns: 17px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 16px;
    padding: 7px;
    border-radius: 4px;
  }
  .ch-board-frame::before { inset: 4px; }
  .ch-ranks span, .ch-files span { font-size: 8px; }
  .ch-player { padding: 5px 9px; gap: 8px; border-radius: 3px; }
  .ch-player-seal { width: 24px; height: 24px; }
  .ch-player-seal .ch-piece { width: 19px; height: 19px; }
  .ch-player-name b { font-size: 11.5px; letter-spacing: .1em; }
  .ch-player-name small { font-size: 6.5px; letter-spacing: .1em; }
  .ch-player-tag { font-size: 8.5px; padding: 1px 7px; }
  .ch-card { padding: 12px 12px 11px; }
  .ch-status-main { gap: 9px; }
  .ch-turn-piece { width: 36px; height: 36px; }
  .ch-turn-piece .ch-piece { width: 28px; height: 28px; }
  .ch-status-text b { font-size: 14px; }
  .ch-stats { gap: 4px; }
  .ch-stat b { font-size: 12px; }
  .ch-move-scroll { max-height: 170px; }
  .ch-rules-details .rule-list { max-height: none; }
  .ch-promo-btn .ch-piece { width: 40px; height: 40px; }
  .ch-result-seal { min-width: 60px; height: 60px; }
  .ch-result-seal .ch-result-piece { width: 40px; height: 40px; }
  .ch-result-seal .ch-result-piece + .ch-result-piece { width: 31px; height: 31px; }
}

@media (max-width: 430px) {
  .ch-stage { padding: 5px; }
  .ch-board-frame {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 15px;
    padding: 6px;
  }
  .ch-ranks { display: none; }
  .ch-board { grid-column: 1; }
  .ch-files { grid-column: 1; }
  .ch-sq-piece { inset: 0; }
}
