.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1;
  margin: 0 auto;
  border: 2px solid var(--line);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  user-select: none;
}
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(28px, 8vw, 48px);
  cursor: pointer;
  position: relative;
}
.cell.light { background: #e9d2a3; }
.cell.dark  { background: #8b5a2b; }
.cell.flip  { transform: rotate(180deg); }
.cell .piece { transition: transform 80ms; }
.cell.flip .piece { transform: rotate(180deg); }
.cell.selected { outline: 3px solid #5ade7a; outline-offset: -3px; z-index: 1; }
.cell.legal::after {
  content: '';
  position: absolute;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: rgba(90, 222, 122, 0.5);
}
.cell.legal.capture::after {
  width: 80%;
  height: 80%;
  background: transparent;
  border: 4px solid rgba(255, 93, 93, 0.6);
}
.cell.lastmove { box-shadow: inset 0 0 0 3px rgba(102, 192, 244, 0.65); }
.cell .piece {
  color: #fff;
  text-shadow:
    -1px -1px 0 #000, 1px -1px 0 #000,
    -1px  1px 0 #000, 1px  1px 0 #000;
}
.cell .piece.black { color: #1a1a1a; text-shadow:
    -1px -1px 0 #fff, 1px -1px 0 #fff,
    -1px  1px 0 #fff, 1px  1px 0 #fff; }
.history-pane {
  margin-top: 16px;
  padding: 12px;
  background: var(--panel2);
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  max-height: 160px;
  overflow-y: auto;
  color: var(--muted);
}
.history-pane span { margin-right: 12px; color: var(--text); }
