/* ============================================================
   拾光游戏厅 · 中国象棋样式
   所有选择器统一使用 .xg- 前缀，不污染其他游戏。
   ------------------------------------------------------------
   1. 舞台与布局
   2. 棋盘（木质、SVG 刻线、铜角）
   3. 棋子（木盘 + 漆面 + 阴刻字）
   4. 交互态：选中 / 合法落点 / 最后一步 / 将军 / 落子
   5. 舞台顶部对局条
   6. 侧栏：棋手 / 统计 / 战况 / 棋谱 / 规则
   7. 终局弹窗
   8. 动效
   9. 响应式
   ============================================================ */

/* ---------------- 1. 舞台与布局 ---------------- */
.xg-wrap {
  --xg-ink-line: rgba(73, 42, 18, .78);
  --xg-brass-glow: rgba(230, 201, 130, .55);
  --xg-red-glow: rgba(214, 90, 62, .55);
  --xg-board-max: 700px;
  min-width: 0;
}

.game-stage.xg-stage {
  background:
    radial-gradient(ellipse at 50% 4%, rgba(255, 231, 180, .12), transparent 54%),
    radial-gradient(ellipse at 50% 105%, rgba(0, 0, 0, .42), transparent 62%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .045) 0 1px, transparent 1px 3px),
    linear-gradient(150deg, #205443, #123a2e 58%, #0b2a20);
}

.xg-stage-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.xg-head,
.xg-board-wrap,
.xg-stage-foot {
  width: min(100%, var(--xg-board-max));
  /* 视口较矮时自动收小棋盘，保证一屏内看得到整张棋盘 */
  width: min(100%, var(--xg-board-max), calc((100svh - 300px) * 0.906));
}

.xg-stage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
  color: rgba(239, 225, 196, .27);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ---------------- 2. 棋盘 ---------------- */
.xg-board-wrap {
  position: relative;
  container-type: inline-size;
  min-width: 0;
}

