.game-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: min(94vmin, 460px);
  aspect-ratio: 1;
  gap: 0;
  border: 2px solid var(--text-strong);
  border-radius: 4px;
  overflow: hidden;
  user-select: none;
  box-shadow: var(--shadow-md);
}
.game-board.is-paused { visibility: hidden; }

.s-cell {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: clamp(16px, 4vmin, 22px);
  color: var(--text-strong);
  cursor: pointer;
  position: relative;
  transition: background .1s ease;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.s-cell[data-c="8"] { border-right: none; }
.s-cell[data-r="8"] { border-bottom: none; }
.s-cell.given { font-weight: 800; }
.s-cell:hover { background: var(--surface-hover); }
.s-cell.selected { background: #fff8d8 !important; box-shadow: inset 0 0 0 2px rgba(237,194,46,0.6); }
body.dark .s-cell.selected { background: #4a3f1f !important; }
.s-cell.same-num { background: #fff4b8; border-radius: 4px; }
body.dark .s-cell.same-num { background: #3a3018; }
.s-cell.peer { background: #faf2dc; }
body.dark .s-cell.peer { background: #2c2418; }
.s-cell.error {
  color: var(--danger);
  background: #fcd6cc !important;
  animation: shake .25s;
}
body.dark .s-cell.error { background: #5a2418 !important; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Thick borders for 3×3 box boundaries */
.s-cell[data-c="2"], .s-cell[data-c="5"] { border-right: 2px solid var(--text-strong); }
.s-cell[data-r="2"], .s-cell[data-r="5"] { border-bottom: 2px solid var(--text-strong); }

.s-cell.user { color: #1976d2; }
body.dark .s-cell.user { color: #64b5f6; }

.notes {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  font-size: clamp(8px, 1.6vmin, 11px);
  font-weight: 600;
  color: var(--text-muted);
  padding: 1px;
}
.notes span {
  display: flex;
  align-items: center;
  justify-content: center;
}

.numpad {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
  max-width: 460px;
  margin: 16px auto 0;
}
.numpad button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-strong);
  border-radius: 999px;
  padding: 12px 0;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  transition: background .12s ease, transform .1s ease;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}
.numpad button:hover { background: var(--surface-hover); transform: scale(1.08); }
.numpad button:disabled { opacity: 0.3; cursor: not-allowed; }

.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 100;
  animation: fadein .3s ease-in-out;
}
.overlay[hidden] { display: none; }
.overlay-text {
  font-size: clamp(36px, 8vmin, 56px);
  font-weight: 800;
  color: var(--text-strong);
  text-align: center;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
