/* ===== 国际象棋棋盘（8×8 方格）===== */
.chessboard {
  position: relative;
  background: #8b5e34; /* 棋盘外框（木质深棕） */
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 0 0 2px #6d4726;
  user-select: none;
}

/* 方格：浅棕 / 深棕交替 */
.cb-square {
  position: absolute;
  box-sizing: border-box;
}
.cb-square.light { background: #f0d9b5; }
.cb-square.dark { background: #b58863; }

/* 区域高亮（描边 / 填充） */
.cb-square.cb-area-outline { box-shadow: inset 0 0 0 2px rgba(255, 111, 0, 0.9); }
.cb-square.cb-area-fill { background: rgba(255, 213, 79, 0.72); }

/* 上一步标记 */
.cb-square.cb-last { box-shadow: inset 0 0 0 3px rgba(255, 193, 7, 0.85); }

/* 坐标标注 */
.cb-coord {
  position: absolute;
  color: #f3e4cc;
  font-size: 12px;
  font-weight: bold;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cb-coord-file { text-align: center; }
.cb-coord-rank { justify-content: flex-end; padding-right: 4px; }
.cb-coord-hl { color: #ffd54f; }

/* 棋子 */
.cb-piece {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--cell-size, 56px) * 0.82);
  line-height: 1;
  pointer-events: none;
}
.cb-piece.white {
  color: #ffffff;
  text-shadow: 0 0 1px #2b2b2b, 0 0 2px #2b2b2b, 0 1px 2px rgba(0, 0, 0, 0.4);
}
.cb-piece.black {
  color: #1f1f1f;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.95), 0 0 2px rgba(255, 255, 255, 0.6);
}
.cb-piece.selected {
  box-shadow: inset 0 0 0 3px var(--success);
  border-radius: 6px;
}

/* 可走点提示：空格为圆点，吃子为圆环 */
.move-hint {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.move-hint::after {
  content: '';
  width: 34%;
  height: 34%;
  border-radius: 50%;
  background: rgba(46, 160, 86, 0.6);
}
.move-hint.capture::after {
  width: 90%;
  height: 90%;
  background: transparent;
  border: 4px solid rgba(214, 64, 64, 0.6);
  box-sizing: border-box;
}
.move-hint.invalid::after {
  width: 90%;
  height: 90%;
  border-radius: 8px;
  background: rgba(214, 64, 64, 0.2);
  border: 3px solid rgba(214, 64, 64, 0.85);
  box-sizing: border-box;
}

/* 点位高亮（题目 / 演示用） */
.cb-point {
  position: absolute;
  z-index: 6;
  border: 3px solid #ff6f00;
  border-radius: 50%;
  box-sizing: border-box;
  pointer-events: none;
}

/* 兵升变选择浮层 */
.cb-promo {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
}
.cb-promo-btn {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #fffdf7;
  border: 2px solid #b58863;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.cb-promo-btn:active { transform: scale(0.92); }
.cb-promo-btn.white { color: #ffffff; text-shadow: 0 0 1px #2b2b2b, 0 0 2px #2b2b2b; }
.cb-promo-btn.black { color: #1f1f1f; }

/* 棋盘容器在窄屏可横向滚动，避免溢出 */
.quiz-board, .eb-board-wrap, .demo-area { overflow-x: auto; }
