/* Sudoku — 9×9 board with thicker 3×3 box dividers, on-screen keypad,
   pencil marks rendered as a 3×3 sub-grid inside each cell. */

.sudoku-timer {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#sd-pencil.active,
#sd-errors.active {
  background: #ffd54f;
  color: #222;
}

.sudoku-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 18px auto;
  padding: 0 8px;
}

.sudoku-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  width: min(540px, calc(100vw - 24px));
  aspect-ratio: 1;
  background: #fff;
  border: 3px solid #1a1a1a;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.sd-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Tahoma', 'Verdana', sans-serif;
  font-size: clamp(15px, 4.4vw, 26px);
  font-weight: 500;
  color: #2563eb;
  border: 1px solid #d4d4d4;
  cursor: pointer;
  background: #fff;
  position: relative;
  box-sizing: border-box;
}
.sd-cell.given {
  font-weight: 700;
  color: #111;
  cursor: default;
}
.sd-cell.thick-right  { border-right:  2px solid #1a1a1a; }
.sd-cell.thick-bottom { border-bottom: 2px solid #1a1a1a; }

.sd-cell.related     { background: #eef2ff; }
.sd-cell.same-digit  { background: #c7d2fe; }
.sd-cell.selected    { background: #fde68a; }
.sd-cell.conflict    { color: #dc2626; }

.pencils {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  font-size: clamp(8px, 1.6vw, 11px);
  font-weight: 500;
  color: #6b7280;
}
.pencils .p {
  display: flex;
  align-items: center;
  justify-content: center;
}
.pencils .p.same {
  font-weight: 800;
  color: #1d4ed8;
}

.sudoku-keypad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: min(540px, calc(100vw - 24px));
}
.sudoku-keypad button {
  padding: 14px 8px;
  font-size: 18px;
  font-weight: 600;
}

.sd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.sd-overlay.hidden { display: none; }
.sd-overlay-card {
  background: white;
  color: #222;
  padding: 32px 48px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.sd-overlay-card h1 { margin: 0 0 12px; font-size: 32px; }
.sd-overlay-card p  { margin: 0 0 20px; font-size: 16px; opacity: 0.85; }
