:root{color-scheme:light;font-family:Avenir Next,Trebuchet MS,Segoe UI,sans-serif;line-height:1.45;font-weight:400;--page-bg: #f5f1e8;--page-bg-deep: #eee6d8;--surface: rgba(255, 253, 248, .94);--surface-muted: #f7f2e9;--surface-soft: rgba(250, 247, 240, .96);--border: #ddd2c0;--border-strong: #cab9a2;--text: #20303d;--text-soft: #5f707b;--accent: #35556b;--accent-strong: #284457;--accent-soft: #dbe5eb;--warm: #b76c49;--warm-soft: #f1e2d8;--success: #5f8569;--success-soft: #e6efe8;--danger: #9a4f4f;--danger-soft: #f3e4e4;--cell-given: #2a3a47;--cell-entry: #35556b;--board-line: #c9b9a4;--board-line-strong: #5f707b;background:radial-gradient(circle at top,rgba(255,255,255,.82),transparent 28rem),linear-gradient(180deg,var(--page-bg) 0%,var(--page-bg-deep) 100%);color:var(--text)}*{box-sizing:border-box}html{min-height:100%}body{margin:0;min-width:320px;min-height:100dvh;color:var(--text);background:radial-gradient(circle at top,rgba(255,255,255,.82),transparent 28rem),linear-gradient(180deg,var(--page-bg) 0%,var(--page-bg-deep) 100%);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;touch-action:manipulation}button{font:inherit}button:focus-visible{outline:3px solid rgba(53,85,107,.24);outline-offset:3px}.page-shell{width:min(1180px,calc(100vw - 16px));margin:0 auto;padding:10px 0 12px}.game-panel{display:flex;flex-direction:column;gap:12px;border:1px solid var(--border);border-radius:28px;background:var(--surface);box-shadow:0 18px 40px #20303d14;min-height:calc(100dvh - 22px);padding:16px}.toolbar{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px}.game-title{margin:0;color:var(--text);font-size:clamp(1.55rem,2.6vw,2.2rem);line-height:.94;letter-spacing:-.05em;white-space:nowrap}.difficulty-picker{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}.difficulty-button,.restart-button,.tool-button,.number-button{border-radius:999px;padding:11px 16px;font-weight:700;cursor:pointer;transition:transform .14s ease,background-color .14s ease,color .14s ease,border-color .14s ease,box-shadow .14s ease}.difficulty-button,.tool-button{border:1px solid var(--border);background:var(--surface-muted);color:var(--accent);box-shadow:inset 0 -1px #fffc}.difficulty-button.is-active,.tool-button.is-active{border-color:var(--warm);background:var(--warm-soft);color:var(--warm);box-shadow:0 10px 22px #b76c4924}.restart-button{border:1px solid transparent;background:var(--accent);color:#f9fbfd;box-shadow:0 10px 24px #35556b29}.difficulty-button:hover,.restart-button:hover,.tool-button:hover,.number-button:hover{transform:translateY(-1px)}.restart-button:hover{background:var(--accent-strong)}.play-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;flex:1;min-height:0}.board-column{display:flex;flex-direction:column;min-width:0;min-height:0}.stats-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.stat-card{padding:10px 12px;border:1px solid var(--border);border-radius:16px;background:var(--surface-muted)}.stat-label{display:block;color:var(--text-soft);font-size:.78rem}.stat-card strong{display:block;margin-top:3px;color:var(--text);font-size:1.12rem;letter-spacing:-.03em;font-variant-numeric:tabular-nums}.message{min-height:22px;margin:10px 0 8px;color:var(--accent);font-size:.95rem;font-weight:700}.sudoku-board{--board-size: min(100%, calc(100dvh - 280px) , 560px);width:var(--board-size);max-width:100%;aspect-ratio:1 / 1;margin:0 auto;display:grid;grid-template-columns:repeat(9,minmax(0,1fr));grid-template-rows:repeat(9,minmax(0,1fr));border:2px solid var(--board-line-strong);border-radius:18px;overflow:hidden;background:#fffdfa;box-shadow:0 14px 30px #20303d14;user-select:none;-webkit-user-select:none}.sudoku-board.is-won{box-shadow:0 14px 30px #5f85692e}.sudoku-cell{position:relative;display:grid;place-items:center;margin:0;padding:0;border:0;border-right:1px solid var(--board-line);border-bottom:1px solid var(--board-line);background:#fffdfa;color:var(--cell-entry);font-size:clamp(1.05rem,3.6vw,1.7rem);font-weight:700;font-variant-numeric:tabular-nums;cursor:pointer;min-width:0;min-height:0;line-height:1;-webkit-tap-highlight-color:transparent}.sudoku-cell.box-right{border-right:none}.sudoku-cell.box-bottom{border-bottom:none}.sudoku-cell.box-left{border-left:2px solid var(--board-line-strong)}.sudoku-cell.box-top{border-top:2px solid var(--board-line-strong)}.sudoku-cell:nth-child(9n+1){border-left:none}.sudoku-cell:nth-child(-n+9){border-top:none}.sudoku-cell.is-given{color:var(--cell-given);font-weight:800}.sudoku-cell.is-in-unit{background:#f3eee4}.sudoku-cell.is-same-value{background:var(--accent-soft)}.sudoku-cell.is-selected{background:#e7eef3;box-shadow:inset 0 0 0 2px #35556b73;z-index:1}.sudoku-cell.is-conflict{color:var(--danger);background:var(--danger-soft)}.sudoku-cell.is-conflict.is-selected{background:#f0d9d9}.cell-notes{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);width:100%;height:100%;padding:2px;pointer-events:none}.note-mark{display:grid;place-items:center;color:var(--text-soft);font-size:clamp(.45rem,1.5vw,.72rem);font-weight:600;line-height:1}.controls-column{display:flex;flex-direction:column;gap:12px;min-width:0}.control-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.tool-button{min-height:48px;border-radius:16px;padding:12px 10px}.number-pad{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.number-button{min-height:56px;border-radius:18px;border:1px solid var(--border-strong);background:#fffdfa;color:var(--accent);font-size:1.35rem;font-weight:800;box-shadow:0 8px 18px #20303d0f}.number-button:active{transform:translateY(0);background:var(--accent-soft)}.hint-text{margin:0;color:var(--text-soft);font-size:.88rem;line-height:1.4}.hint-text strong{color:var(--text);font-weight:700}@media(min-width:900px)and (orientation:landscape){.page-shell{width:min(1240px,calc(100vw - 16px));padding:8px 0 10px}.game-panel{min-height:calc(100dvh - 18px);max-height:calc(100dvh - 18px);padding:14px;gap:10px;overflow:hidden}.play-layout{grid-template-columns:minmax(0,1.2fr) minmax(240px,.75fr);align-items:stretch;gap:16px;flex:1;min-height:0}.board-column{min-height:0}.sudoku-board{--board-size: min(100%, calc(100dvh - 170px) , 620px);margin:0}.message{margin:8px 0 6px}.hint-text{font-size:.84rem}.number-button{min-height:64px;font-size:1.5rem}}@media(min-width:900px)and (max-height:820px)and (orientation:landscape){.toolbar{gap:8px}.game-title{font-size:clamp(1.35rem,2vw,1.7rem)}.difficulty-button,.restart-button{padding:9px 14px}.stats-row{gap:6px}.stat-card{padding:8px 10px;border-radius:14px}.stat-label{font-size:.72rem}.stat-card strong{font-size:1rem}.message{min-height:18px;margin:6px 0 4px;font-size:.86rem}.sudoku-board{--board-size: min(100%, calc(100dvh - 140px) );border-radius:14px}.hint-text{display:none}.number-button{min-height:52px}.tool-button{min-height:44px}}@media(max-width:860px){.page-shell{width:min(calc(100vw - 12px),100%);padding:6px 0;height:100dvh;max-height:100dvh}.game-panel{border-radius:20px;padding:10px;height:100%;min-height:0;max-height:100%;gap:8px;overflow:hidden}.toolbar{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"title new" "difficulty difficulty";align-items:center;gap:8px;flex-shrink:0}.game-title{grid-area:title;font-size:clamp(1.35rem,5vw,1.7rem);white-space:nowrap}.difficulty-picker{grid-area:difficulty;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.restart-button{grid-area:new;justify-self:end;padding:9px 14px;white-space:nowrap}.difficulty-button,.restart-button{text-align:center}.difficulty-button{padding:8px 10px;font-size:.92rem}.play-layout{flex:1;min-height:0;display:flex;flex-direction:column;gap:8px}.board-column{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:0}.stats-row{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;flex-shrink:0}.stat-card{padding:6px 8px;border-radius:12px}.stat-label{font-size:.68rem}.stat-card strong{margin-top:1px;font-size:.95rem}.message{flex-shrink:0;min-height:0;margin:6px 0 4px;font-size:.86rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sudoku-board{--board-size: min(100%, calc(100vw - 32px) , calc(100dvh - 250px) );flex:0 1 auto;width:var(--board-size);max-height:min(var(--board-size),100%);margin:0 auto}.controls-column{flex:0 0 auto;gap:8px;padding-bottom:env(safe-area-inset-bottom,0)}.control-actions{gap:6px}.tool-button{min-height:42px;padding:8px 6px;font-size:.9rem;border-radius:14px}.number-pad{grid-template-columns:repeat(9,minmax(0,1fr));gap:5px}.number-button{min-height:48px;min-width:0;padding:8px 0;border-radius:12px;font-size:1.15rem;box-shadow:0 4px 10px #20303d0d}.hint-text{display:none}}@media(max-width:520px){.page-shell{width:100%;padding:0}.game-panel{border-radius:0;border-left:none;border-right:none;min-height:100dvh;max-height:100dvh;height:100dvh;padding:8px 8px calc(8px + env(safe-area-inset-bottom,0));gap:6px}.toolbar{gap:6px}.game-title{font-size:1.35rem}.difficulty-button{padding:7px 6px;font-size:.86rem}.restart-button{padding:8px 12px;font-size:.9rem}.stats-row{gap:4px}.stat-card{padding:5px 6px}.stat-label{font-size:.64rem}.stat-card strong{font-size:.9rem}.message{margin:4px 0 2px;font-size:.8rem}.sudoku-board{--board-size: min(100%, calc(100vw - 20px) , calc(100dvh - 230px) );border-radius:12px}.sudoku-cell{font-size:clamp(.95rem,4.6vw,1.25rem)}.controls-column{gap:6px}.tool-button{min-height:40px;padding:7px 4px;font-size:.86rem}.number-pad{gap:4px}.number-button{min-height:46px;font-size:1.08rem;border-radius:10px;padding:6px 0}}@media(max-width:860px)and (max-height:700px){.message{display:none}.stat-card{padding:4px 6px}.stat-label{font-size:.6rem}.stat-card strong{font-size:.82rem}.sudoku-board{--board-size: min(100%, calc(100vw - 20px) , calc(100dvh - 215px) )}.tool-button{min-height:38px;padding:6px 4px}.number-button{min-height:44px;font-size:1.05rem}}@media(max-width:860px)and (orientation:landscape)and (max-height:500px){.toolbar{grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"title difficulty new";gap:8px}.game-title{font-size:1.2rem}.difficulty-picker{grid-template-columns:repeat(3,minmax(0,1fr))}.stats-row{display:none}.play-layout{flex-direction:row;align-items:stretch;gap:10px}.board-column{flex:1 1 auto}.controls-column{flex:0 0 min(38%,220px);justify-content:center}.sudoku-board{--board-size: min(100%, calc(100dvh - 72px) );margin:0}.number-pad{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.number-button{min-height:42px}}@media(prefers-reduced-motion:reduce){.difficulty-button,.restart-button,.tool-button,.number-button{transition-duration:0ms}}
