:root{color:#1f2933;background:#eef4f8;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;--safe-top: env(safe-area-inset-top, 0px);--safe-bottom: env(safe-area-inset-bottom, 0px)}*{box-sizing:border-box}html,body,#app{min-height:100%;margin:0}body{overflow-x:hidden}button{border:0;font:inherit}.app-shell{min-height:100vh;min-height:100dvh;background:radial-gradient(circle at 18% 12%,rgba(255,255,255,.96),transparent 28%),radial-gradient(circle at 82% 8%,rgba(195,230,244,.38),transparent 30%),linear-gradient(180deg,#fafdfffa,#eff7fbe6 42%,#deeaf3fa),linear-gradient(90deg,#ffffff52,#aecbde33);color:#1f2933;display:flex;flex-direction:column}.screen{width:min(100%,760px);margin:0 auto;padding:calc(18px + var(--safe-top)) 18px calc(18px + var(--safe-bottom));flex:1}.home-screen{display:grid;grid-template-rows:auto 1fr;min-height:100vh;min-height:100dvh;gap:clamp(12px,2.4vh,22px)}.top-row,.hud-row,.game-actions,.result-actions{display:flex;align-items:center;justify-content:space-between;gap:12px}.brand{display:flex;align-items:center;gap:12px;min-width:0}.brand-mark{width:44px;height:44px;border-radius:8px;background:#1f2933;color:#f4f6f8;display:grid;place-items:center;font-size:26px;font-weight:900;box-shadow:0 10px 24px #1f293329}.brand h1,.level-title h1,.result-panel h1{margin:0;font-size:24px;line-height:1.1;letter-spacing:0}.brand p,.level-title p,.result-panel p{margin:4px 0 0;color:#6b7280;font-size:14px}.home-board{align-self:center;display:grid;justify-items:center;gap:clamp(12px,2.1vh,18px);width:100%;padding-bottom:clamp(8px,4vh,42px)}.hero-board{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;width:min(100%,410px);margin:0 auto;padding:clamp(18px,4vw,24px);border-radius:32px;background:radial-gradient(circle at 24% 16%,rgba(255,255,255,.92),transparent 34%),linear-gradient(180deg,#fcfefffa,#daeaf4f2);box-shadow:0 26px 42px #38536829,inset 0 3px #fffffff5,inset 0 -9px 16px #40658024}.hero-cell{aspect-ratio:1;border-radius:13px;background:linear-gradient(180deg,#ffffffeb,#e5eff6d6);display:grid;place-items:center;color:#1f2933;font-weight:900;box-shadow:inset 0 1px #ffffffeb,inset 0 -1px #47627714,0 8px 18px #1f29330d}.hero-cell.hot{background:linear-gradient(180deg,#ffe88f,#efc63f);color:#1f2933;box-shadow:0 12px 18px #b9842033,inset 0 2px #ffffff75,inset 0 -5px 8px #905b0c29}.hero-cell span{display:grid;place-items:center;width:68%;height:68%;border-radius:11px;background:#ffffff47;font-size:22px}.home-actions,.level-grid{display:grid;gap:10px}.home-actions{width:min(100%,390px);margin:0 auto}.retention-line{width:min(100%,390px);margin:-2px auto 0;text-align:center;color:#506170;font-size:14px;font-weight:760;line-height:1.45}.primary-button,.secondary-button,.icon-button,.level-button{min-height:46px;border-radius:8px;cursor:pointer;transition:transform .14s ease,background .14s ease,opacity .14s ease;-webkit-tap-highlight-color:transparent}.primary-button{background:#1f2933;color:#fff;font-weight:800;box-shadow:0 14px 28px #1f29332e}.secondary-button{background:#ffffffbd;color:#1f2933;font-weight:750;box-shadow:inset 0 0 0 1px #1f293314}.primary-button:active,.secondary-button:active,.icon-button:active,.level-button:active{transform:translateY(1px) scale(.99)}.icon-button{width:46px;min-width:46px;background:#ffffffbd;color:#1f2933;font-weight:900;box-shadow:inset 0 0 0 1px #1f293314}.icon-button[aria-pressed=true]{background:#f2c94c}.header-spacer{width:46px;min-width:46px}.settings-panel{display:grid;gap:10px;width:min(100%,390px);margin:0 auto;padding:12px;border-radius:8px;background:#ffffffb8;box-shadow:inset 0 0 0 1px #1f293314,0 12px 22px #43586914}.settings-row{display:grid;grid-template-columns:minmax(82px,1fr) auto;align-items:center;gap:10px;min-width:0}.settings-row>span{color:#243243;font-size:14px;font-weight:850}.settings-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:2px}.settings-links a{min-height:36px;border-radius:8px;display:grid;place-items:center;padding:8px 10px;background:#ffffff9e;color:#223142;box-shadow:inset 0 0 0 1px #1f293314;font-size:12px;font-weight:850;line-height:1.2;text-align:center;text-decoration:none}.segmented-control{display:inline-grid;grid-template-columns:repeat(2,minmax(74px,1fr));gap:4px;padding:4px;border-radius:8px;background:#1f293312}.segment-button,.toggle-button{min-height:36px;border-radius:8px;cursor:pointer;color:#223142;background:#ffffff9e;font-weight:900;-webkit-tap-highlight-color:transparent}.segment-button[aria-pressed=true]{color:#fff;background:#1f2933}.toggle-button{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;min-width:92px;padding:4px 9px 4px 5px}.toggle-track{display:inline-flex;align-items:center;width:40px;height:24px;padding:3px;border-radius:999px;background:#6b728057;transition:background .14s ease}.toggle-track span{width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 3px 7px #1f29332e;transition:transform .14s ease}.toggle-button[aria-pressed=true] .toggle-track{background:#27ae60}.toggle-button[aria-pressed=true] .toggle-track span{transform:translate(16px)}.toggle-button strong{min-width:24px;font-size:13px;line-height:1}.game-screen{width:min(100%,640px);min-height:100vh;min-height:100dvh;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:8px;padding:calc(8px + var(--safe-top)) clamp(8px,2.8vw,18px) calc(12px + var(--safe-bottom))}.level-title{min-width:0;text-align:center}.level-title h1{font-size:clamp(21px,5.4vw,28px);font-weight:900;color:#223142}.game-screen .level-title p{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.game-hud{display:grid;grid-template-columns:minmax(0,1fr) minmax(92px,.86fr) minmax(0,1fr);grid-template-areas:"back level restart" "lives moves available";align-items:center;gap:8px;min-height:118px}.nav-back,.restart-orb{display:grid;place-items:center;border-radius:50%;cursor:pointer;color:#1f2933;background:linear-gradient(180deg,#fffffffa,#eef4f8eb);box-shadow:0 12px 24px #43586921,inset 0 1px #fffffffa,inset 0 -1px #4e687c14;-webkit-tap-highlight-color:transparent}.nav-back{grid-area:back;justify-self:start;width:44px;height:44px;font-size:24px;font-weight:900}.life-pill,.available-pill,.move-card{display:inline-flex;align-items:center;justify-content:center;min-width:0;color:#243243;background:linear-gradient(180deg,#fffffffc,#f1f6faed);box-shadow:0 13px 24px #4358691f,inset 0 1px #fffffffa,inset 0 -1px #4e687c0f}.life-pill{grid-area:lives;width:100%;min-width:0;height:52px;border-radius:18px;gap:7px;padding:8px 10px}.life-pill img{width:31px;height:31px;object-fit:contain;filter:drop-shadow(0 5px 6px rgba(207,64,55,.2))}.life-pill strong{font-size:20px;font-weight:950;letter-spacing:0;white-space:nowrap}.level-stack{grid-area:level;display:grid;justify-items:center;align-self:center;gap:8px;min-width:0;width:100%;color:#223142;text-align:center}.level-stack h1{margin:0;font-size:clamp(24px,6.4vw,34px);font-weight:950;line-height:1;letter-spacing:0;white-space:nowrap}.level-dots{display:inline-flex;gap:12px}.level-dots span{width:12px;height:12px;border-radius:50%;background:#d6dde4;box-shadow:inset 0 1px #ffffffc7}.level-dots .active{background:#2d9cdb;box-shadow:0 5px 10px #2d9cdb3d,inset 0 1px #ffffff8f}.move-card{grid-area:moves;width:100%;min-width:0;min-height:56px;flex-direction:column;border-radius:18px;padding:8px 10px 9px}.move-card span{font-size:15px;font-weight:850;line-height:1.05}.move-card strong{margin-top:2px;font-size:26px;font-weight:950;line-height:1;letter-spacing:0}.restart-orb{grid-area:restart;justify-self:end;width:56px;height:56px}.restart-orb img{width:34px;height:34px;object-fit:contain}.available-pill{grid-area:available;width:100%;min-width:0;height:52px;gap:7px;border-radius:18px;padding:8px 10px}.available-pill span{font-size:15px;font-weight:850;white-space:nowrap}.available-pill strong{font-size:22px;font-weight:950}.board-wrap{align-self:center;justify-self:center;width:min(calc(100% - 16px),calc((100dvh - var(--safe-top) - var(--safe-bottom) - 286px) * .68),540px);aspect-ratio:.68;margin:0 0 2px;position:relative;border-radius:34px;overflow:visible;background:radial-gradient(circle at 20% 12%,rgba(255,255,255,.88),transparent 33%),linear-gradient(180deg,#fffffffc,#e7f2f9fa 54%,#b0c9dafa),#e8f1f7;isolation:isolate;box-shadow:0 34px 52px #334e633d,0 14px 20px #1f29331f,inset 0 3px #fffffffa,inset 0 -12px 18px #44698233,inset 0 0 0 1px #3a5b7424}.board-wrap:before,.board-wrap:after{content:"";position:absolute;pointer-events:none}.board-wrap:before{top:12px;right:9px;bottom:-18px;left:9px;z-index:-1;border-radius:31px;background:linear-gradient(180deg,#b8d2e3c2,#678ea994);filter:blur(.2px);box-shadow:0 24px 28px #364e6238,inset 0 -1px #ffffff6b}.board-wrap:after{top:10px;right:10px;bottom:10px;left:10px;z-index:4;border-radius:27px;box-shadow:inset 0 2px 3px #fffffff0,inset 0 -8px 14px #5570841a,inset 0 0 0 1px #55708414}.board-canvas,.maze-layer,.arrow-layer{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}.board-canvas{z-index:0;border-radius:34px}.maze-layer{z-index:1;overflow:visible}.arrow-layer{z-index:3;overflow:visible;touch-action:manipulation}.maze-rail,.maze-highlight,.maze-core,.maze-flow,.maze-ambient{fill:none;vector-effect:non-scaling-stroke;stroke-linecap:round;stroke-linejoin:round;shape-rendering:geometricPrecision}.maze-ambient-group,.maze-rail-group{filter:url(#route-shadow)}.maze-flow-group{filter:drop-shadow(0 0 7px rgba(255,255,255,.72))}.maze-ambient{stroke:#ffffffc7;stroke-width:var(--maze-ambient-width, 31px);opacity:.68}.maze-rail{stroke:#fdfefffa;stroke-width:var(--maze-rail-width, 33px)}.maze-highlight{stroke:#ffffffd1;stroke-width:var(--maze-highlight-width, 9px);opacity:.72;transform:translateY(-2px)}.maze-core{stroke:var(--route-color);stroke-width:var(--maze-core-width, 16px);opacity:.18}.maze-core.available{opacity:.54}.maze-flow{stroke:var(--route-color);stroke-width:var(--maze-flow-width, 8px);stroke-dasharray:20 15;opacity:.84;animation:routeFlow var(--flow-duration, 1.72s) linear infinite;animation-delay:var(--flow-delay, 0ms)}.dense-board .maze-flow{stroke-dasharray:none;opacity:.52;animation:none}.dense-board .maze-ambient-group,.dense-board .maze-rail-group{filter:none}.dense-board .maze-ambient,.dense-board .maze-highlight{opacity:.42}.dense-board .exit-gate{animation:none}.low-fx-board .maze-ambient-group,.low-fx-board .maze-rail-group,.low-fx-board .maze-flow-group{filter:none}.low-fx-board .maze-ambient{opacity:.34}.low-fx-board .maze-highlight{display:none}.low-fx-board .maze-core{opacity:.14}.low-fx-board .maze-core.available{opacity:.38}.low-fx-board .maze-flow{stroke-dasharray:none;opacity:.44;animation:none}.low-fx-board .exit-gate,.low-fx-board .arrow-piece,.low-fx-board .exit-burst{filter:none}.low-fx-board .exit-gate{animation:none}.exit-gate{filter:drop-shadow(0 9px 10px rgba(31,41,51,.22)) drop-shadow(0 1px 0 rgba(255,255,255,.75));animation:gatePulse 1.5s ease-in-out infinite}.exit-gate-plate{fill:var(--route-color);opacity:.95}.exit-gate-lip{fill:#ffffff8f}.exit-gate-post{fill:#dbe7ef;stroke:#1f29331f;stroke-width:1}.exit-arrow-badge{fill:var(--route-color);stroke:#fff;stroke-width:3.6}.exit-arrow-symbol{fill:#fff;font-size:17px;font-weight:950;text-anchor:middle;dominant-baseline:central;pointer-events:none}.arrow-piece{cursor:pointer;transform-box:fill-box;transform-origin:center;filter:drop-shadow(0 11px 8px rgba(35,55,72,.22)) drop-shadow(0 1px 0 rgba(255,255,255,.72));transition:filter .16s ease,opacity .16s ease}.arrow-piece .piece-body{transform-box:fill-box;transform-origin:center}.arrow-piece .piece-ring{fill:#ffffff03;stroke:transparent;stroke-width:4;pointer-events:none}.arrow-piece .piece-hitbox{fill:#fff0;pointer-events:all}.arrow-piece .piece-image{pointer-events:none}.arrow-piece .piece-fallback{pointer-events:none;filter:drop-shadow(0 3px 4px rgba(31,41,51,.18)) drop-shadow(0 1px 0 rgba(255,255,255,.38))}.arrow-piece.available .piece-ring{stroke:#ffffffdb;filter:drop-shadow(0 0 8px rgba(255,255,255,.9)) drop-shadow(0 0 13px rgba(74,185,132,.26))}.arrow-piece.tutorial-target .piece-ring,.arrow-piece.hinted .piece-ring{stroke:#f6c94f;stroke-width:5;filter:drop-shadow(0 0 9px rgba(246,201,79,.78)) drop-shadow(0 0 16px rgba(39,174,96,.32))}.arrow-piece.leaving{filter:drop-shadow(0 12px 9px rgba(31,41,51,.2)) drop-shadow(0 0 9px rgba(255,255,255,.7))}.arrow-piece.error .piece-body{animation:shake .22s ease}.arrow-piece.error .piece-ring{stroke:#b42318;stroke-width:6;filter:drop-shadow(0 0 10px rgba(180,35,24,.42))}.arrow-piece.error .piece-image{filter:saturate(.96) sepia(.1) hue-rotate(-8deg)}.board-message{min-height:22px;text-align:center;color:#6b7280;font-size:14px}.play-footer{min-width:0}.game-screen .game-actions{width:min(100%,470px);margin:7px auto 0;justify-content:center}.game-screen .game-actions .action-button{position:relative;display:grid;place-items:center;gap:4px;flex:1;min-height:clamp(64px,8.7dvh,74px);border-radius:20px;cursor:pointer;background:linear-gradient(180deg,#fffffffc,#f2f7faf0);color:#243243;font-size:18px;font-weight:900;box-shadow:0 13px 22px #4358691f,inset 0 1px #fffffff5,inset 0 -1px #4e687c0f}.game-screen .game-actions .action-button:disabled{cursor:default;opacity:.52;filter:saturate(.72)}.action-icon{display:grid;place-items:center;width:42px;height:42px}.action-icon img{width:100%;height:100%;object-fit:contain}.hint-badge{position:absolute;right:18px;top:12px;display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#2d9cdb;color:#fff;font-size:15px;font-weight:950;box-shadow:0 5px 10px #2d9cdb3d}.tool-badge{position:absolute;right:18px;top:12px;display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#2f8f8b;color:#fff;font-size:15px;font-weight:950;box-shadow:0 5px 10px #2f8f8b3d}.tool-badge[hidden]{display:none}.undo-icon img{transform:scaleX(-1)}@media(min-width:620px)and (max-height:620px){.game-screen{width:min(100%,1080px);grid-template-columns:minmax(132px,.9fr) minmax(224px,1fr) minmax(132px,.9fr);grid-template-rows:minmax(0,1fr);column-gap:clamp(12px,2.5vw,24px);row-gap:10px;align-items:stretch;padding-top:calc(12px + var(--safe-top));padding-bottom:calc(12px + var(--safe-bottom))}.game-hud{grid-column:1;grid-row:1;width:100%;height:100%;min-height:0;grid-template-columns:1fr;grid-template-areas:"back" "level" "lives" "moves" "available" "restart";align-content:center;gap:clamp(8px,2.2dvh,14px)}.life-pill,.available-pill{height:48px}.move-card{min-height:54px}.nav-back{justify-self:start}.life-pill,.available-pill,.move-card{width:100%;min-width:0}.restart-orb{justify-self:start}.level-stack{width:100%}.board-wrap{grid-column:2;grid-row:1;width:min(calc(100% - 18px),calc((100dvh - var(--safe-top) - var(--safe-bottom) - 34px) * .68),420px);margin:0}.play-footer{grid-column:3;grid-row:1;align-self:center;width:100%}.play-footer .board-message{min-height:0;text-align:left;line-height:1.45}.game-screen .game-actions{width:100%;flex-direction:column;margin-top:12px}.game-screen .game-actions .action-button{width:100%}}.tutorial-bubble{position:absolute;left:50%;top:12px;z-index:5;display:inline-flex;align-items:center;gap:8px;white-space:nowrap;border-radius:999px;padding:7px 11px;background:#1f2933eb;color:#fff;font-weight:800;font-size:14px;box-shadow:0 10px 20px #1f293329,inset 0 1px #ffffff29;pointer-events:none}.tutorial-hand{position:absolute;z-index:5;width:30px;height:30px;border-radius:50%;background:#f06f5d;box-shadow:0 0 0 8px #f06f5d2e;animation:tapHint 1.1s ease-in-out infinite;pointer-events:none}.level-screen,.result-screen{display:grid;gap:16px}.level-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.level-button{min-height:92px;text-align:left;padding:12px;background:#ffffffb8;color:#1f2933;box-shadow:inset 0 0 0 1px #1f293314}.level-button[disabled]{cursor:default;opacity:.42}.primary-button[disabled],.secondary-button[disabled]{cursor:default;opacity:.62}.level-number{font-size:13px;color:#6b7280;font-weight:800}.level-name{display:block;margin-top:6px;font-size:18px;font-weight:900}.level-meta{display:flex;justify-content:space-between;gap:8px;margin-top:10px;color:#6b7280;font-size:13px}.difficulty-hard,.difficulty-boss{color:#c7554b}.result-screen{min-height:100vh;min-height:100dvh;place-items:center}.result-panel{width:min(100%,520px);text-align:center}.stars{margin:22px 0 12px;color:#f2c94c;font-size:42px;line-height:1;letter-spacing:0}.result-stat-line{color:#6b7280;margin:8px 0}.result-actions{margin-top:22px}.result-actions button{flex:1}.result-secondary-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px}.result-secondary-actions button{width:100%}.modal-scrim{position:fixed;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:20px;background:#1f29333d;z-index:20}.modal{width:min(100%,420px);border-radius:8px;background:#fffdf4;padding:20px;box-shadow:0 24px 54px #1f293347}.modal h2{margin:0 0 8px;font-size:22px}.modal p{margin:0 0 18px;color:#6b7280}.modal-actions{display:flex;gap:10px}.modal-actions button{flex:1}@keyframes shake{0%,to{transform:translate(0)}25%{transform:translate(-4px)}75%{transform:translate(4px)}}@keyframes tapHint{0%,to{transform:translate(-50%,-50%) scale(1);opacity:.92}50%{transform:translate(-40%,-32%) scale(.88);opacity:.65}}@keyframes routeFlow{to{stroke-dashoffset:-56}}@keyframes gatePulse{0%,to{opacity:.92}50%{opacity:1}}@keyframes sparkBurst{0%{opacity:0;transform:translate(0) scale(.4)}18%{opacity:1}to{opacity:0;transform:translate(var(--tx),var(--ty)) scale(.08)}}@keyframes popRing{0%{opacity:.78;transform:scale(.4)}to{opacity:0;transform:scale(4.2)}}.exit-burst{pointer-events:none;filter:drop-shadow(0 0 8px color-mix(in srgb,var(--burst-color),transparent 24%)) drop-shadow(0 4px 7px rgba(31,41,51,.14))}.exit-spark{fill:var(--burst-color);transform-box:fill-box;transform-origin:center;animation:sparkBurst .62s cubic-bezier(.16,.84,.24,1) var(--delay) both}.exit-pop-ring{fill:none;stroke:var(--burst-color);stroke-width:3;transform-box:fill-box;transform-origin:center;animation:popRing .52s ease-out both}.motion-probe{fill:none;stroke:none;opacity:0;pointer-events:none}@media(prefers-reduced-motion:reduce){.maze-flow,.exit-gate,.exit-spark,.exit-pop-ring,.arrow-piece.error,.tutorial-hand{animation:none}.primary-button,.secondary-button,.icon-button,.level-button,.arrow-piece{transition:none}}@media(min-width:680px){.level-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.brand h1{font-size:30px}}@media(max-width:380px){.screen{padding-left:12px;padding-right:12px}.brand h1{font-size:21px}.primary-button,.secondary-button,.icon-button{min-height:42px}}
