:root{
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color-scheme:dark;
  --bg:#0f172a;--panel:#111827;--panel2:#0b1620;--ink:#f8fafc;--muted:#94a3b8;
  --line:#334155;--line-strong:#64748b;--peer:#17233a;--match:#213552;--selected:#315277;
  --given:#f8fafc;--entry:#93c5fd;--note:#cbd5e1;--error:#fecaca;--error-bg:#4c1d1d;--success:#86efac;
}
*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}body{margin:0;min-height:100vh;background:var(--bg);color:var(--ink);padding:12px 12px calc(20px + env(safe-area-inset-bottom))}button,select,input{font:inherit}button{touch-action:manipulation}.ui-text,.ui-text *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.app-shell{width:min(100%,760px);margin:0 auto}.topbar{display:flex;align-items:center;justify-content:space-between;min-height:42px}.back-link,.text-button{color:#e2e8f0;text-decoration:none;font-weight:750;font-size:.86rem}.text-button{border:0;background:transparent;padding:9px 4px;cursor:pointer}
.game-card{background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:14px}.title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}h1{margin:0;font-size:clamp(1.45rem,6vw,2rem);line-height:1.1}.subtitle{margin:6px 0 0;color:var(--muted);font-size:.78rem}.primary-button,.secondary-button{border-radius:10px;padding:10px 12px;font-weight:800;border:1px solid var(--line);cursor:pointer}.primary-button{background:#334155;color:var(--ink)}.secondary-button{background:var(--panel2);color:var(--ink)}button:disabled{opacity:.45;cursor:not-allowed}.wide{width:100%;margin-bottom:12px}
.toolbar{margin:14px 0 5px;display:grid;grid-template-columns:auto 1fr;align-items:end;gap:10px}.select-label{color:var(--muted);font-size:.72rem;font-weight:700;display:grid;gap:4px}select{min-width:116px;border:1px solid var(--line);border-radius:9px;background:var(--panel2);color:var(--ink);padding:8px 9px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;text-align:center}.stats span{display:grid}.stats strong{font-size:.92rem}.stats small{color:var(--muted);font-size:.63rem}.status-bar{min-height:21px;margin:2px 0 7px;color:var(--muted);font-size:.78rem}.status-bar.success{color:var(--success);font-weight:750}.status-bar.error{color:var(--error);font-weight:750}
.board-wrap{display:grid;place-items:center}.sudoku-board{width:min(100%,560px);aspect-ratio:1;display:grid;grid-template-columns:repeat(9,1fr);grid-template-rows:repeat(9,1fr);border:2px solid var(--line-strong);background:var(--line-strong);outline:none}.cell{position:relative;display:grid;place-items:center;border:0;border-right:1px solid var(--line);border-bottom:1px solid var(--line);background:#f8fafc;color:#1e4c73;font-weight:750;font-size:clamp(1.1rem,5.8vw,1.9rem);padding:0;cursor:pointer;min-width:0}.cell:nth-child(9n){border-right:0}.cell:nth-last-child(-n+9){border-bottom:0}.cell.box-right{border-right:2px solid #475569}.cell.box-bottom{border-bottom:2px solid #475569}.cell.peer{background:#e2e8f0}.cell.match{background:#cbdced}.cell.selected{background:#9fc2dc}.cell.given{color:#111827;font-weight:850}.cell.wrong{color:#991b1b;background:#fee2e2}.cell.hint-value{color:#854d0e}.cell:focus-visible{box-shadow:inset 0 0 0 3px #2563eb;z-index:2;outline:none}.notes-grid{position:absolute;inset:2px;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);font-size:clamp(.43rem,2vw,.76rem);font-weight:750;color:#475569;line-height:1}.notes-grid span{display:grid;place-items:center}
.number-pad{width:min(100%,560px);margin:12px auto 0;display:grid;grid-template-columns:repeat(9,1fr);gap:5px}.number-pad button{min-width:0;aspect-ratio:1;border:1px solid var(--line);border-radius:9px;background:#1e293b;color:var(--ink);font-weight:850;font-size:clamp(1rem,4.6vw,1.45rem);cursor:pointer;padding:0}.number-pad button:active{background:#475569}.number-pad button.complete{opacity:.35}
.action-row{width:min(100%,560px);margin:10px auto 0;display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.action-row button{min-width:0;border:1px solid var(--line);border-radius:10px;background:var(--panel2);color:var(--ink);padding:8px 2px 7px;display:grid;gap:2px;place-items:center;font-size:.68rem;font-weight:750;cursor:pointer}.action-row button[aria-pressed="true"]{background:#334155;border-color:#94a3b8}.action-icon{font-size:1.18rem;line-height:1}.settings-row{width:min(100%,560px);margin:11px auto 0;display:flex;justify-content:flex-end}.switch-label{display:flex;align-items:center;gap:8px;color:#cbd5e1;font-size:.78rem;cursor:pointer}.switch-label input{position:absolute;opacity:0;pointer-events:none}.switch{width:34px;height:20px;border-radius:999px;background:#334155;position:relative;border:1px solid #475569}.switch:after{content:"";position:absolute;width:14px;height:14px;border-radius:50%;background:#cbd5e1;left:2px;top:2px;transition:.15s}.switch-label input:checked+.switch{background:#475569;border-color:#94a3b8}.switch-label input:checked+.switch:after{transform:translateX(14px);background:#fff}
.site-footer{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;color:var(--muted);font-size:.75rem;padding:16px 3px 0}.site-footer a,.install-copy a{color:#f8fafc;text-underline-offset:2px}
dialog{width:min(calc(100% - 24px),560px);border:1px solid var(--line);border-radius:16px;background:var(--panel);color:var(--ink);padding:0;box-shadow:0 20px 60px rgba(0,0,0,.45)}dialog::backdrop{background:rgba(2,6,23,.72)}.dialog-card{padding:16px}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.dialog-head h2,.compact-dialog h2{margin:0;font-size:1.18rem}.close-button{border:0;background:transparent;color:var(--ink);font-size:1.7rem;line-height:1;padding:2px 6px;cursor:pointer}.install-copy{color:#cbd5e1;font-size:.84rem;line-height:1.55}.install-copy p{margin:10px 0}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.compact-dialog p{color:#cbd5e1;font-size:.88rem}
@media(max-width:520px){body{padding-left:7px;padding-right:7px}.game-card{padding:10px;border-radius:14px}.title-row{align-items:center}.title-row .primary-button{padding:9px 10px;font-size:.82rem}.subtitle{display:none}.toolbar{margin-top:10px}.number-pad{gap:3px}.number-pad button{border-radius:7px}.action-row{gap:4px}.action-row button{font-size:.62rem}.site-footer{display:grid;justify-items:center;justify-content:center;text-align:center}}
@media(orientation:landscape) and (min-width:700px){.app-shell{width:min(100%,980px)}.game-card{padding:16px}.board-wrap{float:left;width:62%;padding-right:14px}.number-pad,.action-row,.settings-row{width:36%;margin-left:64%;}.number-pad{grid-template-columns:repeat(3,1fr);padding-top:22px}.number-pad button{aspect-ratio:auto;min-height:48px}.action-row{grid-template-columns:repeat(2,1fr)}.action-row button:last-child{grid-column:1/-1}.settings-row{justify-content:flex-start}.game-card:after{content:"";display:block;clear:both}}