.xg-board {
  position: relative;
  width: 100%;
  aspect-ratio: 970 / 1070;
  border-radius: 7px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  background:
    radial-gradient(ellipse at 30% 12%, rgba(255, 241, 208, .55), transparent 58%),
    radial-gradient(ellipse at 50% 52%, rgba(255, 232, 188, 0) 52%, rgba(92, 57, 22, .18) 100%),
    repeating-linear-gradient(91deg,
      rgba(101, 63, 27, .13) 0 1px,
      rgba(101, 63, 27, 0) 1px 5px,
      rgba(255, 231, 183, .055) 5px 6px,
      rgba(255, 231, 183, 0) 6px 15px),
    repeating-linear-gradient(89deg,
      rgba(80, 47, 18, .07) 0 2px,
      rgba(80, 47, 18, 0) 2px 18px),
    repeating-linear-gradient(92deg,
      rgba(255, 244, 213, .035) 0 3px,
      rgba(255, 244, 213, 0) 3px 31px),
    linear-gradient(152deg, #ddb279 0%, #d3a15f 32%, #c58f4f 64%, #b57d42 86%, #a56f39 100%);
  box-shadow:
    0 0 0 1px rgba(84, 52, 22, .55) inset,
    0 1px 0 rgba(255, 242, 210, .4) inset,
    0 2px 0 #6f4c28,
    0 5px 0 #503417,
    0 12px 22px rgba(0, 0, 0, .5),
    0 28px 52px rgba(0, 0, 0, .38);
}

/* 木纹颗粒（内联 SVG 噪声，不请求外部资源） */
.xg-board::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  opacity: .15;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

.xg-board-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.xg-engrave {
  filter: drop-shadow(0 1px 0 rgba(255, 237, 198, .3));
}

.xg-line {
  fill: none;
  stroke: var(--xg-ink-line);
  stroke-width: 2;
  stroke-linecap: round;
}

.xg-line--mark {
  stroke: rgba(73, 42, 18, .6);
  stroke-width: 1.7;
}

.xg-frame-outer {
  fill: none;
  stroke: rgba(58, 32, 12, .86);
  stroke-width: 5.5;
}

.xg-frame-inner {
  fill: none;
  stroke: rgba(73, 42, 18, .48);
  stroke-width: 1.8;
}

.xg-river-text {
  font-family: var(--font-display);
  font-size: 58px;
  font-weight: 700;
  letter-spacing: 32px;
  fill: rgba(64, 36, 14, .68);
}

.xg-seal-rect {
  fill: rgba(155, 48, 33, .84);
  stroke: rgba(88, 21, 11, .55);
  stroke-width: 1;
}

.xg-seal-text {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  fill: #f2e0ba;
}

/* 铜包角 */
.xg-corner {
  position: absolute;
  z-index: 3;
  width: 4.2%;
  aspect-ratio: 1;
  border-radius: 3px;
  pointer-events: none;
  background: linear-gradient(135deg, #f0d79a 0%, #d3ad68 28%, #b08a48 58%, #8b6a34 82%, #6e5226 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 250, 225, .65),
    inset 0 -1px 2px rgba(60, 38, 10, .55),
    0 1px 2px rgba(40, 22, 6, .5);
}

.xg-corner::before {
  content: "";
  position: absolute;
  left: 22%;
  top: 22%;
  width: 56%;
  height: 56%;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff4cf 0%, #cfa95f 42%, #7d5c28 78%, #513a16 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .55), 0 1px 1px rgba(30, 16, 4, .6);
}

.xg-corner--tl { left: 1.1%; top: 1.1%; }
.xg-corner--tr { right: 1.1%; top: 1.1%; }
.xg-corner--bl { left: 1.1%; bottom: 1.1%; }
.xg-corner--br { right: 1.1%; bottom: 1.1%; }

/* 交叉点上的落子按钮 */
.xg-cells {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.xg-cell {
  position: absolute;
  width: 8.7%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.xg-cell.is-empty { cursor: default; }
.xg-cell.is-empty.is-target { cursor: pointer; }

.xg-cell:focus-visible {
  outline: 2px solid rgba(230, 201, 130, .8);
  outline-offset: 2px;
}

/* ---------------- 3. 棋子 ---------------- */
.xg-piece {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 31% 23%, rgba(255, 249, 222, .8), rgba(255, 249, 222, 0) 47%),
    repeating-radial-gradient(circle at 50% 50%,
      rgba(110, 70, 30, .1) 0 1.4%,
      rgba(255, 240, 200, .04) 1.4% 2.8%,
      rgba(110, 70, 30, 0) 2.8% 5.2%),
    radial-gradient(circle at 50% 50%, #f4dca8 0%, #e7c287 40%, #d2a164 66%, #b47f45 86%, #936432 100%);
  box-shadow:
    0 2px 0 rgba(103, 67, 30, .6),
    0 4px 7px rgba(37, 19, 6, .45),
    inset 0 1.5px 1px rgba(255, 248, 226, .8),
    inset 0 -2px 4px rgba(103, 64, 26, .4);
  will-change: transform;
}

/* 黑方棋子用更深一档的胡桃木，木色本身即可区分阵营 */
.xg-piece--b {
  background:
    radial-gradient(circle at 31% 23%, rgba(255, 244, 216, .62), transparent 47%),
    repeating-radial-gradient(circle at 50% 50%,
      rgba(60, 36, 14, .14) 0 1.4%,
      rgba(255, 235, 195, .03) 1.4% 2.8%,
      rgba(60, 36, 14, 0) 2.8% 5.2%),
    radial-gradient(circle at 50% 50%, #d6b07f 0%, #bd9159 38%, #9c713e 64%, #7c552b 85%, #61401e 100%);
}

.xg-piece-face {
  position: absolute;
  inset: 7.5%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
}

.xg-piece--r .xg-piece-face {
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 205, 170, .38), transparent 45%),
    radial-gradient(circle at 50% 62%, #bd4a33 0%, #a53323 42%, #842317 70%, #61150d 100%);
  box-shadow:
    0 0 0 1.5px rgba(226, 190, 126, .9),
    0 0 0 3.5px rgba(116, 70, 32, .55),
    inset 0 1.5px 2px rgba(255, 218, 185, .38),
    inset 0 -4px 7px rgba(52, 8, 4, .55);
}

.xg-piece--b .xg-piece-face {
  background:
    radial-gradient(circle at 35% 25%, rgba(160, 200, 185, .2), transparent 48%),
    radial-gradient(circle at 50% 62%, #46544a 0%, #2f3a32 40%, #1c231e 70%, #0d110e 100%);
  box-shadow:
    0 0 0 1.8px rgba(214, 180, 116, .72),
    0 0 0 4px rgba(80, 52, 24, .6),
    inset 0 1.5px 2px rgba(200, 225, 210, .22),
    inset 0 -4px 7px rgba(0, 0, 0, .6);
}

/* 漆面高光 */
.xg-piece-face::after {
  content: "";
  position: absolute;
  left: 16%;
  top: 7%;
  width: 56%;
  height: 32%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0));
  transform: rotate(-9deg);
  filter: blur(.4px);
  pointer-events: none;
}

.xg-piece-char {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  font-size: 5.5cqw;
  line-height: 1;
  color: #f7e9c8;
  text-shadow:
    0 1px 0 rgba(38, 14, 5, .7),
    0 -1px 0 rgba(255, 248, 224, .18),
    0 2px 4px rgba(0, 0, 0, .25);
  transform: translateY(-1%);
  user-select: none;
  pointer-events: none;
}

.xg-piece--b .xg-piece-char {
  color: #efe0bd;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, .8),
    0 -1px 0 rgba(230, 240, 232, .14),
    0 2px 4px rgba(0, 0, 0, .3);
}

/* ---------------- 4. 交互态 ---------------- */
.xg-cell.is-target::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 26%;
  height: 26%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #f2ce90 0%, #c25a40 45%, #8e2a1b 100%);
  box-shadow:
    0 0 0 1px rgba(120, 44, 24, .45),
    0 1px 3px rgba(60, 18, 8, .55),
    0 0 11px rgba(196, 90, 62, .55);
  pointer-events: none;
}

/* 可吃子的目标：套在敌子外面的红圈 */
.xg-cell.is-target.is-capture::before {
  left: -3%;
  top: -3%;
  right: -3%;
  bottom: -3%;
  width: auto;
  height: auto;
  transform: none;
  background: transparent;
  border: 2.5px solid rgba(222, 112, 84, .98);
  box-shadow:
    0 0 18px rgba(196, 78, 52, .58),
    inset 0 0 12px rgba(196, 78, 52, .22);
}

.xg-cell.is-selected .xg-piece {
  transform: translateY(-5%) scale(1.03);
  filter: brightness(1.06);
  box-shadow:
    0 0 0 2px rgba(240, 208, 138, .95),
    0 0 16px rgba(230, 185, 105, .55),
    0 3px 0 rgba(103, 67, 30, .6),
    0 7px 12px rgba(30, 15, 4, .5),
    inset 0 1.5px 1px rgba(255, 248, 226, .8),
    inset 0 -2px 4px rgba(103, 64, 26, .4);
}

.xg-cell.is-selected::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: -9%;
  border-radius: 50%;
  border: 1.5px solid rgba(243, 211, 141, .92);
  box-shadow:
    0 0 18px rgba(233, 188, 108, .5),
    inset 0 0 14px rgba(233, 188, 108, .2);
  pointer-events: none;
}

.xg-cell.is-last-from::after,
.xg-cell.is-last-to::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
}

