/* 中国象棋 —— 界面样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
}

body {
  background: linear-gradient(180deg, #4a2f1d 0%, #2e1c10 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  font-family: "KaiTi", "STKaiti", "SimSun", serif;
  color: #f3e2bb;
  padding: 18px 10px;
}

.wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 640px;
}

h1 {
  font-size: 34px;
  letter-spacing: 10px;
  text-indent: 10px;
  color: #ffd479;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.55);
}

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.btn {
  font-family: inherit;
  font-size: 15px;
  color: #ffd479;
  background: linear-gradient(180deg, #6b4526, #543518);
  border: 1px solid #a97b3c;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  transition: filter 0.12s, transform 0.06s;
}

.btn:hover {
  filter: brightness(1.18);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  font-size: 18px;
  padding: 10px 28px;
}

.sep {
  width: 1px;
  height: 22px;
  background: #a97b3c;
  opacity: 0.6;
}

.seg {
  display: inline-flex;
  border: 1px solid #a97b3c;
  border-radius: 6px;
  overflow: hidden;
}

.seg-btn {
  font-family: inherit;
  font-size: 15px;
  padding: 8px 14px;
  background: #543518;
  color: #e8c987;
  border: none;
  cursor: pointer;
}

.seg-btn.active {
  background: #b8860b;
  color: #fff;
}

.diff {
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.diff select {
  font-family: inherit;
  font-size: 15px;
  color: #ffd479;
  background: #543518;
  border: 1px solid #a97b3c;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
}

/* ---------- 棋盘 ---------- */
.board-wrap {
  background: #3a2415;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55), inset 0 0 0 2px #6b4526;
}

canvas {
  display: block;
  width: min(94vw, 596px);
  height: auto;
  border-radius: 4px;
  cursor: pointer;
  touch-action: manipulation;
}

/* ---------- 状态与弹窗 ---------- */
.status {
  font-size: 19px;
  min-height: 30px;
  color: #ffd479;
  letter-spacing: 2px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal.hidden {
  display: none;
}

.modal-box {
  background: #4a2f1d;
  border: 2px solid #b8860b;
  border-radius: 14px;
  padding: 30px 44px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.modal-text {
  font-size: 30px;
  color: #ffd479;
  margin-bottom: 20px;
  letter-spacing: 3px;
}
