:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;--bg:#fbf5ec;--surface:#fff;--surface-2:#f5ede2;--text:#2e2530;--muted:#7d6f7a;--line:#eadfd0;--accent:#e0644f;--accent-strong:#c94f3b;--accent-soft:#fde3dc;--on-accent:#fff;--shadow:0 1px 2px #3c281e0f, 0 6px 20px #3c281e14;--cat:#34293a;--cat-ear:#f2a3b6;--cat-eye:#ffd43b;--cat-nose:#f08ca0;--cat-whisker:#ffffff8c;--x-user:#2e2530cc;--x-auto:#2e25304d;--grid-thick:#2e2530;--grid-thin:#2e253029;--hl:#f59e0b;--hl-soft:#f59e0b4d;--hl-lighten:#fff6;--err:#e5484d;--hint:#f0a020;--guess:#8e4ec6;--good:#2f9e61;--region-0:#f7b3c6;--region-1:#fbc68f;--region-2:#f3df73;--region-3:#bde398;--region-4:#8fdacd;--region-5:#a3cbf3;--region-6:#c3b0f1;--region-7:#eeaae6;--region-8:#dcc6a8;--region-9:#cbd2da;--region-10:#f39a90;--region-11:#ddf192;--pencil-0:#1d4ed8;--pencil-1:#d42020;--pencil-2:#15803d;--pencil-3:#7e22ce;--pencil-4:#c2410c;--radius:14px;--font:ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif}@media (prefers-color-scheme:dark){:root{--lightningcss-light: ;--lightningcss-dark:initial;--bg:#19151d;--surface:#241f2a;--surface-2:#2d2734;--text:#f3ebe4;--muted:#a99ca8;--line:#3a3242;--accent:#f07a62;--accent-strong:#ff8f78;--accent-soft:#4a2a27;--on-accent:#1d1419;--shadow:0 1px 2px #0006, 0 6px 20px #00000059;--cat:#fbf1e3;--cat-ear:#f2a3b6;--cat-eye:#2b2230;--cat-nose:#e57f96;--cat-whisker:#2b223066;--x-user:#fff8eed9;--x-auto:#fff8ee52;--grid-thick:#0d0a10;--grid-thin:#00000047;--hl:#fbbf24;--hl-soft:#fbbf244d;--hl-lighten:#ffffff24;--region-0:#a2526b;--region-1:#a86b3a;--region-2:#9b8a2a;--region-3:#5d8a3b;--region-4:#2b887b;--region-5:#3e6ea5;--region-6:#6a56aa;--region-7:#9a4f93;--region-8:#85704f;--region-9:#5d6673;--region-10:#a6463f;--region-11:#7b9230;--pencil-0:#9cc3ff;--pencil-1:#ff9a9a;--pencil-2:#8ff0ac;--pencil-3:#dcb6ff;--pencil-4:#ffbe7d}}*{box-sizing:border-box}html{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}body{background:var(--bg);min-height:100dvh;color:var(--text);font-family:var(--font);-webkit-tap-highlight-color:transparent;margin:0;font-size:16px;line-height:1.4}button{font:inherit;color:inherit}h1,h2,h3{margin:0;line-height:1.15}.hidden{display:none!important}#app{max-width:1120px;min-height:100dvh;margin:0 auto}.screen{padding:max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left))}.card{background:var(--surface);box-shadow:var(--shadow);border-radius:18px;padding:16px}.btn{border:1px solid var(--line);background:var(--surface);cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none;border-radius:12px;justify-content:center;align-items:center;gap:6px;min-height:44px;padding:8px 14px;transition:background .15s,transform .1s,border-color .15s;display:inline-flex}.btn svg{flex:none;width:22px;height:22px}.btn:hover:not(:disabled){background:var(--surface-2)}.btn:active:not(:disabled){transform:scale(.96)}.btn:disabled{opacity:.4;cursor:default}.btn:focus-visible,.tile:focus-visible,.play-btn:focus-visible,.swatch:focus-visible{outline:3px solid var(--accent);outline-offset:2px}.btn.icon-only{background:0 0;border-color:#0000;width:44px;padding:0}.btn.icon-only:hover:not(:disabled){background:var(--surface-2)}.btn.small{min-height:36px;padding:6px 12px;font-size:.95rem}.btn.icon-only.small{width:36px;min-height:36px}.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent);font-weight:700}.btn.primary:hover:not(:disabled){background:var(--accent-strong)}.btn.secondary{background:var(--surface-2);border-color:#0000;font-weight:600}.btn.danger{color:var(--err)}.menu-screen{flex-direction:column;gap:16px;max-width:720px;margin:0 auto;display:flex}.menu-header{justify-content:space-between;align-items:center;display:flex}.logo{align-items:center;gap:10px;display:flex}.logo-cat svg{width:44px;height:44px;display:block}.logo-text{letter-spacing:-.02em;font-size:1.7rem;font-weight:800}.logo-text .plus{color:var(--accent);margin-left:1px}.menu-actions{gap:4px;display:flex}.play-btn{background:linear-gradient(135deg, var(--accent), #f29a59);color:#fff;text-align:left;cursor:pointer;touch-action:manipulation;border:0;border-radius:20px;align-items:center;gap:14px;width:100%;padding:16px 20px;transition:transform .12s;display:flex;box-shadow:0 8px 24px #e0644f4d}.play-btn:active{transform:scale(.98)}.play-ico{background:#ffffff38;border-radius:50%;flex:none;place-items:center;width:48px;height:48px;display:grid}.play-ico svg{width:28px;height:28px}.play-text{flex-direction:column;display:flex}.play-text b{font-size:1.35rem}.play-text small{opacity:.9;font-size:.95rem}.stats-head{justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:12px;display:flex}.stats-head .solved{font-size:1.05rem}.stats-head .solved b{margin-right:2px;font-size:1.8rem}.stats-head .perfect{color:var(--muted)}.stats-head .perfect b{color:var(--text)}.stat-row{grid-template-columns:repeat(3,1fr);gap:10px;display:grid}.stat{background:var(--surface-2);border-radius:14px;grid-template-rows:auto auto auto;grid-template-columns:auto 1fr;align-items:center;column-gap:8px;padding:10px 12px;display:grid}.stat-ico{grid-row:1/span 2;width:30px;height:30px}.stat-ico svg{width:100%;height:100%}.stat.err .stat-ico,.badge-ico.err,.pill.err.on .pill-ico,.result-badge.err.on .pill-ico,.tb.err.on{color:var(--err)}.stat.hint .stat-ico,.badge-ico.hint,.pill.hint.on .pill-ico,.result-badge.hint.on .pill-ico,.tb.hint.on{color:var(--hint)}.stat.guess .stat-ico,.badge-ico.guess,.pill.guess.on .pill-ico,.result-badge.guess.on .pill-ico,.tb.guess.on{color:var(--guess)}.stat-value{font-size:1.5rem;line-height:1}.stat-label{color:var(--muted);white-space:nowrap;font-size:.85rem}.stat-of{color:var(--muted);grid-column:1/span 2;font-size:.75rem}.levels-head{justify-content:space-between;align-items:center;margin-bottom:12px;display:flex}.levels-head h2{font-size:1.2rem}.pager{align-items:center;gap:4px;display:flex}.pager-label{text-align:center;font-variant-numeric:tabular-nums;min-width:64px;color:var(--muted)}.level-grid{grid-template-columns:repeat(auto-fill,minmax(62px,1fr));gap:8px;display:grid}.tile{aspect-ratio:1;background:var(--surface-2);cursor:pointer;touch-action:manipulation;border:2px solid #0000;border-radius:14px;flex-direction:column;justify-content:center;align-items:center;gap:3px;padding:4px;transition:transform .1s;display:flex}.tile:active:not(:disabled){transform:scale(.95)}.tile-num{font-size:1.15rem;font-weight:800;line-height:1}.tile-size{color:var(--muted);white-space:nowrap;font-size:.68rem}.tile-badges{gap:2px;display:flex}.tb{width:14px;height:14px;color:var(--line)}.tb svg,.tile-lock svg{width:100%;height:100%;display:block}.tile.done{background:var(--surface);border-color:var(--line)}.tile.perfect{background:linear-gradient(160deg, var(--surface), #f2c14e2e);border-color:#f2c14e}.tile.current{border-color:var(--accent);background:var(--accent-soft);animation:2.4s ease-in-out infinite glow}.tile.locked{opacity:.45;cursor:default}.tile-lock{width:16px;height:16px;color:var(--muted)}.menu-footer{text-align:center;color:var(--muted);padding:4px 0 8px;font-size:.8rem}@keyframes glow{0%,to{box-shadow:0 0 #e0644f00}50%{box-shadow:0 0 0 4px #e0644f2e}}.game-screen{--board-size:min(calc(100vw - 24px), calc(100dvh - 340px), 620px);flex-direction:column;gap:10px;min-height:100dvh;display:flex}.topbar{grid-template-columns:44px 1fr 44px;align-items:center;display:grid}.topbar .title{text-align:center}.topbar h1{font-size:1.3rem}.topbar .sub{color:var(--muted);font-size:.85rem}.badge-strip{flex-wrap:wrap;justify-content:center;gap:6px;min-height:30px;display:flex}.pill{background:var(--surface);box-shadow:var(--shadow);white-space:nowrap;border-radius:999px;align-items:center;gap:5px;padding:4px 10px 4px 7px;font-size:.8rem;font-weight:600;display:inline-flex}.pill-ico{width:16px;height:16px;color:var(--muted);display:inline-block}.pill-ico svg{width:100%;height:100%;display:block}.pill.off{color:var(--muted);opacity:.7;box-shadow:none;background:var(--surface-2);text-decoration:line-through}.pill.replay{background:var(--surface-2);box-shadow:none;color:var(--muted);padding:4px 10px}.play-area{flex-direction:column;flex:1;align-items:center;gap:12px;display:flex}.board-area{min-width:var(--board-size);min-height:var(--board-size);place-items:center;display:grid}.side{flex-direction:column;gap:10px;width:100%;max-width:620px;display:flex}.board-loading{color:var(--muted);flex-direction:column;align-items:center;gap:12px;display:flex}.spinner{border:4px solid var(--line);border-top-color:var(--accent);border-radius:50%;width:36px;height:36px;animation:.9s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.error{color:var(--err)}.board{width:var(--board-size);height:var(--board-size);grid-template-columns:repeat(var(--n), 1fr);grid-template-rows:repeat(var(--n), 1fr);border:3px solid var(--grid-thick);box-shadow:var(--shadow);touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;cursor:pointer;border-radius:12px;outline:none;display:grid;position:relative;overflow:hidden}.board:focus-visible{box-shadow:0 0 0 3px var(--bg), 0 0 0 6px var(--accent)}.board-lines{pointer-events:none;width:100%;height:100%;position:absolute;inset:0}.grid-thin{fill:none;stroke:var(--grid-thin);stroke-width:1px}.grid-thick{fill:none;stroke:var(--grid-thick);stroke-width:3px;stroke-linecap:square}.cell{background:var(--rc);place-items:center;min-width:0;min-height:0;display:grid;position:relative}.cell>svg,.cell>.ghost{pointer-events:none;width:74%;height:74%}.cell>.ghost{place-items:center;display:grid}.ghost>svg{width:100%;height:100%}.cat .cat-head{fill:var(--cat)}.cat .cat-ear{fill:var(--cat-ear)}.cat .cat-eye{fill:var(--cat-eye)}.cat .cat-nose{fill:var(--cat-nose)}.cat .cat-whisker{fill:none;stroke:var(--cat-whisker);stroke-width:2.5px;stroke-linecap:round}.cross path{fill:none;stroke:var(--x-user);stroke-width:9px;stroke-linecap:round}.cell.x-auto>svg{width:56%;height:56%}.cell.x-auto .cross path{stroke:var(--x-auto);stroke-width:10px}.cell.wrong{background:var(--err);animation:.45s shake}.cell.wrong .cat-head{fill:#fff}.cell.wrong .cat-eye{fill:var(--err)}.cell.pencil>svg{width:58%;height:58%}.pencil-x .cross path{stroke:var(--pc);stroke-width:7px}.pencil-cat .cat-head{fill:color-mix(in srgb, var(--pc) 14%, transparent);stroke:var(--pc);stroke-width:7px;stroke-dasharray:14 8}.pencil-cat .cat-eye{fill:var(--pc)}.pencil-cat .cat-ear,.pencil-cat .cat-nose,.pencil-cat .cat-whisker{display:none}.cell.hl-focus:after{content:"";border:2.5px dashed var(--hl);pointer-events:none;border-radius:5px;position:absolute;inset:3px}.cell.hl-target:before{content:"";background:var(--hl-lighten);box-shadow:inset 0 0 0 3px var(--hl), 0 0 10px var(--hl-soft);pointer-events:none;border-radius:6px;position:absolute;inset:1px}.ghost{animation:1.1s ease-in-out infinite pulse}.ghost .cat-head{fill:var(--cat);opacity:.55}.ghost .cat-ear,.ghost .cat-eye,.ghost .cat-nose,.ghost .cat-whisker{opacity:.55}.ghost .cross path{stroke:var(--x-user);opacity:.6}.cell.armed:after{content:"";box-shadow:inset 0 0 0 3px var(--accent);pointer-events:none;border-radius:6px;position:absolute;inset:2px}.arm-cue{opacity:.45;place-items:center;width:74%;height:74%;animation:.45s ease-out arm;display:grid}.arm-cue svg{width:100%;height:100%}.armed-pencil .cat-head{fill:none;stroke:var(--pc);stroke-width:7px;stroke-dasharray:14 8}.armed-pencil .cat-eye{fill:var(--pc)}.armed-pencil .cat-ear,.armed-pencil .cat-nose,.armed-pencil .cat-whisker{display:none}@keyframes arm{0%{opacity:0;transform:scale(.6)}}.cell.cursor{outline:3px solid var(--accent);outline-offset:-3px;z-index:1}.anim-pop>svg{animation:.35s ease-out pop}.anim-shake{animation:.4s shake}@keyframes pop{0%{transform:scale(.3)}70%{transform:scale(1.15)}to{transform:scale(1)}}@keyframes shake{0%,to{transform:translate(0)}20%,60%{transform:translate(-4px)}40%,80%{transform:translate(4px)}}@keyframes pulse{0%,to{opacity:.75;transform:scale(.88)}50%{opacity:1;transform:scale(1)}}.message{flex-direction:column;justify-content:center;min-height:52px;display:flex}.toast{background:var(--surface);box-shadow:var(--shadow);border-radius:12px;padding:10px 14px;font-size:.92rem;animation:.2s ease-out fade-in}.toast.warn{border-left:4px solid var(--hint)}.toast.good{border-left:4px solid var(--good)}.hint-panel{background:var(--surface);box-shadow:var(--shadow);border:2px solid var(--hl);border-radius:14px;padding:12px 14px;animation:.2s ease-out fade-in}.hint-head{align-items:center;gap:6px;display:flex}.hint-ico svg{width:20px;height:20px;color:var(--hint);display:block}.hint-panel p{margin:6px 0 10px;font-size:.93rem}.hint-actions{justify-content:flex-end;gap:8px;display:flex}@keyframes fade-in{0%{opacity:0;transform:translateY(4px)}}.toolbar{flex-direction:column;gap:8px;display:flex}.tool-row{flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;display:flex}.tool-row:empty{display:none}.tool-row.actions{grid-template-columns:repeat(4,1fr);display:grid}.tool-row.actions .btn{flex-direction:column;gap:2px;min-height:58px;padding:6px 4px}.btn-label{white-space:nowrap;font-size:.8rem;font-weight:600}.hint-btn svg{color:var(--hint)}.btn.toggle{min-height:44px}.btn.toggle.active{background:var(--text);border-color:var(--text);color:var(--bg)}.swatches{gap:10px;padding:2px 0;display:flex}.swatch{border:3px solid var(--surface);background:var(--pc);width:34px;height:34px;box-shadow:0 0 0 1px var(--line);cursor:pointer;touch-action:manipulation;border-radius:50%;transition:transform .12s}.swatch.active{box-shadow:0 0 0 3px var(--text);transform:scale(1.12)}.controls-tip{text-align:center;color:var(--muted);margin:0;font-size:.8rem}@media (width>=900px) and (height>=560px),(orientation:landscape) and (height<=560px){.game-screen{--board-size:min(calc(100dvh - 104px), calc(100vw - 440px), 720px);grid-template:"top top""board badges""board side"1fr/auto 340px;place-content:start center;gap:10px 28px;display:grid}.topbar{grid-area:top}.play-area{display:contents}.board-area{grid-area:board;align-self:start}.badge-strip{grid-area:badges;justify-content:flex-start;align-self:start;padding-top:2px}.side{grid-area:side;width:340px}.message{order:2;justify-content:flex-start;min-height:0}.toolbar{order:1}.controls-tip{text-align:left;order:3}.tool-row{justify-content:flex-start}}@media (orientation:landscape) and (height<=560px){.game-screen{--board-size:min(calc(100dvh - 66px), calc(100vw - 400px));min-height:0;padding-top:max(4px, env(safe-area-inset-top));padding-bottom:max(8px, env(safe-area-inset-bottom));grid-template-columns:auto 320px;gap:6px 18px}.topbar{grid-template-columns:40px 1fr 40px}.topbar .btn.icon-only{width:40px;min-height:40px}.topbar h1{font-size:1.05rem}.topbar .sub{font-size:.75rem}.side{gap:6px;width:320px}.tool-row.actions .btn{min-height:50px}.badge-strip{min-height:0}}dialog.modal{background:var(--surface);width:min(460px,100vw - 24px);max-height:calc(100dvh - 32px);color:var(--text);border:0;border-radius:22px;padding:0;overflow:auto;box-shadow:0 20px 60px #0000004d}dialog.modal[open]{animation:.22s ease-out dialog-in}dialog.modal::backdrop{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#19121c73}@keyframes dialog-in{0%{opacity:0;transform:translateY(10px)scale(.98)}}.modal-header{align-items:center;gap:10px;padding:18px 18px 6px 20px;display:flex}.modal-header h2{flex:1;font-size:1.3rem}.modal-icon{flex:none;width:40px;height:40px}.modal-icon svg{width:100%;height:100%}.result.failed .modal-icon .cross path{stroke:var(--err)}.modal-close{margin:-8px -8px -8px 0}.modal-body{padding:4px 20px 8px}.modal-body p{margin:8px 0}.modal-body .small,.small{color:var(--muted);font-size:.86rem}.modal-actions{justify-content:flex-end;gap:10px;padding:12px 20px 20px;display:flex}.modal-actions .btn{min-width:96px}.help .modal-body{padding-bottom:0}.help section{padding:6px 0}.help h3{margin-bottom:4px;font-size:1rem}.help ul{margin:4px 0;padding-left:20px}.help li{margin:4px 0}.help .controls-list,.help .badge-list{padding:0;list-style:none}.controls-list li,.badge-list li{align-items:flex-start;gap:10px;display:flex}.mini-cell{background:var(--region-5);border:2px solid var(--grid-thick);border-radius:7px;flex:none;place-items:center;width:30px;height:30px;display:grid}.mini-cell svg{width:74%;height:74%}.mini-cell.icon{background:var(--surface-2);border-color:#0000}.mini-cell.icon svg{width:20px;height:20px}.badge-ico{flex:none;width:22px;height:22px;display:inline-block}.badge-ico svg{width:100%;height:100%}.badge-list li b{white-space:nowrap;margin-right:2px}.result-badges{flex-direction:column;gap:8px;margin:12px 0 4px;padding:0;list-style:none;display:flex}.result-badge{background:var(--surface-2);border-radius:12px;align-items:center;gap:10px;padding:10px 12px;font-weight:600;display:flex}.result-badge .pill-ico{width:22px;height:22px}.result-badge .result-state{margin-left:auto;font-size:.85rem}.result-badge.on .result-state{color:var(--good)}.result-badge.off{color:var(--muted)}.result.solved .modal-icon{animation:.5s ease-out pop}.setting{border-bottom:1px solid var(--line);cursor:pointer;align-items:center;gap:14px;padding:12px 0;display:flex}.setting:last-child{border-bottom:0}.setting-text{flex-direction:column;flex:1;display:flex}.setting-text small{color:var(--muted);font-size:.85rem}.setting input[type=checkbox]{width:22px;height:22px;accent-color:var(--accent);flex:none}.setting.danger{cursor:default}@media (prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}
