* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #111;
  color: #f5f5f5;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.game-shell {
  width: 100%;
  max-width: 720px;
  text-align: center;
}

h1 {
  margin-top: 0;
  margin-bottom: 16px;
}

.top-bar {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.panel {
  background: #1d1d1d;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 12px;
}

.board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  background: #222;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid #333;
  user-select: none;
}

.cell {
  aspect-ratio: 1 / 1;
  background: #2c2c2c;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.cell:hover {
  background: #353535;
}

.cell.dark {
  background: #262626;
}

.cell.selected {
  outline: 3px solid #fff;
  outline-offset: -3px;
}

.cell.valid-move {
  border-color: #ffd54f;
  box-shadow: inset 0 0 0 2px #ffd54f;
}

.cell.valid-capture {
  border-color: #ff8a80;
  box-shadow: inset 0 0 0 2px #ff8a80;
}

.piece {
  width: 76%;
  height: 76%;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.p1 {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.12);
}

.p2 {
  border-style: dashed;
}

.red {
  background: #d32f2f;
}

.green {
  background: #2e7d32;
}

.blue {
  background: #1565c0;
}

.controls {
  margin-top: 16px;
}

button {
  background: #f5f5f5;
  color: #111;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
}

button:hover {
  background: #ddd;
}

.legend {
  margin-top: 18px;
  display: grid;
  gap: 8px;
  justify-content: center;
  font-size: 14px;
  color: #ddd;
}

.swatch {
  width: 16px;
  height: 16px;
  display: inline-block;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.7);
  margin-right: 8px;
  vertical-align: middle;
}