.xg-cell.is-last-to::after {
  inset: -7%;
  box-shadow:
    0 0 0 2px rgba(247, 216, 150, .88),
    0 0 0 4px rgba(110, 70, 30, .22),
    0 0 18px rgba(240, 190, 105, .45);
}

.xg-cell.is-last-from::after {
  inset: 37%;
  background: rgba(247, 216, 150, .68);
  box-shadow: 0 0 9px rgba(230, 185, 105, .45);
}

.xg-cell.is-check .xg-piece {
  box-shadow:
    0 0 0 3px rgba(228, 82, 56, .96),
    0 0 26px 6px rgba(214, 66, 46, .5),
    0 2px 0 rgba(103, 67, 30, .6),
    0 4px 8px rgba(37, 19, 6, .45),
    inset 0 1.5px 1px rgba(255, 248, 226, .8),
    inset 0 -2px 4px rgba(103, 64, 26, .4);
}

/* ---------------- 5. 舞台顶部对局条 ---------------- */
.xg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(198, 160, 90, .22);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(45, 32, 22, .92), rgba(24, 17, 12, .94));
  box-shadow: inset 0 1px 0 rgba(255, 228, 180, .1), 0 6px 14px rgba(0, 0, 0, .32);
}

.xg-seat {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 3px 7px 3px 4px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: rgba(239, 225, 196, .38);
}

