/* Sudoku — DOM grid + number pad on top of the shared arcade kit. */
:root { --accent: #5a8bf0; }

#stage {
  aspect-ratio: auto;
  max-height: none;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 8px 10px;
  touch-action: manipulation;
  background: #0c0f1e;
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: min(94vw, 460px);
  aspect-ratio: 1 / 1;
  background: #6b74a8;
  border: 3px solid #6b74a8;
  border-radius: 6px;
  gap: 1px;
  overflow: hidden;
}

.cell {
  position: relative;
  background: #191d33;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Chakra Petch', 'Segoe UI', sans-serif;
  font-size: clamp(16px, 4.6vw, 26px);
  font-weight: 700;
  color: #8fb4ff;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s ease;
}

/* Thicker separators between the 3x3 boxes. */
.cell[data-c="2"], .cell[data-c="5"] { box-shadow: inset -2px 0 0 #6b74a8; }
.cell[data-r="2"], .cell[data-r="5"] { box-shadow: inset 0 -2px 0 #6b74a8; }
.cell[data-c="2"][data-r="2"], .cell[data-c="2"][data-r="5"],
.cell[data-c="5"][data-r="2"], .cell[data-c="5"][data-r="5"] {
  box-shadow: inset -2px 0 0 #6b74a8, inset 0 -2px 0 #6b74a8;
}

.cell.given { color: #e8ebfa; background: #212643; cursor: default; }
.cell.peer { background: #232845; }
.cell.same { background: #2f3560; }
.cell.sel  { background: #3d4577; }
.cell.bad  { color: #ff8578; }
.cell.bad.sel { background: #5a2d33; }

.cell.pulse { animation: cellPop 0.22s ease; }
@keyframes cellPop { 50% { transform: scale(1.14); } }

/* Pencil marks */
.notes {
  position: absolute;
  inset: 2px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  font-size: clamp(7px, 1.9vw, 11px);
  font-weight: 600;
  color: #7e86b5;
  pointer-events: none;
}
.notes span { display: flex; align-items: center; justify-content: center; }

/* ---------- Number pad ---------- */
.pad-wrap { width: min(94vw, 460px); margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.num-row { display: flex; gap: 6px; }
.num {
  flex: 1 1 0;
  min-width: 0;
  height: 52px;
  border-radius: 9px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: 'Chakra Petch', 'Segoe UI', sans-serif;
  font-size: 21px;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  transition: transform 0.08s ease, background 0.12s ease, opacity 0.15s ease;
}
.num:active { transform: scale(0.93); }
.num .left {
  position: absolute;
  bottom: 3px; right: 5px;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-dim);
}
.num.done { opacity: 0.3; }

.tool-row { display: flex; gap: 6px; }
.tool {
  flex: 1 1 0;
  min-height: 46px;
  border-radius: 9px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.12s ease;
}
.tool:active { transform: scale(0.94); }
.tool.on { background: linear-gradient(135deg, #5a8bf0, #3a5ec4); border-color: transparent; }

/* ---------- Menus ---------- */
.diff-row { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
.diff-btn {
  padding: 11px 16px;
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.diff-btn.active { background: linear-gradient(135deg, #5a8bf0, #3a5ec4); border-color: transparent; }

.mode-row { display: flex; gap: 8px; justify-content: center; }
.mode-btn {
  padding: 13px 22px;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.mode-btn.primary { background: linear-gradient(135deg, var(--purple), #9b7bff); border-color: transparent; }
.mode-btn.alt { background: linear-gradient(135deg, #4fa863, #35784a); border-color: transparent; }

.countdown { font-size: 12px; color: var(--text-dim); }
.countdown b { color: var(--gold); font-variant-numeric: tabular-nums; }
