:root {
  --cell-size: 44px;
  --border-thin: 1px solid #bbb;
  --border-thick: 2px solid #222;
  --given-color: #111;
  --user-color: #1565c0;
  --bg: #fafafa;
  --bg-cell: #fff;
  --bg-hover: #eef4ff;
  --bg-error: #ffe5e5;
  --bg-done: #e6f7e6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: #222;
  display: flex;
  justify-content: center;
  padding: 24px;
}

main {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

h1 {
  margin: 0;
  font-weight: 600;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

.controls label {
  font-weight: 500;
}

#difficultyValue {
  display: inline-block;
  min-width: 1.5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#difficulty {
  width: 160px;
}

button {
  padding: 6px 14px;
  font-size: 14px;
  border: 1px solid #888;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

button:hover { background: #f0f0f0; }

.timer {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.timer .label { color: #666; margin-right: 4px; }

.board {
  display: grid;
  grid-template-columns: repeat(9, var(--cell-size));
  grid-template-rows: repeat(9, var(--cell-size));
  border: var(--border-thick);
  background: #222;
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  background: var(--bg-cell);
  border: var(--border-thin);
  font-size: 20px;
  text-align: center;
  outline: none;
  color: var(--user-color);
  font-family: inherit;
  padding: 0;
}

.cell:focus { background: var(--bg-hover); }

.cell.given {
  color: var(--given-color);
  font-weight: 700;
  background: #f3f3f3;
}

.cell.error { background: var(--bg-error); }

.cell.hint {
  color: #2e7d32;
  font-weight: 700;
  background: #eaf7ea;
}

/* Thicker borders between 3x3 blocks */
.cell[data-col="2"], .cell[data-col="5"] { border-right: var(--border-thick); }
.cell[data-row="2"], .cell[data-row="5"] { border-bottom: var(--border-thick); }

.board.done .cell { background: var(--bg-done); }

.status {
  min-height: 1.4em;
  font-weight: 600;
}