.xg-seat.is-active {
  color: #f0e3c4;
  background: rgba(198, 160, 90, .08);
  border-color: rgba(198, 160, 90, .28);
}

.xg-seat--r.is-active { box-shadow: inset 2px 0 0 rgba(196, 80, 60, .85); }
.xg-seat--b.is-active { box-shadow: inset 2px 0 0 rgba(207, 176, 126, .55); }
.xg-seat.is-check { border-color: rgba(200, 96, 72, .45); }

.xg-seat-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.xg-seat-mark--r {
  color: #f6e7c6;
  background: radial-gradient(circle at 35% 28%, #c8543e, #94301f 62%, #601910);
  box-shadow: 0 0 0 1px rgba(230, 201, 130, .75), 0 2px 3px rgba(0, 0, 0, .45), inset 0 1px 1px rgba(255, 225, 190, .4);
}

.xg-seat-mark--b {
  color: #ecdcb8;
  background: radial-gradient(circle at 35% 28%, #4c5a50, #252d27 60%, #0e120f);
  box-shadow: 0 0 0 1px rgba(214, 182, 122, .6), 0 2px 3px rgba(0, 0, 0, .45), inset 0 1px 1px rgba(220, 235, 225, .25);
}

.xg-seat-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.xg-seat-info b {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  white-space: nowrap;
}

.xg-seat-info small {
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .14em;
  color: rgba(198, 160, 90, .45);
}

.xg-seat-tag {
  margin-left: 2px;
  padding: 1px 5px;
  border-radius: 2px;
  color: #2a1a0c;
  background: var(--brass);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .08em;
  white-space: nowrap;
}

.xg-seat-tag.is-check {
  color: #fbe9e2;
  background: #a23a2a;
}

.xg-head-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  text-align: center;
}

.xg-turn-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .12em;
  color: #efdfbd;
  white-space: nowrap;
}

.xg-turn-sub {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(198, 160, 90, .5);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .1em;
  white-space: nowrap;
}

.xg-head.is-check {
  border-color: rgba(200, 92, 68, .5);
  box-shadow: inset 0 1px 0 rgba(255, 210, 185, .12), 0 0 18px rgba(160, 50, 32, .28), 0 6px 14px rgba(0, 0, 0, .32);
}

