
:root{color-scheme:dark;--bg:#07192c;--deep:#0b2840;--panel:#10334b;--cyan:#8ef6e2;--white:#f4fdff;--quiet:#b5d5e4;--sun:#ffd77a;--stroke:#ffffff2f}
*{box-sizing:border-box}html{height:100%}body{margin:0;min-height:100%;background:radial-gradient(ellipse at 50% -10%,#1e6c83aa,transparent 56%),linear-gradient(#07182b,#0b2d49 65%,#061b30);color:var(--white);font-family:ui-rounded,'Trebuchet MS',system-ui,-apple-system,BlinkMacSystemFont,sans-serif}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:3px solid var(--sun);outline-offset:3px}button:disabled{cursor:default;opacity:.52}.app{width:min(1230px,calc(100% - 34px));margin:auto;padding:15px 0 24px}.header{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:12px}.identity{display:flex;align-items:center;gap:10px}.brand{display:grid;place-items:center;font-size:27px;width:44px;height:44px;border-radius:14px;background:linear-gradient(135deg,#62deda,#86b2ec);box-shadow:0 8px 18px #0003}.identity strong{display:block;font-size:15px;letter-spacing:.02em}.identity small{display:block;font-size:11px;color:#a5cfde}.top-actions{display:flex;gap:7px;align-items:center}.top-btn{border:1px solid var(--stroke);background:#ffffff12;color:#edfaff;border-radius:999px;min-height:37px;padding:7px 12px;font-size:12px;font-weight:800}.top-btn:hover{background:#ffffff22}.start-layout{display:grid;grid-template-columns:1.11fr .89fr;gap:17px;margin-top:8px}.intro-scene,.start-card,.game-frame,.status-panel{border:1px solid #c5faff2a;border-radius:24px;box-shadow:0 19px 60px #0004;overflow:hidden}.intro-scene{position:relative;min-height:534px;background:#1c5370}.intro-scene canvas{display:block;width:100%;height:100%;position:absolute;inset:0}.intro-caption{position:absolute;top:28px;left:28px;right:25px;pointer-events:none;text-shadow:0 2px 15px #0b2749aa}.intro-caption .chip{display:inline-block;border:1px solid #ffffff8c;background:#0b466db5;padding:8px 13px;border-radius:100px;font-size:11px;letter-spacing:.09em;text-transform:uppercase;font-weight:950}.intro-caption h2{font-size:clamp(30px,3.2vw,51px);line-height:1.04;letter-spacing:-.055em;max-width:410px;margin:16px 0 10px}.intro-caption p{font-size:15px;max-width:330px;margin:0 0 0 -10px;line-height:1.5;color:#f6ffff;background:#082c48ed;border-radius:9px;padding:8px 10px;text-shadow:none}.intro-bottom{position:absolute;left:20px;bottom:20px;font-size:12px;font-weight:800;border:1px solid #ffffff70;border-radius:99px;background:#062a48aa;padding:8px 12px}.start-card{padding:clamp(19px,3vw,34px);background:linear-gradient(148deg,#123d55,#0a2943);display:flex;flex-direction:column;justify-content:center;gap:13px}.eyebrow{margin:0;color:var(--cyan);letter-spacing:.16em;font-size:11px;font-weight:950;text-transform:uppercase}.start-card h1{font-size:clamp(29px,3.6vw,46px);margin:0;line-height:1.08;letter-spacing:-.045em}.intro-copy{color:#bed9e7;line-height:1.5;margin:0 0 3px;font-size:15px}.modes{display:grid;gap:9px}.mode{border:1px solid var(--stroke);background:#ffffff0b;color:var(--white);text-align:left;border-radius:14px;padding:12px;display:flex;align-items:center;gap:11px}.mode:hover,.mode.active{background:#7af9d91c;border-color:#91f0e0}.mode-icon{width:30px;text-align:center;font-size:23px}.mode b{display:block;font-size:14px}.mode small{display:block;font-size:12px;color:#b8d4e3}.check{margin-left:auto;border:2px solid #70a5ab;border-radius:50%;width:19px;height:19px;flex:none}.mode.active .check{border-color:#8df5e6;background:#8df5e6;box-shadow:inset 0 0 0 4px #123b4c}.primary{border:none;border-radius:15px;min-height:53px;background:linear-gradient(110deg,#72e9dc,#b4f8d9);font-weight:1000;color:#103948;font-size:16px;padding:13px 18px;box-shadow:0 8px 19px #46ddbf35}.primary:hover{filter:brightness(1.06)}.secondary{border:1px solid var(--stroke);border-radius:14px;background:#ffffff13;color:#e3f9ff;font-weight:850;min-height:44px;padding:10px 15px}.smallprint{font-size:11px;color:#a7c8d7;text-align:center;margin:0}.game-layout{display:flex;flex-direction:column;gap:10px}.route{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.route-step{display:flex;align-items:center;gap:8px;background:#ffffff09;border:1px solid var(--stroke);border-radius:13px;padding:8px 10px;min-width:0}.route-step.active{border-color:#76eede;background:#6ef0ce24}.route-step.done{border-color:#ffda814d;background:#fddd7512}.route-step .ic{font-size:18px}.route-step b,.route-step small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.route-step b{font-size:12px}.route-step small{font-size:10px;color:#a9c9d6}.status-panel{display:flex;align-items:center;justify-content:space-between;background:linear-gradient(100deg,#123b53,#0c2b44);padding:10px 16px;gap:15px;min-height:61px}.status-heading b{display:block;font-size:15px}.status-heading small{color:#add0e0;font-size:11px}.stats{display:flex;gap:12px;align-items:center;font-weight:900}.stat{font-size:13px;white-space:nowrap}.crystals{display:flex;gap:4px}.crystals span{font-size:19px;filter:grayscale(1);opacity:.38}.crystals span.got{filter:none;opacity:1}.game-frame{position:relative;background:#2d6a87;height:clamp(325px,52vh,495px);isolation:isolate}.game-frame canvas{display:block;width:100%;height:100%;touch-action:none}.world-label{position:absolute;left:14px;top:13px;padding:7px 12px;background:#082e4fb9;color:white;border:1px solid #ffffff6b;border-radius:99px;font-size:12px;font-weight:900;pointer-events:none}.world-toast{position:absolute;right:14px;top:13px;max-width:40%;padding:9px 12px;background:#0c3452da;color:white;border:1px solid #b6ebf36b;border-radius:14px;font-size:12px;line-height:1.25;font-weight:850;pointer-events:none}.controls{display:flex;justify-content:space-between;align-items:center;gap:11px;padding:1px 5px}.control-cluster{display:flex;gap:10px;align-items:center}.control{touch-action:none;user-select:none;-webkit-user-select:none;min-width:72px;min-height:65px;border:1px solid #7fbdcc7d;border-radius:18px;background:linear-gradient(#244e67,#12364f);color:white;font-size:26px;font-weight:950;box-shadow:inset 0 2px 0 #ffffff20,0 5px 0 #051b30}.control:active,.control.pressed{transform:translateY(3px);box-shadow:inset 0 2px 0 #ffffff20,0 2px 0 #051b30;background:#36829a}.control.action{min-width:111px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:0;font-size:22px}.control.action small{font-size:11px;letter-spacing:.04em}.control.jump{background:linear-gradient(#87e9d9,#52b6b8);color:#073c4b}.control.slide{background:linear-gradient(#e3dbff,#93a9e2);color:#172d58}.controls-guide{text-align:center;color:#a6c9d9;font-size:11px;margin:0}.footnote{text-align:center;color:#85afc1;font-size:11px;margin:17px 0 0}.overlay{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;background:rgba(2,19,33,.79);padding:max(15px,env(safe-area-inset-top)) 15px max(15px,env(safe-area-inset-bottom));backdrop-filter:blur(10px);overflow:auto}.dialog{width:min(620px,100%);max-height:calc(100dvh - 30px);overflow:auto;background:linear-gradient(155deg,#164764,#0b2a45);border:2px solid #a4efe399;border-radius:23px;padding:clamp(17px,3vw,30px);box-shadow:0 22px 75px #0009;text-align:center}.dialog-icon{font-size:37px;line-height:1.2}.dialog .eyebrow{margin:8px 0}.dialog h2{margin:5px 0 10px;font-size:clamp(25px,4vw,34px);letter-spacing:-.035em}.dialog p{color:#e1f2f7;margin:5px auto 13px;max-width:530px;font-size:15px;line-height:1.5}.math-equation{display:inline-block;margin:0 0 15px;font-size:clamp(27px,4.7vw,39px);font-weight:1000;color:#a2ffe7;letter-spacing:.04em}.answers{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.answer{border:2px solid transparent;background:#f0fdff;color:#0b3c51;font-size:27px;min-height:62px;border-radius:16px;font-weight:1000;box-shadow:0 4px 0 #aed3d9}.answer:hover:not(:disabled){background:#fff}.answer.wrong{border-color:#fa9f91;background:#ffdfd6;box-shadow:0 4px 0 #b17870}.answer.right{border-color:#41b990;background:#a5f1cb;box-shadow:0 4px 0 #29886e}.hint-btn{display:block;width:100%;font-size:13px;font-weight:850;margin-top:13px;padding:11px;border:1px dashed #a1d7e3a1;background:#ffffff09;border-radius:12px;color:#d4f5fb}.feedback{min-height:20px;color:#ffe6bc!important;font-weight:800;font-size:13px!important;margin:10px 0 0!important}.count-hint{background:#ffffff0d;border:1px solid #9af2dc80;text-align:left;padding:12px;margin-top:11px;border-radius:13px;max-height:180px;overflow:auto}.count-hint strong{font-size:13px}.count-hint p{font-size:12px;margin:5px 0 9px}.dots{display:flex;gap:5px;flex-wrap:wrap}.dot-group{display:flex;flex-wrap:wrap;gap:3px;border:1px solid #84d9ce78;border-radius:9px;background:#89e6d51a;padding:5px;max-width:100px}.dot{width:8px;height:8px;background:#ffdc83;border-radius:50%}.dialog .primary{width:100%;margin-top:15px}.dialog .secondary{width:100%;margin-top:9px}.prizes{display:flex;gap:10px;justify-content:center;margin:15px auto;font-size:38px}.prizes .muted{filter:grayscale(1);opacity:.25}.big-stars{font-size:55px;margin:14px 0}.win-stats{display:flex;justify-content:center;gap:15px;margin:15px auto}.win-stats div{flex:1;max-width:170px;background:#ffffff13;border-radius:13px;padding:13px}.win-stats b{font-size:29px;display:block}.win-stats small{font-size:10px;letter-spacing:.07em;color:#b8dce5}.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:780px){.start-layout{grid-template-columns:1fr}.intro-scene{min-height:310px}.intro-caption h2{font-size:31px;max-width:300px}.intro-caption{top:19px;left:19px}.start-card{padding:20px}.route-step{padding:7px 8px}.route-step b{font-size:11px}.route-step small{font-size:9px}.game-frame{height:clamp(295px,45vh,430px)}}
@media(max-width:540px){.app{width:min(100% - 18px,1230px);padding-top:7px}.header{gap:5px}.brand{width:35px;height:35px;font-size:23px}.identity strong{font-size:11px}.identity small{font-size:9px}.top-btn{padding:7px 9px;font-size:10px}.route{gap:4px}.route-step{display:grid;justify-items:center;text-align:center;gap:2px;padding:6px 1px}.route-step .ic{font-size:16px}.route-step b{font-size:9px}.route-step small{display:none}.status-panel{padding:9px;gap:5px}.status-heading b{font-size:13px}.status-heading small{font-size:10px}.stats{gap:6px}.stat{font-size:11px}.crystals{gap:1px}.crystals span{font-size:15px}.game-frame{height:clamp(275px,43vh,385px);border-radius:16px}.world-label,.world-toast{font-size:10px;max-width:57%}.controls{gap:6px;padding:2px 0}.control-cluster{gap:6px}.control{min-width:62px;min-height:60px;border-radius:14px}.control.action{min-width:81px;font-size:19px}.controls-guide{font-size:10px}.answers{grid-template-columns:repeat(2,1fr)}.answer{min-height:55px}.dialog{padding:17px}.dialog p{font-size:14px}}
@media(max-height:670px) and (min-width:700px){.app{padding-top:6px}.header{margin-bottom:6px}.route-step{padding:5px 10px}.status-panel{min-height:46px;padding:5px 12px}.game-frame{height:clamp(290px,50vh,400px)}.control{min-height:50px}.controls-guide,.footnote{display:none}.dialog{padding:16px}.dialog h2{font-size:25px}.dialog p{margin:3px auto 7px}.answer{min-height:48px}.math-equation{font-size:29px;margin-bottom:9px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
@media print{body{background:white;color:#123}.header,.controls,.route,.footnote,.game-frame{display:none!important}.game-layout{display:block!important}.overlay{position:static!important;display:flex!important;overflow:visible;background:white;backdrop-filter:none;padding:20px}.dialog{color:#17354c;background:white;box-shadow:none;border:2px solid #789}.dialog p,.dialog .eyebrow{color:#17354c!important}.dialog .secondary,.dialog .primary{display:none}.win-stats div{background:#ecf5fa}.win-stats small{color:#17354c}}

/* Dedicated first-world Grade 4 supply models; safe for touch and short screens. */
.age-label{pointer-events:none}.track-choice{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.track-button{min-height:67px;text-align:left;border:1px solid var(--stroke);border-radius:13px;background:#ffffff0b;color:#eaffff;padding:12px}.track-button b,.track-button small{display:block}.track-button b{font-size:13px}.track-button small{font-size:11px;color:#c4dde6;line-height:1.35;margin-top:4px}.track-button.selected{border-color:var(--cyan);background:#58dfc522}.supply-array{display:grid;grid-template-columns:repeat(auto-fit,minmax(105px,1fr));gap:7px}.supply-crate{display:block;text-align:center;padding:10px 7px;border:1px solid #a5f8e6a0;border-radius:10px;background:#2a69758a;font-size:13px}.supply-crate b{color:#fff4b9}@media(max-width:540px){.track-choice{grid-template-columns:1fr}.top-actions{flex-wrap:wrap;justify-content:flex-end}.header{align-items:flex-start}.top-btn{padding:7px 9px}.game-frame{height:clamp(295px,48vh,430px)}}

.pip-static-nav{display:flex;justify-content:flex-end;gap:18px;align-items:center;width:min(1230px,calc(100% - 34px));margin:13px auto 0;font-weight:900;font-size:12px;letter-spacing:.07em}.pip-static-nav a{color:#b8f3e9;text-decoration:none}.pip-static-nav a:hover,.pip-static-nav a:focus-visible{color:white;text-decoration:underline}

/* Launch first on phones: illustration and optional settings follow the playable action. */
.game-entry-actions{display:flex;flex-direction:column;gap:9px}
.game-entry-actions .primary{width:100%}
.game-entry-actions .secondary{width:100%}
.setup-label{font-size:10px;font-weight:900;letter-spacing:.11em;color:#a6d8db;margin:7px 0 0}
@media(max-width:780px){.start-card{order:-1}.intro-scene{min-height:300px}}
