:root{--bg: #faf8f5;--bg-surface: #ffffff;--text: #2d2a26;--text-muted: #6b6560;--border: #e0dbd5;--border-light: #ece8e3;--primary: #2563eb;--primary-hover: #1d4ed8;--primary-light: #eff4ff;--primary-text: #fff;--danger: #dc2626;--success: #16a34a;--cell-bg: #fff;--cell-border: #c8c3bc;--cell-selected: #bfdbfe;--cell-miss: #fecaca;--cell-hint: #fef08a;--found-1: #86efac;--found-2: #93c5fd;--found-3: #fcd34d;--found-4: #fda4af;--found-5: #c4b5fd;--found-6: #67e8f9;--found-7: #fdba74;--found-8: #a5b4fc;--overlay-bg: rgba(0, 0, 0, .5);--dialog-bg: #fff;--focus-ring: #2563eb;--shadow-sm: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);--shadow-md: 0 4px 12px rgba(0, 0, 0, .08), 0 2px 4px rgba(0, 0, 0, .04);--shadow-lg: 0 10px 30px rgba(0, 0, 0, .1), 0 4px 8px rgba(0, 0, 0, .05);--radius-sm: 8px;--radius-md: 14px;--radius-lg: 20px;--radius-xl: 24px;--gradient-header: linear-gradient(135deg, #2563eb, #7c3aed);--gradient-primary: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);--gradient-success: linear-gradient(135deg, #16a34a 0%, #22c55e 100%)}.dark{--bg: #1c1a17;--bg-surface: #292622;--text: #e8e4de;--text-muted: #a09a93;--border: #3d3a35;--border-light: #33302b;--primary: #3b82f6;--primary-hover: #60a5fa;--primary-light: #1e293b;--primary-text: #fff;--cell-bg: #33302b;--cell-border: #4a4540;--cell-selected: #1e3a5f;--cell-miss: #7f1d1d;--cell-hint: #713f12;--found-1: #166534;--found-2: #1e40af;--found-3: #854d0e;--found-4: #9f1239;--found-5: #5b21b6;--found-6: #155e75;--found-7: #9a3412;--found-8: #3730a3;--dialog-bg: #292622;--focus-ring: #60a5fa;--shadow-sm: 0 1px 3px rgba(0, 0, 0, .2), 0 1px 2px rgba(0, 0, 0, .15);--shadow-md: 0 4px 12px rgba(0, 0, 0, .25), 0 2px 4px rgba(0, 0, 0, .15);--shadow-lg: 0 10px 30px rgba(0, 0, 0, .35), 0 4px 8px rgba(0, 0, 0, .2)}.high-contrast{--cell-border: #000;--text: #000;--cell-bg: #fff;--found-1: #00c853;--found-2: #2979ff;--found-3: #ffd600;--found-4: #ff1744;--found-5: #d500f9;--found-6: #00e5ff;--found-7: #ff9100;--found-8: #651fff}.dark.high-contrast{--cell-border: #fff;--text: #fff;--cell-bg: #000}*,*:before,*:after{box-sizing:border-box}html{font-size:16px}body{margin:0;padding:0;font-family:Segoe UI,system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--text);line-height:1.5;min-height:100vh;overscroll-behavior:none;-webkit-tap-highlight-color:transparent}#root{min-height:100vh}.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4em;padding:.6em 1.2em;font-size:1.1rem;font-weight:600;font-family:inherit;border:2px solid var(--border);border-radius:var(--radius-md);background:var(--bg-surface);color:var(--text);cursor:pointer;transition:background .15s,border-color .15s,transform .1s,box-shadow .15s;min-height:48px;min-width:48px;box-shadow:var(--shadow-sm)}.btn:hover{border-color:var(--primary);background:var(--primary-light);box-shadow:var(--shadow-md);transform:translateY(-1px)}.btn:focus-visible{outline:3px solid var(--focus-ring);outline-offset:2px}.btn:active{transform:scale(.97) translateY(0);box-shadow:var(--shadow-sm)}.btn-primary{background:var(--gradient-primary);color:var(--primary-text);border-color:var(--primary)}.btn-primary:hover{background:var(--primary-hover);border-color:var(--primary-hover)}.btn-primary:disabled{opacity:.5;cursor:not-allowed;transform:none;box-shadow:none}.btn-secondary{background:var(--bg-surface);border-color:var(--primary);color:var(--primary)}.btn-sm{padding:.4em .8em;font-size:.95rem;min-height:40px}.btn-large{padding:.8em 2em;font-size:1.3rem;min-height:60px}.btn-active{background:var(--primary);color:var(--primary-text);border-color:var(--primary)}.btn-group{display:flex;gap:.5rem;flex-wrap:wrap}.start-page{padding:1.5rem;background:var(--bg);color:var(--text);min-height:100vh}.start-page>*{max-width:800px;margin-left:auto;margin-right:auto}.start-header{text-align:center;padding:2rem 0 1rem}.start-logo{width:100px;height:100px;margin-bottom:.5rem;filter:drop-shadow(0 4px 12px rgba(37,99,235,.3))}.start-header h1{font-size:3rem;margin:0;background:var(--gradient-header);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;letter-spacing:.05em}.subtitle{font-size:1.2rem;color:var(--text-muted);margin:.5rem 0 0}.start-form{display:flex;flex-direction:column;gap:1.8rem}.section-card{background:var(--bg-surface);border:none;border-radius:var(--radius-lg);padding:1.5rem;box-shadow:var(--shadow-md)}.section-card h2{font-size:1.2rem;font-weight:700;color:var(--primary);margin:0 0 1rem}.start-form fieldset{border:2px solid var(--border);border-radius:var(--radius-lg);padding:1.2rem;margin:0}.start-form legend{font-size:1.2rem;font-weight:700;padding:0 .5em;color:var(--primary)}.theme-buttons{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:1rem}.btn-theme{font-size:1.1rem;padding:.6em 1.4em}.custom-words{margin-top:.8rem}.custom-words label{display:block;font-size:1rem;margin-bottom:.4rem;font-weight:500}.custom-words textarea{width:100%;padding:.8em;font-size:1.1rem;font-family:inherit;border:2px solid var(--border);border-radius:var(--radius-sm);background:var(--bg-surface);color:var(--text);resize:vertical}.custom-words textarea:focus{outline:3px solid var(--focus-ring);outline-offset:1px}.word-count{font-size:1rem;margin:.5rem 0 0;color:var(--text-muted)}.warning{color:var(--danger);font-weight:600}.grid-size-buttons{display:flex;flex-wrap:wrap;gap:.5rem}.btn-size{min-width:80px}.auto-hint{margin:.5rem 0 0;font-size:.95rem;color:var(--text-muted)}.slider-bounds{font-size:.9rem;color:var(--text-muted);white-space:nowrap}.checkbox-group{margin-bottom:.8rem}.difficulty-row{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem 1rem}.group-label{font-weight:600;font-size:1rem;margin:0}.checkbox-label{display:flex;align-items:center;gap:.5rem;font-size:1.1rem;padding:.3em .5em;cursor:pointer;min-height:40px;border-radius:var(--radius-sm);transition:background .15s}.checkbox-label:hover{background:var(--primary-light)}.checkbox-label input[type=checkbox]{width:26px;height:26px;accent-color:var(--primary);cursor:pointer}.setting-row{display:flex;flex-wrap:wrap;align-items:center;gap:.8rem;margin-bottom:.8rem}.setting-row label{font-size:1.05rem;font-weight:500;min-width:160px}.setting-row input[type=range]{flex:1;min-width:120px;height:8px;accent-color:var(--primary)}.start-actions{display:flex;flex-wrap:nowrap;gap:.8rem;justify-content:center;padding:1rem 0 2rem}.start-actions .btn{flex:1 1 0;min-width:0;white-space:nowrap}.start-footer{text-align:center;color:var(--text-muted);font-size:.9rem;padding:.5rem 1rem 2rem;opacity:.7}.game-page{background:var(--bg);color:var(--text);min-height:100vh}.game-header{position:sticky;top:0;z-index:50;display:flex;align-items:center;gap:.8rem;padding:.8rem 1rem;padding-top:max(.8rem,env(safe-area-inset-top));padding-left:max(1rem,env(safe-area-inset-left));padding-right:max(1rem,env(safe-area-inset-right));background:var(--bg-surface);box-shadow:var(--shadow-md);flex-wrap:wrap}.timer{font-size:1.5rem;font-weight:700;font-variant-numeric:tabular-nums;padding:.2em .7em;min-width:80px;background:var(--primary-light);border-radius:var(--radius-md)}.header-actions{display:flex;gap:.5rem;flex-wrap:wrap;margin-left:auto}.progress-bar-container{width:100%;background:var(--border-light);border-radius:6px;height:8px;overflow:hidden}.progress-bar-fill{height:100%;background:var(--gradient-success);border-radius:6px;transition:width .4s ease;min-width:0}.game-main{display:flex;justify-content:center;padding:1rem;gap:1.25rem;align-items:flex-start}.wordlist-container{flex:0 0 auto;position:sticky;top:80px}.suchsel-grid{background:var(--border);border:2px solid var(--cell-border);border-radius:4px;box-shadow:var(--shadow-md)}.suchsel-cell{display:flex;align-items:center;justify-content:center;background:var(--cell-bg);color:var(--text);font-weight:700;font-family:Consolas,Courier New,monospace;border:1px solid var(--cell-border);border-radius:3px;transition:background .15s;cursor:pointer;overflow:hidden;text-align:center}.suchsel-cell.cell-selected{background:var(--cell-selected)}.suchsel-cell.cell-miss{animation:flash-miss .4s ease forwards}.suchsel-cell.cell-warm{animation:flash-warm 1.8s ease-in-out forwards}.dark .suchsel-cell.cell-warm{animation:flash-warm-dark 1.8s ease-in-out forwards}.suchsel-cell.cell-found{color:#000;font-weight:800}.dark .suchsel-cell.cell-found{color:#fff}.suchsel-cell.cell-hint{background:var(--cell-hint);animation:pulse-hint .6s ease infinite alternate}.suchsel-cell.high-contrast{border-width:2px;font-weight:900}@keyframes flash-miss{0%,30%{background:var(--cell-miss)}to{background:var(--cell-bg)}}@keyframes flash-warm{0%{background:var(--cell-bg)}15%{background:#fef08a}60%{background:#fef08a}to{background:var(--cell-bg)}}@keyframes flash-warm-dark{0%{background:var(--cell-bg)}15%{background:#854d0e}60%{background:#854d0e}to{background:var(--cell-bg)}}@keyframes pulse-hint{0%{opacity:.6}to{opacity:1}}.word-list{background:var(--bg-surface);border:none;border-radius:var(--radius-lg);padding:1rem;display:flex;flex-direction:column;overflow:hidden;box-shadow:var(--shadow-md)}.word-list h2{margin:0 0 .8rem;font-size:1.3rem;color:var(--primary);flex-shrink:0}.word-list ul{list-style:none;padding:0;margin:0;overflow-y:auto;flex:1 1 0;min-height:0}.word-list li{display:flex;align-items:center;gap:.6rem;padding:.4em .3em;border-bottom:1px solid var(--border-light)}.word-list li:last-child{border-bottom:none}.word-check{font-size:1.2em;flex-shrink:0}.word-text{font-weight:600}.word-text-found{text-decoration:line-through;opacity:.6;font-weight:400}.word-found{opacity:.7}.settings-dialog{border:none;border-radius:var(--radius-xl);padding:2rem;background:var(--dialog-bg);color:var(--text);max-width:500px;width:90vw;box-shadow:var(--shadow-lg)}.settings-dialog::backdrop{background:var(--overlay-bg);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}.settings-dialog h2{margin:0 0 1.5rem;font-size:1.5rem;color:var(--primary)}.dialog-actions{margin-top:1.5rem;display:flex;justify-content:flex-end}.overlay{position:fixed;inset:0;background:var(--overlay-bg);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:100;animation:fade-in .3s ease}.overlay-content{background:var(--dialog-bg);color:var(--text);border-radius:var(--radius-xl);padding:2.5rem;text-align:center;max-width:450px;width:90vw;box-shadow:var(--shadow-lg);animation:slide-up .4s ease}.overlay-content h2{font-size:2.5rem;margin:0 0 1rem;color:var(--success)}.victory-time{font-size:1.8rem;font-weight:700;margin:.5rem 0}.victory-score{font-size:1.5rem;font-weight:700;color:var(--primary);margin:.3rem 0}.hint-penalty{color:var(--text-muted);font-size:.95em}.gave-up-title{color:var(--text-muted)!important}.overlay-actions{display:flex;flex-direction:column;gap:.8rem;margin-top:1.5rem}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes slide-up{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}.stats-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:1rem;padding:0 1rem 1.5rem}.stat-card{background:var(--bg-surface);border:none;border-radius:var(--radius-lg);padding:1.5rem;display:flex;flex-direction:column;align-items:center;gap:.4rem;box-shadow:var(--shadow-md);transition:transform .2s,box-shadow .2s}.stat-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-lg)}.stat-icon{font-size:2rem;line-height:1;margin-bottom:.2rem}.stat-value{font-size:2.2rem;font-weight:800;color:var(--primary);font-variant-numeric:tabular-nums}.stat-label{font-size:1rem;color:var(--text-muted);font-weight:500}@media(max-width:700px){.start-actions{flex-wrap:wrap}.start-actions .btn{flex:1 1 100%}.game-main{flex-direction:column;align-items:center;padding:.5rem;gap:.75rem}.wordlist-container{width:100%;position:static}.word-list{height:auto!important;overflow:visible}.word-list ul{overflow-y:visible;display:grid;grid-template-columns:1fr 1fr;gap:0 .5rem;flex:none;min-height:auto}.word-list li{padding:.3em .2em}.game-header{padding:.5rem .6rem;gap:.4rem}.btn-label{display:none}.header-actions{margin-left:auto;width:auto;gap:.3rem}.header-actions .btn{padding:.4em .6em;min-width:44px;min-height:44px;font-size:1.15rem}.game-header>.btn{padding:.4em .6em;min-width:44px;min-height:44px;font-size:1.15rem}.timer{font-size:1.2rem;padding:.15em .5em}.start-page{padding:1rem}.start-header{padding:1.2rem 0 .8rem}.start-logo{width:72px;height:72px}.start-header h1{font-size:2.4rem}.start-form{gap:1.2rem}.section-card{padding:1.2rem;border-radius:var(--radius-md)}.btn-theme{font-size:.95rem;padding:.5em .9em}.btn-large{padding:.7em 1.2em;font-size:1.15rem;min-height:52px}.difficulty-row{gap:.3rem .6rem}.setting-row label{min-width:0;width:100%}.overlay-content{padding:1.8rem 1.5rem;border-radius:var(--radius-lg)}.overlay-content h2{font-size:2rem}.victory-time{font-size:1.4rem}.victory-score{font-size:1.2rem}.stats-grid{grid-template-columns:repeat(2,1fr);gap:.75rem;padding:0 .5rem 1rem}.stat-card{padding:1rem;border-radius:var(--radius-md)}.stat-icon{font-size:1.6rem}.stat-value{font-size:1.8rem}.settings-dialog{width:95vw;padding:1.5rem;border-radius:var(--radius-lg)}}@media(max-width:400px){.start-header h1{font-size:1.9rem}.subtitle{font-size:1rem}.section-card{padding:1rem}.section-card h2{font-size:1.05rem}.btn-theme{font-size:.88rem;padding:.45em .7em;min-height:40px}.overlay-content h2{font-size:1.7rem}.stats-grid{grid-template-columns:repeat(2,1fr)}.stat-value{font-size:1.5rem}}