.xg-head.is-check .xg-turn-label { color: #ee9a82; }
.xg-head.is-over .xg-turn-label { color: var(--brass-hi); }

/* ---------------- 6. 侧栏 ---------------- */
.xg-panel .panel-heading { margin-bottom: 10px; }

.xg-players { display: flex; flex-direction: column; gap: 6px; }

.xg-player {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid rgba(100, 67, 32, .16);
  border-radius: 3px;
  background: rgba(255, 249, 232, .26);
  color: rgba(74, 51, 29, .72);
}

.xg-player.is-active {
  color: #4a331d;
  background: rgba(198, 160, 90, .12);
  border-color: rgba(140, 100, 48, .32);
}

.xg-player--r.is-active { box-shadow: inset 2px 0 0 #a53628; }
.xg-player--b.is-active { box-shadow: inset 2px 0 0 #3a2a1c; }

.xg-player.is-check {
  border-color: rgba(178, 58, 43, .42);
  background: rgba(178, 58, 43, .09);
}

.xg-player-disc {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f6e8c8;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.xg-player-disc--r {
  background: radial-gradient(circle at 35% 27%, #c9553f, #9a3222 60%, #67190f);
  box-shadow: 0 0 0 1.5px #e7c78e, 0 0 0 2.5px rgba(100, 62, 26, .5), 0 2px 3px rgba(60, 35, 12, .35), inset 0 1px 1px rgba(255, 220, 190, .45);
}

.xg-player-disc--b {
  background: radial-gradient(circle at 35% 27%, #4a574d, #2b342d 58%, #10140f);
  box-shadow: 0 0 0 1.5px #d8bd8c, 0 0 0 2.5px rgba(70, 46, 22, .5), 0 2px 3px rgba(60, 35, 12, .35), inset 0 1px 1px rgba(220, 235, 225, .3);
}

.xg-player-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.xg-player-main b {
  color: #402b16;
  font-size: 12.5px;
  letter-spacing: .08em;
}

.xg-player-main small {
  color: rgba(93, 64, 31, .5);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .12em;
}

.xg-player-tag {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 2px;
  color: #3a250f;
  background: linear-gradient(180deg, #e2c082, #c6a05a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 1px 1px rgba(90, 60, 20, .25);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .08em;
  white-space: nowrap;
}

.xg-player-tag.is-check {
  color: #fbeae3;
  background: linear-gradient(180deg, #b04a37, #8a2c1e);
  box-shadow: inset 0 1px 0 rgba(255, 200, 180, .3), 0 1px 1px rgba(70, 20, 10, .3);
}

.xg-player-tag.is-win { color: #2c1d0b; background: linear-gradient(180deg, #e8cb8b, #c09a52); }
.xg-player-tag.is-lose { color: #f0d8cf; background: rgba(80, 50, 24, .5); box-shadow: none; }

.xg-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 9px 0 11px;
}

.xg-stat {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(100, 67, 32, .16);
  border-radius: 2px;
  background: rgba(255, 250, 235, .3);
}

.xg-stat dt {
  color: rgba(80, 55, 27, .5);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .1em;
}

.xg-stat dd {
  margin: 2px 0 0;
  overflow: hidden;
  color: #4a331d;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xg-stat.is-check dd { color: #a23524; }
.xg-stat.is-over dd { color: #7a4c1e; }

.xg-mini-side {
  display: inline-block;
  padding: 0 3px;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 600;
  vertical-align: 1px;
}

.xg-mini-side--r { color: #8d2a1e; background: rgba(178, 58, 43, .12); }
.xg-mini-side--b { color: #3a2a1c; background: rgba(58, 42, 28, .1); }

.xg-toolbar { gap: 5px; margin-top: 2px; }
.xg-toolbar .btn {
  flex: 1 1 0;
  justify-content: center;
  min-width: 0;
  padding-left: 4px;
  padding-right: 4px;
}

.xg-cap-group + .xg-cap-group {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed rgba(100, 67, 32, .18);
}

.xg-cap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(80, 55, 27, .62);
  font-size: 10px;
  letter-spacing: .06em;
}

.xg-cap-head b {
  color: rgba(80, 55, 27, .45);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
}

.xg-cap-pieces {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  margin-top: 6px;
}

.xg-cap-disc {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f6e8c8;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
}

.xg-cap-disc--r {
  background: radial-gradient(circle at 35% 27%, #c9553f, #9a3222 60%, #67190f);
  box-shadow: 0 0 0 1px #e2c084, 0 1px 2px rgba(60, 35, 12, .35);
}

.xg-cap-disc--b {
  background: radial-gradient(circle at 35% 27%, #4a574d, #2b342d 58%, #10140f);
  box-shadow: 0 0 0 1px #d0b482, 0 1px 2px rgba(60, 35, 12, .35);
}

.xg-cap-empty {
  color: rgba(80, 55, 27, .36);
  font-size: 10px;
  letter-spacing: .08em;
}

.xg-moves {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 190px;
  overflow-y: auto;
  padding-right: 3px;
}

.xg-move-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 5px;
  padding: 3px 6px;
  border-radius: 2px;
  font-size: 11.5px;
}

.xg-move-row:nth-child(odd) { background: rgba(255, 250, 235, .3); }
.xg-move-row.is-current { background: rgba(198, 160, 90, .2); box-shadow: inset 2px 0 0 #a97b3c; }

.xg-move-no {
  color: rgba(80, 55, 27, .42);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.xg-move {
  overflow: hidden;
  font-weight: 600;
  letter-spacing: .02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xg-move--r { color: #8c2b1d; }
.xg-move--b { color: #3b2b1b; }

.xg-empty {
  padding: 16px 6px;
  color: rgba(80, 55, 27, .42);
  font-size: 10.5px;
  line-height: 1.8;
  text-align: center;
}

.xg-panel .rule-list {
  gap: 5px;
  font-size: 10.5px;
}

.xg-rules-note {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed rgba(100, 67, 32, .18);
  color: rgba(80, 55, 27, .5);
  font-size: 10px;
  line-height: 1.7;
}

/* ---------------- 7. 终局弹窗 ---------------- */
.xg-over {
  padding: 2px 0 6px;
  text-align: center;
}

.xg-over-disc {
  width: 66px;
  height: 66px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f7e9c8;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.xg-over-disc--r {
  background: radial-gradient(circle at 35% 27%, #c9553f, #9a3222 60%, #5f170e);
  box-shadow: 0 0 0 2px #e7c78e, 0 0 0 4px rgba(100, 62, 26, .45), 0 6px 12px rgba(60, 30, 10, .3), inset 0 2px 2px rgba(255, 220, 190, .4);
}

.xg-over-disc--b {
  background: radial-gradient(circle at 35% 27%, #4a574d, #2b342d 58%, #0d110e);
  box-shadow: 0 0 0 2px #d8bd8c, 0 0 0 4px rgba(70, 46, 22, .45), 0 6px 12px rgba(60, 30, 10, .3), inset 0 2px 2px rgba(220, 235, 225, .25);
}

.xg-over-title {
  color: #5a3418;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: .14em;
}

.xg-over-reason {
  margin-top: 4px;
  color: rgba(58, 38, 17, .72);
  font-size: 12px;
}

.xg-over-meta {
  margin-top: 9px;
  color: rgba(93, 64, 31, .45);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
}

/* ---------------- 8. 动效 ---------------- */
@keyframes xg-land {
  0% { transform: translateY(-10%) scale(1.07); }
  55% { transform: translateY(2%) scale(.985); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes xg-board-shake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-3px); }
  40% { transform: translateX(2.5px); }
  62% { transform: translateX(-1.5px); }
  82% { transform: translateX(1px); }
}

@keyframes xg-target-breathe {
  0%, 100% { opacity: .78; transform: translate(-50%, -50%) scale(.94); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes xg-capture-breathe {
  0%, 100% { opacity: .72; }
  50% { opacity: 1; }
}

@keyframes xg-check-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.16); }
}

@keyframes xg-ring-pulse {
  0%, 100% { opacity: .7; }
  50% { opacity: 1; }
}

@keyframes xg-head-check {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 210, 185, .12), 0 0 14px rgba(160, 50, 32, .2), 0 6px 14px rgba(0, 0, 0, .32); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 210, 185, .16), 0 0 22px rgba(180, 60, 38, .4), 0 6px 14px rgba(0, 0, 0, .32); }
}

@media (prefers-reduced-motion: no-preference) {
  .xg-seat,
  .xg-player,
  .xg-player-tag,
  .xg-piece {
    transition: color .18s ease, background-color .18s ease, border-color .18s ease,
      box-shadow .18s ease, transform .16s ease, filter .16s ease;
  }

  .xg-cell.is-target::before {
    animation: xg-target-breathe 1.9s ease-in-out infinite;
  }

  .xg-cell.is-target.is-capture::before {
    animation: xg-capture-breathe 1.6s ease-in-out infinite;
  }

  .xg-cell.is-selected::before {
    animation: xg-ring-pulse 1.9s ease-in-out infinite;
  }

  .xg-cell.is-check .xg-piece {
    animation: xg-check-pulse 1.4s ease-in-out infinite;
  }

  .xg-head.is-check {
    animation: xg-head-check 2s ease-in-out infinite;
  }

  .xg-cell.is-just-moved .xg-piece {
    animation: xg-land .27s cubic-bezier(.2, .85, .3, 1.12);
  }

  .xg-board-wrap.is-shake {
    animation: xg-board-shake .34s cubic-bezier(.36, .07, .19, .97);
  }
}

@media (hover: hover) and (pointer: fine) {
  .xg-cell:not(.is-empty):hover .xg-piece {
    transform: translateY(-2.5%) scale(1.015);
    filter: brightness(1.05);
    box-shadow:
      0 3px 0 rgba(103, 67, 30, .6),
      0 7px 11px rgba(30, 15, 4, .48),
      0 0 0 1px rgba(240, 208, 138, .5),
      0 0 12px rgba(230, 185, 105, .3),
      inset 0 1.5px 1px rgba(255, 248, 226, .8),
      inset 0 -2px 4px rgba(103, 64, 26, .4);
  }

  .xg-cell.is-target.is-capture:hover .xg-piece { transform: none; }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .xg-cell:not(.is-empty):active .xg-piece { transform: translateY(0) scale(.98); }
}

/* ---------------- 9. 响应式 ---------------- */
@media (max-width: 1080px) {
  .xg-head,
  .xg-board-wrap,
  .xg-stage-foot {
    width: min(100%, 620px);
    width: min(100%, 620px, calc((100svh - 290px) * 0.906));
  }
}

@media (max-width: 900px) {
  .xg-stage-inner { gap: 10px; }
  .xg-head,
  .xg-board-wrap,
  .xg-stage-foot {
    width: min(100%, 640px);
    width: min(100%, 640px, calc((100svh - 270px) * 0.906));
  }
}

@media (max-width: 700px) {
  .xg-cell { width: 9.3%; }

  .xg-head {
    gap: 5px;
    padding: 6px 8px;
  }

  .xg-seat {
    gap: 5px;
    padding: 2px 5px 2px 3px;
  }

  .xg-seat-mark { width: 24px; height: 24px; font-size: 13px; }
  .xg-turn-label { font-size: 13px; letter-spacing: .08em; }
  .xg-turn-sub { font-size: 7px; letter-spacing: .06em; }
  .xg-seat-info small { display: none; }
}

@media (max-width: 600px) {
  .xg-stage-inner { gap: 8px; }
  .xg-head { padding: 5px 7px; }
  .xg-seat-info b { font-size: 10.5px; }
  .xg-seat-tag { padding: 1px 4px; font-size: 7.5px; }
  .xg-stage-foot { font-size: 7px; letter-spacing: .08em; }
  .xg-stage-foot span:first-child { display: none; }
  .xg-stage-foot { justify-content: center; }
  .xg-line { stroke-width: 2.6; }
  .xg-line--mark { stroke-width: 2.2; }
  .xg-frame-outer { stroke-width: 6.5; }
  .xg-frame-inner { stroke-width: 2.2; }
  .xg-moves { max-height: 220px; }
}

@media (max-width: 420px) {
  .xg-seat-mark { width: 22px; height: 22px; font-size: 12px; }
  .xg-turn-label { font-size: 12px; letter-spacing: .05em; }
  .xg-seat { padding: 2px 4px 2px 2px; }
  .xg-head { padding: 4px 6px; }
}
