:root{--bg: #0e1116;--panel: #171c26;--panel-2: #212940;--text: #e8ecf4;--muted: #93a0b4;--line: #3a465e;--accent: #38bdf8;--accent-ink: #06222f;color-scheme:dark}*{box-sizing:border-box}[hidden]{display:none!important}html,body,#app{height:100%}body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;-webkit-tap-highlight-color:transparent;overflow:hidden}.game{position:relative;height:100%;max-width:640px;margin-inline:auto;padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));display:flex;flex-direction:column;gap:10px;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.hud{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none}.chips{display:flex;gap:6px;min-width:0}.chip{display:inline-flex;align-items:center;gap:6px;min-height:38px;padding-inline:10px;border-radius:10px;background:var(--panel);font-size:15px;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}.chip .icon{width:17px;height:17px;flex:none}#level-chip .icon{color:#f59e0b}#pipes-chip .icon{color:var(--accent)}.actions{display:flex;gap:6px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;min-width:44px;padding-inline:14px;border:0;border-radius:10px;background:var(--panel-2);color:var(--text);font:inherit;font-size:17px;font-weight:600;cursor:pointer;touch-action:manipulation}.btn .icon{width:21px;height:21px;flex:none}.btn:active{transform:translateY(1px)}.btn:disabled{cursor:default;opacity:.45}.btn:disabled:active{transform:none}.btn-icon{padding-inline:0}.btn-primary{background:var(--accent);color:var(--accent-ink);padding-inline:22px}.stage{flex:1;min-height:0;min-width:0;display:flex;flex-direction:column;gap:10px}.board-wrap{position:relative;flex:1;min-height:0;min-width:0}.board{position:absolute;border-radius:14px;background:var(--panel);touch-action:none}.paper{position:absolute;inset:0;width:100%;height:100%;display:block}.is-off{display:none}.tile{fill:#242d3d}.pipe{fill:none;stroke:var(--pipe, var(--accent));stroke-width:.4;stroke-linecap:round;stroke-linejoin:round;opacity:.78}.pipe.is-done{opacity:1;stroke-width:.44}.head{fill:var(--pipe, var(--accent));stroke:#0e1116;stroke-width:.06}.dot{fill:var(--pipe, var(--accent));stroke:#0e11168c;stroke-width:.05}.dot.is-done{stroke:#fffc;stroke-width:.07}.dot.is-hinted{animation:dot-pulse .7s ease-out 2}@keyframes dot-pulse{50%{r:.42}}.board.is-solved .pipe{animation:pipe-glow .62s ease-out}@keyframes pipe-glow{40%{stroke-width:.56}}.c0{--pipe: #ef4444}.c1{--pipe: #38bdf8}.c2{--pipe: #22c55e}.c3{--pipe: #f59e0b}.c4{--pipe: #a78bfa}.c5{--pipe: #ec4899}.c6{--pipe: #2dd4bf}.c7{--pipe: #e2e8f0}.side{flex:none;min-width:0;display:flex;flex-direction:column;gap:8px}.fill{flex:none;display:flex;height:8px;border-radius:999px;background:var(--panel);overflow:hidden}.fill-bar{display:block;inline-size:0;border-radius:inherit;background:linear-gradient(90deg,#38bdf8,#a78bfa);transition:inline-size .11s ease-out}.fill.is-full .fill-bar{background:linear-gradient(90deg,#22c55e,#a3e635)}.howto{flex:none;margin:0;margin-inline-end:56px;text-align:center;color:var(--muted);font-size:13px;line-height:1.45}@media(min-width:620px){.howto{margin-inline-end:150px}}.overlay{position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:center;padding:10px;background:#0e1116ad;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:overlay-in .2s ease-out;pointer-events:none}.is-embedded .overlay{padding-block-end:60px}@keyframes overlay-in{0%{opacity:0}to{opacity:1}}.card{pointer-events:auto;width:min(100%,330px);max-height:100%;overflow-y:auto;display:flex;flex-direction:column;align-items:center;gap:8px;padding:16px 18px;border-radius:16px;background:var(--panel);box-shadow:0 18px 44px #0000008c;text-align:center}.card-title{margin:0;font-size:clamp(19px,4.4vw,26px);font-weight:800}.card-line{margin:0;color:var(--muted);font-size:15px;font-weight:600}.card-line:empty{display:none}.card-perfect{color:#f59e0b;font-weight:800}.card-hints{font-size:13px}.stats{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;width:100%;margin:2px 0 0}.stat{display:flex;flex-direction:column;align-items:center;gap:2px}.stat-value{margin:0;font-size:20px;font-weight:800;font-variant-numeric:tabular-nums}.stat-label{font-size:11px;line-height:1.2;color:var(--muted)}.card-actions{position:sticky;bottom:0;display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:6px;padding-top:6px;background:var(--panel)}@media(max-width:440px){.game{gap:8px;padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}.stage{gap:8px}}@media(max-height:620px){.game{gap:8px}.stage{gap:6px}.chip{min-height:34px;padding-inline:8px;font-size:14px}.howto{font-size:12px}}@media(max-height:470px){.side{gap:5px}.howto{display:none}.fill{margin-inline-end:56px}.card{gap:5px;padding:12px 14px}}@media(max-width:300px){.game{gap:6px;padding:max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left))}#pipes-chip{display:none}.chips,.actions{gap:4px}.chip{min-height:30px;padding-inline:6px;gap:4px;border-radius:8px;font-size:12px}.chip .icon{width:14px;height:14px}.btn{min-height:36px;min-width:36px;border-radius:8px;font-size:15px}.btn .icon{width:18px;height:18px}.fill{height:6px}}@media(min-aspect-ratio:6 / 5)and (min-width:560px){.game{display:grid;grid-template-columns:minmax(0,1fr) min(30vw,230px);grid-template-rows:auto minmax(0,1fr);column-gap:14px;max-width:none}.hud{grid-column:1 / -1}.stage{display:contents}.side{align-self:center;padding-bottom:60px}.howto{display:block;margin-inline-end:0}.fill{margin-inline-end:0}}@media(prefers-reduced-motion:reduce){.dot.is-hinted,.board.is-solved .pipe,.overlay{animation-duration:1ms;animation-iteration-count:1}.fill-bar{transition-duration:1ms}}
