:root{color-scheme:dark;--page-bg: #111827;--surface: #1f2937;--surface-2: #374151;--surface-3: #4b5563;--text: #f9fafb;--muted: #9ca3af;--border: #4b5563;--primary: #3b82f6;--primary-hover: #2563eb;--primary-active: #1d4ed8;--highlight-bg: #2d2816;--highlight-border: #8a7418;--danger: #f87171;--input-bg: #1f2937;--board-cell-bg: #111827;--board-fixed-bg: #1f2937;--board-grid: #344154;--board-strong-border: #64748b;--board-fixed-text: #d1d5db;--board-user-text: #4b6fa8;--board-note-text: #8490a0;--board-selected-bg: #172033;--board-selected-border: #4b6fa8}:root[data-theme=light]{color-scheme:light;--page-bg: #ffffff;--surface: #f9fafb;--surface-2: #f3f4f6;--surface-3: #e5e7eb;--text: #111827;--muted: #6b7280;--border: #d1d5db;--primary: #3b82f6;--primary-hover: #2563eb;--primary-active: #1d4ed8;--highlight-bg: #fef3c7;--highlight-border: #f59e0b;--danger: #dc2626;--input-bg: #ffffff;--board-cell-bg: #ffffff;--board-fixed-bg: #f3f4f6;--board-grid: #9ca3af;--board-strong-border: #000000;--board-fixed-text: #111827;--board-user-text: #1d4ed8;--board-note-text: #4b5563;--board-selected-bg: #dbeafe;--board-selected-border: #2563eb}*{box-sizing:border-box}body{margin:0;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:var(--page-bg);color:var(--text)}button,select,input,textarea{font:inherit;color:inherit}button{min-height:40px;padding:8px 16px;border:1px solid transparent;border-radius:6px;background:var(--primary);color:#fff;font-size:.875rem;font-weight:500;cursor:pointer;transition:background .15s ease,border-color .15s ease,opacity .15s ease}button:hover:not(:disabled){background:var(--primary-hover)}button:active:not(:disabled){background:var(--primary-active)}button:disabled{opacity:.45;cursor:default}select,input,textarea{border:1px solid var(--border);border-radius:6px;background:var(--input-bg);color:var(--text)}select,input{min-height:40px}a{color:var(--primary);font-weight:500}.app{display:flex;flex-direction:column;align-items:center;min-height:100vh;padding:24px 20px 48px}.app-header{display:flex;align-items:center;justify-content:space-between;width:min(720px,100%);gap:24px;margin-bottom:20px}.app-header h1{margin:0;font-size:1.875rem;line-height:2.25rem;font-weight:700}.mode-tabs{display:flex;justify-content:center;width:min(720px,100%);gap:8px;margin-bottom:28px}.mode-tab{flex:1 1 0;max-width:220px}.mode-tab:not(.mode-tab-active){background:var(--surface-2);color:var(--text)}.mode-tab:not(.mode-tab-active):hover{background:var(--surface-3)}.mode-tab-active{background:var(--primary)}.app-view{display:flex;justify-content:center;width:100%}.app-view[hidden]{display:none}.theme-switch,.autosave-switch{display:inline-flex;align-items:center;gap:10px;font-size:.875rem;font-weight:600;cursor:pointer;-webkit-user-select:none;user-select:none}.theme-switch input,.autosave-switch input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.switch-track{position:relative;display:inline-block;width:44px;height:24px;flex:0 0 auto;border-radius:9999px;background:var(--surface-3);transition:background .15s ease}.switch-thumb{position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:9999px;background:#fff;box-shadow:0 1px 2px #0000004d;transition:transform .15s ease}.theme-switch input:checked+.switch-track,.autosave-switch input:checked+.switch-track{background:var(--primary)}.theme-switch input:checked+.switch-track .switch-thumb,.autosave-switch input:checked+.switch-track .switch-thumb{transform:translate(20px)}.sudoku-game{display:flex;flex-direction:column;align-items:center;width:100%;max-width:100%}.sudoku-toolbar{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:10px}.sudoku-toolbar-secondary{margin-bottom:16px}.sudoku-action-button,.sudoku-generate-button,.generated-puzzle-actions button{min-height:40px;padding:8px 16px}.sudoku-note-button-active{background:var(--primary-active);box-shadow:0 0 0 2px #3b82f64d}.sudoku-timer-bar{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px;margin-bottom:14px}.sudoku-timer-value{min-width:110px;font-size:1rem;font-weight:700;font-variant-numeric:tabular-nums;text-align:center}.sudoku-timer-button{min-width:112px}.sudoku-board{display:grid;width:min(var(--board-max-size),calc(100vw - 32px));max-width:100%;border:3px solid var(--board-strong-border);outline:none;background:var(--board-strong-border)}.sudoku-cell{position:relative;display:flex;align-items:center;justify-content:center;width:100%;min-width:0;aspect-ratio:1 / 1;border:0;border-right:1px solid var(--board-grid);border-bottom:1px solid var(--board-grid);font-size:clamp(16px,5vw,24px);background:var(--board-cell-bg);cursor:pointer;-webkit-user-select:none;user-select:none}.sudoku-cell:hover{filter:brightness(1.05)}.sudoku-cell-box-right{border-right:2px solid var(--board-strong-border)}.sudoku-cell-box-bottom{border-bottom:2px solid var(--board-strong-border)}.sudoku-cell-last-column{border-right:0}.sudoku-cell-last-row{border-bottom:0}.sudoku-cell-box-right.sudoku-cell-last-column{border-right:0}.sudoku-cell-box-bottom.sudoku-cell-last-row{border-bottom:0}.sudoku-cell-fixed{font-weight:700;color:var(--board-fixed-text);background:var(--board-fixed-bg)}.sudoku-cell-user-value{color:var(--board-user-text);font-weight:600}.sudoku-cell-missing{background:var(--highlight-bg)}.sudoku-cell-selected{background:var(--board-selected-bg);box-shadow:inset 0 0 0 2px var(--board-selected-border)}.sudoku-value{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.sudoku-candidates{position:absolute;inset:0;display:grid;grid-template-columns:repeat(var(--candidate-columns),1fr);grid-auto-rows:1fr;width:100%;height:100%}.sudoku-candidate{display:flex;align-items:center;justify-content:center;font-size:clamp(.48rem,2vw,.7rem);font-weight:500;line-height:1;color:var(--board-note-text)}.sudoku-mobile-keypad{display:none}.sudoku-help{margin-top:12px;max-width:600px;font-size:.875rem;line-height:1.25rem;color:var(--muted);text-align:center}.sudoku-status{margin:12px 0 0;text-align:center;font-size:.875rem;font-weight:600}.sudoku-error{color:var(--danger)}.sudoku-meta{margin:0 0 16px;color:var(--muted);text-align:center;text-transform:capitalize;font-size:.875rem;font-weight:500}.generator-panel{display:flex;flex-direction:column;gap:16px;width:min(560px,100%)}.generator-settings{display:grid;grid-template-columns:1fr 1fr;gap:12px}.generator-field{display:flex;flex-direction:column;gap:6px}.generator-field>span{font-size:.875rem;font-weight:600}.generator-field select,.generator-field input,.generator-field textarea{width:100%;padding:8px 12px}.generator-field textarea{min-height:120px;resize:vertical}.generator-status{margin:0;color:var(--muted);font-size:.875rem}.generated-puzzle{display:flex;flex-direction:column;gap:10px;margin-top:4px}.generated-puzzle-actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px}.puzzle-solver{display:flex;flex-direction:column;align-items:center;width:100%;max-width:100%}.puzzle-message{width:min(600px,100%);margin-top:24px;padding:20px;border:1px solid var(--border);border-radius:6px;background:var(--surface)}.puzzle-message h2{margin:0 0 12px;font-size:1.25rem}.puzzle-message p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.solver-empty-state{width:min(520px,100%);padding:32px;border:1px solid var(--border);border-radius:6px;background:var(--surface);text-align:center}.solver-empty-state h2{margin:0 0 12px;font-size:1.25rem}.solver-empty-state p{margin:8px 0;color:var(--muted)}.solver-error-details{font-size:.875rem;color:var(--danger)!important;overflow-wrap:anywhere}@media(max-width:768px),(hover:none)and (pointer:coarse){.app{padding:16px 12px 36px}.app-header{align-items:flex-start;flex-direction:column}.mode-tabs{flex-direction:column;align-items:stretch;margin-bottom:20px}.mode-tab{max-width:none}.generator-settings{grid-template-columns:1fr}.sudoku-toolbar{gap:6px}.sudoku-action-button{min-height:36px;padding:7px 10px;font-size:.8rem}.sudoku-timer-bar{margin-bottom:12px}.sudoku-timer-value{font-size:.95rem}.sudoku-board{width:min(var(--board-max-size),calc(100vw - 24px))}.sudoku-mobile-keypad{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;width:min(100%,450px);margin-top:14px}.sudoku-number-button{min-width:0;min-height:46px;padding:8px 4px;font-size:1rem;font-weight:700}.sudoku-number-clear{background:var(--surface-2);color:var(--text)}.sudoku-number-clear:hover:not(:disabled){background:var(--surface-3)}.sudoku-help{margin-top:10px;font-size:.75rem}}
