:root{color-scheme:dark;--text: #f4f7ff;--text-soft: #dce4f5;--card: #f7faff;--ink: #22304d;--ink-soft: #5b6a86;--snow: #ffffff;--snow-shade: #dce6f4;--empty: #d9e3f1;--earth: #4a3a2e;--earth-dark: #33281f;--hole: #1c1611;--gold: #ffd27a;--ok: #2e8b57;--bad: #c0392b}*{box-sizing:border-box}html,body{margin:0}body{background:#1e2944;color:var(--text);font-family:Fredoka,system-ui,-apple-system,Segoe UI,sans-serif;-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer}button:disabled{opacity:.45;cursor:default}.world{position:relative;min-height:100vh;overflow:hidden;transition:background .6s}.scene{position:absolute;top:0;left:0;width:100%;height:260px;display:block}.app{position:relative;max-width:520px;margin:0 auto;padding:20px 16px 28px;display:flex;flex-direction:column;gap:14px}.top{display:flex;align-items:center;justify-content:space-between}.title{text-align:center}.title h1{margin:0;font-size:30px;font-weight:700;color:#fff;text-shadow:0 2px 8px rgb(0 0 0 / .25)}.title p{margin:2px 0 0;font-size:15px;font-weight:500;color:var(--gold)}.icon-btn{width:44px;height:44px;border-radius:50%;border:none;background:#ffffff29;color:var(--text);display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:600}.icon-btn svg{width:20px;height:20px}.sky-space{height:112px}.hint{margin:0;min-height:1.3em;text-align:center;font-size:15px;line-height:1.4;color:var(--text-soft)}.card{background:var(--card);color:var(--ink);border-radius:24px;padding:14px;display:flex;flex-direction:column;gap:12px;box-shadow:0 12px 30px #050a1966}.tools{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}.tool{--animal: var(--ink-soft);height:46px;min-width:46px;padding:0 12px;border-radius:23px;border:2px solid color-mix(in srgb,var(--animal) 30%,#fff);background:#fff;color:var(--animal);display:flex;align-items:center;justify-content:center;gap:6px;font-size:15px;font-weight:600}.tool-icon{width:20px;height:20px;flex-shrink:0}.tool .cnt{color:var(--ink-soft);font-variant-numeric:tabular-nums}.tool.over .cnt{color:var(--bad)}.tool.sel{background:var(--animal);border-color:var(--animal);color:#fff}.tool.sel .cnt{color:#fff}.tool.sel.over .cnt{text-decoration:underline wavy}.cross-tool{padding:0;border-color:#dde3ee;color:var(--ink-soft)}.cross-tool.sel{background:var(--ink-soft);border-color:var(--ink-soft);color:#fff}.board-wrap{position:relative;align-self:center}.board{display:grid;gap:var(--gap);touch-action:none;-webkit-user-select:none;user-select:none;cursor:pointer}.board.solved{cursor:default}.paths{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;overflow:visible}.cell{width:var(--cell);height:var(--cell);border-radius:calc(var(--cell) * .22);position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center}.cell.fresh{background:var(--snow);box-shadow:inset 0 -3px 0 var(--snow-shade)}.sparkle{position:absolute;top:12%;right:12%;width:16%;height:16%;fill:#c7d6ec}.cell.empty{background:var(--empty)}.cell.cross{color:#9aa8c2}.cross-mark{width:30%;height:30%}.cell.clue{background:var(--snow);box-shadow:inset 0 -3px 0 var(--snow-shade);gap:2px}.print{width:56%;height:56%}.dots{font-size:calc(var(--cell) * .13);letter-spacing:1px;line-height:1;color:#7c8ba6}.cell.den{background:var(--earth);box-shadow:inset 0 -4px 0 var(--earth-dark);justify-content:flex-end;padding-bottom:12%}.den-hole{width:70%;height:46%;background:var(--hole);border-radius:40px 40px 6px 6px;display:flex;align-items:center;justify-content:center}.den-print{width:60%;height:80%}.cell.mine{--animal: var(--ink-soft);background:color-mix(in srgb,var(--animal) 10%,#fff);border:2px dashed color-mix(in srgb,var(--animal) 55%,#fff)}.cell.mine.Z{--animal: #e9793f}.cell.mine.L{--animal: #8c6644}.cell.mine.P{--animal: #2d6fb0}.mine-print{width:50%;height:50%}.board.solved .cell{animation:pop .4s ease-out}.board.solved .cell.mine{border-style:solid}@keyframes pop{50%{transform:scale(1.08)}}.trail-line{fill:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;opacity:.6;stroke-dasharray:1;stroke-dashoffset:1;animation-name:draw;animation-timing-function:linear;animation-fill-mode:both}.trail.L .trail-line{stroke-dasharray:.02 .03;stroke-dashoffset:0;animation-name:fade}@keyframes draw{to{stroke-dashoffset:0}}@keyframes fade{0%{opacity:0}to{opacity:.6}}.status{margin:0;text-align:center;min-height:1.3em;font-weight:600;font-size:16px}.status.ok{color:#9be3b5}.status.bad{color:#ffb3a7}.actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}.pill{height:44px;padding:0 22px;border-radius:22px;border:none;background:#ffffff29;color:var(--text);font-size:15px;font-weight:500}.pill.primary{background:var(--gold);color:var(--ink);font-weight:600}.legend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px;padding:14px;border-radius:18px;background:#ffffff14;font-size:13px;color:var(--text-soft)}.legend span{display:flex;align-items:center;gap:8px}.legend .legend-wide{grid-column:1 / -1}.sw{width:18px;height:18px;border-radius:6px;flex-shrink:0;display:inline-block}.sw-fresh{background:#fff}.sw-empty{background:var(--empty);opacity:.6}.sw-den{background:var(--earth)}.sw-mine{border:2px dashed #f0b48c}dialog{max-width:min(480px,calc(100vw - 32px));border:none;border-radius:24px;background:var(--card);color:var(--ink);padding:20px 22px;font-family:inherit}dialog::backdrop{background:#080c1a99}dialog h2{margin:0 0 8px;font-weight:700}dialog p{line-height:1.45}dialog ul{padding-left:18px;line-height:1.45}dialog li{margin:4px 0}dialog ul.animals{list-style:none;padding:0}dialog ul.animals li{display:flex;gap:10px;align-items:flex-start}.rule-icon{width:24px;height:24px;flex-shrink:0}.dlg-actions{text-align:right;margin-top:12px}dialog .pill{background:#e6ecf6;color:var(--ink)}dialog .pill.primary{background:var(--gold)}.muted{color:var(--ink-soft);margin-top:-4px}.menu-group{margin:12px 0}.menu-group h3{margin:0 0 6px;font-size:15px;color:var(--ink-soft);font-weight:600}.menu-group .btns{display:flex;flex-wrap:wrap;gap:6px}.menu-group button{min-width:44px;height:44px;border-radius:14px;border:2px solid #dde3ee;background:#fff;color:var(--ink);font-weight:600}.menu-group button.done{background:#e8f6ee;border-color:var(--ok);color:var(--ok)}.menu-group button.current{border-color:#e9793f}@media(prefers-reduced-motion:reduce){.trail-line{animation:none;stroke-dashoffset:0;opacity:.6}.board.solved .cell{animation:none}}.notice{margin:0;align-self:center;padding:8px 16px;border-radius:16px;background:var(--gold);color:var(--ink);font-weight:600;text-align:center}.how-unlock{font-size:14px;background:#eef3fb;border-radius:14px;padding:10px 12px;margin:8px 0 4px}.test-note{font-size:13px;color:#8a4b00;background:#fff3d6;border-radius:10px;padding:6px 10px}.menu-group h3{display:flex;justify-content:space-between;align-items:center}.zone-name{display:inline-flex;align-items:center;gap:6px}.zone-count{font-size:13px;font-variant-numeric:tabular-nums}.lock{width:16px;height:16px}.menu-group.locked h3{color:#8b97ad}.zone-hint{margin:0 0 6px;font-size:13px;color:var(--ink-soft)}dialog h3{margin:16px 0 4px;font-size:17px}.test-btn{align-self:center;margin-top:4px;padding:6px 14px;border-radius:14px;border:1px dashed rgb(255 210 122 / .7);background:transparent;color:var(--gold);font-size:13px}.test-flags{display:flex;flex-direction:column;gap:10px;margin:12px 0}.test-flag{display:flex;align-items:center;gap:10px;font-size:15px;min-height:32px}.test-flag input{width:20px;height:20px}.test-actions{display:flex;flex-direction:column;gap:8px;align-items:flex-start}.dlg-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.dlg-head h2{margin:0}.lang-switch{display:inline-flex;background:#e6ecf6;border-radius:16px;padding:3px}.lang-switch button{border:none;background:transparent;color:var(--ink-soft);border-radius:13px;padding:0 12px;height:32px;font-size:14px;font-weight:500}.lang-switch button.sel{background:#fff;color:var(--ink);font-weight:600;box-shadow:0 1px 3px #0000001f}.tool.full .cnt{color:var(--ink);font-weight:700}.tool.sel.full .cnt{color:#fff}.counter-help{margin:0;font-size:13px;line-height:1.4;color:var(--ink);background:#eef3fb;border-radius:12px;padding:8px 10px}
