@font-face{font-family:Game;src:local('Microsoft YaHei')}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#050918;color:#e8f6ff;font-family:Game,'Segoe UI',sans-serif}body{display:grid;place-items:center}#stage{position:relative;width:min(100vw,177.7778vh);height:min(100vh,56.25vw);overflow:hidden;background:#080e28;box-shadow:0 0 90px #172752}canvas{display:block;width:100%;height:100%;touch-action:none}button,input,select{font:inherit}button{border:1px solid #6db0d34d;border-radius:13px;padding:11px 18px;color:#e5f4ff;background:linear-gradient(135deg,#243653e8,#14233beb);cursor:pointer;box-shadow:inset 0 1px #ffffff12;transition:transform .15s,background .15s;touch-action:manipulation}button:hover{background:#37516d;transform:translateY(-2px)}button:focus-visible{outline:3px solid #ffb5d4}button:disabled{opacity:.36;cursor:default;transform:none}.pink,.primary{background:linear-gradient(115deg,#e85081,#a854aa);border-color:#ffa4ce66;color:white;box-shadow:0 8px 26px #ea6d9230}#overlay{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}#overlay>*{pointer-events:auto}.hidden{display:none!important}.veil{position:absolute;inset:0;background:#030818bd;backdrop-filter:blur(9px);display:grid;place-items:center}.panel{position:relative;width:min(87%,920px);max-height:90%;overflow:auto;border:1px solid #7eafd340;border-radius:24px;padding:28px 34px;background:linear-gradient(135deg,#182741f5,#111b34f5);box-shadow:0 22px 100px #0008}.panel h2{margin:0 0 10px;font-size:28px;letter-spacing:2px}.panel p{line-height:1.8;color:#b9ccdf}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.spread{justify-content:space-between}.menu{position:absolute;left:7%;top:14%;width:55%;text-shadow:0 2px 20px #06122a}.eyebrow{font-size:13px;letter-spacing:5px;color:#a2d4ed}.menu h1{font-size:clamp(22px,4.3vw,64px);line-height:1.3;margin:18px 0;font-weight:900;letter-spacing:3px}.menu h1 span{font-size:.56em;color:#ffbed7}.menu p{font-size:15px;color:#a3bbd9;line-height:2}.menu .row{margin-top:26px}.menuFoot{position:absolute;bottom:5%;left:7%;right:6%;display:flex;justify-content:space-between;align-items:center;color:#9cb3ca;font-size:12px}.menuFoot button{padding:6px 12px;background:transparent}.top{position:absolute;left:3%;right:3%;top:3%;display:flex;justify-content:space-between;align-items:flex-start;gap:15px;pointer-events:none}.chapter{background:linear-gradient(90deg,#091329e8,#0d193d8c);border-left:3px solid #ff8dba;border-radius:0 14px 14px 0;padding:12px 20px;max-width:62%}.chapter small{display:block;color:#8daccb;font-size:10px;letter-spacing:3px}.chapter strong{display:block;font-size:20px;margin:4px 0}.chapter span{font-size:12px;color:#c2d3df}.topActions{display:flex;align-items:center;gap:8px;pointer-events:auto}.topActions span{color:#ffdaa7;font-size:15px;margin-right:7px}.topActions button{padding:9px 13px}.bottomActions{position:absolute;right:3%;bottom:4%;display:flex;gap:8px}#context{position:absolute;left:50%;bottom:15%;transform:translateX(-50%);text-align:center;background:#101d35d9;border:1px solid #87bfd84f;padding:9px 18px;border-radius:20px;color:#d9f7ff;font-size:13px;pointer-events:none}#context:empty{display:none}#saveMark{position:absolute;left:3%;bottom:3%;color:#7d9cba;font-size:10px;pointer-events:none}#toast{position:absolute;left:50%;top:19%;transform:translateX(-50%);padding:11px 24px;background:#233853ef;border:1px solid #a0e1dd70;border-radius:22px;opacity:0;transition:opacity .25s;pointer-events:none;white-space:nowrap;z-index:9}#toast.on{opacity:1}.dialog{position:absolute;bottom:5%;width:85%;left:7.5%;border:1px solid #8fb6d463;background:linear-gradient(110deg,#192947f7,#11182ef7);border-radius:22px;padding:23px 26px;display:flex;gap:22px;align-items:center;box-shadow:0 15px 45px #0008}.portrait{width:75px;height:75px;background:#304b6f;border-radius:22px;flex-shrink:0;overflow:hidden}.dialog strong{color:#ffb4d1;letter-spacing:2px}.dialog p{font-size:19px;line-height:1.7;margin:8px 0;min-height:33px}.dialog small{color:#819cba}.dialog button{margin-left:auto;flex-shrink:0}.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:18px 0}.card{padding:16px;border-radius:14px;background:#ffffff06;border:1px solid #8da5cd21}.card strong{color:#bddfea}.card p{font-size:13px;margin:8px 0}.dim{color:#728ba7}.setting{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:11px 0;border-bottom:1px solid #ffffff09}.setting input[type=text],select{background:#111b32;border:1px solid #537698;border-radius:8px;color:#e9f4ff;padding:8px;max-width:190px}.setting input[type=range]{accent-color:#e887b9;max-width:160px}.puzzleShell{position:absolute;inset:5% 5%;display:flex;background:#101b32f7;border:1px solid #85b6d657;border-radius:23px;overflow:hidden;box-shadow:0 30px 80px #0009}.boardWrap{width:61%;position:relative;display:grid;place-items:center;background:radial-gradient(ellipse,#294064,#111b33)}#board{width:100%;height:100%;max-height:100%;touch-action:none}.puzzleInfo{width:39%;padding:25px;overflow:auto}.puzzleInfo h2{font-size:23px;margin:10px 0}.puzzleInfo p{font-size:14px;line-height:1.9;color:#bcd1e5}.puzzleInfo .row{margin:15px 0}.puzzleInfo button{padding:9px 12px;font-size:12px}#puzzleStatus{min-height:45px;color:#ffd1b0}.chips{display:flex;flex-wrap:wrap;gap:7px}.chip{font-size:12px;padding:7px 10px;background:#223751;border-radius:8px;color:#a9d9ec}.mapCanvas{width:100%;max-height:370px;object-fit:contain;background:#0c1429;border-radius:15px}#touch{position:absolute;bottom:7%;left:4%;display:none;text-align:center}#touch button{padding:8px 15px;min-width:44px;background:#243e5ca8;margin:2px;user-select:none;touch-action:none}.ending{text-align:center}.ending h2{font-size:35px}.ending .row{justify-content:center}@media(pointer:coarse){#touch{display:block}.bottomActions{bottom:5%;max-width:48%;flex-wrap:wrap;justify-content:flex-end}.bottomActions button{font-size:11px;padding:9px}.topActions button{font-size:11px;padding:7px}.chapter strong{font-size:15px}.chapter span{font-size:10px}#saveMark{display:none}}@media(max-width:850px){.panel{padding:18px 22px}.menu p{font-size:12px}.menu .row{margin-top:15px}.menu button{font-size:12px;padding:9px 12px}.menuFoot{font-size:9px}.puzzleInfo{padding:14px}.puzzleInfo h2{font-size:18px}.puzzleInfo p{font-size:12px}.dialog{padding:13px 18px;gap:12px}.dialog p{font-size:14px}.portrait{width:55px;height:55px}.grid{gap:7px;margin:10px 0}.card{padding:10px}.topActions{gap:4px}.bottomActions button{font-size:11px;padding:8px 11px}}
/* Keep a reliable exit and readable controls on phone-sized landscape screens. */
.puzzleExit{position:absolute;right:10px;top:9px;z-index:2;width:34px;height:34px;padding:0;border-radius:50%;font-size:22px;background:#1b2e49}.puzzleInfo h2{padding-right:18px}
@media(max-height:540px){.puzzleInfo{padding:15px 13px}.puzzleInfo .eyebrow{font-size:8px}.puzzleInfo h2{font-size:17px;margin:7px 0}.puzzleInfo p{font-size:11px;line-height:1.5;margin:8px 0}.puzzleInfo .row{gap:6px;margin:8px 0}.puzzleInfo button{font-size:10px;padding:7px 9px}.puzzleInfo .chip{font-size:10px;padding:5px 7px}#puzzleStatus{min-height:28px}#puzzleHint{font-size:10px}.puzzleExit{width:31px;height:31px}.dialog small button{padding:2px 6px}.menuFoot{bottom:3%}.panel h2{font-size:22px}.setting{padding:7px 0}}
.mathGame{width:min(86%,820px);padding:28px;text-align:center;border:1px solid #9bdff177;border-radius:28px;background:linear-gradient(145deg,#152b4cf5,#241c46f5);box-shadow:0 28px 90px #000a}.mathLevel{color:#9fdff1;letter-spacing:2px}.mathPicture{height:110px;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin:18px}.mathPicture i{width:25px;height:25px;border-radius:50%;background:hsl(calc(195 + var(--i)*9),75%,70%);box-shadow:0 0 17px #86ddff88}.mathEquation{display:flex;align-items:center;justify-content:center;gap:22px;font-size:42px}.mathEquation b{min-width:82px;padding:11px;border-radius:18px;background:#fff1;color:#fff}.mathEquation span{color:#ffafd1}.mathChoices{display:flex;justify-content:center;gap:18px;margin:24px}.mathChoices button{min-width:115px;font-size:30px;background:linear-gradient(135deg,#39729c,#b24d87)}.mathDots{display:flex;justify-content:center;gap:7px}.mathDots i{width:10px;height:10px;border-radius:50%;background:#49617c}.mathDots i.now{background:#ff9ac5;box-shadow:0 0 10px #ff9ac5}.mathDots i.done{background:#8be2c4}.missionGrid{grid-template-columns:repeat(5,1fr)}.missionGrid .card{display:grid;gap:7px}.missionGrid strong{display:block}@media(max-width:900px){.missionGrid{grid-template-columns:repeat(3,1fr)}.mathGame{padding:16px}.mathPicture{height:55px;margin:8px}.mathPicture i{width:17px;height:17px}.mathEquation{font-size:28px;gap:10px}.mathEquation b{min-width:55px;padding:7px}.mathChoices{margin:12px}.mathChoices button{min-width:78px;font-size:22px}}
.rewardReveal{text-align:center;padding:12px 8px 4px}.rewardReveal h2{margin:8px 0;color:#fff2b9;font-size:30px}.rewardReveal p{font-size:17px}.rewardChest{width:118px;height:118px;margin:0 auto 10px;border-radius:34px;display:grid;place-items:center;background:radial-gradient(circle at 35% 25%,#fff7c8,#ff7fb5 38%,#526ee5 75%,#172855);box-shadow:0 0 35px #ff9ac8aa,0 0 70px #7ecfff66;animation:rewardPop .65s cubic-bezier(.2,1.45,.45,1)}.rewardChest span{font-size:58px;filter:drop-shadow(0 5px 5px #18204488)}.rewardStars{color:#ffe98b;letter-spacing:9px;font-size:21px;margin:11px}.rewardSection{margin-top:18px;padding-top:14px;border-top:1px solid #b7ddff33}.rewardShelf{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.rewardMini{min-height:70px;padding:8px 3px;border-radius:14px;background:#0b173777;border:1px dashed #87acd955;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;opacity:.48}.rewardMini.got{opacity:1;border-style:solid;background:linear-gradient(150deg,#543b8bcc,#194d7dcc);box-shadow:inset 0 0 15px #ff8fbd22}.rewardMini span{font-size:25px;color:#ffe9a8}.rewardMini small{font-size:11px;color:#dff4ff}@keyframes rewardPop{0%{transform:scale(.2) rotate(-16deg);opacity:0}65%{transform:scale(1.12) rotate(4deg)}100%{transform:scale(1) rotate(0)}}
.mazeProgress{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:12px 0}.mazeProgress span{padding:9px 5px;text-align:center;border-radius:13px;background:#0a173477;color:#8297b5;border:1px solid #7188a344}.mazeProgress span.on{color:#fff2bc;background:linear-gradient(135deg,#4d478c,#28658c);border-color:#a6dded}
.practiceGame{position:relative;width:min(720px,92vw);padding:24px;border-radius:26px;background:linear-gradient(155deg,#142b53f5,#291d4ff5);border:1px solid #a9dbff66;box-shadow:0 20px 70px #030817aa;text-align:center}.practiceExit{position:absolute;right:14px;top:12px;min-width:40px;padding:7px}.practiceTop{display:flex;justify-content:space-between;color:#ffdaed;font-size:18px;padding-right:45px}.practiceContext{font-size:23px;color:#fff0b6;margin:20px 0 8px}.practiceTrack{display:grid;grid-template-columns:repeat(12,1fr);gap:5px;margin:18px 0}.practiceTrack i{height:8px;border-radius:8px;background:#476078}.practiceTrack i.done{background:#74d8ba}.practiceTrack i.now{background:#ff8fbd;box-shadow:0 0 12px #ff8fbd}.practiceTrack i.challenge{outline:1px solid #ffe08c}.practiceResult{text-align:center;padding:18px}.practiceResult>strong{font-size:52px;color:#fff0a8}.learnRows{display:grid;gap:6px}.learnRow{display:grid;grid-template-columns:34px 1fr 70px 42px;align-items:center;gap:8px;padding:8px 10px;border-radius:12px;background:#10234199}.learnRow>b{width:28px;height:28px;display:grid;place-items:center;border-radius:50%;background:#4d4c91}.learnRow span{display:flex;flex-direction:column}.learnRow small{color:#a9c6d9}.learnRow em{text-align:right;color:#ffe0a2;font-style:normal}.learnRow button{min-width:38px;padding:7px}

.schoolLaunch{margin:0 0 12px;background:linear-gradient(115deg,#177ba2,#b44d94);border-color:#9eeeff66}.schoolSource{display:flex;align-items:center;gap:12px;padding:12px 15px;border-radius:15px;background:#0f375b;border:1px solid #78d7ff55}.schoolSource b{padding:5px 9px;border-radius:9px;background:#47a5c9;color:#06172c}.schoolSource.preview{background:#35294f;border-color:#eeabd955}.schoolSource.preview b{background:#da79ad;color:white}.schoolRoute{display:flex;align-items:center;gap:8px;margin:17px 0}.schoolRoute i{font-style:normal;padding:9px 13px;border-radius:18px;background:#173d61;color:#c8edff}.schoolRoute i+i:before{content:'›';margin-right:14px;color:#ffafd2}.schoolGame{position:relative;width:min(760px,92vw);padding:24px;border-radius:28px;text-align:center;background:radial-gradient(circle at 50% 25%,#264f79,#142448 55%,#211b46);border:1px solid #9ce5ff77;box-shadow:0 22px 85px #020714cc}.schoolTarget{display:flex;justify-content:center;align-items:end;gap:10px;margin:18px 0;color:#bfeeff}.schoolTarget b{font-size:42px;color:#fff0ae}.schoolTarget small{margin-right:18px;padding-bottom:7px}.schoolClues{height:120px;display:flex;justify-content:center;align-items:center;gap:30px}.schoolClues span{padding:24px 20px 15px;border-radius:50% 50% 20px 20px;background:linear-gradient(#70d8f0,#2e668e);box-shadow:0 10px 25px #0005}.schoolClues span+span{background:linear-gradient(#ff9cc2,#7b4b9c)}.schoolUnits{min-height:150px;display:flex;flex-wrap:wrap;justify-content:center;align-content:center;gap:15px;padding:12px}.schoolDrone,.schoolRover{position:relative;width:54px;height:47px;display:inline-block;background:linear-gradient(145deg,#baf3ff,#3797bd);border:2px solid #e7fbff;border-radius:20px 20px 13px 13px;box-shadow:0 8px 18px #0005}.schoolDrone b,.schoolRover b{position:absolute;width:14px;height:8px;left:18px;top:10px;border-radius:8px;background:#13294b;box-shadow:0 0 8px #ffb7df}.schoolDrone u,.schoolRover u{position:absolute;width:7px;height:16px;bottom:-14px;border-radius:5px;background:#8ae3ef;text-decoration:none}.schoolDrone u:nth-of-type(1){left:10px}.schoolDrone u:nth-of-type(2){right:10px}.schoolRover{background:linear-gradient(145deg,#ffb4d1,#7655a8)}.schoolRover u{width:9px;height:9px;bottom:-8px;background:#a8d8ff;border:2px solid #283158}.schoolRover u:nth-of-type(1){left:3px}.schoolRover u:nth-of-type(2){left:17px}.schoolRover u:nth-of-type(3){right:17px}.schoolRover u:nth-of-type(4){right:3px}.schoolEmpty{height:95px;display:grid;place-items:center;color:#c7eaff;background:radial-gradient(ellipse,#6b569a55,transparent 66%)}.schoolChoices button b{color:#fff0a8}.schoolDots{display:flex;justify-content:center;gap:8px}.schoolDots i{width:26px;height:7px;border-radius:8px;background:#49647d}.schoolDots i.now{background:#ff8fbd;box-shadow:0 0 12px #ff8fbd}.schoolDots i.done{background:#75dec1}@media(max-height:540px){.schoolGame{padding:14px}.schoolTarget{margin:7px 0}.schoolTarget b{font-size:30px}.schoolClues{height:65px}.schoolClues span{padding:12px}.schoolUnits{min-height:80px}.schoolChoices{margin:8px}}
