:root{--desk:#e8dcc5;--paper:#fffaf0;--card:#fffdf8;--ink:#2d2a32;--muted:#7a7266;--grid:#d3e2ee;--marigold:#ffc93c;--red:#e5484d;--yes:#2e9e6e;--no:#e5484d;--lift:3px 3px 0 var(--ink);--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;font-family:ui-rounded,SF Pro Rounded,Nunito,Segoe UI,system-ui,sans-serif}*{box-sizing:border-box}html,body{height:100%;color:var(--ink);overscroll-behavior:none;background-color:var(--desk);background-image:radial-gradient(#5a463014 1px,#0000 1.2px),radial-gradient(#ffffff40 1px,#0000 1.2px);background-position:0 0,3px 5px;background-size:7px 7px,11px 11px;margin:0}#app{height:100dvh;overflow:hidden}button{font:inherit;color:var(--ink);cursor:pointer;border:2px solid var(--ink);background:var(--card);box-shadow:var(--lift);touch-action:manipulation;border-radius:10px;padding:8px 14px;font-weight:800;transition:transform 80ms,box-shadow 80ms}button:active:not(:disabled){box-shadow:1px 1px 0 var(--ink);transform:translate(2px,2px)}button:disabled{cursor:default;opacity:.4;box-shadow:none}button:focus-visible{outline:3px solid var(--marigold);outline-offset:2px}.primary,.play-btn,.run{background:var(--marigold)}.icon{flex:none;justify-content:center;align-items:center;width:38px;height:38px;padding:0;font-size:17px;display:inline-flex}.danger{color:var(--red)}.eyebrow{letter-spacing:.35em;text-transform:uppercase;color:var(--red);margin:0;font-size:12px;font-weight:800}.star{color:#2d2a3214;display:inline-block}.star.lit{color:var(--marigold);text-shadow:1px 1px #fff,-1px -1px #fff,1px -1px #fff,-1px 1px #fff,2px 3px #5a463033}.menu{max-width:640px;height:100dvh;margin:0 auto;padding:18px 16px 40px;position:relative;overflow-y:auto}.corner{gap:8px;display:flex;position:absolute;top:14px;right:14px}.logo{text-align:center;padding:26px 0 8px}.logo-gems{width:176px;height:66px;overflow:visible}.bob{animation:3.2s ease-in-out infinite bob}.b1{transform-origin:24px 24px;rotate:-8deg}.b2{animation-delay:-1s}.b3{transform-origin:96px 24px;animation-delay:-2s;rotate:6deg}@keyframes bob{50%{transform:translateY(-4px)}}.logo h1{letter-spacing:-.02em;-webkit-box-decoration-break:clone;box-decoration-break:clone;background:linear-gradient(#0000 58%,#ffc93cb3 58% 90%,#0000 90%);margin:0;font-size:clamp(30px,8.5vw,50px);font-weight:900;line-height:1.25;display:inline}.logo .eyebrow{margin:6px 0 4px}.play-btn{border-radius:14px;margin:20px auto 0;padding:12px 40px;font-size:20px;display:block;rotate:-1.5deg}.star-total{color:var(--muted);margin:16px 0 0;font-weight:800}.chapter-block{margin-top:24px}.chapter{letter-spacing:.2em;text-transform:uppercase;color:var(--muted);align-items:center;gap:8px;margin:0 0 10px;font-size:13px;display:flex}.level-row{grid-template-columns:repeat(5,1fr);gap:12px;display:grid}.level-tile{aspect-ratio:1;background:var(--card);border:3px solid #fff;border-radius:14px;outline:1px solid #d8cfbd;flex-direction:column;justify-content:center;align-items:center;gap:2px;padding:0;display:flex;box-shadow:2px 3px #5a463033}.level-tile:nth-child(odd){rotate:-2deg}.level-tile:nth-child(2n){rotate:1.5deg}.tile-num{font-size:clamp(18px,5vw,26px);font-weight:900}.tile-stars{letter-spacing:1px;font-size:11px}.level-tile.current{background:var(--marigold);animation:2.4s ease-in-out infinite wiggle}.level-tile.locked{box-shadow:none;opacity:1;background:0 0;border:2px dashed #b9ad97;outline:none}.level-tile.locked .tile-num{opacity:.45;font-size:16px}@keyframes wiggle{50%{rotate:2deg}}.play{flex-direction:column;max-width:760px;height:100dvh;min-height:0;margin:0 auto;display:flex}.topbar{align-items:center;gap:8px;padding:10px 12px 8px;display:flex}.back{font-size:22px}.level-num{background:var(--marigold);border:3px solid #fff;border-radius:50%;flex:none;justify-content:center;align-items:center;width:32px;height:32px;font-weight:900;display:inline-flex;rotate:-6deg;box-shadow:1px 2px #5a463040}.level-title{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;font-size:17px;font-weight:900;overflow:hidden}.run{flex:none;height:40px;padding:0 16px;font-size:16px}.run.busy{animation:.5s ease-in-out infinite wiggle}.board-wrap{flex:1;justify-content:center;align-items:center;min-height:0;padding:0 10px;display:flex;position:relative}.board{touch-action:none;-webkit-user-select:none;user-select:none;filter:drop-shadow(0 2px #5a463026)drop-shadow(0 8px 14px #5a463026);width:100%;height:100%;display:block}.board-bg{fill:var(--paper)}.grid-line{fill:none;stroke:var(--grid);stroke-width:.8px}.hint-pill{color:var(--ink);white-space:nowrap;pointer-events:none;clip-path:polygon(0 8%,3% 0,97% 4%,100% 0,100% 92%,97% 100%,3% 96%,0 100%);background:#f4e3a1d9;align-self:center;margin:0 0 8px;padding:5px 16px;font-size:13px;font-weight:800;transition:opacity .6s;animation:.4s ease-out drop-in;rotate:-1.5deg}.hint-pill.dim{opacity:.45}@keyframes drop-in{0%{opacity:0;transform:translateY(-10px)}}.banner{border:2px solid var(--ink);width:max-content;max-width:calc(100% - 40px);box-shadow:var(--lift);color:var(--ink);text-align:center;opacity:0;pointer-events:none;background:#ffb3b3;padding:14px 20px;font-size:17px;font-weight:900;position:absolute;top:40%;left:50%;transform:translate(-50%,-50%)rotate(-3deg)}.banner.show{animation:2.6s ease-out forwards slap}@keyframes slap{0%{opacity:0;transform:translate(-50%,-50%)rotate(-12deg)scale(1.4)}10%,80%{opacity:1;transform:translate(-50%,-50%)rotate(-3deg)scale(1)}to{opacity:0;transform:translate(-50%,-40%)rotate(-3deg)scale(1)}}.node{cursor:grab}.node.fixed{cursor:default}.node-inner{transform-box:fill-box;transform-origin:50%}.node-shadow{fill:var(--ink);transform:translate(3px)}.node-body{fill:var(--card);stroke:var(--ink);stroke-width:2px}.kind-source .node-body{fill:#fff1dd}.kind-output .node-body{fill:#eaf1fa}.kind-dummy .node-body{stroke-dasharray:6 4}.node.selected .node-body{fill:#fff3c4;stroke-width:3px}.node.target-ok .node-body{fill:#ddf3e6;stroke:var(--yes);stroke-width:3px}.node.target-bad .node-body{fill:#ffe1e1;stroke:var(--no);stroke-width:3px}.badge-halo{fill:#5a4630;opacity:.22;transform:translate(.8px,1.4px)}.badge{stroke:#fff;stroke-width:3px}.node-glyph{fill:#fff;pointer-events:none;font-size:15px;font-weight:900}.node-glyph.small{font-size:12px}.node-title{fill:var(--ink);pointer-events:none;font-size:13px;font-weight:900}.node-sub{fill:var(--muted);pointer-events:none;font-size:12px;font-weight:800}.node-sub.tight{font-size:10.5px}.node-pic,.mine-gems,.tray{pointer-events:none}.ordered-mark{fill:var(--red);letter-spacing:.08em;font-size:10px;font-weight:900}.ghost-gems{opacity:.28}.slot-gem{transform-box:fill-box;transform-origin:50%;animation:.3s cubic-bezier(.3,1.6,.5,1) stick}@keyframes stick{0%{opacity:0;transform:scale(1.9)rotate(-25deg)}}.wrong-ring{fill:none;stroke:var(--red);stroke-width:2px}.handle{fill:#fff;stroke:var(--ink);stroke-width:2.2px;pointer-events:none}.handle-hit{fill:#0000;cursor:crosshair}.node:hover .handle{fill:var(--marigold)}.hop-under{display:none}.hop-line{fill:none;stroke:var(--ink);stroke-width:2.4px;stroke-linecap:round}.hop-flow{fill:none;stroke:var(--marigold);stroke-width:2px;stroke-dasharray:4 12;stroke-linecap:round;opacity:0;pointer-events:none}.running .hop-flow{opacity:1;animation:.45s linear infinite flow}@keyframes flow{to{stroke-dashoffset:-32px}}.hop.fresh .hop-line{stroke-dasharray:600;animation:.35s ease-out draw}@keyframes draw{0%{stroke-dashoffset:600px}}.drag-line{fill:none;stroke:var(--ink);stroke-width:2.4px;stroke-dasharray:6 6;stroke-linecap:round;pointer-events:none;animation:.6s linear infinite flow}.hop-hit{fill:none;stroke:#0000;stroke-width:22px;cursor:pointer}.hop.selected .hop-line{stroke:var(--red);stroke-width:3.6px}.arrowhead{fill:none;stroke:var(--ink);stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.branch circle,.verdict circle,.spill-tag circle{stroke:#fff;stroke-width:2.5px}.branch.yes circle,.verdict.ok circle{fill:var(--yes)}.branch.no circle,.verdict.bad circle,.spill-tag circle{fill:var(--no)}.branch text,.verdict text,.spill-tag text{fill:#fff;pointer-events:none;font-size:12px;font-weight:900}.verdict{animation:.35s cubic-bezier(.3,1.6,.5,1) pop-in}.fx{pointer-events:none}.node-inner.pop{animation:.38s cubic-bezier(.3,1.6,.5,1) pop-in}.node-inner.pulse{animation:.22s ease-out pulse}.node-inner.shake{animation:.45s ease-in-out shake}.node-inner.seal{animation:.7s ease-out seal}@keyframes pop-in{0%{opacity:0;transform:scale(.4)rotate(-8deg)}}@keyframes pulse{40%{transform:scale(1.06)}}@keyframes shake{20%,60%{transform:translate(-5px)rotate(-1deg)}40%,80%{transform:translate(5px)rotate(1deg)}}@keyframes seal{30%{transform:scale(1.1)rotate(-2deg)}}.panel{flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;min-height:56px;padding:8px 12px;display:flex}.panel.open{animation:.18s ease-out rise}.panel .clear{margin-left:auto}@keyframes rise{0%{opacity:0;transform:translateY(8px)}}.panel-face{align-items:center;gap:6px;margin-right:2px;font-weight:900;display:inline-flex}.chip{justify-content:center;align-items:center;gap:1px;min-width:42px;height:42px;padding:4px 8px;font-size:16px;font-weight:900;display:inline-flex}.chip.on{box-shadow:1px 1px 0 var(--ink);background:#fff3c4;transform:translate(2px,2px)}.chip.yes.on{color:var(--yes);background:#ddf3e6}.chip.no.on{color:var(--no);background:#ffe1e1}.gem-icon{display:block;overflow:visible}.palette{padding:12px 10px calc(14px + env(safe-area-inset-bottom));background:var(--paper);border-top:2px dashed #b9ad97;flex-wrap:wrap;justify-content:center;gap:10px;display:flex}.palette.empty{background:0 0;border-top:none;min-height:12px;padding:0}.tool,.drag-ghost{-webkit-user-select:none;user-select:none;grid-template-rows:auto auto;grid-template-columns:auto auto;align-items:center;column-gap:7px;padding:5px 12px 5px 5px;display:grid}.tool{touch-action:none}.tool .tool-badge,.drag-ghost .tool-badge{grid-row:span 2}.tool-badge{color:#fff;background:var(--tint);border:3px solid #fff;border-radius:50%;justify-content:center;align-items:center;width:30px;height:30px;font-size:14px;font-weight:900;display:inline-flex;box-shadow:1px 2px #5a463040}.tool-name{font-size:13px;font-weight:900}.pips{gap:3px;display:flex}.pips i{border:1.5px solid var(--ink);border-radius:50%;width:7px;height:7px}.pips i.on{background:var(--marigold)}.tool.nudge{background:#fff3c4;animation:.5s ease-in-out 3 nudge}@keyframes nudge{25%{transform:rotate(-7deg)scale(1.08)}75%{transform:rotate(7deg)scale(1.08)}}.drag-ghost{background:var(--card);border:2px solid var(--ink);pointer-events:none;z-index:50;border-radius:10px;margin:-20px 0 0 -44px;position:fixed;top:0;left:0;rotate:-4deg;box-shadow:5px 6px #2d2a3255}.drag-ghost .tool-name{grid-row:span 2}.scrim{z-index:40;background:#2d2a3240;justify-content:center;align-items:center;padding:16px;animation:.2s ease-out fade;display:flex;position:fixed;inset:0}@keyframes fade{0%{opacity:0}}.card{background:var(--card);border:2px solid var(--ink);width:min(360px,100%);max-height:100%;box-shadow:6px 6px 0 var(--ink);border-radius:6px;padding:26px 22px 22px;animation:.35s cubic-bezier(.3,1.5,.5,1) pop-in;position:relative;overflow-y:auto;rotate:-1deg}.card:before{content:"";background:#f4e3a1d9;width:96px;height:22px;position:absolute;top:-2px;left:50%;translate:-50%;rotate:2deg}.card-actions{justify-content:center;gap:10px;margin-top:18px;display:flex}.card-actions .primary{padding:10px 28px;font-size:17px}.win{text-align:center}.win-gems{justify-content:center;animation:2.4s ease-in-out infinite bob;display:flex}.win h2{background:linear-gradient(#0000 58%,#ffc93cb3 58% 92%,#0000 92%);margin:6px 0 4px;font-size:30px;font-weight:900;display:inline-block}.win-stars{letter-spacing:6px;font-size:44px}.win-stars .star{animation:.45s cubic-bezier(.3,1.8,.5,1) backwards star-in}.win-stars .star:first-child{animation-delay:.35s;rotate:-10deg}.win-stars .star:nth-child(2){animation-delay:.61s}.win-stars .star:nth-child(3){animation-delay:.87s;rotate:10deg}@keyframes star-in{0%{opacity:0;transform:scale(2.4)}}.win-steps{color:var(--muted);margin:4px 0 0;font-weight:700}.win-steps b{color:var(--ink)}.gem-names{justify-content:space-around;gap:8px;display:flex}.gem-name{align-items:center;gap:6px;font-size:13px;font-weight:900;line-height:1.1;display:flex}.gem-name small{color:var(--muted);font-weight:700}.help-line{text-align:center;color:var(--muted);margin:16px 0 12px;font-weight:700}.help-line .dot{color:var(--ink)}.legend{gap:8px;margin:0;padding:0;list-style:none;display:grid}.legend li{grid-template-columns:30px 64px 1fr;align-items:center;gap:8px;font-size:13px;display:grid}.legend-blurb{color:var(--muted);font-weight:700}@media (width<=420px){.topbar{gap:6px;padding:8px 8px 6px}.topbar .icon{width:34px;height:34px}.level-title{font-size:15px}.run{padding:0 12px}.palette{gap:7px;padding-left:6px;padding-right:6px}.tool{column-gap:5px;padding:4px 9px 4px 4px}.tool-badge{width:26px;height:26px;font-size:12px}.tool-name{font-size:12px}.chip{min-width:38px;height:38px}.panel-face .tool-name{display:none}.level-row{gap:9px}}@media (prefers-reduced-motion:reduce){*,:before,:after{animation-duration:.01ms!important;animation-iteration-count:1!important}}
