:root{color-scheme:dark;--ink:#101e27;--panel:#172a34;--muted:#90a7ae;--text:#e9f2ef;--teal:#a2eadb;--coral:#ffaf94;--line:#29434e;--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);font-family:Inter,"Segoe UI",system-ui,-apple-system,sans-serif;font-synthesis:none}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;min-height:100%;background:var(--ink);overscroll-behavior:none}body{color:var(--text);user-select:none;-webkit-user-select:none;background:radial-gradient(ellipse at 15% 8%,#213b413d,transparent 50%),var(--ink)}button,a{touch-action:manipulation}button{font:inherit;color:inherit;border:0;cursor:pointer}button:disabled{cursor:default;opacity:.3}button:focus-visible,a:focus-visible{outline:3px solid var(--coral);outline-offset:4px}button:active:not(:disabled){transform:scale(.97)}button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.sprite{position:absolute;width:0;height:0;overflow:hidden}[hidden]{display:none!important}.screen{width:min(100%,480px);margin:auto;padding:calc(16px + var(--safe-top)) 24px calc(12px + var(--safe-bottom));min-height:100svh}.home{display:flex;flex-direction:column}.home-header{display:flex;align-items:center;justify-content:space-between}.wordmark{font-size:23px;font-weight:720;letter-spacing:-1.1px;display:flex;align-items:center;gap:5px}.wordmark>span{width:6px;height:6px;background:var(--coral);border-radius:50%;margin-top:12px}.icon-button{width:44px;height:44px;background:transparent;border:1px solid #9fc5cd1c;border-radius:50%;display:grid;place-items:center;color:var(--muted)}.home-content{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:stretch;padding:26px 0 5px}.eyebrow{font-size:9px;letter-spacing:2.2px;font-weight:650;color:var(--muted);display:flex;align-items:center;gap:8px}.live-dot{display:inline-block;width:5px;height:5px;background:var(--teal);border-radius:50%;box-shadow:0 0 12px #a2eadb70;flex-shrink:0}h1{font-size:clamp(29px,8.5vw,38px);letter-spacing:-1.8px;line-height:1.15;margin:18px 0 12px;font-weight:650}h1 span{color:var(--teal)}.home-intro{font-size:14px;line-height:1.7;color:var(--muted);margin:0}.hero-art{width:100%;height:clamp(170px,30svh,270px);display:flex;align-items:center;justify-content:center;margin:8px 0 10px}.hero-art>svg{height:100%;max-width:100%;overflow:visible}.hero-grid rect{fill:#1c313b;stroke:#35505a;stroke-width:.7}.hero-grid rect:nth-child(5){fill:#223f47;stroke:#71958d70}.hero-dim{fill:none;stroke:#435d68;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.hero-path,.hero-glow{fill:none;stroke:url(#flow);stroke-width:5;stroke-linecap:round;stroke-linejoin:round}.hero-glow{stroke-width:13;opacity:.45}.hero-source-halo{fill:#ffaf9410;stroke:#ffaf9440;stroke-width:1}.hero-gem{fill:#85dbcc;filter:drop-shadow(0 0 9px #6bd4c490)}.primary{min-height:54px;width:100%;display:flex;align-items:center;justify-content:space-between;padding:0 22px;border-radius:15px;background:var(--teal);color:#15322f;font-weight:700;font-size:15px;box-shadow:0 6px 20px #0002;transition:transform .15s,background .15s}.primary:hover{background:#b6f5e7}.secondary-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}.secondary-actions button{background:#1a2d37;border:1px solid #324852;border-radius:14px;display:grid;grid-template-columns:24px 1fr;column-gap:10px;row-gap:3px;text-align:left;padding:15px 12px;font-size:12px;font-weight:650}.secondary-actions svg{grid-row:span 2;color:var(--coral);align-self:center;width:21px}.secondary-actions small{font-size:10px;color:var(--muted);font-weight:400}.home-note{font-size:10px;letter-spacing:.1px;color:#779199;text-align:center;margin:18px 0 10px}.store-link{font-size:10px;text-align:center;color:#87a0a8;text-underline-offset:4px;line-height:32px;align-self:center;padding:4px 16px}.game{display:flex;flex-direction:column;justify-content:center}.game-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:26px}.game-header>div{text-align:center}.game-header .eyebrow{justify-content:center;font-size:8px;letter-spacing:1.8px}h2{font-size:18px;letter-spacing:-.45px;font-weight:620;margin:8px 0 0}.game-header .icon-button{width:40px;height:40px;flex-shrink:0}.play-layout{display:flex;flex-direction:column;gap:18px}.board-caption{font-size:10px;color:var(--muted);display:flex;justify-content:space-between;align-items:center;padding:0 3px;margin-bottom:14px;letter-spacing:.5px}.board-caption>span:first-child{display:flex;gap:8px;align-items:center;color:#bfd5d7}.board{display:grid;grid-template-columns:repeat(var(--size,3),1fr);gap:7px;border:1px solid #2c4652;background:#0c1921;padding:10px;border-radius:21px;box-shadow:0 12px 30px #0002;aspect-ratio:1}.tile{border-radius:12px;border:1px solid #324a56;background:linear-gradient(145deg,#213944,#1b2e39);padding:0;position:relative;overflow:visible;aspect-ratio:1;display:grid;place-items:center;min-width:0;transition:background .2s,border-color .2s,transform .13s;touch-action:manipulation}.tile svg{width:100%;height:100%;overflow:visible}.tile .wire{stroke:#526e7a;stroke-width:5;fill:none;stroke-linecap:round;stroke-linejoin:round;transition:stroke .18s,filter .18s}.tile .joint{fill:#526e7a;transition:fill .18s}.tile.lit{background:linear-gradient(145deg,#25464b,#1d3941);border-color:#6bb7ae70}.tile.lit .wire{stroke:#b3f2e0;filter:drop-shadow(0 0 4px #74e2cf78)}.tile.lit .joint{fill:#b3f2e0}.tile.source{cursor:default;background:#463b38;border-color:#bd826777}.tile.source .wire{stroke:#ffc2a9;filter:drop-shadow(0 0 4px #ef947e6e)}.source-ring{fill:#ffaf9410;stroke:#ffae9470;stroke-width:1}.source-core{fill:#ffc2a9;filter:drop-shadow(0 0 6px #ff9c7c90)}.source-center{fill:#fff5e8}.gem{fill:#294350;stroke:#6a8693;stroke-width:1.5;transition:fill .2s,stroke .2s}.tile.lit .gem{fill:#89d9c9;stroke:#c9ffee;filter:drop-shadow(0 0 6px #69eac686)}.tile.lit .gem-inner{stroke:#e9fff8}.gem-inner{fill:none;stroke:#7193a1;stroke-width:1;stroke-linejoin:round}.tile.hinted{animation:hint-flash .7s 2}.board[data-size="5"]{gap:5px;padding:8px;border-radius:18px}.board[data-size="5"] .tile{border-radius:9px}.board-message{font-size:11px;line-height:1.5;min-height:17px;text-align:center;margin:14px 0 0;color:#91a9b0}.game-stats{display:flex;justify-content:space-around;gap:10px;margin:0 0 19px}.game-stats>div{display:flex;flex-direction:column;align-items:center;gap:5px;flex:1}.game-stats>div+div{border-left:1px solid #2c424c}.game-stats span{font-size:22px;font-weight:500;letter-spacing:-.7px;font-variant-numeric:tabular-nums}.game-stats small{font-size:9px;color:var(--muted);letter-spacing:.3px}.toolbar{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.toolbar button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:64px;border-radius:14px;background:#1a2d37;border:1px solid #324852;font-size:10px;color:#afc4ca}.toolbar button:last-child{color:var(--coral)}.toolbar svg{width:21px;height:21px}.game-note{font-size:10px;letter-spacing:.3px;text-align:center;color:#65828d;margin:20px 0 0}dialog{border:1px solid #3b525c;border-radius:24px;background:#172b35;color:var(--text);padding:25px;width:min(calc(100% - 30px),410px);max-height:calc(100svh - 36px - var(--safe-top) - var(--safe-bottom));overflow:auto;box-shadow:0 30px 100px #0008}dialog::backdrop{background:#07131bcc;backdrop-filter:blur(7px)}.modal-top{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin-bottom:20px}.modal-top h2{font-size:25px;margin:7px 0 0}.modal-top .icon-button{width:36px;height:36px;flex-shrink:0;font-size:20px}.help-steps{display:grid;gap:17px;margin-bottom:22px}.help-step{display:flex;gap:14px;align-items:center}.step-art{width:54px;height:54px;background:#24414a;border:1px solid #47606a;border-radius:12px;flex-shrink:0;display:grid;place-items:center}.step-art svg{width:42px;height:42px}.help-step h3{font-size:13px;margin:0 0 5px}.help-step p{font-size:12px;color:#a5bdc5;line-height:1.55;margin:0}.help-foot{font-size:10px;line-height:1.6;color:var(--muted);margin:18px 0 0}.level-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:18px}.level-choice{height:58px;background:#203944;border:1px solid #3a5662;border-radius:11px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px}.level-choice span{font-size:16px}.level-choice.current{border-color:var(--teal);color:var(--teal)}.level-choice svg{width:14px;height:14px}.level-stars{display:flex;gap:2px;color:var(--coral)}.level-stars svg{width:9px;height:9px;fill:currentColor}.muted-copy{color:var(--muted);font-size:12px;line-height:1.7}.complete{text-align:center;padding:7px 0 0}.success-mark{margin:6px auto 20px;width:76px;height:76px;border:1px solid #75cfbb70;border-radius:24px;background:radial-gradient(#81dbc32b,#81dbc302);display:grid;place-items:center;transform:rotate(-6deg);box-shadow:0 0 35px #6dbd9a16}.success-mark svg{width:40px;height:40px;fill:none;stroke:var(--teal);stroke-width:1.3}.complete h2{font-size:29px;letter-spacing:-1px;margin:12px 0 6px}.complete .eyebrow{justify-content:center}.complete>p{color:var(--muted);font-size:12px;line-height:1.7}.result-stars{display:flex;justify-content:center;gap:10px;color:var(--coral);margin:22px 0}.result-stars svg{width:27px;height:27px;stroke:currentColor;stroke-width:1.5;fill:currentColor}.result-stars .empty{color:#3a535d;fill:transparent}.result-stats{display:flex;gap:6px;justify-content:space-evenly;margin:22px 0}.result-stats>div{display:flex;flex-direction:column;gap:4px;font-size:20px}.result-stats small{font-size:10px;color:var(--muted)}.text-button{background:transparent;color:#afc7ce;padding:14px 18px;font-size:12px;min-height:44px}.button-row{display:flex;gap:10px;margin-top:22px}.button-row button{flex:1}.button-row .primary{justify-content:center}.secondary{min-height:48px;border-radius:13px;background:#2b414b;color:#b9cdd3;font-size:13px}.modal-full-button{justify-content:center}#toast{position:fixed;bottom:calc(24px + var(--safe-bottom));left:50%;transform:translate(-50%,20px);opacity:0;transition:opacity .2s,transform .2s;pointer-events:none;max-width:calc(100% - 40px);background:#e0f6ee;color:#173a35;font-size:12px;padding:13px 18px;border-radius:50px;box-shadow:0 4px 30px #0005;text-align:center;z-index:20}#toast.visible{opacity:1;transform:translate(-50%,0)}@keyframes hint-flash{50%{border-color:var(--coral);box-shadow:0 0 0 3px #ffaf9430}}
@media(max-height:700px) and (orientation:portrait){.screen{padding-top:calc(10px + var(--safe-top));padding-bottom:calc(8px + var(--safe-bottom))}.home-content{padding-top:14px}.home .eyebrow{font-size:8px}h1{font-size:30px;margin:13px 0 9px}.home-intro{font-size:12px}.hero-art{height:160px;margin:0}.home-note{margin:12px 0 2px;font-size:9px}.secondary-actions button{padding:12px 10px}.home-actions .primary{min-height:49px}.home-header .icon-button{width:36px;height:36px}.game-header{padding-bottom:16px}.play-layout{gap:12px}.board-caption{margin-bottom:10px}.board-message{margin-top:10px;font-size:10px}.game-stats{margin-bottom:13px}.game-note{margin-top:12px}.toolbar button{height:57px}}
@media(max-width:350px){.screen{padding-left:18px;padding-right:18px}h1{font-size:29px}.home-content{padding-top:11px}.hero-art{height:145px}.home-intro{line-height:1.6}.board{gap:5px;padding:8px;border-radius:17px}.tile{border-radius:9px}.game-header h2{font-size:16px}.game-header .eyebrow{font-size:7px}.game-stats span{font-size:20px}.home-note{font-size:8px}.secondary-actions button{column-gap:7px;font-size:11px}.secondary-actions small{font-size:9px}dialog{padding:20px}.help-step{gap:10px}.help-step p{font-size:11px}.level-choice{height:49px}.level-grid{gap:7px}}
@media(orientation:landscape) and (max-height:560px){.screen{width:min(100%,850px);padding:calc(10px + var(--safe-top)) max(24px,env(safe-area-inset-left)) calc(10px + var(--safe-bottom));min-height:100svh}.home{position:relative}.home-header{position:absolute;top:20px;left:28px;right:28px}.home-content{padding:44px 0 0 45%;position:relative;justify-content:center;min-height:310px}.home .eyebrow{font-size:8px}.home h1{font-size:29px;margin:10px 0}.home-intro{display:none}.hero-art{position:absolute;left:0;top:50px;width:42%;height:245px}.home-note{margin:13px 0 0}.store-link{position:absolute;left:8%;bottom:12px}.secondary-actions button{padding:12px}.game{justify-content:center}.game-header{padding:0 0 7px;position:absolute;top:16px;right:25px;left:calc(50% + 12px)}.game-header h2{font-size:17px}.game-header .icon-button{width:36px;height:36px}.play-layout{display:grid;grid-template-columns:1fr 1fr;gap:35px;align-items:center}.board-column{width:min(100%,calc(100svh - 77px));justify-self:center}.board-caption{margin-bottom:8px;font-size:9px}.board-message{font-size:9px;margin-top:7px}.board{padding:7px;gap:5px;border-radius:16px}.game-sidebar{padding-top:50px}.game-note{margin-top:22px}.toolbar button{height:68px}.game-stats{margin-bottom:25px}.game-stats span{font-size:25px}dialog{max-width:550px}.help-steps{grid-template-columns:repeat(3,1fr);gap:16px}.help-step{display:block}.step-art{margin-bottom:12px}.help-step p{font-size:11px}.level-grid{grid-template-columns:repeat(8,1fr)}.complete{padding:0}.success-mark{width:44px;height:44px;margin:0 auto 10px;border-radius:14px}.success-mark svg{width:28px}.complete h2{font-size:24px;margin:8px 0}.result-stars{margin:13px 0}.result-stats{margin:13px 0}.complete>p{margin:7px 0}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
