/* ============================================================
   中国象棋界面样式
   ============================================================ */

.xq-board-wrap {
  position: relative;
  width: min(100%, 62vh);
  aspect-ratio: 9 / 10;
  margin: 0 auto;
}

.xq-board {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 30% 15%, rgba(255, 180, 100, 0.08), transparent 60%),
    linear-gradient(160deg, #1c2440, #131a30);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
}

.xq-grid {
  position: absolute;
  inset: 0;
}

.xq-pieces,
.xq-marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ---------------- 棋子 ---------------- */
.xq-piece {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  font-family: "KaiTi", "STKaiti", "SimSun", serif;
  font-weight: 700;
  user-select: none;
  transition: left 0.28s cubic-bezier(0.25, 1, 0.4, 1), top 0.28s cubic-bezier(0.25, 1, 0.4, 1);
  will-change: left, top;
  z-index: 2;
}

.xq-piece.red {
  color: #c0392b;
  background: radial-gradient(circle at 34% 28%, #fff8ec 0%, #f5e3c0 55%, #d8bf94 100%);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.45),
    inset 0 0 0 2px rgba(192, 57, 43, 0.75),
    inset 0 0 0 4px rgba(255, 255, 255, 0.5);
}

.xq-piece.black {
  color: #2c3e50;
  background: radial-gradient(circle at 34% 28%, #fdfdfd 0%, #dfe6ee 55%, #b8c6d8 100%);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.45),
    inset 0 0 0 2px rgba(44, 62, 80, 0.75),
    inset 0 0 0 4px rgba(255, 255, 255, 0.5);
}

/* ---------------- 选中与落点标记 ---------------- */
.xq-mark-sel {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px var(--accent);
  animation: xqSel 1.2s ease-in-out infinite;
  z-index: 3;
}

@keyframes xqSel {
  0%,
  100% {
    box-shadow: 0 0 0 3px var(--accent);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(77, 141, 255, 0.35);
  }
}

.xq-mark-dot {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--win);
  opacity: 0.85;
  z-index: 3;
  animation: chipIn 0.2s ease;
}

.xq-mark-dot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26%;
  height: 26%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--win);
}

.xq-mark-capture {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px var(--lose);
  z-index: 3;
  animation: chipIn 0.2s ease;
}

/* ---------------- 侧栏座位色 ---------------- */
.xq-sd {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-family: "KaiTi", serif;
  font-weight: 700;
}

.xq-sd.red {
  background: radial-gradient(circle at 34% 28%, #fff8ec, #d8bf94);
  color: #c0392b;
  box-shadow: inset 0 0 0 1.5px rgba(192, 57, 43, 0.7);
}

.xq-sd.black {
  background: radial-gradient(circle at 34% 28%, #fdfdfd, #b8c6d8);
  color: #2c3e50;
  box-shadow: inset 0 0 0 1.5px rgba(44, 62, 80, 0.7);
}

/* 对手昵称 */
.xq-opp {
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.xq-opp b {
  color: var(--ink);
  font-weight: 600;
}

/* ---------------- 状态点：红黑 ---------------- */
.gom-dot.red {
  background: #c0392b;
  box-shadow: 0 0 8px rgba(192, 57, 43, 0.6);
}

/* ---------------- 浅色主题 ---------------- */
[data-theme="light"] .xq-board {
  background: linear-gradient(160deg, #fdf6e8, #f3e7cd);
  border-color: rgba(120, 90, 40, 0.35);
  box-shadow: 0 14px 40px rgba(27, 42, 63, 0.12);
}

@media (max-width: 720px) {
  .xq-board-wrap {
    width: max(300px, 100%);
  }
}
