/* V1R: the approved mobile composition. Scope isolates Home and accepted gameplay. */
body:is(.mode-hub-view,.hub-progress-view):not(.playing){background:#020b18;overflow-x:hidden}
body:is(.mode-hub-view,.hub-progress-view):not(.playing):before{background:linear-gradient(90deg,#020b18bc,transparent 75%),linear-gradient(180deg,transparent 50%,#020b18 94%),url('assets/hub-cosmos.webp') 58% top/auto 790px no-repeat;opacity:1;animation:world-drift 28s ease-in-out infinite}
body:is(.mode-hub-view,.hub-progress-view):not(.playing):after{display:none}
body:is(.mode-hub-view,.hub-progress-view):not(.playing) .app{max-width:1180px;width:100%;padding:0 16px calc(90px + env(safe-area-inset-bottom));margin:0 auto;overflow:hidden}
body:is(.mode-hub-view,.hub-progress-view):not(.playing) .app>header,
body:is(.mode-hub-view,.hub-progress-view):not(.playing) :is(.topline,#launch,.home-controls,.world-nav,#journey,.workspace,#leaderboard,footer){display:none!important}
body:is(.mode-hub-view,.hub-progress-view):not(.playing) main{display:block;padding:0;margin:0}
body:is(.mode-hub-view,.hub-progress-view):not(.playing) .home-deck{display:block;margin:0}
body.mode-hub-view:not(.playing) #learning-progress{display:none!important}
body.hub-progress-view:not(.playing) #mode-lobby{display:none!important}
body.hub-progress-view:not(.playing) #learning-progress{display:flex;position:static;max-width:740px;width:100%;margin:22px auto;padding:20px}
.mission-header{display:none}
body:is(.mode-hub-view,.hub-progress-view):not(.playing) .mission-header{display:flex;align-items:center;justify-content:space-between;height:74px;gap:8px;position:relative;z-index:3}
.mission-brand{position:relative;display:flex;flex-direction:column;text-decoration:none;font-family:Arial,Tahoma,sans-serif;font-style:italic;font-weight:950;line-height:.87;letter-spacing:-1px;color:#effcff;padding:3px 10px 0}
.mission-brand>span{font-size:29px;text-shadow:0 0 10px #76dfff50}
.mission-brand>b{font-size:24px;color:#ffdc79}
.mission-brand>small{font-style:normal;font-weight:400;font-size:12px;line-height:1.3;letter-spacing:0;margin:5px 0 0 17px;color:#9cb9cb}
.mission-brand:after{content:'';position:absolute;top:21px;right:-2px;width:70px;height:25px;border:1px solid #fbd270;border-left-color:transparent;border-radius:50%;transform:rotate(-25deg);pointer-events:none}
.mission-header-actions{display:flex;align-items:center;gap:8px}
.mission-language{display:flex;border:1px solid #6886a1;border-radius:25px;overflow:hidden;background:#0612249c}
.mission-language button{border:0;box-shadow:none;background:none;color:#bfd3e6;min-width:44px;min-height:44px;padding:7px;font:800 14px Arial,sans-serif;border-radius:25px}
.mission-language button[aria-pressed=true]{background:linear-gradient(#ffe7a0,#ffc84e);color:#20170b;box-shadow:0 0 14px #ffe89a25}
#mission-settings-slot .mission-settings{width:44px;min-width:44px;height:44px;padding:0;border:0;box-shadow:none;background:transparent;color:#c4e2f1;font-size:25px;line-height:1;border-radius:50%}
body.game-world.mode-hub-view:not(.playing) #mode-lobby{padding:0;border:0;background:transparent;box-shadow:none;isolation:isolate;scroll-margin-top:0}
body.mode-hub-view #mode-lobby [hidden]{display:none!important}
body.mode-hub-view #mode-lobby .lobby-heading{margin:3px 9px 4px;position:relative;z-index:2}
body.mode-hub-view #mode-lobby .lobby-heading h2{font-family:Arial,Tahoma,sans-serif;font-size:16px;font-weight:900;line-height:1.1;letter-spacing:.065em;color:#e8faff;margin:0}
body.mode-hub-view #mode-lobby .lobby-heading h2:after{content:'';display:block;width:32px;height:1px;background:#b3eee5;margin-top:3px}
body.game-world.mode-hub-view #mode-lobby .mode-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
body.mode-hub-view #mode-lobby .featured-mission{height:220px;min-height:0;padding:0 9px;margin:0;grid-column:1/-1;overflow:visible;border-radius:0;background:transparent;isolation:isolate}
body.mode-hub-view .featured-mission:before{inset:-75px -16px -30px;z-index:-2;background:linear-gradient(90deg,#020b18bb 4%,#020b1840 60%,transparent),url('assets/hub-cosmos.webp') 62% 15%/auto 430px no-repeat;mask-image:linear-gradient(180deg,transparent,#000 15%,#000 85%,transparent)}
body.mode-hub-view .featured-mission:after{display:none}
body.mode-hub-view .mission-copy{width:56%;max-width:440px;position:relative;background:linear-gradient(90deg,#020b1850,transparent);text-shadow:0 2px 10px #020b18}
body.mode-hub-view .mission-kicker{font-size:13px;font-weight:800;letter-spacing:.04em;color:#ffdc79}
body.mode-hub-view #ufo-meteor-title{font:950 35px/.91 Arial,Tahoma,sans-serif;font-style:normal;letter-spacing:-1px;margin:4px 0 10px;color:#f0fcff}
body.mode-hub-view #ufo-meteor-title>span{display:block}
body.mode-hub-view #ufo-meteor-title>span:last-child{color:#80e6f3}
body.mode-hub-view .mission-level{width:104px}
body.mode-hub-view .mission-level select{min-height:44px;width:100%;font:800 18px Arial,sans-serif;border-radius:25px;border:1px solid #acc4d0;padding:7px 12px;color:#f2f8ff;background:#03101bc9}
body.mode-hub-view .mission-copy p{font-size:14px;line-height:1.38;width:196px;max-width:100%;margin:4px 0 0;color:#c5deec}
body.mode-hub-view .mission-foreground{position:absolute;z-index:-1;pointer-events:none;width:260px;height:200px;aspect-ratio:auto;right:-12px;top:-8px;animation:mission-float 10s ease-in-out infinite}
body.mode-hub-view .mission-scene{position:absolute;width:242px;height:auto;right:-16px;top:2px}
body.mode-hub-view .mission-rocks{position:absolute;left:0;bottom:-2px;width:260px;aspect-ratio:2/1}
.mission-rock-image{display:block;width:100%;height:auto}
body.mode-hub-view .mission-rocks>span{position:absolute;font-family:serif;font-weight:800;line-height:1;color:#ffe2a3;text-shadow:0 0 12px #ef9a40,0 2px 3px #3b210e;transform:translate(-50%,-50%) rotate(-8deg);font-size:38px}
body.mode-hub-view .mission-rocks .hanzi-rock-one{left:28%;top:48%}
body.mode-hub-view .mission-rocks .hanzi-rock-two{left:80%;top:57%;font-size:clamp(38px,5vw,66px)!important}
body.mode-hub-view #mode-lobby .mission-play{position:absolute;bottom:0;left:9px;right:9px;width:calc(100% - 18px);min-height:44px;margin:0;font:900 22px Arial,sans-serif;letter-spacing:.04em;border-radius:0;clip-path:polygon(3% 0,97% 0,100% 20%,100% 80%,97% 100%,3% 100%,0 80%,0 20%);background:linear-gradient(160deg,#ffe797,#ffd35f 65%,#edac35);color:#231a0b;box-shadow:inset 0 0 0 2px #ffe6a0,0 3px 18px #ffbf2520}
body.mode-hub-view .mission-play>span:first-child{order:2}
body.game-world.mode-hub-view #mode-lobby .mode-tile{grid-column:span 1;position:relative;min-height:64px;padding:0;display:grid;grid-template-columns:32% minmax(0,1fr);gap:0;border:1px solid #628ba766;border-radius:9px;background:#061525cf;box-shadow:none;overflow:hidden;transition:transform .14s,background .14s;}
body.game-world.mode-hub-view #mode-lobby .mode-tile .mode-art{display:block;min-height:64px;position:relative;width:100%;height:100%;background-image:url('assets/hub-training.webp');background-size:300% 300%;opacity:1;mask-image:linear-gradient(90deg,#000 75%,transparent);border:0}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-art-cell="0"] .mode-art{background-position:0 0}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-art-cell="1"] .mode-art{background-position:50% 0}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-art-cell="2"] .mode-art{background-position:100% 0}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-art-cell="3"] .mode-art{background-position:0 50%}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-art-cell="4"] .mode-art{background-position:50% 50%}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-art-cell="5"] .mode-art{background-position:100% 50%}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-art-cell="6"] .mode-art{background-position:0 100%}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-art-cell="7"] .mode-art{background-position:50% 100%}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-art-cell="8"] .mode-art{background-position:100% 100%}
body.game-world.mode-hub-view #mode-lobby .mode-tile .mode-art:after{background:none;box-shadow:none}
body.game-world.mode-hub-view #mode-lobby .mode-tile .mode-copy{display:flex;flex-direction:column;justify-content:center;position:relative;min-width:0;width:auto;padding:8px 17px 8px 0;gap:0;background:none;border:0}
body.game-world.mode-hub-view #mode-lobby .mode-tile .mode-copy :is(strong,h3){font:700 14px/1.22 Arial,Tahoma,sans-serif;letter-spacing:0;text-transform:uppercase;color:#e2f0fa;overflow-wrap:normal;word-break:normal;margin:0}
body.mode-hub-view .mode-tile:before{content:'›';position:absolute;right:7px;top:50%;transform:translateY(-50%);font-size:25px;color:#c9e2ed;z-index:2}
body.mode-hub-view #mode-lobby .mode-tile .mode-copy :is(.tile-kicker,.eyebrow,b){display:none}
body.game-world.mode-hub-view #mode-lobby .mode-tile .mode-copy>span:not(.tile-kicker):not(.eyebrow),body.game-world.mode-hub-view #mode-lobby .mode-tile .mode-copy>p{position:absolute;display:block;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body.mode-hub-view #mode-lobby .mode-emblem{display:none}
.arcade-hanzi{position:absolute;left:48%;top:48%;transform:translate(-50%,-50%);font:800 25px serif;color:#bcf7ff;text-shadow:0 0 7px #49b4ef}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-tier="major"]{min-height:124px;display:block;align-content:start;background:#092039}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-tier="major"] .mode-art{position:absolute;inset:0;min-height:0;mask-image:none;background-image:url('assets/hub-destinations.webp');background-size:200% 100%;background-position:0 50%}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-world-mode="writing"] .mode-art{background-position:100% 50%}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-tier="major"] .mode-copy{position:absolute;top:0;left:0;justify-content:flex-start;flex:none;padding:10px;width:100%;margin:0;background:linear-gradient(180deg,#02101e99,transparent);}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-tier="major"] .mode-copy strong{font:900 19px/1.05 Arial,Tahoma,sans-serif;letter-spacing:0;color:#ffde8b;}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-world-mode="writing"] .mode-copy strong{color:#b4fff1}
html[lang="en"] body.mode-hub-view #mode-lobby [data-world-mode="writing"] .mode-copy strong{max-width:6em}
body.mode-hub-view .mode-tile[data-tier="major"]:before{top:auto;bottom:2px;right:9px;transform:none;font-size:34px;color:#ffdd79}
body.mode-hub-view #mode-lobby .destination-hanzi{left:54%;top:43%;font-size:42px}
body.mode-hub-view #mode-lobby .mode-group-heading{grid-column:1/-1;margin:0 4px;padding:0 0 1px;display:flex;align-items:center;gap:14px;font:800 15px/1.2 Arial,Tahoma,sans-serif;letter-spacing:.2em;color:#c5e5ef}
body.mode-hub-view #mode-lobby .mode-group-heading:after{content:'';width:28px;height:1px;background:#adc6d1}
body.game-world.mode-hub-view #mode-lobby .mode-tile[data-world-mode="sentences"]{grid-column:1/-1}
.mission-nav{position:fixed;z-index:30;left:0;right:0;bottom:0;min-height:65px;display:flex;align-items:center;justify-content:space-around;gap:0;padding:6px max(8px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom));border-top:1px solid #72bdde55;background:linear-gradient(#041425f2,#020c19fa);box-shadow:0 -8px 18px #020b1877}
.mission-nav[hidden],body.playing .mission-nav,body:has(dialog[open]) .mission-nav{display:none}
.mission-nav a{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:74px;min-height:48px;font-size:14px;line-height:1.2;text-decoration:none;color:#92b4cf;padding:0 5px;position:relative}
.mission-nav a>span:first-child{font-size:0;line-height:1}.mission-nav svg{display:block;width:26px;height:26px}
.mission-nav a[aria-current="page"]{color:#ffdc79}
.mission-nav a[aria-current="page"]:after{content:'';position:absolute;left:10px;right:10px;bottom:-3px;height:1px;background:#ffdc79}
.mission-settings-dialog{width:min(500px,calc(100vw - 24px));max-height:calc(100dvh - 30px);padding:14px;background:#08182d;color:#effaff;border:1px solid #668d9f;border-radius:16px;overflow:auto;box-shadow:0 20px 80px #0009}
.mission-settings-dialog::backdrop{background:#010610b8}
.mission-settings-dialog #settings-panel{display:block!important;width:100%;border:0;box-shadow:none;background:transparent;padding-top:38px}
.mission-settings-close{position:absolute;right:9px;top:9px;width:44px;height:44px;border:0;background:#163247;color:#effaff;font-size:28px;border-radius:50%}
@keyframes mission-float{0%,100%{transform:translate3d(0,0,0)}50%{transform:translate3d(0,-4px,0)}}
@keyframes world-drift{0%,100%{transform:translate3d(0,0,0)}50%{transform:translate3d(-2px,2px,0)}}
/* V4.2A: already-current incoming content; stable geometry, nav and world. */
@keyframes shell-route-enter{from{opacity:.82}to{opacity:1}}
body.home-view[data-shell-entry=home]:not(.playing):not(.adventure-view) .home-scene>:is(.home-brand,.home-tagline,.home-intro,.home-entry,.home-destinations,.home-tools,.home-save-status),
body.mode-hub-view[data-shell-entry=modes]:not(.playing):not(.adventure-view) #mode-lobby,
body.hub-progress-view[data-shell-entry=progress]:not(.playing):not(.adventure-view) #learning-progress{animation:shell-route-enter 160ms ease-out}
@media(prefers-reduced-motion:reduce){
 body[data-shell-entry] #mode-lobby,body[data-shell-entry] #learning-progress,
 body[data-shell-entry] .home-scene>:is(.home-brand,.home-tagline,.home-intro,.home-entry,.home-destinations,.home-tools,.home-save-status){animation:none!important}
}
body.hub-ambient-paused .mission-foreground,body.hub-ambient-paused:before{animation-play-state:paused}
@media(hover:hover){body.game-world.mode-hub-view #mode-lobby .mode-tile:hover{transform:translateY(-2px);background:#0d2337}body.mode-hub-view #mode-lobby .mission-play:hover{filter:brightness(1.06)}}
body.game-world.mode-hub-view #mode-lobby .mode-tile:active{transform:scale(.985)}
@media(min-width:651px){
 body:is(.mode-hub-view,.hub-progress-view):not(.playing) .app{padding-left:30px;padding-right:30px}
 body:is(.mode-hub-view,.hub-progress-view):not(.playing) .mission-header{height:90px}
 body.mode-hub-view #mode-lobby .lobby-heading h2{font-size:23px}
 body.mode-hub-view #mode-lobby .featured-mission{height:365px;padding:0 20px;margin-bottom:12px}
 body.mode-hub-view #ufo-meteor-title{font-size:66px}
 body.mode-hub-view .mission-kicker{font-size:16px}
 body.mode-hub-view .mission-level{width:142px}
 body.mode-hub-view .mission-level select{font-size:22px}
 body.mode-hub-view .mission-copy p{font-size:16px;width:275px;margin-top:12px}
 body.mode-hub-view .mission-foreground{width:480px;height:325px;right:-20px;top:-10px}
 body.mode-hub-view .mission-scene{width:440px;right:-28px}
 body.mode-hub-view .mission-rocks{width:420px;left:34px;bottom:0}
 body.mode-hub-view .mission-rocks>span{font-size:58px}
 body.mode-hub-view #mode-lobby .mission-play{min-height:54px;left:20px;right:20px;width:calc(100% - 40px);font-size:25px}
 body.game-world.mode-hub-view #mode-lobby .mode-grid{gap:14px}
 body.game-world.mode-hub-view #mode-lobby .mode-tile[data-tier="major"]{min-height:215px}
 body.game-world.mode-hub-view #mode-lobby .mode-tile[data-tier="major"] .mode-copy{padding:17px}
 body.game-world.mode-hub-view #mode-lobby .mode-tile[data-tier="major"] .mode-copy strong{font-size:28px}
 body.game-world.mode-hub-view #mode-lobby .mode-tile[data-tier="standard"],body.game-world.mode-hub-view #mode-lobby .mode-tile[data-tier="standard"] .mode-art{min-height:82px}
 body.game-world.mode-hub-view #mode-lobby .mode-tile[data-tier="standard"] .mode-copy :is(strong,h3){font-size:17px}
 body.mode-hub-view #mode-lobby .destination-hanzi{font-size:70px}
}
@media(min-width:1100px){
 body.mode-hub-view:not(.playing):before{background-size:cover}
 body.mode-hub-view .featured-mission:before{background:linear-gradient(90deg,#020b1870,transparent);mask-image:none}
 body.game-world.mode-hub-view #mode-lobby .mode-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:16px}
 body.mode-hub-view #mode-lobby .featured-mission{height:420px}
 body.mode-hub-view .mission-copy{width:43%}
 body.mode-hub-view #ufo-meteor-title{font-size:83px}
 body.mode-hub-view .mission-foreground{width:650px;height:390px;right:0;top:-20px}
 body.mode-hub-view .mission-scene{width:580px}
 body.mode-hub-view .mission-rocks{width:480px;left:100px}
 body.mode-hub-view .mission-rocks>span{font-size:66px}
 body.game-world.mode-hub-view #mode-lobby .mode-tile[data-tier="major"]{grid-column:span 3;min-height:230px}
 body.game-world.mode-hub-view #mode-lobby .mode-tile[data-tier="standard"]{grid-column:span 2}
 .mission-nav{width:460px;left:50%;right:auto;transform:translateX(-50%);border-radius:20px 20px 0 0}
}
@media(max-height:450px) and (min-width:651px){
 body:is(.mode-hub-view,.hub-progress-view):not(.playing) .mission-header{height:62px}
 body.mode-hub-view #mode-lobby .lobby-heading h2{font-size:18px}
 body.mode-hub-view #mode-lobby .featured-mission{height:223px}
 body.mode-hub-view .mission-copy{width:50%}
 body.mode-hub-view #ufo-meteor-title{font-size:45px}
 body.mode-hub-view #ufo-meteor-title>span{display:block}
 body.mode-hub-view .mission-copy p{font-size:14px;width:290px;margin-top:8px}
 body.mode-hub-view .mission-foreground{width:420px;height:217px;right:-10px;top:-8px}
 body.mode-hub-view .mission-scene{width:360px}
 body.mode-hub-view .mission-rocks{width:270px;left:45px}
 body.mode-hub-view .mission-rocks>span{font-size:40px}
 body.mode-hub-view #mode-lobby .mission-play{left:auto;width:42%;right:20px;min-height:44px}
 .mission-nav{min-height:52px;padding:4px 12px}
 .mission-nav a{flex-direction:row;align-items:center;gap:8px;min-height:44px}
 .mission-nav svg{width:20px;height:20px}
}
@media(prefers-reduced-motion:reduce){
 body:is(.mode-hub-view,.hub-progress-view):not(.playing):before,body.mode-hub-view .mission-foreground,body.mode-hub-view #mode-lobby{animation:none}
 body.game-world.mode-hub-view #mode-lobby .mode-tile,body.mode-hub-view #mode-lobby .mission-play{transition:none}
 body.game-world.mode-hub-view #mode-lobby .mode-tile:is(:hover,:active){transform:none}
 html:focus-within{scroll-behavior:auto}
}
html:has(body:is(.mode-hub-view,.hub-progress-view)):not(:has(body.playing)){scrollbar-width:none}
html:has(body:is(.mode-hub-view,.hub-progress-view)):not(:has(body.playing))::-webkit-scrollbar{display:none}
/* Outside the isolated mission view, keep the prior Home hub art composition. */
body:not(.mode-hub-view) .mission-scene{content:url('assets/hub-ufo-flight.webp')}
body:not(.mode-hub-view) .mission-rocks{position:absolute;inset:0}
body:not(.mode-hub-view) .mission-rock-image{display:none}
body:not(.mode-hub-view) .mission-rocks>span{position:absolute;font-family:serif;font-weight:800;color:#ffe2a3;text-shadow:0 0 12px #ef9a40;transform:translate(-50%,-50%) rotate(-9deg);font-size:clamp(28px,4vw,55px);line-height:1}
body:not(.mode-hub-view) .mission-rocks .hanzi-rock-one{left:25%;top:68%}
body:not(.mode-hub-view) .mission-rocks .hanzi-rock-two{left:63%;top:83%;font-size:clamp(22px,3vw,40px)!important}
/* Mission selection moves immediately; scroll animations must not shift tap targets. */
html:has(body:is(.mode-hub-view,.hub-progress-view)):not(:has(body.playing)){scroll-behavior:auto!important}
