.ch-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: min(98vw, 70vh, 560px);
  aspect-ratio: 1;
  border: 3px solid #5a3a22;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  user-select: none;
  /* `none` (not `manipulation`) so a touch-drag on a piece doesn't get
     interpreted as a page scroll — needed for drag-and-drop to receive
     pointermove events on iOS. */
  touch-action: none;
}

.ch-sq {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  border: none;
  padding: 0;
  min-width: 0;
  min-height: 0;
  font-size: clamp(24px, 7vw, 40px);
  line-height: 1;
}

/* Classic cream + walnut squares */
.ch-sq.light { background: #f0d9b5; }
.ch-sq.dark  { background: #b58863; }

.ch-sq.selected { outline: 3px solid #f59e0b; outline-offset: -3px; z-index: 2; }
.ch-sq.check    { background: #fecaca; }
.ch-sq.last     { box-shadow: inset 0 0 0 3px rgba(16, 185, 129, 0.55); }

.ch-sq.hint::after {
  content: "";
  position: absolute;
  width: 26%;
  height: 26%;
  background: rgba(16, 185, 129, 0.8);
  border-radius: 50%;
}

.ch-sq.hint-capture::after {
  width: 85%;
  height: 85%;
  background: transparent;
  border: 3px solid rgba(239, 68, 68, 0.75);
  border-radius: 50%;
}

.ch-piece {
  position: relative;
  z-index: 1;
  line-height: 1;
}

/* Both players use the filled (solid) Unicode glyphs, differentiated
   by color + outline so white pieces stand out on any square. */
.ch-piece.white {
  color: #fafafa;
  text-shadow:
    -1px -1px 0 #1e293b,
     1px -1px 0 #1e293b,
    -1px  1px 0 #1e293b,
     1px  1px 0 #1e293b,
     0 1px 2px rgba(0,0,0,0.5);
}
.ch-piece.black {
  color: #0f172a;
  text-shadow:
     0 1px 0 rgba(255,255,255,0.35),
     0 1px 2px rgba(0,0,0,0.25);
}

.ch-setup-label {
  font-size: 13px;
  color: var(--text-muted);
  text-align: left;
  margin: 4px 2px;
  font-weight: 600;
}

/* Captured-pieces strip — one above and one below the board. */
.ch-captured {
  min-height: 24px;
  padding: 2px 6px;
  font-size: clamp(16px, 4vw, 22px);
  line-height: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  color: var(--text);
  opacity: 0.85;
}

.ch-captured .cap-piece {
  text-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
.ch-captured .cap-piece.white {
  color: #fafafa;
  text-shadow:
    -1px -1px 0 #1e293b,
     1px -1px 0 #1e293b,
    -1px  1px 0 #1e293b,
     1px  1px 0 #1e293b;
}
.ch-captured .cap-piece.black { color: #0f172a; }

.ch-captured .cap-advantage {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  align-self: center;
}

/* Action buttons — smaller so all 5 fit on a phone row. */
.ch-action {
  padding: 6px 10px;
  font-size: 13px;
  min-height: 34px;
}

.promo-btn {
  font-size: 32px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
  min-width: 60px;
}

.promo-btn:hover { background: var(--bg-2); }
