:root{font-family:Tahoma,Arial,sans-serif;color:#24334e;font-size:16px;font-synthesis:none}*{box-sizing:border-box}html,body{margin:0;min-height:100%;overflow-x:hidden}body{background:linear-gradient(165deg,#d9f6ff 0%,#f3faff 36%,#e7ffe3 100%);min-height:100vh}button{font:inherit;cursor:pointer}button:focus-visible,[tabindex]:focus-visible{outline:4px solid #e58e27;outline-offset:3px}button:disabled{opacity:.38;cursor:not-allowed}.sky{position:fixed;inset:0;pointer-events:none;overflow:hidden;opacity:.58}.sky span{position:absolute;font-size:90px;top:9%;left:2%;animation:cloud 25s ease-in-out infinite alternate}.sky span:nth-child(2){top:52%;left:82%;font-size:66px;animation-delay:-8s}.sky span:nth-child(3){top:30%;left:50%;font-size:40px}@keyframes cloud{to{transform:translateX(50px)}}.app{position:relative;max-width:1120px;margin:auto;padding:clamp(10px,2.5vw,28px);min-height:100vh}.topbar{display:flex;align-items:center;gap:12px;background:#fffdf9;border:3px solid #e4f0e0;border-radius:24px;box-shadow:0 9px 20px #4a6e8f18;padding:11px 16px}.brand{flex:1;font-size:clamp(.85rem,2.6vw,1.17rem);font-weight:900;text-align:center;line-height:1.65}.brand small{display:block;color:#438e67;font-size:.72em}.logo{font-size:30px}.home-btn{background:#e8f8ff;color:#2b6692;border:2px solid #c4e8f7;border-radius:14px;width:44px;height:44px;font-size:31px;line-height:1}main{padding:12px 0 30px}footer{text-align:center;color:#577480;font-size:.79rem;padding:12px}.hero{text-align:center;padding:24px 10px 18px}.eyebrow{color:#356d81;font-weight:800;font-size:.84rem}.hero h1{font-size:clamp(2rem,7vw,3.8rem);line-height:1.25;margin:7px 0;background:linear-gradient(115deg,#ff923e,#d65a53);color:transparent;background-clip:text;-webkit-background-clip:text;text-shadow:0 3px #fff9}.hero p{margin:7px auto;max-width:660px;color:#587083;line-height:1.8}.subject-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(12px,3vw,24px);max-width:860px;margin:10px auto 28px}.subject{border:3px solid white;border-radius:28px;min-height:270px;padding:20px;display:flex;align-items:center;justify-content:space-between;gap:12px;position:relative;overflow:hidden;box-shadow:0 13px 0 #415d5d16,0 18px 25px #284f5b22;color:#fff;transition:transform .2s;text-align:right}.subject:hover{transform:translateY(-4px)}.subject.science{background:linear-gradient(145deg,#18a99e,#1763a2)}.subject.math{background:linear-gradient(145deg,#9860df,#e65e8b)}.subject::before{content:"";position:absolute;border-radius:50%;width:180px;height:180px;left:-65px;top:-65px;background:#ffffff16}.subject .emoji{font-size:clamp(70px,9vw,125px);line-height:1;filter:drop-shadow(0 12px 0 #233b642a);align-self:center}.subject h2{font-size:clamp(1.25rem,3vw,2rem);margin:4px 0 9px}.subject p{font-size:.94rem;line-height:1.85;color:#fffef4}.subject .go{background:#ffffffeb;color:#25334c;border-radius:30px;padding:8px 14px;font-weight:900;display:inline-block}.route{text-align:center;color:#526982;font-weight:900;background:#fff9;border:2px dashed #b7ded3;border-radius:20px;padding:14px;margin:auto;max-width:820px}.section-head{text-align:center;padding:20px 8px 10px}.section-head h1{font-size:clamp(1.7rem,5vw,2.7rem);margin:9px 0}.section-head p{color:#5d7284;line-height:1.8;margin:8px auto}.back{border:0;background:#fff;border-radius:100px;color:#315976;padding:10px 16px;font-weight:900;box-shadow:0 3px 10px #163e4815}.levels{max-width:790px;margin:0 auto;display:grid;gap:13px}.level{display:flex;gap:16px;align-items:center;border:3px solid white;text-align:right;padding:13px;border-radius:23px;background:#fff;box-shadow:0 7px 16px #52728f17;min-width:0}.level:not(:disabled):hover{border-color:#f5b85c}.level.lock{background:#f3f5f7}.level .levelIcon{display:grid;place-items:center;background:#d7f0fd;border-radius:17px;width:70px;min-width:70px;height:68px;font-size:36px}.level .info{flex:1;min-width:0}.level strong{display:block;font-size:1.05rem;color:#253c55}.level small{display:block;color:#5b7185;line-height:1.7;margin-top:4px}.level .step{padding:6px 10px;border-radius:30px;background:#fff3db;color:#975b17;font-size:.78rem;font-weight:900}.game{margin:8px auto;max-width:850px;background:#fffefb;border:3px solid white;border-radius:27px;box-shadow:0 13px 35px #2d5f6b1a;padding:clamp(12px,3vw,25px);overflow:hidden}.game-top{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.chip{display:inline-block;background:#e0f7e9;color:#26744d;border-radius:100px;padding:7px 12px;font-weight:900;font-size:.85rem}.chip.blue{background:#e7efff;color:#355b9e}.progress{height:10px;background:#e5edf1;border-radius:50px;overflow:hidden;margin:12px 0}.progress>span{display:block;height:100%;background:linear-gradient(90deg,#49cfa6,#73abed);border-radius:50px;transition:width .3s}.game h2{font-size:clamp(1.45rem,4.5vw,2.15rem);margin:8px 0}.prompt{font-size:1.02rem;line-height:1.85;color:#42596c;background:#edf8ff;border-radius:16px;padding:13px 16px;border-right:5px solid #72badf;margin:12px 0}.stage{background:linear-gradient(#e9f9fe,#e9f6ec);border:2px solid #d9edf0;border-radius:21px;padding:clamp(8px,2.2vw,16px);min-height:200px;overflow:hidden}.stageTitle{font-weight:900;color:#397a8e;margin-bottom:12px}.controls{display:flex;justify-content:center;flex-wrap:wrap;gap:9px;margin:13px 0}.btn{border:0;border-radius:15px;padding:12px 17px;font-weight:900;min-height:45px;background:#e8ecf7;color:#32465b;box-shadow:0 4px 0 #8294a830}.btn.main{background:#fcb951;color:#4b3821;box-shadow:0 5px 0 #dc8f32}.btn.blue{background:#b3e9f6;color:#205b76}.btn.green{background:#90e7b9;color:#205a42}.btn.selected{outline:3px solid #f29f40;background:#fff1c9}.btn:active,.tap:active{transform:translateY(2px)}.msg{min-height:45px;border-radius:14px;background:#fff3dd;padding:12px 14px;font-weight:800;color:#78613a;line-height:1.65}.msg.ok{background:#ddf9e6;color:#1a754a}.msg.bad{background:#ffe5e2;color:#a33b35}.actions{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:13px}.small{font-size:.83rem;color:#66818c;line-height:1.7}.pieces{display:flex;justify-content:center;flex-wrap:wrap;gap:9px;margin:12px 0}.piece{border:2px solid #bdd7e2;border-radius:14px;padding:9px;min-width:62px;min-height:51px;background:white;font-size:24px}.piece.active{background:#ffe7ae;border-color:#e9a84b}.circuit{width:100%;height:auto;max-width:610px;display:block;margin:auto;touch-action:pan-y}.circuit text{font-size:14px;fill:#334a66;font-weight:900;pointer-events:none}.wire{stroke:#e56858;stroke-width:5;stroke-linecap:round;pointer-events:stroke;cursor:pointer}.terminal{fill:#e9f4fa;stroke:#3487af;stroke-width:4;cursor:pointer}.terminal.chosen{fill:#ffb743;stroke:#a76316;stroke-width:5}.terminal:focus-visible{stroke:#f07d2a;stroke-width:7}.svg-button{cursor:pointer}.bulb-glow{fill:#ffdd3e;filter:drop-shadow(0 0 7px #fdb218)}.bulb-off{fill:#d7e0e4}.pipeboard{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;max-width:440px;margin:auto;direction:ltr}.pipe{aspect-ratio:1;border:2px solid #a7d4e3;border-radius:12px;min-width:0;background:linear-gradient(140deg,#f7fafb,#dceff5);display:grid;place-items:center;position:relative;padding:0;touch-action:manipulation}.pipe svg{width:94%;height:94%;pointer-events:none}.pipe.live{background:#bcf4fb;border-color:#399ec1}.pipe.start{box-shadow:inset 0 0 0 3px #51be9b}.pipe.end{box-shadow:inset 0 0 0 3px #f5b247}.pipe small{position:absolute;font-size:9px;bottom:1px;left:0;right:0;text-align:center;color:#365e67;font-weight:bold}.object-row{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}.obj{border:3px solid #cfe0e8;border-radius:18px;background:white;padding:12px 14px;text-align:center;min-width:90px;max-width:170px;flex:1}.obj.sel{border-color:#e9a03d;background:#fff2d3}.obj .pic{font-size:50px;display:block}.obj strong{display:block;font-size:.86rem;margin:6px 0}.waterline{height:115px;position:relative;display:grid;place-items:center;background:linear-gradient(#d8f5ff 50%,#67d5ed 51%,#b0e8fa 100%);border:2px solid #abddeb;border-radius:17px;margin:12px 0;overflow:hidden}.boat{font-size:67px;position:absolute;left:50%;top:15%;transform:translateX(-50%);transition:top .4s}.boat.sunk{top:62%}.boat.floating{top:18%}.metrics{display:flex;gap:9px;justify-content:center;flex-wrap:wrap}.metric{border:2px solid #d8e8eb;border-radius:14px;background:#fff;padding:10px 14px;text-align:center;font-weight:900;min-width:97px}.math-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:3px;max-width:380px;margin:10px auto;direction:ltr}.cell{aspect-ratio:1;border:2px solid #c0d9e4;border-radius:8px;background:#fff;min-width:0;touch-action:manipulation}.cell.on{background:linear-gradient(135deg,#ffda77,#ffae76);border-color:#dc8657}.fractions{display:grid;grid-template-columns:repeat(8,1fr);gap:5px;max-width:500px;margin:10px auto;direction:ltr}.slice{aspect-ratio:1;min-width:0;border:2px solid #ded8c1;border-radius:11px;background:#fff8da;font-size:clamp(16px,4vw,33px);touch-action:manipulation}.slice.on{background:#f7a95c;border-color:#bb6b27}.fractionVis{width:min(210px,64vw);aspect-ratio:1;border:9px solid #dca257;border-radius:50%;margin:12px auto;display:grid;place-items:center;font-size:55px;background:conic-gradient(#fcbf6b 0deg,#fff1d2 0);box-shadow:0 6px 0 #b98748}.balance{display:flex;justify-content:space-between;gap:14px;padding:16px 8px 30px;max-width:550px;margin:10px auto;position:relative}.pan{background:#fff;border:3px solid #bfcde9;border-radius:17px;padding:20px 9px;min-width:0;flex:1;text-align:center;font-weight:900;box-shadow:0 7px 0 #a6b7d6}.beam{position:absolute;left:12%;right:12%;height:8px;background:#9585af;border-radius:10px;bottom:13px;transform-origin:center;transition:transform .3s}.beam::after{content:'▲';position:absolute;left:49%;top:3px;color:#9585af}.robotboard{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;max-width:375px;margin:10px auto;direction:ltr}.robotcell{aspect-ratio:1;display:grid;place-items:center;font-size:clamp(19px,6vw,31px);border:2px solid #cfe3e9;border-radius:9px;background:#fff}.robotcell.wall{background:#6c839e}.robotcell.treasure{background:#fff5cb}.robotcell.robot{background:#daf4da}.commands{display:flex;min-height:45px;gap:4px;flex-wrap:wrap;justify-content:center;border:2px dashed #b9cdd4;border-radius:10px;padding:8px;direction:ltr;background:white}.command{font-size:24px;border-radius:7px;background:#d5e8f1;min-width:30px;text-align:center}.reveal{animation:pop .4s ease}@keyframes pop{from{transform:scale(.93);opacity:.3}to{transform:scale(1);opacity:1}}@media(max-width:650px){.app{padding:8px}.topbar{padding:8px 10px;border-radius:17px}.brand{font-size:.83rem}.logo{font-size:24px}.subject-grid{grid-template-columns:1fr;max-width:480px}.subject{min-height:167px;padding:15px}.subject .emoji{font-size:69px}.hero{padding:14px 6px}.hero h1{font-size:2.25rem}.section-head{padding:12px 5px 8px}.level .levelIcon{width:55px;min-width:55px;height:55px;font-size:29px}.game{border-radius:18px;padding:10px}.stage{padding:7px;border-radius:15px}.btn{padding:10px 12px;font-size:.92rem}.obj{min-width:76px;padding:7px}.obj .pic{font-size:39px}.pipe{border-radius:8px}.prompt{font-size:.96rem}.fractions{gap:3px}.slice{border-radius:7px}.chip{font-size:.77rem}.game-top{gap:5px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
