.sudoku-surface {
  display: grid;
  gap: var(--space-4);
}

.sudoku-board-shell {
  display: flex;
  justify-content: center;
}

.sudoku-board {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  width: min(100%, 32rem);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 24px;
  border: 2px solid rgba(146, 198, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(8, 15, 27, 0.98), rgba(12, 22, 36, 0.98)),
    #0b1423;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 18px 36px rgba(0, 0, 0, 0.24);
}

.sudoku-cell {
  position: relative;
  border: 1px solid rgba(144, 171, 214, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text);
  font: inherit;
  font-size: clamp(1rem, 2.5vw, 1.45rem);
  font-weight: 800;
  padding: 0;
  min-width: 0;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.sudoku-cell:nth-child(3n) {
  border-right-width: 2px;
  border-right-color: rgba(146, 198, 255, 0.3);
}

.sudoku-cell:nth-child(9n + 1) {
  border-left-width: 2px;
  border-left-color: rgba(146, 198, 255, 0.3);
}

.sudoku-cell.box-top {
  border-top-width: 2px;
  border-top-color: rgba(146, 198, 255, 0.3);
}

.sudoku-cell.box-bottom {
  border-bottom-width: 2px;
  border-bottom-color: rgba(146, 198, 255, 0.3);
}

.sudoku-cell.is-given {
  background:
    linear-gradient(180deg, rgba(32, 52, 83, 0.9), rgba(19, 31, 52, 0.92));
  color: #eef5ff;
}

.sudoku-cell.is-selected {
  background:
    linear-gradient(180deg, rgba(49, 92, 156, 0.95), rgba(30, 58, 103, 0.96));
  box-shadow: inset 0 0 0 2px rgba(193, 225, 255, 0.42);
}

.sudoku-cell.is-related {
  background: rgba(97, 143, 214, 0.14);
}

.sudoku-cell.is-same-value {
  background: rgba(255, 215, 125, 0.14);
}

.sudoku-cell.is-conflict {
  background:
    linear-gradient(180deg, rgba(134, 32, 46, 0.92), rgba(89, 22, 34, 0.96));
  color: #fff4f5;
}

.sudoku-cell.is-empty {
  color: rgba(255, 255, 255, 0.36);
}

.cell-value {
  line-height: 1;
}

.cell-notes {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
  padding: 0.22rem;
  font-size: clamp(0.36rem, 1.45vw, 0.62rem);
  color: rgba(219, 231, 255, 0.78);
}

.cell-note {
  line-height: 1;
}

.number-pad-wrap {
  width: min(100%, 32rem);
  margin-inline: auto;
}

.number-pad-header,
.number-pad-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.number-pad {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 0.55rem;
}

.number-button,
.notes-toggle {
  min-height: 3.15rem;
}

.number-button {
  border: 1px solid rgba(146, 198, 255, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(29, 50, 80, 0.94), rgba(15, 28, 46, 0.96));
  color: var(--color-text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
}

.number-button.is-active {
  border-color: rgba(255, 214, 122, 0.42);
  background:
    linear-gradient(180deg, rgba(83, 65, 20, 0.94), rgba(54, 42, 13, 0.96));
}

.number-button:disabled {
  opacity: 0.45;
}

@media (max-width: 720px) {
  .sudoku-board {
    border-radius: 18px;
  }

  .number-pad {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .number-button:nth-child(9) {
    grid-column: 4 / 6;
  }
}

@media (min-width: 980px) {
  .sudoku-board {
    width: min(100%, 34rem);
  }
}
