.sudoku-options {display:grid;grid-template-columns:auto 1fr;gap:.65rem;align-items:center;max-width:23rem;margin:1.2rem 0}
.sudoku-options .modes {grid-column:1/-1;justify-content:start;margin:0}
.sudoku-options #stats {grid-column:1/-1;justify-self:start}
.sudoku-options select {background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:.7rem;min-height:44px;padding:.4rem .7rem;font:inherit}
.sudoku details {color:var(--muted)}
.sudoku summary {cursor:pointer}
.sudoku-panel {container-type:inline-size}
.sudoku-meta {display:flex;justify-content:space-between;color:var(--muted);margin-bottom:.45rem;font-size:.9rem;font-variant-numeric:tabular-nums}
#grid {border:2px solid var(--text);border-radius:.35rem;background:var(--line);overflow:hidden}
.sudoku-row {display:grid;grid-template-columns:repeat(9,minmax(0,1fr))}
.sudoku-cell {border-right:1px solid var(--line);border-bottom:1px solid var(--line);min-width:0;aspect-ratio:1;background:var(--panel)}
.sudoku-cell:nth-child(3n):not(:last-child) {border-right:2px solid var(--text)}
.sudoku-row:nth-child(3n):not(:last-child) .sudoku-cell {border-bottom:2px solid var(--text)}
.sudoku-cell:last-child {border-right:0}
.sudoku-row:last-child .sudoku-cell {border-bottom:0}
.sudoku-cell button {padding:0;border:0;border-radius:0;width:100%;height:100%;min-height:0;display:grid;place-items:center;background:transparent;color:var(--brand);font-size:clamp(.95rem,5cqi,1.6rem);font-variant-numeric:tabular-nums}
.sudoku-cell.given button {color:var(--text);font-weight:800}
.sudoku-cell.related {background:var(--bg)}
.sudoku-cell.match {background:var(--key)}
.sudoku-cell.selected {background:var(--key);box-shadow:inset 0 0 0 2px var(--brand);position:relative}
.sudoku-cell.wrong button {color:#c14c35;text-decoration:underline wavy}
[data-theme=dark] .sudoku-cell.wrong button {color:#ffa58b}
@media(prefers-color-scheme:dark) {:root:not([data-theme]) .sudoku-cell.wrong button {color:#ffa58b}}
.sudoku-cell button:focus-visible {outline-offset:-3px}
.pencil {display:grid;grid-template-columns:repeat(3,1fr);width:100%;height:100%;align-items:center;font-size:clamp(.48rem,2.45cqi,.8rem);line-height:1;color:var(--muted)}
.sudoku-tools,#numpad {display:grid;gap:.28rem;margin-top:.35rem}
.sudoku-tools {grid-template-columns:repeat(4,1fr)}
#numpad {grid-template-columns:repeat(9,1fr)}
.sudoku-tools button,#numpad button {padding:.2rem;min-width:0}
.sudoku-tools button {font-size:clamp(.72rem,3cqi,.95rem)}
.sudoku-tools button[aria-pressed=true],#next {color:var(--on);background:var(--brand)}
#numpad button {background:var(--key)}
#next {width:100%;margin-top:.5rem}
.sudoku #status {min-height:2.6em;display:grid;place-items:center;font-size:.875rem;margin:.1rem 0}
.sudoku button:disabled {opacity:.5;cursor:default}
@media(max-width:680px) {
    .sudoku-options {display:flex;flex-wrap:wrap;margin:.65rem 0}
    .sudoku-options .modes {flex-basis:100%}
    .sudoku details {font-size:.875rem}
}
