/* Mini Sudoku: dark board, boxes split by stage-black gutters, translucent number pad. */
.board-frame.s-frame { width: min(480px, 100cqw); max-width: 100%; }
.s-board {
  --n: 6;
  --s-thick: var(--stage-bg, #000);
  --s-thin: rgba(255, 255, 255, .07);
  --s-peer: #242426;
  --s-same: color-mix(in srgb, var(--game) 26%, #1c1c1e);
  --s-sel: color-mix(in srgb, var(--game) 48%, #1c1c1e);
  container-type: inline-size;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  grid-template-rows: repeat(var(--n), 1fr);
  border-radius: 16px;
  overflow: hidden;
  background: #1c1c1e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.s-cell {
  position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0;
  border-right: 1px solid var(--s-thin); border-bottom: 1px solid var(--s-thin);
  font-size: calc(100cqw / var(--n) * .5); line-height: 1; letter-spacing: -0.02em;
  color: var(--accent); font-weight: 500; cursor: pointer;
  transition: background-color .18s var(--ease-out), color .18s;
}
.s-cell.s-lc { border-right: 0; }
.s-cell.s-lr { border-bottom: 0; }
.s-cell.s-br { border-right: 3px solid var(--s-thick); }
.s-cell.s-bb { border-bottom: 3px solid var(--s-thick); }
.s-cell.s-given { color: #fff; font-weight: 620; }
.s-cell.s-peer { background: var(--s-peer); }
.s-cell.s-same { background: var(--s-same); }
.s-cell.s-sel { background: var(--s-sel); color: #fff; }
.s-cell.s-bad { color: var(--danger); }
.s-cell.s-bad:not(.s-given)::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: color-mix(in srgb, var(--danger) 16%, transparent);
}
@media (hover: hover) { .s-cell:not(.s-sel):hover { background: #2c2c2e; } }
.s-cell.s-pop { animation: s-pop .38s var(--ease-spring); }
@keyframes s-pop { from { transform: scale(.7); } }

/* Pencil marks: 3×2 grid. */
.s-notes {
  position: absolute; inset: 2px; display: grid;
  grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr;
  color: var(--muted); font-weight: 500; font-size: calc(100cqw / var(--n) * .22);
}
.s-notes span { display: flex; align-items: center; justify-content: center; line-height: 1; }
.s-cell.s-note-hit .s-notes { color: #fff; }

/* Number pad. */
.s-pad { width: min(480px, 100cqw); max-width: 100%; display: flex; flex-direction: column; gap: 8px; user-select: none; -webkit-user-select: none; }
.s-digits { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: clamp(4px, 1.4vw, 8px); }
.s-key {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; height: clamp(50px, 14vw, 62px); padding: 0; border-radius: 14px; cursor: pointer;
  border: 0; background: rgba(255, 255, 255, .1); color: #fff; font: inherit;
  touch-action: manipulation; transition: background-color .15s, transform .2s var(--ease-spring), opacity .2s;
}
@media (hover: hover) { .s-key:hover:not(:disabled) { background: rgba(255, 255, 255, .16); } }
.s-key:active:not(:disabled) { transform: scale(.92); background: rgba(255, 255, 255, .2); }
.s-key-d { font-size: clamp(1.3rem, 5.5vw, 1.6rem); font-weight: 550; line-height: 1; letter-spacing: -0.02em; }
.s-key-c { font-size: .66rem; font-weight: 500; color: var(--muted); line-height: 1; }
.s-key.s-done { opacity: .35; cursor: default; }
.s-key.s-done .s-key-c { color: var(--good); }
.s-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stage .s-act, .s-act {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: #fff; font: inherit; font-weight: 550; font-size: .92rem;
  touch-action: manipulation; transition: background-color .15s, color .15s, transform .2s var(--ease-spring);
}
@media (hover: hover) { .stage .s-act:hover, .s-act:hover { background: rgba(255, 255, 255, .16); } }
.s-act:active { transform: scale(.96); }
.stage .s-act.s-on, .s-act.s-on { background: #fff; color: #000; }
.s-toggle { font-size: .68rem; font-weight: 650; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: var(--muted); }
.s-act.s-on .s-toggle { background: var(--game); color: #fff; }
.s-pad.s-locked { opacity: .55; pointer-events: none; }

/* Teaching hints: the unit that explains it, the cells that justify it, the target cell. */
.s-cell.s-hint-area { background: color-mix(in srgb, var(--game) 16%, #1c1c1e); }
.s-cell.s-hint-focus { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
.s-cell.s-hint-target { z-index: 1; box-shadow: inset 0 0 0 3px var(--game); animation: s-hint-pulse 1.1s ease-in-out infinite; }
.s-cell.s-hint-target.s-hint-warn { box-shadow: inset 0 0 0 3px var(--danger); animation-name: s-hint-pulse-warn; }
@keyframes s-hint-pulse { 50% { background-color: color-mix(in srgb, var(--game) 34%, #1c1c1e); } }
@keyframes s-hint-pulse-warn { 50% { background-color: color-mix(in srgb, var(--danger) 30%, #1c1c1e); } }
@media (prefers-reduced-motion: reduce) { .s-cell.s-hint-target { animation: none; } }
