.sudoku-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

#board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: min(90vw, 460px);
  aspect-ratio: 1 / 1;
  border: 3px solid var(--text);
  background: var(--surface);
  border-radius: 6px;
  overflow: hidden;
}

.cell {
  display: grid;
  place-items: center;
  font-size: clamp(1rem, 4vw, 1.5rem);
  font-weight: 600;
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
  background: var(--surface);
}

.cell.fixed {
  color: var(--text);
  font-weight: 700;
}

.cell.editable {
  color: var(--primary);
}

.cell.selected {
  background: color-mix(in srgb, var(--primary) 25%, transparent);
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  z-index: 1;
}

.cell.related {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.cell.same {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  font-weight: 700;
}

.cell.mistake {
  color: var(--danger);
  font-weight: 700;
  background: color-mix(in srgb, var(--danger) 15%, transparent);
}

.cell.hint {
  color: var(--accent);
  font-weight: 800;
}

/* 3x3 box borders */
.cell.col-2, .cell.col-5 { border-right: 3px solid var(--text); }
.cell.row-2, .cell.row-5 { border-bottom: 3px solid var(--text); }

/* number pad */
.num-pad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: min(90vw, 320px);
}

.num-pad button {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 1.3rem;
  font-weight: 700;
  transition: background 0.15s ease, transform 0.1s ease;
}

.num-pad button:hover {
  background: color-mix(in srgb, var(--primary) 20%, var(--surface-2));
}

.num-pad button:active {
  transform: scale(0.92);
}

@media (max-width: 480px) {
  .num-pad { gap: 5px; }
  .num-pad button { font-size: 1.05rem; }
}
