:root {
  --size: min(72vmin, 620px);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1f2937;
  background: radial-gradient(circle at 22% 8%, #f5f2eb 0%, #ebe5d9 58%, #e2d9c9 100%);
}
.layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 340px;
  gap: 18px;
  max-width: 1220px;
  margin: 0 auto;
  padding: 16px;
}
.board-wrap {
  background: #f7f5ef;
  border-radius: 14px;
  box-shadow: 0 8px 26px rgba(0,0,0,.12);
  padding: 14px;
}
.status { min-height: 28px; font-weight: 700; }
.board {
  width: var(--size);
  height: var(--size);
  margin: 8px auto;
  position: relative;
  border-radius: 12px;
  border: 3px solid #7d5a2d;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 -8px 18px rgba(93, 61, 27, .22),
    0 12px 24px rgba(67, 45, 20, .25);
  background:
    linear-gradient(145deg, rgba(255,255,255,.22), rgba(0,0,0,.06)),
    repeating-linear-gradient(102deg,
      rgba(122, 82, 40, .10) 0px,
      rgba(122, 82, 40, .10) 2px,
      rgba(206, 164, 109, .06) 2px,
      rgba(206, 164, 109, .06) 8px),
    linear-gradient(135deg, #eed6ab 0%, #e2c290 48%, #d4a76e 100%);
}
.grid-line {
  position: absolute;
  background: #5a3f21;
  opacity: 0.75;
}

.grid-line {
  pointer-events: none;
}
.node::after {
  pointer-events: none;
}
.node {
  z-index: 2;
  touch-action: manipulation;
}
.grid-line.h { height: 2px; width: calc(100% - 72px); left: 36px; }
.grid-line.v { width: 2px; height: calc(100% - 72px); top: 36px; }
.node {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: none;
  background: transparent;
  cursor: pointer;
}
.node::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: rgba(40,30,20,.2);
}
.piece {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  box-shadow:
    inset -6px -8px 12px rgba(0,0,0,.32),
    inset 8px 10px 14px rgba(255,255,255,.18),
    0 4px 8px rgba(0,0,0,.35);
}
.piece.black {
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.34) 0 18%, transparent 36%),
    radial-gradient(circle at 72% 78%, rgba(0,0,0,.35) 0 26%, transparent 44%),
    repeating-linear-gradient(32deg, #252525 0 5px, #151515 5px 10px),
    linear-gradient(150deg, #3a3a3a, #0c0c0c);
}
.piece.white {
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.98) 0 22%, transparent 40%),
    radial-gradient(circle at 72% 78%, rgba(115,115,115,.18) 0 30%, transparent 48%),
    repeating-linear-gradient(34deg, #f5f5f5 0 6px, #dcdcdc 6px 12px),
    linear-gradient(150deg, #ffffff, #c7c7c7);
}
.piece.removing { animation: fadePop .45s ease forwards; }
@keyframes fadePop {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(.1); }
}
.controls { display: flex; gap: 10px; justify-content: center; }
button {
  padding: 9px 16px;
  border: 1px solid #7c5f36;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(180deg, #f7edd8, #e2c595);
}
.panel {
  background: #faf8f1;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  padding: 14px;
}
.choice-box.hidden { display: none; }
.choice {
  width: 100%;
  margin: 6px 0;
  text-align: left;
  animation: blink 1s infinite;
}
@keyframes blink { 50% { filter: brightness(1.14); } }
.log {
  margin-top: 12px;
  height: 300px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.35;
  background: #fff;
  border: 1px solid #e0d8cb;
  border-radius: 8px;
  padding: 8px;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .panel { order: -1; }
}


.choice-info {
  font-size: 14px;
  color: #4b5563;
  margin: 6px 0;
}
.choice-picked {
  font-weight: 700;
  margin: 6px 0;
}
.piece.hint {
  animation: pulseHint 0.9s infinite;
  outline: 2px solid rgba(250, 204, 21, 0.9);
  outline-offset: -2px;
}
.piece.hint-selected {
  animation: none;
  outline: 3px solid #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25), inset -6px -8px 12px rgba(0,0,0,.32), inset 8px 10px 14px rgba(255,255,255,.18), 0 4px 8px rgba(0,0,0,.35);
}
@keyframes pulseHint {
  50% { transform: scale(1.06); filter: brightness(1.15); }
}
