/* Sudoku online (scripts/games-sudoku.mjs, public/games/sudoku.js). Tokens from style.css. */
.sd-levels { display: flex; flex-wrap: wrap; gap: var(--s2); }
.sd-who { font-weight: 500; font-size: var(--t-sm); color: var(--muted); }
.sd-levels [aria-pressed="true"] .sd-who { color: inherit; }
.gm[data-game="sudoku"] .gm-sel input[type="number"] { font: inherit; width: 6em; min-height: 48px; padding: 6px 10px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); box-sizing: border-box; }
.gm-sel[hidden] { display: none; }

.sd { display: grid; gap: var(--s4); grid-template-columns: 1fr; justify-items: center; }
@media (min-width: 900px) { .sd { grid-template-columns: minmax(0, 560px) 220px; justify-content: center; align-items: start; justify-items: stretch; gap: var(--s5); } }
.sd-grid { --size: min(100%, 560px); width: var(--size); aspect-ratio: 1; display: grid; grid-template-rows: repeat(var(--n), 1fr); background: #fff; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; box-sizing: border-box; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.sd-row { display: grid; grid-template-columns: repeat(var(--n), 1fr); min-height: 0; }
.sd-c { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; border-right: 1px solid #b9b4a8; border-bottom: 1px solid #b9b4a8; color: #1f4fb8; font: 700 calc(min(100vw - 72px, 540px) / var(--n) * .56) / 1 var(--font); cursor: pointer; outline: none; }
.sd-row .sd-c:last-child { border-right: 0; }
.sd-row:last-child .sd-c { border-bottom: 0; }
.sd-c.sd-br { border-right: 3px solid var(--ink); }
.sd-c.sd-bb { border-bottom: 3px solid var(--ink); }
.sd-c.sd-given { color: var(--ink); font-weight: 800; cursor: default; }
.sd-c.sd-peer { background: #f2efe6; }
.sd-c.sd-same { background: #d9e6ff; }
.sd-c.sd-sel { background: var(--sun); }
.sd-c:focus-visible { box-shadow: inset 0 0 0 3px var(--focus); }
.sd-c.sd-clash .sd-v { color: #b3261e; text-decoration: underline wavy #b3261e; text-decoration-thickness: 2px; }
.sd-c.sd-bad::after { content: ""; position: absolute; inset: 3px; border: 3px solid #b3261e; border-radius: 6px; pointer-events: none; }
.sd-pic { width: 78%; height: 78%; display: block; }
.sd-c.sd-clash .sd-pic { outline: 3px dashed #b3261e; outline-offset: -2px; border-radius: 6px; }
.sd-notes-g { position: absolute; inset: 2px; display: grid; grid-template-columns: repeat(3, 1fr); font: 600 calc(min(100vw - 72px, 540px) / var(--n) * .2) / 1 var(--font); color: var(--muted); }
.sd-grid[style*="--n: 4"] .sd-notes-g { grid-template-columns: repeat(2, 1fr); }
.sd-notes-g span { display: flex; align-items: center; justify-content: center; }
.sd-nv { width: 80%; height: 80%; }

.sd-pad { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; width: min(100%, 560px); }
@media (min-width: 900px) { .sd-pad { grid-template-columns: repeat(3, 1fr); width: 100%; } }
.sd-k { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: 4px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); font: 800 1.5rem / 1 var(--font); cursor: pointer; }
.sd-k:hover { background: var(--sun); }
.sd-k:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sd-kv.sd-pic { width: 40px; height: 40px; }
.sd-kn { font-size: .8rem; font-weight: 700; color: var(--muted); }
.sd-erase, .sd-notes { font-size: 1rem; font-weight: 700; grid-column: span 2; }
@media (min-width: 900px) { .sd-erase { grid-column: span 1; } .sd-notes { grid-column: span 2; } }
.sd-notes[aria-pressed="true"] { background: var(--ink); color: #fff; }

.gm-big .sd-grid { --size: 100%; }
.gm-big .sd-c { font-size: calc(min(100vw - 48px, 720px) / var(--n) * .6); }
.gm-big .sd-k { min-height: 68px; font-size: 1.9rem; }
.gm-big .sd-erase, .gm-big .sd-notes { font-size: 1.2rem; }
@media (min-width: 900px) { .gm-big .sd { grid-template-columns: 1fr; justify-items: center; } .gm-big .sd-grid { width: min(100%, 720px); } .gm-big .sd-pad { grid-template-columns: repeat(6, 1fr); width: min(100%, 720px); } }
