/* Sudoku — classic NYT-style board (shared look lives in ../theme.css) */

.board-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 0;
}

.sudoku-board {
  display: flex;
  gap: 34px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  border: 2.5px solid var(--ink);
  width: min(62vh, 560px, 92vw);
  aspect-ratio: 1;
  background: var(--card);
  user-select: none;
}

.sq {
  border: 0.5px solid #cfcfcf;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1rem, 3.4vh, 1.7rem);
  font-weight: 500;
  cursor: pointer;
  position: relative;
  touch-action: manipulation;
}

/* Thick 3x3 box borders */
.sq.box-right { border-right: 2px solid var(--ink); }
.sq.box-bottom { border-bottom: 2px solid var(--ink); }

.sq.given {
  font-weight: 700;
  color: var(--ink);
}

.sq.entry {
  color: var(--accent);
  font-weight: 600;
}

.sq.peer {
  background: #f1f4fd;
}

.sq.same-num {
  background: #dbe4fd;
}

.sq.selected {
  background: #b9cbfa !important;
}

.sq.conflict {
  color: #d33131 !important;
}

.sq .notes {
  position: absolute;
  inset: 1px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  font-size: clamp(0.42rem, 1.15vh, 0.62rem);
  font-weight: 600;
  color: var(--ink-soft);
  pointer-events: none;
}

.sq .notes span {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pad-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.pad-toggles {
  display: flex;
  gap: 10px;
}

#notesBtn.notes-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.digit-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pad-btn {
  font: inherit;
  width: 74px;
  height: 74px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.06s ease, background 0.1s ease;
}

.pad-btn:active {
  transform: scale(0.94);
  background: var(--accent-soft);
}

.pad-btn .count {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.pad-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.pad-hint {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .sudoku-board {
    gap: 18px;
  }

  .pad-btn {
    width: 58px;
    height: 58px;
    font-size: 1.4rem;
  }
}
