:root{font-family:'Trebuchet MS','Arial Rounded MT Bold',Arial,sans-serif;color:#fff;background:#062239;font-synthesis:none;--ink:#053352;--panel:#053855;--warm:#fff1b5}
*{box-sizing:border-box}html,body{height:100%;width:100%;margin:0;overflow:hidden}button{font-family:inherit;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:3px solid #ffe285;outline-offset:4px}body{background:radial-gradient(ellipse at 50% 40%,#08799c,#031e34 88%);touch-action:manipulation}.game-shell{height:100dvh;width:100vw;display:flex;align-items:center;justify-content:center;overflow:hidden}.game{position:relative;isolation:isolate;width:min(100vw,177.77778dvh);aspect-ratio:16/9;overflow:hidden;background:#045e8f;container-type:inline-size;border-radius:4px;box-shadow:0 0 65px #0006}.reef-video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-3}.subtle-vignette{pointer-events:none;position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,29,61,.52),transparent 22%,transparent 75%,rgba(0,27,45,.24)),linear-gradient(90deg,rgba(0,46,72,.15),transparent 60%,rgba(0,23,44,.04));z-index:-2}.ambient-specks{position:absolute;inset:0;pointer-events:none;z-index:-1}.ambient-specks i{position:absolute;width:6px;height:6px;background:#d1fcff55;border-radius:100%;left:var(--left);top:105%;animation:rise 11s linear infinite;animation-delay:var(--delay)}.ambient-specks i:nth-child(1){--left:9%;--delay:-3s}.ambient-specks i:nth-child(2){--left:21%;--delay:-7s}.ambient-specks i:nth-child(3){--left:34%;--delay:-2s}.ambient-specks i:nth-child(4){--left:48%;--delay:-11s}.ambient-specks i:nth-child(5){--left:57%;--delay:-5s}.ambient-specks i:nth-child(6){--left:66%;--delay:-8s}.ambient-specks i:nth-child(7){--left:79%;--delay:-4s}.ambient-specks i:nth-child(8){--left:89%;--delay:-10s}@keyframes rise{0%{transform:translateY(10px);opacity:0}8%{opacity:.55}90%{opacity:.55}100%{transform:translateY(-750px);opacity:0}}
.topbar{position:absolute;z-index:8;left:3.2%;right:3.2%;top:3.7%;display:flex;justify-content:space-between;align-items:center;gap:2cqw}.brand{display:flex;gap:1cqw;align-items:center;filter:drop-shadow(0 3px 5px #00365399)}.brand-icon{width:4.35cqw;height:4.35cqw;border-radius:50%;display:grid;place-items:center;font-size:2.4cqw;color:#deffff;background:radial-gradient(circle at 35% 30%,#a5f4ff,#199ad0 65%,#075482);border:.23cqw solid #e6ffff;box-shadow:inset 0 0 .65cqw #fff8}.brand strong{display:block;font-weight:1000;font-size:2cqw;line-height:1;letter-spacing:.055em;color:#fff;text-shadow:0 .2cqw .45cqw #003651}.brand strong em{color:#ffe99e;font-style:normal}.brand span:not(.brand-icon){display:block;font-size:.85cqw;font-weight:800;letter-spacing:.3em;margin-top:.43cqw;color:#e9ffff}.topbar-right{display:flex;align-items:center;gap:1cqw}.word-tracker{display:flex;align-items:center;gap:.6cqw;white-space:nowrap;font-size:1cqw;font-weight:900;letter-spacing:.10em;background:#063c61ac;border:1px solid #d5f8ff88;border-radius:20cqw;padding:1cqw 1.5cqw;backdrop-filter:blur(10px)}.word-tracker b{font-size:1.25cqw;color:#ffe68c}.word-tracker span{color:#a9d6ec}.header-button{display:grid;place-items:center;width:3.6cqw;height:3.6cqw;padding:0;border:1px solid #e2faff90;border-radius:50%;font-size:2cqw;background:#073957ac;color:#fff;cursor:pointer;backdrop-filter:blur(8px);transition:transform .16s,background .16s}.header-button:hover,.header-button:active{transform:scale(1.08);background:#1178a4}.instruction-pill{position:absolute;top:14%;left:10%;z-index:3;min-width:35%;text-align:center;pointer-events:none;font-size:1.18cqw;font-weight:1000;letter-spacing:.14em;color:#e9ffff;text-shadow:0 2px 7px #00405c;padding:.8cqw 1.5cqw;border-radius:99px;background:linear-gradient(90deg,transparent,#035b7990,transparent)}
.bubble-area{position:absolute;inset:0;z-index:5;pointer-events:none}.bubble{position:absolute;display:grid;place-items:center;width:9.0%;aspect-ratio:1;min-width:0;border-radius:50%;border:.20cqw solid #e8fcffda;background:radial-gradient(circle at 32% 25%,#f1ffffe9 0%,#d8faffb3 15%,#91e8fcad 37%,#2cafe5aa 75%,#03598dca 99%);box-shadow:inset -.7cqw -.9cqw 1.55cqw #08639cb3,inset .3cqw .5cqw 1.2cqw #ffffff98,0 .35cqw 1.0cqw #00547170,0 0 1.8cqw #a2f5ff66;color:#072e57;cursor:pointer;pointer-events:auto;transform:translate(-50%,-50%);animation:bubbleBob var(--bob-duration,3.7s) ease-in-out infinite alternate;animation-delay:var(--bob-delay,0s);transition:filter .22s,opacity .42s ease,transform .42s ease;touch-action:manipulation;user-select:none}.bubble::before{content:'';position:absolute;left:17%;top:11%;width:43%;height:17%;border-radius:100%;transform:rotate(-37deg);background:#fffdfcd7;box-shadow:-.45cqw .45cqw .25cqw #fff7}.bubble::after{content:'';position:absolute;bottom:14%;right:17%;width:17%;height:9%;border-radius:90%;transform:rotate(-36deg);background:#d6ffff8f}.bubble .bubble-text{position:relative;z-index:1;font-size:3.0cqw;line-height:1;font-weight:1000;letter-spacing:-.07em;text-shadow:0 1px 0 #f5feff9e,0 0 9px #fff8}.bubble.choice-hidden{opacity:0!important;pointer-events:none}
.bubble:hover:not(:disabled){filter:brightness(1.18) drop-shadow(0 0 .7cqw #d7ffff)}.bubble:active:not(:disabled){filter:brightness(1.3)}.bubble:disabled{cursor:default;filter:saturate(.75);opacity:.77}.bubble.correct{animation:popOut .33s ease-in forwards;pointer-events:none}.bubble.incorrect{animation:shakeWrong .38s ease-out!important}.bubble .number-key{position:absolute;right:10%;bottom:10%;font-size:.7cqw;line-height:1;color:#effbff99;display:none}@media(hover:hover){.bubble .number-key{display:block}}@keyframes bubbleBob{0%{translate:0 0}100%{translate:1.4cqw -2.9cqw}}@keyframes popOut{0%{scale:1;opacity:1}35%{scale:1.25;opacity:.8;filter:brightness(1.7)}100%{scale:.06;opacity:0}}@keyframes shakeWrong{0%,100%{rotate:0deg}25%{rotate:-8deg}50%{rotate:8deg}75%{rotate:-5deg}}.sparkle{position:absolute;width:1cqw;height:1cqw;color:#fff6ac;font-size:2.6cqw;z-index:6;pointer-events:none;animation:sparkleFlight .9s ease-out forwards;text-shadow:0 0 8px #fff}@keyframes sparkleFlight{0%{transform:translate(0,0) scale(.5);opacity:1}100%{transform:translate(var(--dx),var(--dy)) scale(1.5);opacity:0}}
.clam-container{position:absolute;z-index:3;width:42%;aspect-ratio:1;right:-1.1%;bottom:15.9%;pointer-events:none}.clam-image{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 .3cqw .6cqw #001c3390)}.pearl-picture{position:absolute;width:26.5%;height:26.5%;left:50%;top:66.4%;transform:translate(-50%,-50%) scale(.67);border-radius:50%;background:transparent;display:grid;place-items:center;padding:1%;opacity:0;transition:opacity .45s,transform .6s;overflow:hidden}.pearl-picture.revealed{opacity:1;transform:translate(-50%,-50%) scale(1)}.pearl-picture img{display:block;width:111%;height:111%;max-width:none;max-height:none;object-fit:contain;filter:drop-shadow(0 2px 1px #7c9aa047)}.clam-shimmer{position:absolute;left:65%;top:38%;font-size:4.3cqw;color:#f7ffff;text-shadow:0 0 18px #f1ffff;opacity:0}.clam-shimmer.visible{animation:clamShine 1.1s ease-out forwards}@keyframes clamShine{0%{opacity:0;transform:scale(.4) rotate(0)}40%{opacity:1}100%{opacity:0;transform:scale(1.8) rotate(70deg)}}
.bottom-panel{position:absolute;z-index:9;bottom:2.5%;left:3.2%;width:93.6%;height:16.3%;display:flex;align-items:center;gap:2cqw;padding:1.3cqw 2cqw;border:.12cqw solid #d5ffff8c;border-radius:1.65cqw;background:linear-gradient(125deg,rgba(6,52,79,.92),rgba(3,43,72,.87) 60%,rgba(9,83,105,.85));box-shadow:0 .6cqw 2.0cqw #0019368e,inset 0 1px 0 #fff8;backdrop-filter:blur(17px)}.panel-intro{flex:0 0 27%;border-right:1px solid #9ccce35c;display:flex;flex-direction:column;justify-content:center;min-width:0}.panel-overline{display:block;color:#addfe8;font-size:.87cqw;letter-spacing:.18em;font-weight:900;margin-bottom:.44cqw}.panel-intro strong{font-size:1.7cqw;letter-spacing:.01em;line-height:1.18;color:#f6fdff}.panel-intro small{font-size:1.05cqw;color:#d7f3f3;margin-top:.55cqw}.spelling-area{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;gap:.25cqw}.spelling-slots{display:flex;align-items:center;justify-content:center;gap:.56cqw;width:100%;height:5.5cqw}.spelling-slot{flex:0 0 auto;width:5.2cqw;height:5.1cqw;display:grid;place-items:center;border:.16cqw dashed #c9f6ff7f;border-radius:.8cqw;background:linear-gradient(180deg,#76d8ec2c,#0e618052);font-weight:1000;font-size:2cqw;color:#fcfeff;text-shadow:0 2px 2px #00364c99;transition:all .2s}.spelling-slot.filled{color:#04415b;background:linear-gradient(180deg,#fff9cf,#f2d78e);border:2px solid #fff7c6;box-shadow:0 .2cqw .9cqw #ffe7a250;animation:slotFlash .28s ease-out}.spelling-slot.next-slot{border-color:#fcf3cecc}@keyframes slotFlash{0%{scale:.7}65%{scale:1.13}100%{scale:1}}.panel-actions{display:flex;flex:0 0 24%;align-items:center;justify-content:end;gap:.9cqw}.action-btn{display:flex;align-items:center;justify-content:center;gap:.7cqw;white-space:nowrap;border:1px solid #fff8;border-radius:1cqw;color:#f9feff;background:linear-gradient(180deg,#278ac1,#0b658d);padding:1.2cqw 1.0cqw;font-weight:1000;font-size:1.03cqw;letter-spacing:.05em;box-shadow:0 4px 0 #033953;cursor:pointer}.action-btn span:first-child{font-size:1.65cqw}.action-btn:active{transform:translateY(3px);box-shadow:0 1px 0 #033953}.treasure-counter{display:flex;align-items:center;gap:.2cqw;color:#ffedb5;font-size:1.2cqw;white-space:nowrap}.treasure-counter>span:first-child{font-size:2.4cqw}.treasure-counter b{font-size:1.7cqw}.treasure-outof{opacity:.8;font-size:.9cqw}
.screen-overlay{position:absolute;z-index:15;inset:0;background:linear-gradient(90deg,rgba(0,34,58,.68),rgba(0,23,53,.14) 83%);display:flex;align-items:center;justify-content:flex-start;padding-left:9%;backdrop-filter:blur(2px);transition:opacity .32s}.screen-overlay.hidden{opacity:0;pointer-events:none;visibility:hidden}.intro-card{width:51%;padding:4.2cqw 3.4cqw;text-align:center;border:1px solid #e6faff9a;border-radius:2.3cqw;background:linear-gradient(160deg,rgba(8,86,117,.94),rgba(1,47,80,.94));box-shadow:0 1cqw 4cqw #003350ae,inset 0 1px 0 #fff7}.intro-tag{font-size:1.05cqw;font-weight:900;letter-spacing:.22em;color:#bceeff}.intro-illustration{font-size:4.4cqw;margin:1cqw 0 .3cqw}.intro-card h1{font-size:5.5cqw;line-height:.98;letter-spacing:.04em;margin:.4cqw auto 1.6cqw;text-shadow:0 .25cqw .2cqw #013352}.intro-card h1 em{color:#ffe5a0;font-style:normal}.intro-card p{font-size:1.45cqw;line-height:1.55;color:#e0f7ff;margin:.5cqw 0 2.1cqw}.big-button{display:flex;align-items:center;justify-content:center;gap:1.4cqw;margin:auto;border:.15cqw solid #fff0a9;border-bottom:.32cqw solid #be8027;padding:1.2cqw 2cqw;border-radius:100px;background:linear-gradient(180deg,#ffe9a6,#ffc953);color:#184b65;font-weight:1000;font-size:1.56cqw;box-shadow:0 .4cqw 1.2cqw #022c5c7d;cursor:pointer;transition:transform .16s,filter .16s}.big-button:hover{filter:brightness(1.07);transform:translateY(-2px)}.big-button:active{transform:translateY(3px)}.intro-small{font-size:1.03cqw;color:#bce8f0;margin-top:1.8cqw;letter-spacing:.04em}.intro-small strong{color:#ffe1a5}.result-overlay{z-index:13;background:linear-gradient(90deg,rgba(0,31,57,.66),rgba(0,25,47,.08) 86%)}.result-card{width:47%;margin-left:4%;text-align:center;padding:3cqw 2.7cqw;border-radius:2cqw;background:linear-gradient(160deg,#07658ce8,#053d6aee);border:1px solid #c4f8ffc4;box-shadow:0 1cqw 3cqw #002c4ab0}.result-star{font-size:4.4cqw;color:#ffe68c;text-shadow:0 0 2cqw #ffdb70;margin-bottom:.3cqw}.result-card h2{font-size:3.75cqw;line-height:1.04;margin:.9cqw 0 1cqw;color:#fff3bf}.result-card p{font-size:1.44cqw;line-height:1.4;margin:0 0 2cqw;color:#e7fcff}.alert-live{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}.rotate-prompt{display:none}
@media(prefers-reduced-motion:reduce){.bubble,.ambient-specks i{animation-duration:10s}.clam-shimmer{display:none}}

/* Original Galactic Phonics production video from the earlier game. */
.credits-overlay{z-index:18;justify-content:center;padding:0;background:#010817;backdrop-filter:none}
.gp-intro-video{position:absolute;inset:0;display:block;width:100%;height:100%;background:#030a1b;object-fit:contain;pointer-events:none}
.gp-intro-start{position:absolute;bottom:8%;left:50%;transform:translateX(-50%);z-index:1;min-width:13%;text-shadow:none}
.gp-intro-start:hover{transform:translateX(-50%) translateY(-2px)}
.gp-intro-start:active{transform:translateX(-50%) translateY(3px)}
.gp-intro-hint{position:absolute;bottom:2%;left:0;right:0;font-size:1.05cqw;text-align:center;color:#dcf4ff;letter-spacing:.035em;text-shadow:0 2px 5px #0019}
.gp-intro-hint strong{color:#ffe7a7}
.credits-overlay.credits-running .gp-intro-start,.credits-overlay.credits-running .gp-intro-hint{display:none}
/* Orientation overlay is controlled by JS after checking viewport geometry for touch devices. */
.orientation-blocker{position:fixed;inset:0;background:radial-gradient(circle at 50% 20%,#136889,#041e39 77%);z-index:9999;display:none;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:6vw;color:#f3ffff;gap:1.2rem}
.orientation-blocker .orientation-symbol{font-size:clamp(48px,12vw,100px);color:#ffe8a4;line-height:1}
.orientation-blocker strong{font-size:clamp(24px,4vw,40px)}.orientation-blocker p{font-size:clamp(16px,2.6vw,24px);max-width:680px;line-height:1.5;margin:0}.orientation-blocker small{color:#b5e6f1;font-size:clamp(13px,1.8vw,18px)}
body.orientation-blocked .orientation-blocker{display:flex}
body.orientation-blocked .game,body.orientation-blocked .game *,body.orientation-blocked .game *::before,body.orientation-blocked .game *::after{animation-play-state:paused!important;transition:none!important}
body.orientation-blocked .game{pointer-events:none}
/* JS sets body.orientation-blocked only when the device actually needs rotating. */

:root:fullscreen .game-shell{width:100vw;height:100dvh}
:root:fullscreen .game{border-radius:0;box-shadow:none}

.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}
.icon-button{padding:0;overflow:hidden}
.icon-button img{display:block;width:100%;height:100%;object-fit:cover;border-radius:50%}
.volume-controls{display:flex;align-items:center;gap:.65cqw;padding:.45cqw .85cqw .45cqw .55cqw;border:1px solid #d5f8ff88;border-radius:20cqw;background:#063c61ac;backdrop-filter:blur(10px)}
.volume-mute{width:3.1cqw;height:3.1cqw;font-size:1.35cqw;flex:0 0 auto}
.volume-slider{width:8.5cqw;accent-color:#ffe68c;cursor:pointer}
.volume-slider::-webkit-slider-runnable-track{height:.46cqw;border-radius:999px;background:linear-gradient(90deg,#7be6ff,#ffe68c)}
.volume-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:1.15cqw;height:1.15cqw;border-radius:50%;background:#fff;border:.12cqw solid #0a638b;margin-top:-.33cqw;box-shadow:0 0 .35cqw #002a44}
.volume-slider::-moz-range-track{height:.46cqw;border-radius:999px;background:linear-gradient(90deg,#7be6ff,#ffe68c)}
.volume-slider::-moz-range-thumb{width:1.15cqw;height:1.15cqw;border-radius:50%;background:#fff;border:.12cqw solid #0a638b;box-shadow:0 0 .35cqw #002a44}
@media (max-aspect-ratio: 4/3){.volume-slider{width:10.5cqw}}

/* Phonic Quest – Haunted Mansion: all foreground elements can be moved independently. */
.haunted-video{display:none}
.game.haunted-scene{background:#10162d}
.game.haunted-scene #reef-video{display:none}
.game.haunted-scene .haunted-video{display:block}
.game.haunted-scene .ambient-specks{display:none}
.game.haunted-scene .subtle-vignette{background:linear-gradient(180deg,rgba(3,9,28,.55),transparent 27%,transparent 68%,rgba(3,9,28,.34))}
[hidden]{display:none!important}
.scene-switch{width:auto;min-width:5.1cqw;padding:0 0.8cqw;border-radius:3cqw;font-size:0.82cqw;font-weight:1000;letter-spacing:.055em}
.game.haunted-scene .brand-icon{background:radial-gradient(circle at 35% 30%,#faf6ff,#9462cb 65%,#24123e);border-color:#f9deff}
.game.haunted-scene .instruction-pill{background:linear-gradient(90deg,transparent,#261c548f,transparent);color:#ffe6fb}
.game.haunted-scene .bottom-panel{background:linear-gradient(125deg,rgba(25,20,51,.94),rgba(20,18,46,.92) 60%,rgba(70,30,95,.89));border-color:#d7b9fba0}
.game.haunted-scene .spelling-slot{background:linear-gradient(180deg,#a584e92b,#27154890)}
.game.haunted-scene .spelling-slot.filled{background:linear-gradient(180deg,#fff2c0,#f5c981)}
.game.haunted-scene .action-btn{background:linear-gradient(180deg,#9673c5,#532c8d);box-shadow:0 4px 0 #241440}
.game.haunted-scene .treasure-counter{color:#f4d9ff}
.crypt-container{position:absolute;z-index:3;width:39%;aspect-ratio:1;right:-1.5%;left:auto;bottom:16.4%;pointer-events:none}
.crypt-image{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 .3cqw 1.25cqw #000a)}
.crypt-picture{position:absolute;width:37%;height:37%;top:56.5%;left:50%;border-radius:1.1cqw;padding:.5%;display:grid;place-items:center;overflow:hidden;opacity:0;transform:translate(-50%,-50%) scale(.16);transition:opacity 1.15s ease-out,transform 1.35s cubic-bezier(.15,.8,.23,1);background:radial-gradient(circle,#f0eaff3e,#14122445 72%,transparent 88%)}
.crypt-picture.concealed{opacity:0!important;visibility:hidden!important;transition:none!important;transform:translate(-50%,-50%) scale(.16)!important}
.crypt-picture.revealed{opacity:1;transform:translate(-50%,-50%) scale(1.16)}
.crypt-picture img{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 .2cqw .65cqw #fff6)}
.bubble.ghost-choice{width:11.3%;aspect-ratio:3/4;border:0;border-radius:0;background:none;box-shadow:none;filter:drop-shadow(0 0 1.0cqw #b3baff55);animation:ghostWander var(--bob-duration,5s) ease-in-out infinite alternate;opacity:1}
.bubble.ghost-choice::before,.bubble.ghost-choice::after{display:none}
.ghost-choice .ghost-sprite{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:.84;filter:drop-shadow(0 0 .6cqw #cfe9ff66);pointer-events:none;user-select:none}
.ghost-choice .bubble-text{position:relative;margin-top:13%;font-size:2.7cqw;min-width:4.6cqw;min-height:4.2cqw;padding:0 .4cqw;display:grid;place-items:center;border:.16cqw solid #ffedcfe8;border-radius:1.25cqw;color:#fff4bd;letter-spacing:-.04em;background:linear-gradient(180deg,#291c52d8,#0b1535db);box-shadow:0 0 .8cqw #fbf2ff94,0 .15cqw .6cqw #07102ab9;text-shadow:0 .12cqw .25cqw #000c;pointer-events:none}
.bubble.ghost-choice:disabled{filter:grayscale(.12) drop-shadow(0 0 .8cqw #9ec8ff44);opacity:.8}
.bubble.ghost-choice:hover:not(:disabled){filter:brightness(1.32) drop-shadow(0 0 1.15cqw #e6dbff)}
.bubble.ghost-choice.correct{animation:ghostCaptured .5s ease-out forwards}
.bubble.ghost-choice.incorrect{animation:shakeWrong .4s ease-out!important}
@keyframes ghostWander{
  0%{translate:calc(var(--ghost-drift-x,1.5cqw) * -1) var(--ghost-drift-low,1cqw);rotate:var(--ghost-tilt-left,-2deg)}
  50%{translate:0 var(--ghost-drift-high,-1.2cqw);rotate:0deg}
  100%{translate:var(--ghost-drift-x,1.5cqw) var(--ghost-drift-end,.5cqw);rotate:var(--ghost-tilt-right,2deg)}
}
@keyframes ghostCaptured{0%{scale:1;opacity:1}40%{scale:1.2;filter:brightness(2)}100%{scale:.1;opacity:0}}
.scene-overlay{z-index:17;justify-content:center;padding:2.2cqw;background:linear-gradient(135deg,#0a203aeF,#1b1545f5);backdrop-filter:blur(7px)}
.scene-picker{text-align:center;width:76%;max-height:92%;display:flex;flex-direction:column;align-items:center;gap:1.1cqw}
.scene-picker-kicker{font-size:.9cqw;letter-spacing:.22em;color:#ffe5a7;font-weight:1000}
.scene-picker h1{font-size:4.1cqw;line-height:1.06;margin:0;color:#fff3c1;text-shadow:0 .3cqw 1cqw #0007}
.scene-picker p{font-size:1.35cqw;color:#dbeafa;margin:.1cqw 0 .6cqw}
.scene-choices{width:100%;display:flex;gap:2.2cqw;justify-content:center}
.scene-choice{position:relative;overflow:hidden;display:flex;flex-direction:column;width:43%;aspect-ratio:1.65/1;background:#163d61;border:.24cqw solid #bce6ff;border-radius:1.6cqw;padding:0;cursor:pointer;color:white;box-shadow:0 .7cqw 2cqw #0009;transition:transform .18s,filter .18s}
.scene-choice:hover,.scene-choice:focus-visible{transform:translateY(-.4cqw);filter:brightness(1.12)}
.scene-choice img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.scene-choice-text{position:absolute;bottom:0;width:100%;padding:2.2cqw 1.1cqw 1.15cqw;background:linear-gradient(0deg,#091c32f5,#102a55e0 65%,transparent);display:flex;flex-direction:column;gap:.45cqw}
.scene-choice-text strong{font-size:2.15cqw;line-height:1.1}.scene-choice-text small{font-size:1.07cqw;color:#f9e6b4}
.scene-picker-foot{font-size:1.0cqw;color:#b9d8f2}
.result-change-scene{margin-top:1.1cqw;border:none;color:#e7d8ff;text-decoration:underline;background:none;font-size:1.06cqw;font-weight:800;cursor:pointer;padding:.6cqw}
.result-change-scene:hover{color:#fff}
@media(prefers-reduced-motion:reduce){.ghost-choice{animation-duration:9s!important}}

/* Keep the instruction line clear of the crypt roof. */
.game.haunted-scene .instruction-pill{top:12.9%;left:6%;width:48%;min-width:0;white-space:nowrap;z-index:4;font-size:1.1cqw}

/* Cosmic Quest additions */
.cosmic-video{display:none}
.game.cosmic-scene{background:#060e2f}
.game.cosmic-scene #reef-video,.game.cosmic-scene .haunted-video{display:none}
.game.cosmic-scene .cosmic-video{display:block}
.game.cosmic-scene .ambient-specks{display:none}
.game.cosmic-scene .subtle-vignette{background:linear-gradient(180deg,rgba(5,8,31,.42),transparent 26%,transparent 71%,rgba(5,8,31,.34)),linear-gradient(90deg,rgba(12,17,47,.26),transparent 64%,rgba(5,8,31,.14))}
.game.cosmic-scene .brand-icon{background:radial-gradient(circle at 35% 30%,#fff6d6,#6e9dff 63%,#132260);border-color:#f7ebc3;color:#fff9d7}
.game.cosmic-scene .instruction-pill{background:linear-gradient(90deg,transparent,#1b2b75ac,transparent);color:#eef5ff;top:13%;left:7%;width:45%;min-width:0;white-space:nowrap;z-index:4}
.game.cosmic-scene .bottom-panel{background:linear-gradient(125deg,rgba(12,20,58,.95),rgba(6,14,41,.94) 60%,rgba(30,48,101,.87));border-color:#a9c4ff9e}
.game.cosmic-scene .spelling-slot{background:linear-gradient(180deg,#8aa6ff20,#17295f82);border-color:#c6d7ff7e}
.game.cosmic-scene .spelling-slot.filled{background:linear-gradient(180deg,#fff4c6,#f5d68d)}
.game.cosmic-scene .action-btn{background:linear-gradient(180deg,#6c8fff,#3656bb);box-shadow:0 4px 0 #1e2d72}
.game.cosmic-scene .treasure-counter{color:#ffebb3}
/* Perspective-aligned overlay: 925,219 to 1180,400 in the 1280x720 video.
   Every word clue is prewarped to the satellite screen polygon. */
.satellite-container{position:absolute;z-index:3;left:72.265625%;top:30.416667%;width:19.921875%;height:25.138889%;pointer-events:none}
.satellite-picture{position:absolute;inset:0;opacity:0;transition:none;pointer-events:none}
.satellite-picture.revealing,.satellite-picture.revealed{opacity:1}
.satellite-picture canvas{display:block;width:100%;height:100%;border:0;border-radius:0;background:transparent;object-fit:fill;transform:none;box-shadow:none;filter:none}
.bubble.asteroid-choice{width:12.2%;aspect-ratio:1;border:0;border-radius:0;background:none;box-shadow:none;filter:drop-shadow(0 .35cqw .9cqw #0007);animation:asteroidFloat var(--bob-duration,9s) ease-in-out infinite alternate;opacity:1}
.bubble.asteroid-choice::before,.bubble.asteroid-choice::after{display:none}
.asteroid-choice .asteroid-sprite{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none;animation:asteroidSpin var(--spin-duration,22s) linear infinite;filter:drop-shadow(0 .18cqw .55cqw #0008)}
.asteroid-choice .bubble-text{position:relative;z-index:1;min-width:4.5cqw;min-height:4.2cqw;padding:0 .5cqw;display:grid;place-items:center;margin:0 auto;font-size:2.55cqw;line-height:1;font-weight:1000;letter-spacing:-.04em;color:#fff3bf;text-shadow:0 .15cqw .34cqw #000d,0 0 .8cqw #000;pointer-events:none;background:linear-gradient(180deg,rgba(7,18,53,.62),rgba(7,18,53,.42));border:.14cqw solid #ffd772ae;border-radius:1.35cqw;box-shadow:0 0 .8cqw #97b3ff45}
.bubble.asteroid-choice:disabled{filter:saturate(.82) drop-shadow(0 .25cqw .9cqw #0008);opacity:.84}
.bubble.asteroid-choice:hover:not(:disabled){filter:brightness(1.18) drop-shadow(0 0 1.0cqw #c8d8ff)}
.bubble.asteroid-choice.correct{animation:asteroidCaptured .46s ease-out forwards}
.bubble.asteroid-choice.incorrect{animation:shakeWrong .4s ease-out!important}
@keyframes asteroidFloat{0%{translate:calc(var(--asteroid-drift-x,1.1cqw)*-1) calc(var(--asteroid-drift-y,1cqw)*.65);rotate:-2deg}50%{translate:0 calc(var(--asteroid-drift-y,1cqw)*-1)}100%{translate:var(--asteroid-drift-x,1.1cqw) var(--asteroid-drift-y,1cqw);rotate:2deg}}
@keyframes asteroidSpin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
@keyframes asteroidCaptured{0%{scale:1;opacity:1}35%{scale:1.18;filter:brightness(1.7)}100%{scale:.06;opacity:0}}

/* Scene picker tweaks for three adventures */
.scene-choices{gap:1.6cqw;align-items:stretch;flex-wrap:nowrap}
.scene-choice{width:31.5%;aspect-ratio:1.1/1}
.scene-choice-text strong{font-size:1.8cqw}
.scene-choice-text small{font-size:0.94cqw}
.scene-picker p{max-width:48cqw}
.scene-picker-foot{margin-top:.4cqw}

@media(prefers-reduced-motion:reduce){.asteroid-choice,.asteroid-choice .asteroid-sprite{animation-duration:14s!important}}

/* V19 — Wizarding Words: original portal background + seven keyed animated pupils */
.wizard-video{display:none}
.game.wizard-scene{background:#221b55}
.game.wizard-scene #reef-video,
.game.wizard-scene .haunted-video,
.game.wizard-scene .cosmic-video{display:none}
.game.wizard-scene .wizard-video{display:block}
.game.wizard-scene .ambient-specks{display:none}
.game.wizard-scene .subtle-vignette{background:linear-gradient(180deg,rgba(17,8,52,.4),transparent 23%,transparent 69%,rgba(15,10,44,.4)),linear-gradient(90deg,transparent 80%,rgba(18,8,51,.08))}
.game.wizard-scene .brand-icon{background:radial-gradient(circle at 35% 30%,#fff5d0,#e8a9ff 52%,#643aa1);color:#fff8d8;border-color:#fff1cd}
/* The portal occupies roughly x=281..565 and y=48..339 in the 1280x720 video.
   Keep the picture safely inside the bright loop, centred at (405,190). */
.wizard-picture{position:absolute;z-index:3;left:31.7%;top:26.45%;width:18.4%;aspect-ratio:1;pointer-events:none;overflow:hidden;border-radius:50%;display:grid;place-items:center;background:transparent;box-shadow:0 0 1.1cqw rgba(255,198,245,.34);opacity:0;visibility:hidden;transform:translate(-50%,-50%) scale(.58);transition:opacity 1.25s ease,transform 1.4s cubic-bezier(.12,.8,.2,1),visibility 0s linear 1.4s}
.wizard-picture.revealed{opacity:1;visibility:visible;transform:translate(-50%,-50%) scale(1);transition:opacity 1.25s ease,transform 1.4s cubic-bezier(.12,.8,.2,1),visibility 0s}
.wizard-picture img{display:block;object-fit:contain;width:95%;height:95%;border-radius:50%;filter:drop-shadow(0 .13cqw .18cqw #34284935)}
.game.wizard-scene .instruction-pill{top:11.7%;left:51%;width:43%;min-width:0;z-index:4;background:linear-gradient(90deg,transparent,rgba(58,31,115,.89),transparent);color:#fff7d4;font-size:1.05cqw;white-space:nowrap}
.game.wizard-scene .bottom-panel{background:linear-gradient(118deg,rgba(35,23,80,.95),rgba(21,20,67,.96) 58%,rgba(63,34,103,.88));border-color:#f9c6f5a0}
.game.wizard-scene .spelling-slot{background:linear-gradient(180deg,#bd85fd26,#39205c82);border-color:#f9dcff80}
.game.wizard-scene .spelling-slot.filled{background:linear-gradient(180deg,#fff7d0,#f4d48b)}
.game.wizard-scene .action-btn{background:linear-gradient(180deg,#af80d5,#693ba2);box-shadow:0 4px 0 #2d1e51}
.game.wizard-scene .treasure-counter{color:#ffdf9a}
.bubble.wizard-choice{width:var(--wizard-size,12.4%);aspect-ratio:1;border:0;border-radius:0;background:none;box-shadow:none;filter:drop-shadow(0 .3cqw .85cqw #14082dbf);animation:wizardFloat var(--bob-duration,9s) ease-in-out infinite alternate;animation-delay:var(--bob-delay,0s);opacity:1;overflow:visible;isolation:isolate;will-change:translate,rotate}
.bubble.wizard-choice::before,.bubble.wizard-choice::after{display:none}
.wizard-choice .wizard-sprite{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none;-webkit-user-drag:none}
.wizard-choice .bubble-text{position:absolute;left:var(--orb-x,50%);top:var(--orb-y,25%);z-index:2;display:flex;align-items:center;justify-content:center;transform:translate(-50%,-50%);min-width:3.2cqw;min-height:2.7cqw;padding:0 .3cqw;color:#301a50;text-shadow:0 .08cqw .05cqw #fff,0 0 .45cqw #fff,0 0 .5cqw #fff;font-size:var(--orb-text-size,3cqw);font-weight:1000;line-height:1;letter-spacing:-.075em;background:none;border:0;box-shadow:none;pointer-events:none;white-space:nowrap}
.bubble.wizard-choice:disabled{filter:drop-shadow(0 .25cqw .65cqw #130c2770);opacity:.88}
.bubble.wizard-choice:hover:not(:disabled){filter:brightness(1.13) drop-shadow(0 0 .85cqw #e9c6ff)}
.bubble.wizard-choice.correct{animation:wizardCaught .5s ease-in forwards;pointer-events:none}
.bubble.wizard-choice.incorrect{animation:shakeWrong .4s ease-out!important}
@keyframes wizardFloat{
  from{translate:calc(var(--wizard-drift-x,0.6cqw) * -1) var(--wizard-drift-y,0.5cqw);rotate:-1.5deg}
  to{translate:var(--wizard-drift-x,0.6cqw) calc(var(--wizard-drift-y,0.5cqw)*-1);rotate:1.5deg}
}
@keyframes wizardCaught{0%{scale:1;opacity:1}40%{scale:1.16;filter:brightness(1.75)}100%{scale:.2;opacity:0}}
/* Four equally accessible scene cards; no horizontal scroll on narrow landscape. */
.scene-picker{width:90%;gap:.85cqw}
.scene-choices{gap:1.3cqw}
.scene-choice{width:23.7%;aspect-ratio:1.17/1}
.scene-choice-text{padding:1.45cqw .9cqw .75cqw}
.scene-choice-text strong{font-size:1.42cqw}
.scene-choice-text small{font-size:.77cqw}
.scene-picker h1{font-size:3.65cqw}
.scene-picker p{font-size:1.2cqw}
.scene-picker-foot{font-size:.93cqw}
@media(prefers-reduced-motion:reduce){.wizard-choice{animation-duration:13s!important}.wizard-picture{transition-duration:.2s!important}}

/* V22: 3 × 2 adventure selector, reserving the last two slots for future scenes. */
.scene-picker{width:min(86%,1120px);max-height:95%;gap:.62cqw}
.scene-picker h1{font-size:3.2cqw}
.scene-picker p{font-size:1.08cqw;margin:0 0 .2cqw;max-width:none}
.scene-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.05cqw 1.3cqw;width:100%;align-items:stretch;flex-wrap:initial}
.scene-choice{width:100%;height:auto;aspect-ratio:1.85/1;min-width:0;border-width:.19cqw;border-radius:1.1cqw}
.scene-choice-text{padding:1.75cqw .85cqw .58cqw;gap:.15cqw}
.scene-choice-text strong{font-size:1.42cqw}
.scene-choice-text small{font-size:.78cqw}
.scene-picker-foot{font-size:.86cqw;margin-top:.2cqw}
.scene-choice-coming{position:relative;border-style:dashed;border-color:#9bc0d4b3;background:#1b3153;cursor:default;box-shadow:none;filter:saturate(.75)}
.scene-choice-coming:hover,.scene-choice-coming:focus-visible{transform:none;filter:saturate(.75)}
.scene-coming-art{position:absolute;inset:0;display:grid;place-items:center;background:radial-gradient(ellipse at 35% 30%,#557a9c 0%,#25365b 52%,#151d38 100%);color:#c8ddf4;text-shadow:0 0 1.8cqw #aabcf8b0}
.scene-coming-art span{font-size:6cqw;font-weight:300;opacity:.66}
.scene-coming-art-alt{background:radial-gradient(ellipse at 65% 40%,#725b8a 0%,#2e2b52 52%,#171a36 100%)}
.scene-choice-coming .scene-choice-text{background:linear-gradient(0deg,#0d1730f6,#162544d0 65%,transparent)}
/* A further modest scale increase; retain separate sizes for single- and multi-letter graphemes. */
.bubble.wizard-choice{width:var(--wizard-size,15.8%)}
@media (max-height:490px) and (orientation:landscape){
  .scene-picker{gap:.2cqw;max-height:98%}
  .scene-picker h1{font-size:2.75cqw}
  .scene-picker p{font-size:.85cqw;margin:0}
  .scene-choices{gap:.6cqw 1.1cqw}
  .scene-choice{aspect-ratio:2.15/1}
  .scene-choice-text{padding:1.25cqw .8cqw .35cqw}
  .scene-choice-text strong{font-size:1.25cqw}
  .scene-choice-text small{font-size:.7cqw}
}

/* V23 — Dino Discovery: animated hatching egg and spring-born grapheme bubbles. */
.dino-video{display:none}
.game.dino-scene{background:#338c79}
.game.dino-scene #reef-video,.game.dino-scene .haunted-video,.game.dino-scene .cosmic-video,.game.dino-scene .wizard-video{display:none}
.game.dino-scene .dino-video{display:block}
.game.dino-scene .ambient-specks{display:none}
.game.dino-scene .subtle-vignette{background:linear-gradient(180deg,rgba(13,48,32,.32),transparent 23%,transparent 77%,rgba(11,44,29,.20))}
.game.dino-scene .brand-icon{background:radial-gradient(circle at 35% 30%,#f4ebad,#e49a41 56%,#7e441c);color:#fff9d6;border-color:#fff2ad}
.game.dino-scene .instruction-pill{left:10%;top:13.2%;min-width:47%;background:linear-gradient(90deg,transparent,rgba(16,67,47,.86),transparent);color:#fff7ca;font-size:1.1cqw}
.game.dino-scene .bottom-panel{background:linear-gradient(115deg,rgba(17,61,45,.95),rgba(12,54,43,.93) 58%,rgba(77,68,34,.93));border-color:#d4edb4a8}
.game.dino-scene .spelling-slot{background:linear-gradient(180deg,#a2d8aa37,#1d655d70);border-color:#d4f2bdab}
.game.dino-scene .spelling-slot.filled{background:linear-gradient(180deg,#fff2c6,#f3c884)}
.game.dino-scene .action-btn{background:linear-gradient(180deg,#6bba82,#267452);box-shadow:0 4px 0 #134b37}
.game.dino-scene .treasure-counter{color:#ffe69d}
.dino-egg-container{position:absolute;z-index:4;width:40%;aspect-ratio:1;right:-1.0%;bottom:10%;pointer-events:none}
.dino-egg-image{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 .45cqw .7cqw rgba(26,29,15,.46))}
/* The picture sits entirely inside the hollowed egg, with its PNG transparency intact. */
.dino-picture{position:absolute;left:49.7%;top:47.1%;width:34.8%;height:36.3%;border-radius:44% 44% 40% 40%;display:grid;place-items:center;overflow:hidden;opacity:0;visibility:hidden;transform:translate(-50%,-50%) scale(.38);transition:opacity .6s ease,transform .78s cubic-bezier(.2,.7,.1,1),visibility 0s linear .78s}
.dino-picture.revealed{opacity:1;visibility:visible;transform:translate(-50%,-50%) scale(1);transition:opacity .6s ease,transform .78s cubic-bezier(.2,.7,.1,1),visibility 0s}
.dino-picture img{display:block;width:99%;height:99%;object-fit:contain;filter:drop-shadow(0 .15cqw .3cqw #0009)}
.bubble.dino-choice{width:9.8%;border:.20cqw solid #f7ffe7de;background:radial-gradient(circle at 27% 26%,#fff9f7d9 0%,#e5ffffd1 16%,#b9f9f4aa 35%,#61d4c995 67%,#338c83b8 99%);box-shadow:inset -.5cqw -.7cqw 1.1cqw #0a7a81bd,inset .35cqw .5cqw .7cqw #fff9,0 0 1.3cqw #a3fff6ac;opacity:1}
.bubble.dino-choice:not(.choice-hidden):not(.risen):not(.correct):not(.incorrect){animation:dinoBubbleRise 1.8s cubic-bezier(.16,.64,.22,1) both;transition:none}
.bubble.dino-choice.risen:not(.correct):not(.incorrect){animation:bubbleBob var(--bob-duration,5s) ease-in-out infinite alternate;animation-delay:var(--bob-delay,0s)}
.bubble.dino-choice .bubble-text{font-size:3.05cqw;color:#073f48;text-shadow:0 1px 0 #fff,0 0 5px #fff}
@keyframes dinoBubbleRise{0%{transform:translate(calc(-50% + var(--launch-dx,0cqw)),calc(-50% + var(--launch-dy,0cqw))) scale(.15);opacity:.04}24%{opacity:.85}100%{transform:translate(-50%,-50%) scale(1);opacity:1}}
@media(prefers-reduced-motion:reduce){.bubble.dino-choice:not(.choice-hidden){animation-duration:.8s!important}}

/* --- Grapheme Express scene --- */
.express-video{display:none}
.game.express-scene{background:#5ea7db}
.game.express-scene #reef-video,.game.express-scene .haunted-video,.game.express-scene .cosmic-video,.game.express-scene .wizard-video,.game.express-scene .dino-video{display:none}
.game.express-scene .express-video{display:block}
.game.express-scene .ambient-specks{display:none}
.game.express-scene .subtle-vignette{background:linear-gradient(180deg,rgba(18,45,78,.22),transparent 23%,transparent 79%,rgba(18,36,58,.22))}
.game.express-scene .brand-icon{background:radial-gradient(circle at 35% 30%,#fff4b4,#ffd061 53%,#b16b15);color:#24334d;border-color:#fff3b7}
.game.express-scene .instruction-pill{left:49%;top:12.6%;min-width:36%;background:linear-gradient(90deg,transparent,rgba(24,64,104,.88),transparent);color:#fff4d2;font-size:1.02cqw}
.game.express-scene .bottom-panel{background:linear-gradient(115deg,rgba(23,62,103,.95),rgba(22,71,95,.96) 56%,rgba(53,93,66,.92));border-color:#d3e9ffb3}
.game.express-scene .spelling-slot{background:linear-gradient(180deg,#d7edff2e,#29586c7a);border-color:#d1ecff92}
.game.express-scene .spelling-slot.filled{background:linear-gradient(180deg,#fff5c9,#f4d37d)}
.game.express-scene .action-btn{background:linear-gradient(180deg,#72b2df,#3977af);box-shadow:0 4px 0 #1e4a78}
.game.express-scene .treasure-counter{color:#ffe4a2}
.express-container{position:absolute;inset:0;z-index:4;pointer-events:none}
.express-tree{position:absolute;left:0;top:0;width:34%;height:100%;object-fit:contain;mix-blend-mode:normal;opacity:.98;z-index:2}
.express-fence{position:absolute;left:13.4%;top:28.4%;width:25%;opacity:.88;z-index:1;filter:drop-shadow(0 .08cqw .2cqw rgba(0,0,0,.22))}
.express-sign-wrap{position:absolute;right:7.2%;top:31.3%;width:13.2%;z-index:4}
.express-sign{display:block;width:100%;height:auto;filter:drop-shadow(0 .2cqw .22cqw rgba(0,0,0,.18))}
.express-sign-picture{position:absolute;left:50%;top:33.5%;width:76%;height:44%;display:grid;place-items:center;overflow:hidden;opacity:0;transform:translate(-50%,-50%) scale(.74);transition:opacity .5s ease,transform .6s cubic-bezier(.18,.75,.22,1)}
.express-sign-picture.revealed{opacity:1;transform:translate(-50%,-50%) scale(1)}
.express-sign-picture img{max-width:92%;max-height:92%;object-fit:contain;filter:drop-shadow(0 .05cqw .15cqw rgba(0,0,0,.18))}
.express-front-lowering,.express-front-loop{position:absolute;left:1.4%;top:23.5%;width:18.4%;height:auto;z-index:6;opacity:1;pointer-events:none}
.express-rear-lowering,.express-rear-down{position:absolute;left:47.5%;top:16.2%;width:20.8%;height:auto;z-index:3;pointer-events:none}
.hidden-media{opacity:0!important;visibility:hidden!important}
.express-train{position:absolute;left:11.4%;bottom:31.9%;display:flex;align-items:flex-end;gap:.35cqw;z-index:5;transform:translateX(124%);opacity:0;transition:transform 1.25s cubic-bezier(.17,.74,.26,1),opacity .25s ease}
.express-train.visible{opacity:1}
.express-train.arrived{transform:translateX(0)}
.express-engine{width:14.2cqw;height:auto;filter:drop-shadow(0 .2cqw .32cqw rgba(0,0,0,.28))}
.express-wagons{display:flex;align-items:flex-end;gap:.25cqw;pointer-events:none}
.express-train.ready .express-wagons{pointer-events:auto}
.bubble.train-choice{position:relative;left:auto;top:auto;transform:none;width:10.2cqw;aspect-ratio:auto;border:0;border-radius:0;background:none;box-shadow:none;animation:none;overflow:visible;opacity:1;padding:0;display:block}
.bubble.train-choice::before,.bubble.train-choice::after{display:none}
.train-choice .train-wagon-sprite{display:block;width:100%;height:auto;filter:drop-shadow(0 .18cqw .22cqw rgba(0,0,0,.28))}
.train-choice .bubble-text{position:absolute;left:53%;top:39%;transform:translate(-50%,-50%);width:58%;display:flex;align-items:center;justify-content:center;text-align:center;color:#26384f;font-size:1.9cqw;font-weight:1000;letter-spacing:-.075em;line-height:1;text-shadow:0 .05cqw .04cqw #fff,0 0 .35cqw rgba(255,255,255,.92);white-space:nowrap;pointer-events:none}
.bubble.train-choice.choice-hidden{opacity:0;transform:translateY(.8cqw) scale(.93)}
.bubble.train-choice:not(.choice-hidden){transition:transform .3s ease,filter .2s ease,opacity .28s ease}
.bubble.train-choice:hover:not(:disabled){transform:translateY(-.2cqw) scale(1.02);filter:brightness(1.08)}
.bubble.train-choice:disabled{opacity:.94}
.bubble.train-choice.correct{animation:trainChoicePop .45s ease forwards;pointer-events:none}
.bubble.train-choice.incorrect{animation:shakeWrong .4s ease-out!important}
@keyframes trainChoicePop{0%{transform:scale(1);opacity:1}40%{transform:translateY(-.15cqw) scale(1.06);filter:brightness(1.3)}100%{transform:translateY(-.3cqw) scale(.84);opacity:0}}
@media (max-width: 900px){
  .express-sign-wrap{width:15.3%}
  .express-engine{width:16.6cqw}
  .bubble.train-choice{width:11.7cqw}
  .train-choice .bubble-text{font-size:2.15cqw}
}


/* V28 — Reference-matched, layer-correct continuous moving freight train */
.express-container{overflow:hidden}
.express-tree{width:100%;height:100%;left:0;top:0;object-fit:fill;opacity:1;z-index:8}
.express-fence{object-fit:fill;position:absolute;top:50.4%;height:19.8%;width:auto;opacity:1;z-index:6;filter:drop-shadow(0 .1cqw .12cqw #0004)}
.express-fence-left{left:-.8%;width:23%}
.express-fence-right{left:60.2%;width:40.6%}
.express-sign-wrap{right:1.6%;top:41.6%;width:21.2%;z-index:9}
.express-sign-picture{left:50%;top:31%;width:79%;height:40%}
.express-front-lowering,.express-front-loop{left:9.7%;top:9.8%;width:39.0%;height:auto;z-index:7}
.express-rear-lowering,.express-rear-down{left:23.8%;top:28.0%;width:35%;height:auto;z-index:2}
.express-train{left:0;top:24.5%;bottom:auto;display:flex;align-items:flex-end;gap:.1cqw;opacity:0;transform:translate3d(120vw,0,0);transition:opacity .24s ease;z-index:5;will-change:transform}
.express-train.visible{opacity:1}
.express-train.arrived{transform:none}
.express-engine{width:42cqw;max-width:none;height:auto;flex:none;display:block}
.express-wagons{align-items:flex-end;gap:.08cqw;display:flex;flex:none;pointer-events:none}
.express-train.ready .express-wagons{pointer-events:auto}
.bubble.train-choice{width:39cqw;height:auto;flex:none;display:block;position:relative;left:auto;top:auto;transform:none;opacity:1;border:0;box-shadow:none;background:none;border-radius:0;padding:0;animation:none;pointer-events:auto}
.bubble.train-choice .bubble-text{font-size:2.55cqw;top:36.9%;left:53.3%;width:57%;color:#243348;max-width:57%;text-shadow:0 .04cqw .06cqw #fff,0 0 .32cqw #fffe;}
.bubble.train-choice:disabled{opacity:1}
.bubble.train-choice.correct{animation:none!important;opacity:1;transform:none;filter:none;pointer-events:none}
.bubble.train-choice.correct .bubble-text{color:#236c48}
.bubble.train-choice:not(.choice-hidden){transition:filter .15s ease}
.bubble.train-choice.incorrect{animation:shakeWrong .4s ease-out!important}
@media(max-width:900px){
  .express-engine{width:42cqw}
  .bubble.train-choice{width:39cqw}
  .bubble.train-choice .bubble-text{font-size:2.55cqw}
  .express-sign-wrap{width:21.2%}
}

/* V28 fine alignment against the supplied crossing reference. */
.express-train{top:30.3%}
.express-engine{transform:scaleY(1.12);transform-origin:center bottom}
.express-wagons{transform:translateY(-3.28cqw)}
.train-choice .train-wagon-sprite{transform:scaleY(1.12);transform-origin:center bottom}
.express-rear-lowering,.express-rear-down{clip-path:inset(0 0 17% 0)}
.express-fence-left{left:-.8%;width:18%}


/* V29 — alignment and motion refinements requested after review. */
.express-rear-lowering,.express-rear-down{left:31.8%;top:18.7%;width:20.4%;height:auto;z-index:2}
.express-train{top:30.1%}
.express-wagons{gap:-1.15cqw;transform:translateY(.18cqw)}
.bubble.train-choice{width:39cqw;margin-left:-.08cqw}
.train-choice .train-wagon-sprite{transform:scaleY(1.12);transform-origin:center bottom}
.express-fence-left{top:50.8%;left:-.8%;width:18%}
.express-fence-right{top:54.8%;left:60.0%;width:40.9%}
@media(max-width:900px){
  .express-rear-lowering,.express-rear-down{left:31.8%;top:18.7%;width:20.4%}
  .express-fence-right{top:54.8%}
}


/* V30 – final railway-crossing perspective and connected freight consist. */
/* The far-side crossing must stand in the grass to the right of the road,
   fully behind the rails; the source video has a generous transparent canvas. */
.express-rear-lowering,.express-rear-down{
  left:37.7%;top:29.0%;width:26.0%;height:auto;z-index:2;
  clip-path:none;
}
/* Push the foreground chain-link fence towards the viewer, leaving the road open. */
.express-fence-left{top:54.0%;left:-.8%;width:18%;}
.express-fence-right{top:55.4%;left:60.0%;width:40.9%;}
/* Engine and all wagons share ONE moving flex row. The slight overlap of each
   coupler is intentional: the source PNGs contain transparent edge padding. */
.express-train{gap:0!important;}
.express-wagons{display:flex;align-items:flex-end;gap:0!important;transform:translateY(-2.4cqw);}
.bubble.train-choice{margin-left:-1.15cqw;}
.bubble.train-choice:first-child{margin-left:-1.15cqw;}
/* Slim dark coupler between every pair, behind the wagon artwork. */
.bubble.train-choice::before{
  content:"";display:block;position:absolute;left:-1.0cqw;top:62.5%;
  height:.45cqw;width:1.8cqw;border-radius:.22cqw;
  background:linear-gradient(#79818a,#171f29 55%,#79818a);
  box-shadow:0 .05cqw .2cqw #0008;
  border:.07cqw solid #222a31;z-index:-1;pointer-events:none;
}
.bubble.train-choice::after{display:none;}
@media(max-width:900px){
  .express-rear-lowering,.express-rear-down{left:37.7%;top:29.0%;width:26%}
  .express-fence-left{top:54.0%}
  .express-fence-right{top:55.4%}
}


/* V31 – faster train, clearer wagon labels, larger sign image and stronger crossing lights. */
.express-sign-picture{
  left:50%;
  top:31.2%;
  width:80%;
  height:44%;
  padding:1.2% 1.8%;
  display:flex;
  align-items:center;
  justify-content:center;
}
.express-sign-picture img{
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  object-position:center center;
}
.bubble.train-choice .bubble-text{
  left:53.8%;
  top:39.2%;
  width:60%;
  max-width:60%;
  height:22%;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-size:3.35cqw;
  font-weight:1000;
  letter-spacing:-0.02em;
  line-height:.92;
}
/* Add brighter, fuller flashing red lenses aligned over the signal heads. */
.express-container::before,.express-container::after{
  content:"";
  position:absolute;
  width:2.35cqw;
  height:2.35cqw;
  border-radius:50%;
  pointer-events:none;
  opacity:0;
  z-index:8;
  background:radial-gradient(circle at 34% 34%, rgba(255,255,255,.95) 0 14%, rgba(255,194,194,.95) 15%, rgba(255,76,76,.98) 42%, rgba(203,0,0,.98) 66%, rgba(102,0,0,.28) 72%, rgba(102,0,0,0) 74%);
  box-shadow:inset 0 0 .12cqw rgba(255,255,255,.85), 0 0 .45cqw rgba(255,88,88,.75), 0 0 .95cqw rgba(255,28,28,.68);
}
.express-container::before{left:16.25%;top:32.35%;animation:expressFlashLeft .8s step-end infinite;}
.express-container::after{left:19.18%;top:32.35%;animation:expressFlashRight .8s step-end infinite;}
.express-container.lights-active::before,.express-container.lights-active::after{opacity:1;}
@keyframes expressFlashLeft{0%,49.9%{opacity:1}50%,100%{opacity:.1}}
@keyframes expressFlashRight{0%,49.9%{opacity:.1}50%,100%{opacity:1}}
@media(max-width:900px){
  .bubble.train-choice .bubble-text{font-size:3.35cqw;}
}


/* V32 – remove overlay light orbs, centre wagon graphemes precisely, and use the supplied handwriting font everywhere. */
@font-face{
  font-family:"Edu NSW ACT Hand";
  src:url("assets/fonts/EduNSWACTHandPre-VariableFont_wght.ttf") format("truetype");
  font-weight:100 900;
  font-style:normal;
  font-display:swap;
}
:root,body,button,input,select,textarea,.game,.bubble .bubble-text,.ghost-choice .bubble-text,.asteroid-choice .bubble-text,.wizard-choice .bubble-text,.train-choice .bubble-text,.scene-title,.menu-card,.scene-button,.ui-pill,.prompt-chip,.status-chip,.choice-label{
  font-family:"Edu NSW ACT Hand",'Trebuchet MS','Arial Rounded MT Bold',Arial,sans-serif !important;
}
/* Remove the extra red flashing orbs that were overlaid on top of the front signal. */
.express-container::before,.express-container::after{
  content:none !important;
  display:none !important;
}
/* Precisely centre the grapheme label inside the wagon sign plate. */
.bubble.train-choice .bubble-text{
  position:absolute !important;
  left:56.0% !important;
  top:34.9% !important;
  width:39.0% !important;
  max-width:39.0% !important;
  height:24.5% !important;
  transform:translate(-50%,-50%) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
  box-sizing:border-box !important;
  padding:0 .4cqw !important;
  margin:0 !important;
  font-size:3.1cqw !important;
  font-weight:800 !important;
  letter-spacing:0 !important;
  line-height:.92 !important;
  color:#2d3a47 !important;
  text-shadow:0 .04cqw .05cqw rgba(255,255,255,.96),0 0 .24cqw rgba(255,255,255,.78) !important;
  white-space:nowrap !important;
  overflow:hidden !important;
}
@media(max-width:900px){
  .bubble.train-choice .bubble-text{font-size:3.1cqw !important;}
}


/* V34 – only the locomotive is lowered; the wagon row remains untouched. */
.game.express-scene .express-engine {
  transform: translateY(0.80cqw) scaleY(1.12);
  transform-origin: center bottom;
}


/* V35 – nudge only the post-lowered front flashing loop so the signal/barrier does not jump when the swap occurs. */
.game.express-scene .express-front-loop{
  transform:translate(0.28cqw,-0.24cqw);
  transform-origin:top left;
}


/* V36 – lock the front barrier on the final lowered frame and overlay only the flashing
   signal-head portion of the loop clip. This removes the small forward jump after lowering. */
.game.express-scene .express-front-lowering{
  z-index:7;
}
.game.express-scene .express-front-loop{
  z-index:8;
  /* Correct the flashing top without touching the fixed barrier underneath. */
  transform:translate(0.54cqw,calc(-0.24cqw + 2px)) scaleX(0.977);
  transform-origin:24.3% top;
  clip-path:inset(0 54% 54% 0);
}


/* V37 – nudge the flashing top section slightly further right and lift wagon graphemes upwards. */


/* V40 – low-risk UI polish. No gameplay object coordinates are modified. */
.scene-overlay{background:#0c1932eb;isolation:isolate;overflow:hidden}
.scene-overlay::before{
  content:"";position:absolute;inset:-1.5%;z-index:-2;
  background:url("assets/ui/scene-selection-panorama.webp") center / cover no-repeat;
  filter:brightness(.68) saturate(.91) blur(1.1px);
  pointer-events:none;
}
.scene-overlay::after{
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:radial-gradient(ellipse at 50% 50%,rgba(8,16,35,.72) 4%,rgba(8,18,39,.51) 57%,rgba(8,16,35,.36) 100%),linear-gradient(0deg,rgba(8,17,37,.44),transparent 32%,rgba(7,15,30,.3));
}
.scene-picker{position:relative;z-index:1;width:min(89%,1240px);max-height:96%;gap:.60cqw}
.scene-picker-kicker{padding:.30cqw .85cqw;border:1px solid #ffe6a577;border-radius:20px;background:#142341ad;text-shadow:0 1px 4px #0009}
.scene-picker h1{color:#fff4ce;text-shadow:0 .2cqw .8cqw #010d28,0 0 1.2cqw #0f2035}
.scene-picker p,.scene-picker-foot{text-shadow:0 .08cqw .25cqw #020b19}
.scene-choice{border:.18cqw solid rgba(214,232,255,.82);border-radius:1.05cqw;box-shadow:0 .35cqw 1.2cqw #000b, inset 0 0 0 .08cqw #fffa;isolation:isolate;transform-origin:center;transition:transform .19s ease,filter .19s ease,border-color .19s ease,box-shadow .19s ease}
.scene-choice img{transition:transform .3s ease;object-position:center}
.scene-choice:hover,.scene-choice:focus-visible{transform:translateY(-.28cqw) scale(1.025);filter:brightness(1.12);border-color:#fff3ba;box-shadow:0 .55cqw 1.7cqw #000e,0 0 1.05cqw #f4d98b9c}
.scene-choice:hover img,.scene-choice:focus-visible img{transform:scale(1.07)}
.scene-choice:active{transform:scale(.985)}
.scene-choice::before{content:var(--scene-glyph,"✦");position:absolute;z-index:2;right:.6cqw;top:.56cqw;display:grid;place-items:center;width:2.45cqw;height:2.45cqw;font-size:1.45cqw;border-radius:.7cqw;background:var(--scene-accent,#364e82);border:1px solid #fffc;box-shadow:0 .15cqw .6cqw #000b;text-shadow:0 1px 2px #0006;pointer-events:none}
.scene-choice::after{content:"";position:absolute;z-index:3;inset:0;border-radius:inherit;pointer-events:none;background:linear-gradient(115deg,transparent 25%,#fff4 44%,transparent 60%);transform:translateX(-110%);transition:transform .52s ease}
.scene-choice:hover::after,.scene-choice:focus-visible::after{transform:translateX(110%)}
.scene-choice[data-scene="ocean"]{--scene-accent:#0877a9;--scene-glyph:"◉"}
.scene-choice[data-scene="haunted"]{--scene-accent:#6a4390;--scene-glyph:"✧"}
.scene-choice[data-scene="cosmic"]{--scene-accent:#364da1;--scene-glyph:"✦"}
.scene-choice[data-scene="wizard"]{--scene-accent:#8c4d9b;--scene-glyph:"✶"}
.scene-choice[data-scene="dino"]{--scene-accent:#497d30;--scene-glyph:"◆"}
.scene-choice[data-scene="express"]{--scene-accent:#b45b22;--scene-glyph:"★"}
.scene-choice-text{background:linear-gradient(0deg,#071124f8,#0c2340e8 65%,transparent);padding:1.6cqw .9cqw .50cqw}
.scene-choice-text strong{font-size:1.38cqw;line-height:1.14;text-shadow:0 .1cqw .25cqw #000}
.scene-choice-text small{font-size:.78cqw;line-height:1.25;color:#e7f3ff}
.scene-celebration-layer{position:absolute;inset:0;z-index:15;pointer-events:none;overflow:hidden}
.gp-celebrate-spark{position:absolute;left:var(--burst-x,50%);top:var(--burst-y,50%);font-size:clamp(17px,2.6cqw,43px);line-height:1;font-weight:900;text-shadow:0 0 10px currentColor,0 2px 8px #0006;will-change:transform,opacity;animation:gpWordBurst 1.15s ease-out both}
@keyframes gpWordBurst{0%{transform:translate3d(0,0,0) scale(.35) rotate(0);opacity:0}13%{opacity:1}55%{opacity:1}100%{transform:translate3d(var(--burst-dx),var(--burst-dy),0) scale(.7) rotate(var(--burst-rotate));opacity:0}}
/* The visual tap is on the label only: freight wagons remain coupled and stationary relative to each other. */
.bubble.gp-tapped .bubble-text{animation:gpLabelSelect .34s ease-out}
@keyframes gpLabelSelect{0%{filter:brightness(1);text-shadow:inherit}35%{filter:brightness(1.65) drop-shadow(0 0 .5cqw #fff8)}100%{filter:brightness(1)}}
.spelling-slot.gp-new-slot{animation:gpNewSlot .36s cubic-bezier(.18,.8,.2,1)}
@keyframes gpNewSlot{0%{filter:brightness(1.7);box-shadow:0 0 1cqw #ffe7a7a9;scale:1.12}100%{filter:brightness(1);scale:1}}
.result-finish-banner{font-size:1.16cqw;font-weight:1000;letter-spacing:.15em;color:#fff1b8;text-shadow:0 0 12px #ffe09b;border-radius:20px;padding:.42cqw 1cqw;border:1px solid #ffdf88aa;background:#6f421991}
.result-gem-progress{display:flex;gap:.62cqw;align-items:center;justify-content:center;margin:.40cqw auto .75cqw}
.result-gem{display:grid;place-items:center;width:2.15cqw;height:2.15cqw;border-radius:50%;border:.1cqw solid #bbd8ed99;color:#7095b8;background:#122f4d8a;font-size:1.25cqw}
.result-gem.is-earned{color:#ffe2a1;background:radial-gradient(circle at 30% 25%,#8e6e3a,#44335b);border-color:#f4d38c;box-shadow:0 0 .5cqw #f6cd7980}
.result-overlay.adventure-complete .result-card{box-shadow:0 0 3.6cqw #ffe0a54a,0 1.1cqw 3cqw #0009}
.result-overlay.adventure-complete .result-star{animation:gpEndStar 1.4s ease-in-out infinite alternate;filter:drop-shadow(0 0 .7cqw #ffe6a5)}
@keyframes gpEndStar{from{transform:scale(1) rotate(-9deg)}to{transform:scale(1.16) rotate(9deg)}}
@media (max-height:490px) and (orientation:landscape){
 .scene-picker{width:min(90%,1240px);gap:.12cqw}
 .scene-picker h1{font-size:2.6cqw}
 .scene-picker p{font-size:.90cqw}
 .scene-choices{gap:.55cqw .95cqw}
 .scene-choice{aspect-ratio:2.18/1}
 .scene-choice-text{padding:1.15cqw .8cqw .28cqw}
 .scene-choice::before{width:2cqw;height:2cqw;font-size:1.15cqw}
}
@media(prefers-reduced-motion:reduce){
 .scene-choice,.scene-choice img,.scene-choice::after{transition:none!important}
 .scene-choice::after{display:none}
 .gp-celebrate-spark{animation-duration:.38s}
 .spelling-slot.gp-new-slot,.bubble.gp-tapped .bubble-text{animation:none}
 .result-overlay.adventure-complete .result-star{animation:none}
}

/* v41: official circular Galactic Phonics logo for the return-to-website button. */
.topbar .gp-site-return{
  width:4.2cqw;height:4.2cqw;min-width:34px;min-height:34px;
  padding:0;border:0;border-radius:50%;background:transparent;
  box-shadow:0 .15cqw .55cqw rgba(0,0,0,.48);
  overflow:hidden;flex-shrink:0;backdrop-filter:none;
}
.gp-site-return img{display:block;width:100%;height:100%;object-fit:contain;border-radius:50%;}
.topbar .gp-site-return:hover,.topbar .gp-site-return:active{
  background:transparent;filter:brightness(1.09);
}
.gp-return-from-picker{
  position:absolute;right:0;top:0;z-index:3;
  width:clamp(38px,4.5cqw,74px);height:clamp(38px,4.5cqw,74px);
  padding:0;background:transparent;border:0;border-radius:50%;
  box-shadow:0 .12cqw .65cqw rgba(0,0,0,.55);
  overflow:hidden;cursor:pointer;transition:transform .16s,filter .16s;
}
.gp-return-from-picker:hover{transform:scale(1.07);filter:brightness(1.08)}
.gp-return-from-picker:active{transform:scale(.98)}
.gp-site-return:focus-visible{outline:3px solid #ffe894;outline-offset:3px}
@media(prefers-reduced-motion:reduce){.gp-return-from-picker{transition:none!important}}

/* Phonic Quest v44 — in-set error count and optional missed-word practice.
   Only interface styling: existing scenes, animations, sound and hitboxes unchanged. */
.pq-mistake-counter{
  display:flex;align-items:center;gap:.32cqw;white-space:nowrap;
  font-size:.9cqw;font-weight:900;letter-spacing:.035em;
  background:rgba(7,47,76,.74);border:1px solid #ddf7ff99;
  border-radius:20cqw;padding:.82cqw 1.0cqw;
  box-shadow:inset 0 1px 0 #ffffff21;color:#eaf8ff;
}
.pq-mistake-counter span:first-child{font-size:1.42cqw;color:#ffe6b5}
.pq-mistake-counter b{font-size:1.26cqw;color:#ffe5ab;font-variant-numeric:tabular-nums}
.pq-mistake-counter:focus-visible{outline:2px solid #fff}
.result-overlay.pq-show-summary{justify-content:center;padding:0 1cqw;background:rgba(1,23,46,.78)}
.result-overlay.pq-show-summary .result-card{
  margin:0;width:56%;max-height:91%;overflow-y:auto;overscroll-behavior:contain;
  padding:1.35cqw 2.2cqw;scrollbar-width:thin;
}
.result-overlay.pq-show-summary .result-star{font-size:2.5cqw;margin:0}
.result-overlay.pq-show-summary .result-card h2{font-size:2.7cqw;margin:.4cqw 0 .5cqw}
.result-overlay.pq-show-summary .result-card p{font-size:1.18cqw;margin:.15cqw 0 .5cqw}
.result-overlay.pq-show-summary .result-gem-progress{margin:.25cqw auto .5cqw}
.result-overlay.pq-show-summary .result-gem{width:1.45cqw;height:1.45cqw;font-size:.8cqw}
.pq-set-summary{width:100%;margin:.45cqw auto .7cqw;color:#fff}
.pq-set-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:.6cqw}
.pq-set-metrics>div{display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:.22cqw;padding:.55cqw .3cqw;border-radius:.7cqw;background:#052744b0;border:1px solid #a3dffc63}
.pq-set-metrics strong{font-size:2.2cqw;line-height:1;color:#ffe5a4;font-variant-numeric:tabular-nums}
.pq-set-metrics small{font-size:.88cqw;line-height:1.2;font-weight:850;color:#e3f3ff}
.pq-trouble-section{margin:.65cqw auto 0;text-align:left}
.pq-trouble-heading{font-size:.93cqw;font-weight:1000;letter-spacing:.12em;color:#ffe3a1;text-align:center;margin-bottom:.4cqw}
.pq-trouble-list{margin:0;padding:0;list-style:none;max-height:9.3cqw;overflow-y:auto;scrollbar-width:thin;
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.35cqw .5cqw}
.pq-trouble-list li{min-width:0;display:flex;justify-content:space-between;align-items:center;gap:.35cqw;
  padding:.35cqw .7cqw;background:#021c35a8;border:1px solid #d0ebff45;border-radius:.45cqw}
.pq-trouble-list strong{font-size:1.05cqw;color:#fff;overflow:hidden;text-overflow:ellipsis}
.pq-trouble-list span{font-size:.87cqw;color:#ffe1b0;white-space:nowrap}
.pq-perfect{font-size:1.1cqw;color:#fff4bb;font-weight:900;margin:.65cqw auto}
.pq-practice-button{display:block;margin:.6cqw auto .55cqw;padding:.65cqw 1.5cqw;border-radius:100px;
  background:linear-gradient(180deg,#bfeff6,#70d2e7);color:#123b58;border:2px solid #fff;
  font-size:1.1cqw;font-weight:1000;box-shadow:0 .2cqw .8cqw #0008;cursor:pointer}
.pq-practice-button:hover{filter:brightness(1.09)}
.pq-practice-button:focus-visible{outline:3px solid #fff3ac;outline-offset:2px}
.result-overlay.pq-show-summary .big-button{font-size:1.15cqw;padding:.65cqw 1.5cqw}
.result-overlay.pq-show-summary .result-change-scene{font-size:.88cqw;margin-top:.3cqw}
@media (max-aspect-ratio: 4/3){
  .pq-mistake-counter{padding:.55cqw .7cqw}
  .result-overlay.pq-show-summary .result-card{width:72%}
}
@media (prefers-reduced-motion:reduce){.pq-practice-button{transition:none!important}}

/* Phonic Quest v45: discreet release number on the scene-selection menu only.
   Does not affect any scene, animation, game controls, or button hitbox. */
.scene-overlay > .pq-version-label {
  position: absolute;
  right: clamp(10px, 1.15cqw, 22px);
  bottom: clamp(7px, .7cqw, 14px);
  z-index: 3;
  color: rgba(231, 245, 255, .77);
  background: rgba(6, 22, 45, .48);
  border: 1px solid rgba(227, 240, 255, .15);
  border-radius: 999px;
  padding: .2em .65em;
  font: 750 clamp(10px, .87cqw, 15px)/1.3 system-ui, sans-serif;
  letter-spacing: .055em;
  pointer-events: none;
  user-select: none;
}

/* Phonic Quest v46 — stack the website return logo precisely under Full Screen.
   Trackers and wide audio bar remain in a separate, aligned first row.  No
   game-hitbox, scene layout or gameplay scripts are modified. */
.topbar { align-items: flex-start; }
.topbar-right {
  align-items: flex-start;
  gap: .75cqw;
  margin-left: auto;
  flex-shrink: 0;
}
.topbar-right > .word-tracker,
.topbar-right > .pq-mistake-counter,
.topbar-right > .scene-switch,
.topbar-right > .volume-controls {
  margin-top: .33cqw;
}
.pq-control-stack {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: .66cqw;
  width: 4.3cqw;
  min-width: 34px;
}
.pq-control-stack > #fullscreen-toggle {
  flex: 0 0 auto;
  margin: 0;
}
.topbar .pq-control-stack > .gp-site-return {
  flex: 0 0 auto;
  width: 4.15cqw;
  height: 4.15cqw;
}
/* Keep the large information bars to the left of the vertical control stack. */
@media (max-aspect-ratio: 4/3) {
  .topbar-right { gap: .55cqw; }
  .topbar-right > .word-tracker,
  .topbar-right > .pq-mistake-counter,
  .topbar-right > .scene-switch,
  .topbar-right > .volume-controls { margin-top: .24cqw; }
}

/* v47 — three vertically aligned round controls with tap-to-open audio panel.
   The former always-visible audio slider no longer occupies the top information row. */
.topbar-right{
  flex:1 1 auto;
  min-width:0;
  justify-content:space-between;
  gap:1.2cqw;
  margin-left:2.4cqw;
}
.topbar-right > .word-tracker,
.topbar-right > .pq-mistake-counter,
.topbar-right > .scene-switch{margin-top:.33cqw;flex-shrink:0}
.pq-control-stack{position:relative;gap:.60cqw;isolation:isolate}
.pq-volume-trigger{flex:0 0 auto;width:3.6cqw;height:3.6cqw;}
.pq-volume-trigger svg{width:61%;height:61%;overflow:visible;filter:drop-shadow(0 1px 1px #001c3699)}
.pq-volume-trigger .pq-speaker-muted{display:none}
.pq-volume-trigger.is-muted .pq-speaker-wave{display:none}
.pq-volume-trigger.is-muted .pq-speaker-muted{display:block}
.pq-volume-trigger[aria-expanded="true"]{background:#16799d;border-color:#fff3ac;box-shadow:0 0 .85cqw #ffe8a255}
.pq-volume-popover[hidden]{display:none!important}
.pq-volume-popover{
  position:absolute;
  z-index:20;
  right:calc(100% + .8cqw);
  top:calc(3.6cqw + .05cqw);
  width:18.3cqw;
  min-width:165px;
  max-width:250px;
  padding:.83cqw 1cqw 1cqw;
  color:#fff;
  border:1px solid #c8edffbb;
  border-radius:1.2cqw;
  background:linear-gradient(155deg,rgba(6,59,92,.97),rgba(3,33,60,.97));
  box-shadow:0 .5cqw 1.65cqw #001c3aad,inset 0 1px 0 #ffffff33;
  backdrop-filter:blur(14px);
  animation:pqVolumeOpen .17s ease-out both;
}
.pq-volume-popover::after{
  content:"";position:absolute;right:-.44cqw;top:1.25cqw;width:.8cqw;height:.8cqw;
  background:#063653;transform:rotate(45deg);border-right:1px solid #c8edffbb;
  border-top:1px solid #c8edffbb;
}
@keyframes pqVolumeOpen{from{opacity:0;transform:translateX(.35cqw) scale(.97)}to{opacity:1;transform:translateX(0) scale(1)}}
.pq-volume-heading{font-size:clamp(10px,.8cqw,14px);letter-spacing:.16em;color:#c1e9f8;font-weight:1000;margin-bottom:.52cqw}
.pq-volume-popover .volume-controls{width:100%;background:transparent;border:0;border-radius:0;box-shadow:none;padding:0;gap:.8cqw;backdrop-filter:none}
.pq-volume-popover .volume-mute{width:3.1cqw;height:3.1cqw;min-width:29px;min-height:29px;font-size:1.35cqw}
.pq-volume-popover .volume-slider{flex:1 1 auto;width:100%;min-width:0;height:2.7cqw;touch-action:pan-x}
@media(max-aspect-ratio:4/3){.topbar-right{gap:.75cqw;margin-left:1.15cqw}}
@media(prefers-reduced-motion:reduce){.pq-volume-popover{animation:none}}


/* v48 — group the top information and Scenes action at the right edge.
   Retain the three-button vertical stack and compact volume popover. */
.topbar-right {
  flex: 0 1 auto;
  width: auto;
  justify-content: flex-end;
  align-items: flex-start;
  gap: clamp(8px, .9cqw, 16px);
  margin-left: auto;
  min-width: 0;
}
.topbar-right > .word-tracker,
.topbar-right > .pq-mistake-counter,
.topbar-right > .scene-switch {
  flex-shrink: 0;
  margin-top: .33cqw;
}
.pq-control-stack { margin-left: .15cqw; }
@media (max-aspect-ratio: 4/3) {
  .topbar-right { gap: clamp(5px, .6cqw, 10px); margin-left: auto; }
  .pq-control-stack { margin-left: 0; }
}


/* Phonic Quest v49 — uniform height for top information pills and Scenes button.
   Preserve right alignment, consistent gaps, and the three round controls.
   No scene sizing or input targets elsewhere are affected. */
.topbar-right > .word-tracker,
.topbar-right > .pq-mistake-counter,
.topbar-right > .scene-switch {
  box-sizing: border-box;
  height: 3.5cqw;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
}

/* v50: the swaying tree has a clean alpha matte. Safari/iOS receives an animated WebP fallback. */
.express-tree.using-webp{display:none!important}
.express-tree-fallback{display:none!important}
.express-tree-fallback.use-webp{display:block!important}


/* v51 – reassuring, accurate per-scene asset loading screen. All dimensions
   use stage-responsive cqw sizing to remain legible on large and small devices. */
.pq-loading-overlay{z-index:40;display:flex;align-items:center;justify-content:center;padding:2cqw;
  background:radial-gradient(circle at 48% 32%,rgba(43,70,119,.96),rgba(9,22,49,.98) 74%);backdrop-filter:blur(12px)}
.pq-loading-card{box-sizing:border-box;width:min(62%,740px);padding:3cqw 4.2cqw 2.7cqw;text-align:center;
  border:2px solid rgba(236,220,160,.88);border-radius:2.3cqw;color:white;
  background:linear-gradient(152deg,#20456deF,#102e56f8 68%,#16254bed);box-shadow:0 .9cqw 4cqw #000a,inset 0 1px #fff8}
.pq-loader-kicker{display:block;font-size:1.05cqw;font-weight:1000;letter-spacing:.22em;color:#afddfc}
.pq-loading-spark{display:block;margin:.4cqw auto -.2cqw;font-size:3.5cqw;color:#ffdc83;text-shadow:0 0 1.5cqw #ffca70}
.pq-loading-card h2{font-size:3.3cqw;line-height:1.1;margin:.35cqw 0 .75cqw;color:#fff0bf;text-shadow:0 .18cqw .6cqw #0007}
.pq-loading-card #pq-loading-phase{font-size:1.14cqw;letter-spacing:.07em;font-weight:900;color:#e7f7ff;margin:.5cqw auto 1.65cqw}
.pq-loading-track{box-sizing:border-box;width:100%;height:1.7cqw;min-height:12px;overflow:hidden;border:2px solid #e7fcff;
  background:#061b34;border-radius:999px;box-shadow:inset 0 .2cqw .5cqw #000b,0 0 .65cqw #7de7ff55}
.pq-loading-fill{height:100%;width:0;max-width:100%;border-radius:inherit;
  background:linear-gradient(90deg,#80d8e7 0%,#9de2bc 48%,#ffe492 100%);box-shadow:0 0 .8cqw #ffda8599;transition:width .17s linear}
.pq-loading-percentage{display:block;font-size:2.6cqw;line-height:1.25;margin:.45cqw auto .3cqw;color:#ffe6a9;font-variant-numeric:tabular-nums}
.pq-loading-status{color:#d1eafa;font-size:1.04cqw;line-height:1.35;min-height:1.6em;margin:.3cqw auto 1cqw;overflow-wrap:anywhere}
.pq-loading-actions{display:flex;align-items:center;justify-content:center;gap:.9cqw;margin-top:.6cqw}
.pq-loading-button{border:1px solid #cde7f6;border-radius:999px;padding:.7cqw 1.5cqw;cursor:pointer;background:#19436a;color:#fff;font-weight:900;font-size:.98cqw;letter-spacing:.04em}
.pq-loading-button.pq-retry{background:linear-gradient(#ffefb3,#ffca66);color:#14344f;border-color:#fff1c7}
.pq-loading-button:hover{filter:brightness(1.16)}
.pq-loading-button:focus-visible{outline:.25cqw solid #ffe3a0;outline-offset:.25cqw}
.pq-loading-button[hidden]{display:none}
@media (max-aspect-ratio:4/3){.pq-loading-card{width:78%}}
@media (prefers-reduced-motion:reduce){.pq-loading-fill{transition:none}}


/* ================== PHONIC QUEST v52 — RESPONSIVE STAGE ==================
   Immutable 16:9 scene: all cqw layouts, animation positions and media stay
   inside #game. The HUD is moved to the available screen space by game.js.
   No image/video is stretched, zoomed or cropped by these changes. */
:root { --pq-safe-top:env(safe-area-inset-top,0px); --pq-safe-bottom:env(safe-area-inset-bottom,0px); }
html,body { overscroll-behavior:none; }
.game-shell {
  position:fixed; inset:0;
  box-sizing:border-box;
  height:100vh; height:100dvh; width:100vw;
  display:flex; justify-content:center; align-items:center;
  overflow:hidden;
  padding:var(--pq-safe-top) env(safe-area-inset-right,0px) var(--pq-safe-bottom) env(safe-area-inset-left,0px);
  gap:0;
  background:radial-gradient(circle at 50% 48%,#10567a,#082c4b 59%,#031829);
  container-type:inline-size;
}
.game-shell[data-scene="haunted"]{background:radial-gradient(circle at 50% 48%,#453067,#1b1940 65%,#080f25)}
.game-shell[data-scene="cosmic"]{background:radial-gradient(circle at 50% 45%,#24386c,#081836 65%,#060c20)}
.game-shell[data-scene="wizard"]{background:radial-gradient(circle at 50% 45%,#65468b,#2a225b 65%,#140c31)}
.game-shell[data-scene="dino"]{background:radial-gradient(circle at 50% 40%,#597a4b,#1d4c45 68%,#0a292c)}
.game-shell[data-scene="express"]{background:radial-gradient(circle at 50% 50%,#538ba8,#21566d 68%,#153c56)}
.game-shell .game {flex:none;min-width:0;max-width:100%;aspect-ratio:16/9;border-radius:0;box-shadow:0 0 35px #0006;}
.game-shell[data-layout="overlay"] .game {width:min(100%,177.77778dvh);}
/* iPad and other square-ish landscape tablets: roomy HUD above and below. */
.game-shell[data-layout="separate"] {flex-direction:column;}
.game-shell[data-layout="separate"] .game {
  width:min(100%,calc(177.777778dvh - 284.45px));
  max-height:calc(100dvh - 160px - var(--pq-safe-top) - var(--pq-safe-bottom));
  box-shadow:0 8px 24px #00162f66;
}
/* 16:10 and 3:2: keep the complete scene wide, reserve a compact bottom HUD. */
.game-shell[data-layout="hybrid"] {flex-direction:column;}
.game-shell[data-layout="hybrid"] .game {
  width:min(100%,calc(177.777778dvh - 142.23px));
  max-height:calc(100dvh - 80px - var(--pq-safe-top) - var(--pq-safe-bottom));
}
/* Wider than 16:9: world fills screen height; spelling controls use the right rail. */
.game-shell[data-layout="side"] {flex-direction:row;--pq-rail:clamp(140px,calc(100vw - 177.777778dvh),360px);}
.game-shell[data-layout="side"] .game {
  width:min(calc(100% - var(--pq-rail)),177.777778dvh);
  max-height:calc(100dvh - var(--pq-safe-top) - var(--pq-safe-bottom));
}
/* HUD extracted from the 16:9 animation. Its own fonts and touch areas are
   deliberately sized in CSS px instead of inheriting the scene's cqw scale. */
.game-shell[data-layout="separate"] > .topbar,
.game-shell[data-layout="separate"] > .bottom-panel,
.game-shell[data-layout="hybrid"] > .bottom-panel,
.game-shell[data-layout="side"] > .bottom-panel {
  position:relative;left:auto;right:auto;top:auto;bottom:auto;
  flex-shrink:0;z-index:10;box-sizing:border-box;
  backdrop-filter:blur(13px);-webkit-backdrop-filter:blur(13px);
  border:1px solid #d7f6ff6a;
}
.game-shell[data-layout="separate"] > .topbar {
  width:min(100%,calc(177.777778dvh - 284.45px));
  min-height:56px;height:56px;
  display:flex;align-items:center;justify-content:space-between;
  padding:4px 12px;gap:8px;
  background:linear-gradient(110deg,#092e4fec,#064164dc);
  border-radius:13px 13px 0 0;
  box-shadow:0 -5px 18px #07162e44;
}
.game-shell[data-layout="separate"] > .topbar .brand {gap:8px;flex-shrink:0;}
.game-shell[data-layout="separate"] > .topbar .brand-icon {width:35px;height:35px;font-size:20px;border-width:2px;}
.game-shell[data-layout="separate"] > .topbar .brand strong {font-size:clamp(14px,1.55vw,21px);}
.game-shell[data-layout="separate"] > .topbar .brand span:not(.brand-icon){font-size:clamp(7px,.72vw,10px);letter-spacing:.10em;margin-top:3px;}
.game-shell[data-layout="separate"] > .topbar .topbar-right {display:flex;align-items:center;gap:clamp(5px,.75vw,12px);min-width:0;}
.game-shell[data-layout="separate"] > .topbar .word-tracker,
.game-shell[data-layout="separate"] > .topbar .pq-mistake-counter {font-size:clamp(10px,.85vw,14px);padding:7px 10px;gap:4px;}
.game-shell[data-layout="separate"] > .topbar .word-tracker b {font-size:clamp(12px,1.0vw,16px);}
.game-shell[data-layout="separate"] > .topbar .pq-mistake-counter span:first-child{font-size:16px;}
.game-shell[data-layout="separate"] > .topbar .scene-switch{width:auto;height:42px;min-width:67px;font-size:12px;padding:0 8px;border-radius:14px;margin:0;}
.game-shell[data-layout="separate"] > .topbar .pq-control-stack{position:relative;display:flex;flex-direction:row;gap:6px;align-items:center;}
.game-shell[data-layout="separate"] > .topbar .header-button:not(.scene-switch){width:42px;height:42px;min-width:42px;min-height:42px;font-size:23px;}
.game-shell[data-layout="separate"] > .topbar .pq-volume-popover {top:calc(100% + 6px);right:0;}
.game-shell[data-layout="separate"] > .bottom-panel,
.game-shell[data-layout="hybrid"] > .bottom-panel {
  display:flex;flex-direction:row;align-items:center;justify-content:space-between;
  gap:clamp(8px,1.4vw,20px);margin:0;
  border-radius:0 0 14px 14px;
  box-shadow:0 10px 24px #06182e55;
  background:linear-gradient(120deg,#07395bf5,#0a5265f2);
  padding:9px clamp(12px,1.6vw,24px);
}
.game-shell[data-layout="separate"] > .bottom-panel{height:104px;width:min(100%,calc(177.777778dvh - 284.45px));}
.game-shell[data-layout="hybrid"] > .bottom-panel{height:80px;width:min(100%,calc(177.777778dvh - 142.23px));}
.game-shell[data-layout="separate"] > .bottom-panel .panel-intro,
.game-shell[data-layout="hybrid"] > .bottom-panel .panel-intro{flex:0 1 27%;}
.game-shell[data-layout="separate"] > .bottom-panel .panel-intro strong,
.game-shell[data-layout="hybrid"] > .bottom-panel .panel-intro strong {font-size:clamp(13px,1.3vw,19px);line-height:1.15;}
.game-shell[data-layout="separate"] > .bottom-panel .panel-intro small,
.game-shell[data-layout="hybrid"] > .bottom-panel .panel-intro small{font-size:clamp(10px,.95vw,14px);margin-top:4px;}
.game-shell[data-layout="separate"] > .bottom-panel .panel-overline,
.game-shell[data-layout="hybrid"] > .bottom-panel .panel-overline{font-size:clamp(10px,.8vw,12px);letter-spacing:.12em;margin-bottom:4px;}
.game-shell[data-layout="separate"] > .bottom-panel .spelling-area,
.game-shell[data-layout="hybrid"] > .bottom-panel .spelling-area{flex:1 1 auto;min-width:0;gap:3px;}
.game-shell[data-layout="separate"] > .bottom-panel .spelling-slots,
.game-shell[data-layout="hybrid"] > .bottom-panel .spelling-slots{height:auto;min-height:48px;gap:clamp(5px,.6vw,10px);}
.game-shell[data-layout="separate"] > .bottom-panel .spelling-slot,
.game-shell[data-layout="hybrid"] > .bottom-panel .spelling-slot {width:clamp(33px,4.0vw,53px);height:clamp(40px,4.2vw,54px);font-size:clamp(19px,2vw,28px);border-radius:9px;border-width:2px;}
.game-shell[data-layout="separate"] > .bottom-panel .panel-actions,
.game-shell[data-layout="hybrid"] > .bottom-panel .panel-actions{flex:0 0 auto;gap:10px;}
.game-shell[data-layout="separate"] > .bottom-panel .action-btn,
.game-shell[data-layout="hybrid"] > .bottom-panel .action-btn {min-height:46px;font-size:clamp(11px,.92vw,14px);padding:7px 12px;border-radius:10px;}
.game-shell[data-layout="separate"] > .bottom-panel .action-btn span:first-child,
.game-shell[data-layout="hybrid"] > .bottom-panel .action-btn span:first-child{font-size:20px;}
.game-shell[data-layout="separate"] > .bottom-panel .treasure-counter,
.game-shell[data-layout="hybrid"] > .bottom-panel .treasure-counter{font-size:14px;gap:4px;}
.game-shell[data-layout="separate"] > .bottom-panel .treasure-counter>span:first-child,
.game-shell[data-layout="hybrid"] > .bottom-panel .treasure-counter>span:first-child{font-size:25px;}
.game-shell[data-layout="separate"] > .bottom-panel .treasure-counter b,
.game-shell[data-layout="hybrid"] > .bottom-panel .treasure-counter b{font-size:18px;}
.game-shell[data-layout="separate"] > .bottom-panel .treasure-outof,
.game-shell[data-layout="hybrid"] > .bottom-panel .treasure-outof{font-size:12px;}
.game-shell[data-layout="side"] > .bottom-panel{
  width:var(--pq-rail);height:min(100%,590px);max-height:100%;min-width:0;
  display:flex;flex-direction:column;align-items:center;justify-content:space-evenly;
  padding:clamp(8px,2dvh,16px);gap:clamp(7px,1.7dvh,18px);
  border-radius:0 14px 14px 0;
  background:linear-gradient(155deg,#073d61ef,#0a5267f0);
  overflow:hidden;
}
.game-shell[data-layout="side"] > .bottom-panel .panel-intro{
  flex:none;width:100%;min-width:0;align-items:center;text-align:center;
  border:0;border-bottom:1px solid #9ccce35c;padding-bottom:6px;
}
.game-shell[data-layout="side"] > .bottom-panel .panel-overline {font-size:9px;letter-spacing:.1em;margin:0 0 4px;}
.game-shell[data-layout="side"] > .bottom-panel .panel-intro strong{font-size:clamp(12px,1.45dvh,17px);line-height:1.2;}
.game-shell[data-layout="side"] > .bottom-panel .panel-intro small{font-size:10px;line-height:1.2;margin-top:5px;}
.game-shell[data-layout="side"] > .bottom-panel .spelling-area{flex:1 1 auto;width:100%;min-height:0;gap:5px;justify-content:center;}
.game-shell[data-layout="side"] > .bottom-panel .spelling-slots{
  display:flex;align-content:center;align-items:center;justify-content:center;flex-wrap:wrap;
  height:auto;max-height:130px;gap:5px;
}
.game-shell[data-layout="side"] > .bottom-panel .spelling-slot{
  width:clamp(30px,3.7dvh,44px);height:clamp(35px,4.0dvh,48px);
  font-size:clamp(18px,2.4dvh,26px);border-width:2px;border-radius:8px;
}
.game-shell[data-layout="side"] > .bottom-panel .panel-actions{
  flex:none;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;
}
.game-shell[data-layout="side"] > .bottom-panel .action-btn{
  width:100%;min-height:44px;padding:8px 5px;font-size:clamp(10px,1.55dvh,13px);border-radius:9px;gap:6px;
}
.game-shell[data-layout="side"] > .bottom-panel .action-btn span:first-child{font-size:18px;}
.game-shell[data-layout="side"] > .bottom-panel .treasure-counter{font-size:12px;gap:5px;}
.game-shell[data-layout="side"] > .bottom-panel .treasure-counter>span:first-child{font-size:21px;}
.game-shell[data-layout="side"] > .bottom-panel .treasure-counter b{font-size:16px;}
.game-shell[data-layout="side"] > .bottom-panel .treasure-outof{font-size:11px;}
/* Keep HUD colours recognisably linked to the selected adventure. */
.game-shell[data-scene="haunted"] > .bottom-panel{background:linear-gradient(135deg,#231c48f5,#4c2861f1);border-color:#e1baf4b0;}
.game-shell[data-scene="cosmic"] > .bottom-panel{background:linear-gradient(135deg,#101c4cf5,#1c326bf1);border-color:#b9ceffb0;}
.game-shell[data-scene="wizard"] > .bottom-panel{background:linear-gradient(135deg,#292259f5,#603a85f1);border-color:#f3c9f4b0;}
.game-shell[data-scene="dino"] > .bottom-panel{background:linear-gradient(135deg,#194d3cf5,#47643bf1);border-color:#d4ebadbb;}
.game-shell[data-scene="express"] > .bottom-panel{background:linear-gradient(135deg,#164764f5,#2c6561f1);border-color:#c1e4f6bb;}
/* A loading, introduction or result dialogue must not leave external touch
   controls active. Keep the dialogs over the world at original 16:9 scale. */
.game-shell:has(.screen-overlay:not(.hidden)) > .topbar,
.game-shell:has(.screen-overlay:not(.hidden)) > .bottom-panel {visibility:hidden;pointer-events:none;}
/* Tablet and touchscreen target sizes: do not shrink touch hit areas below
   comfortable physical button sizes on compact device screens. */
@media(pointer:coarse){
  .game-shell .header-button:not(.scene-switch){min-width:40px;min-height:40px;}
  .game-shell .scene-switch{min-height:40px;}
  .game-shell .listen-btn {min-height:44px;}
}
@media (max-height:410px) and (orientation:landscape){
  .game-shell[data-layout="side"] > .bottom-panel {padding:7px;gap:4px;}
  .game-shell[data-layout="side"] > .bottom-panel .panel-intro small{display:none;}
  .game-shell[data-layout="side"] > .bottom-panel .panel-intro{padding-bottom:4px;}
  .game-shell[data-layout="side"] > .bottom-panel .spelling-slots{max-height:95px;}
  .game-shell[data-layout="side"] > .bottom-panel .panel-actions{gap:3px;}
}
/* Web-app on notched screens keeps controls inside the OS safe bounds. */
@media(display-mode:standalone){.game-shell{box-shadow:inset 0 0 0 1px #ffffff13;}}
/* Safe orientation treatment also covers header/footer moved outside #game. */
body.orientation-blocked .game-shell{pointer-events:none;}
body.orientation-blocked .game-shell *,body.orientation-blocked .game-shell *::before,body.orientation-blocked .game-shell *::after{animation-play-state:paused!important;transition:none!important;}
/* The scene landscape is never transformed; maintain native aspect 16:9. */
.game-shell .game .reef-video{object-fit:cover;}
/* ========================== END v52 ========================== */
/* v52 tablet toolbar correction: three circular buttons need their natural row width,
   otherwise the original 4.3cqw stack width clips the volume and home buttons. */
.game-shell[data-layout="separate"] > .topbar .pq-control-stack {
  width:auto;min-width:0;flex:0 0 auto;max-width:none;
}
.game-shell[data-layout="separate"] > .topbar .pq-control-stack > .gp-site-return {
  width:42px;height:42px;min-width:42px;min-height:42px;
}

/* v53 Safari/iOS: transparent animated WebP replaces chroma-green WebM signals.
   The identical positioning, final lowered still and flashing-head clip are retained.
   The original video DOM remains for other browsers without layout changes. */
.pq-signal-fallback{display:none;}
html.pq-safari-signals .game.express-scene .pq-signal-fallback{display:block;}
html.pq-safari-signals .game.express-scene video.express-front-lowering,
html.pq-safari-signals .game.express-scene video.express-front-loop,
html.pq-safari-signals .game.express-scene video.express-rear-lowering{display:none!important;}


/* ============ v54: TRUE VIEWPORT-WIDE ADVENTURE PICKER ============
   Unlike the 16:9 gameplay stage, this menu covers the whole device viewport.
   Background uses COVER (no stretching/squashing), and all six buttons grow
   into the available space, while retaining a 3 x 2 landscape grid.
   The menu is a sibling of .game-shell, not a descendant of #game: that
   prevents container positioning / stage letterboxing on 4:3 or wide devices.
*/
body > #scene-screen.scene-overlay {
  position:fixed;
  inset:0;
  z-index:150;
  box-sizing:border-box;
  width:100vw;
  height:100vh;
  height:100dvh;
  max-width:none;
  max-height:none;
  display:flex;
  align-items:stretch;
  justify-content:stretch;
  padding:clamp(10px,2.25dvh,28px) clamp(11px,2.3vw,40px);
  padding-top:max(clamp(10px,2.25dvh,28px),env(safe-area-inset-top,0px));
  padding-right:max(clamp(11px,2.3vw,40px),env(safe-area-inset-right,0px));
  padding-bottom:max(clamp(10px,2.25dvh,28px),env(safe-area-inset-bottom,0px));
  padding-left:max(clamp(11px,2.3vw,40px),env(safe-area-inset-left,0px));
  overflow:hidden;
  background:#0b1d36;
  container-type:inline-size;
}
body > #scene-screen.scene-overlay::before {
  inset:0;
  background-image:url("assets/ui/scene-selection-panorama.webp");
  background-repeat:no-repeat;
  background-size:cover;
  background-position:center center;
}
body > #scene-screen .scene-picker {
  position:relative;
  box-sizing:border-box;
  flex:1 1 auto;
  min-width:0;
  min-height:0;
  max-width:none;
  max-height:none;
  width:100%;
  height:100%;
  gap:clamp(5px,0.95dvh,14px);
  justify-content:center;
  overflow:visible;
}
body > #scene-screen .scene-picker-kicker {
  flex:0 0 auto;
  font-size:clamp(9px,1.22dvh,15px);
  padding:clamp(3px,0.45dvh,7px) clamp(10px,1.3vw,20px);
  letter-spacing:.13em;
}
body > #scene-screen .scene-picker h1 {
  flex:0 0 auto;
  font-size:clamp(30px,5.6dvh,67px);
  line-height:1.03;
  margin:0;
}
body > #scene-screen .scene-picker p {
  flex:0 0 auto;
  max-width:100%;
  margin:0;
  padding:0;
  font-size:clamp(12px,1.68dvh,20px);
  line-height:1.16;
}
body > #scene-screen .scene-choices {
  flex:1 1 auto;
  min-width:0;
  min-height:0;
  max-width:none;
  width:100%;
  height:auto;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  grid-template-rows:repeat(2,minmax(0,1fr));
  gap:clamp(6px,1.3dvh,16px) clamp(8px,1.3vw,22px);
  align-items:stretch;
  justify-content:stretch;
}
body > #scene-screen .scene-choice {
  position:relative;
  display:block;
  box-sizing:border-box;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  aspect-ratio:auto;
  border-width:clamp(2px,0.2vw,4px);
  border-radius:clamp(8px,1vw,18px);
}
body > #scene-screen .scene-choice img {
  width:100%;height:100%;object-fit:cover;
}
body > #scene-screen .scene-choice-text {
  box-sizing:border-box;
  gap:clamp(1px,0.16dvh,3px);
  padding:clamp(18px,3.8dvh,42px) clamp(5px,0.95vw,17px) clamp(5px,1dvh,13px);
}
body > #scene-screen .scene-choice-text strong {
  font-size:clamp(12px,1.35vw,24px);
  line-height:1.1;
}
body > #scene-screen .scene-choice-text small {
  font-size:clamp(9px,0.86vw,15px);
  line-height:1.14;
}
body > #scene-screen .scene-choice::before {
  width:clamp(22px,2.65vw,43px);
  height:clamp(22px,2.65vw,43px);
  top:clamp(5px,.6vw,12px);
  right:clamp(5px,.6vw,12px);
  font-size:clamp(12px,1.55vw,24px);
  border-radius:clamp(5px,.65vw,10px);
}
body > #scene-screen .scene-picker-foot {
  flex:0 0 auto;
  font-size:clamp(10px,1.25dvh,16px);
  line-height:1.15;
  margin:0;
}
body > #scene-screen .gp-return-from-picker {
  width:clamp(38px,4.9dvh,65px);
  height:clamp(38px,4.9dvh,65px);
  right:0;top:0;
}
body > #scene-screen > .pq-version-label {
  bottom:max(6px,env(safe-area-inset-bottom,0px));
  right:max(8px,env(safe-area-inset-right,0px));
  font-size:clamp(10px,1dvh,14px);
}
/* Short landscape phones: reclaim vertical room without hiding any choices. */
@media (max-height:460px) and (orientation:landscape) {
  body > #scene-screen.scene-overlay {
    padding-top:max(6px,env(safe-area-inset-top,0px));
    padding-bottom:max(6px,env(safe-area-inset-bottom,0px));
  }
  body > #scene-screen .scene-picker {gap:clamp(3px,.7dvh,6px);}
  body > #scene-screen .scene-picker h1 {font-size:clamp(26px,8.2dvh,38px);}
  body > #scene-screen .scene-picker p {font-size:clamp(11px,3dvh,14px);}
  body > #scene-screen .scene-choice-text small {font-size:clamp(9px,1.05vw,12px);}
  body > #scene-screen .scene-choice-text strong {font-size:clamp(11px,1.55vw,16px);}
}
/* Unusual but usable portrait viewports: display 2 x 3 for the picker only.
   The unchanged game keeps its existing landscape-required notice. */
@media (orientation:portrait) {
  body > #scene-screen .scene-choices {
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-rows:repeat(3,minmax(0,1fr));
  }
  body > #scene-screen .scene-choice-text strong {font-size:clamp(12px,2.7vw,19px);}
  body > #scene-screen .scene-choice-text small {font-size:clamp(9px,1.8vw,12px);}
}
/* ============ END v54 ============ */


/* v56: touchscreen information bar. Fixed-size, matching-height widgets share
   a single right-aligned line across the DEVICE, not just the 16:9 world.
   The animated world and its coordinate system are unchanged. */
.game-shell.pq-touch-ui{--pq-hud-size:clamp(40px,5.5dvh,46px);}
#pq-adaptive-shell.pq-touch-ui > .topbar{
  position:absolute;z-index:35;left:max(8px,env(safe-area-inset-left,0px));
  right:max(8px,env(safe-area-inset-right,0px));
  top:max(7px,env(safe-area-inset-top,0px));
  width:auto;max-width:none;height:var(--pq-hud-size);min-height:0;
  margin:0;padding:0;box-sizing:border-box;display:flex;
  align-items:center;justify-content:flex-end;gap:0;
  background:transparent;border:0;box-shadow:none;backdrop-filter:none;
}
#pq-adaptive-shell.pq-touch-ui > .topbar .brand{display:none;}
#pq-adaptive-shell.pq-touch-ui > .topbar .topbar-right{
  display:flex;align-items:center;justify-content:flex-end;flex-direction:row;
  flex-wrap:nowrap;flex:0 1 auto;width:auto;max-width:100%;min-width:0;
  margin:0;padding:0;gap:clamp(4px,.7vw,10px);
}
#pq-adaptive-shell.pq-touch-ui > .topbar .word-tracker,
#pq-adaptive-shell.pq-touch-ui > .topbar .pq-mistake-counter{
  display:flex;box-sizing:border-box;flex:0 0 auto;
  height:var(--pq-hud-size);min-height:var(--pq-hud-size);max-height:var(--pq-hud-size);
  margin:0;padding:0 clamp(7px,1.15vw,13px);align-items:center;justify-content:center;
  font-size:clamp(10px,1.3vw,14px);line-height:1;letter-spacing:.02em;
  border-radius:999px;gap:clamp(3px,.45vw,7px);white-space:nowrap;
}
#pq-adaptive-shell.pq-touch-ui > .topbar .word-tracker b,
#pq-adaptive-shell.pq-touch-ui > .topbar .pq-mistake-counter b{
  font-size:clamp(13px,1.48vw,17px);line-height:1;
}
#pq-adaptive-shell.pq-touch-ui > .topbar .pq-mistake-counter span:first-child{
  font-size:clamp(13px,1.55vw,18px);
}
#pq-adaptive-shell.pq-touch-ui > .topbar .scene-switch,
#pq-adaptive-shell.pq-touch-ui > .topbar .pq-control-stack > .header-button{
  box-sizing:border-box;flex:0 0 var(--pq-hud-size);
  width:var(--pq-hud-size);min-width:var(--pq-hud-size);max-width:var(--pq-hud-size);
  height:var(--pq-hud-size);min-height:var(--pq-hud-size);max-height:var(--pq-hud-size);
  margin:0;padding:0;border-radius:50%;display:grid;place-items:center;
  font-size:clamp(20px,2.3vw,26px);line-height:1;
}
#pq-adaptive-shell.pq-touch-ui > .topbar .scene-switch svg{
  width:56%;height:56%;display:block;
}
#pq-adaptive-shell.pq-touch-ui > .topbar .pq-control-stack{
  display:flex;flex:0 0 auto;flex-direction:row;align-items:center;justify-content:flex-end;
  gap:clamp(4px,.7vw,10px);width:auto;min-width:0;max-width:none;
  height:var(--pq-hud-size);margin:0;padding:0;position:relative;
}
#pq-adaptive-shell.pq-touch-ui > .topbar .pq-control-stack > .gp-site-return{
  width:var(--pq-hud-size);height:var(--pq-hud-size);
  min-width:var(--pq-hud-size);min-height:var(--pq-hud-size);
  max-width:var(--pq-hud-size);max-height:var(--pq-hud-size);
  border-radius:50%;overflow:hidden;
}
#pq-adaptive-shell.pq-touch-ui > .topbar .pq-volume-popover{
  top:calc(var(--pq-hud-size) + 9px);
  right:calc(var(--pq-hud-size) + clamp(4px,.7vw,10px));left:auto;
  width:min(230px,60vw);min-width:155px;max-width:230px;
  padding:11px 13px;border-radius:13px;
}
#pq-adaptive-shell.pq-touch-ui > .topbar .pq-volume-popover::after{
  top:-5px;right:14px;left:auto;
  border-left:1px solid #c8edffbb;border-top:1px solid #c8edffbb;
  border-right:0;border-bottom:0;
}
#pq-adaptive-shell.pq-touch-ui > .topbar .pq-volume-popover .volume-mute{
  width:36px;height:36px;min-width:36px;min-height:36px;
}
#pq-adaptive-shell.pq-touch-ui > .topbar .pq-volume-popover .volume-slider{height:32px;}
/* The world still has its own in-scene overlays. An active modal must be above
   the full-device HUD and block accidental presses. */
#pq-adaptive-shell.pq-touch-ui:has(.screen-overlay:not(.hidden)) > .topbar{
  visibility:hidden;pointer-events:none;
}
/* Non-touch screens use the original header geometry, but the new home control
   is circular rather than a text pill. */
.topbar .scene-switch{
  width:3.6cqw;min-width:3.6cqw;height:3.6cqw;
  padding:0;border-radius:50%;display:grid;place-items:center;
  margin-top:0;
}
.topbar .scene-switch svg{width:58%;height:58%;display:block;}
.game-shell[data-layout="separate"] > .topbar .scene-switch{
  width:42px;min-width:42px;height:42px;border-radius:50%;padding:0;
}
/* Separate, viewport-centred production intro. Prior to PLAY and while the
   film runs, the poster/video stays mathematically centred on every device. */
body > #start-screen.credits-overlay{
  position:fixed;inset:0;z-index:140;display:flex;align-items:center;
  justify-content:center;width:100vw;height:100vh;height:100dvh;
  max-width:none;max-height:none;margin:0;padding:0;overflow:hidden;
  background:#030a1b;box-sizing:border-box;
}
body > #start-screen .gp-intro-video{
  position:absolute;inset:auto;left:50%;top:50%;
  transform:translate(-50%,-50%);
  width:min(100vw,177.777778dvh);height:min(100dvh,56.25vw);
  max-width:100vw;max-height:100dvh;
  object-fit:contain;object-position:center;background:transparent;
}
body > #start-screen .gp-intro-start{
  font-size:clamp(15px,1.6vw,23px);padding:clamp(9px,1.2dvh,16px) clamp(22px,3vw,48px);
  bottom:max(7%,env(safe-area-inset-bottom,0px));
}
body > #start-screen .gp-intro-hint{
  font-size:clamp(11px,1.08vw,17px);
  bottom:max(2%,env(safe-area-inset-bottom,0px));
}
/* On extra-wide phones the independent spelling rail begins at the screen top.
   Leave room for the global right-aligned toolbar instead of painting mission
   information underneath its icons. */
#pq-adaptive-shell.pq-touch-ui[data-layout="side"] > .bottom-panel{
  padding-top:calc(var(--pq-hud-size) + 16px);
}

/* v57 — Wide touchscreen header docks against the 16:9 scene's right edge,
   not the right-hand panel containing correctly selected sounds.
   The JS-measured inset accounts for extra side margins on very wide displays. */
#pq-adaptive-shell.pq-touch-ui[data-layout="side"] > .topbar{
  right:var(--pq-header-right-inset,calc(var(--pq-rail) + 8px));
}
/* The spelling rail no longer needs clearance for header buttons and gets its
   normal full height back, including room for collected grapheme tiles. */
#pq-adaptive-shell.pq-touch-ui[data-layout="side"] > .bottom-panel{
  padding-top:clamp(7px,2dvh,16px);
}

/* v59 — Make the house symbol easier to recognise, without changing the
   circular Home button diameter, spacing, alignment or navigation. */
.topbar .scene-switch svg {
  width:76%;height:76%;display:block;
}
#pq-adaptive-shell.pq-touch-ui > .topbar .scene-switch svg {
  width:76%;height:76%;
}

/* v61 — Word or Waffle-style Skip Intro button. The introduction film stays
   centred; the control belongs to the fixed viewport, not to the 16:9 video. */
body > #start-screen .intro-skip{
  display:none; position:absolute;
  bottom:max(25px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  right:max(28px, calc(env(safe-area-inset-right, 0px) + 12px));
  z-index:4;
  background:#0d2845b8; color:#f4f7ff;
  border:1px solid #f3f6ffc0; border-radius:22px;
  padding:9px 19px; font-size:13px; font-weight:700; letter-spacing:1px;
  font-family:inherit; line-height:1.2; cursor:pointer; touch-action:manipulation;
  min-height:44px; align-items:center; justify-content:center; gap:6px;
}
body > #start-screen.credits-running:not(.hidden) .intro-skip{display:flex}
body > #start-screen .intro-skip:hover{background:#1b456a}
body > #start-screen .intro-skip:focus-visible{outline:3px solid #ffe18e;outline-offset:3px}
body > #start-screen .intro-skip:active{background:#275779}


/* Phonics Quest v64 — unified top-right HUD, regardless of touch input,
   screen ratio, adventure or ?list= word set. Scene art stays native 16:9.
   The selected-graphemes rail is never covered by the header. */
#pq-adaptive-shell{--pq-hud-size:clamp(40px,5.4dvh,48px);}
#pq-adaptive-shell > .topbar.pq-universal-header{
  position:absolute;z-index:35;
  left:auto;right:max(8px,env(safe-area-inset-right,0px));
  top:max(7px,env(safe-area-inset-top,0px));bottom:auto;
  width:auto;max-width:calc(100vw - 16px);
  min-width:0;min-height:0;height:var(--pq-hud-size);
  margin:0;padding:0;box-sizing:border-box;
  display:flex;align-items:center;justify-content:flex-end;
  gap:0;background:transparent;border:0;border-radius:0;
  box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;
}
#pq-adaptive-shell > .topbar.pq-universal-header .brand{display:none;}
#pq-adaptive-shell > .topbar.pq-universal-header .topbar-right{
  display:flex;flex:0 1 auto;flex-direction:row;flex-wrap:nowrap;
  align-items:center;justify-content:flex-end;min-width:0;
  gap:clamp(4px,.64vw,9px);margin:0;padding:0;
}
#pq-adaptive-shell > .topbar.pq-universal-header .word-tracker,
#pq-adaptive-shell > .topbar.pq-universal-header .pq-mistake-counter{
  display:flex;flex:0 0 auto;align-items:center;justify-content:center;
  height:var(--pq-hud-size);min-height:var(--pq-hud-size);max-height:var(--pq-hud-size);
  box-sizing:border-box;margin:0;padding:0 clamp(7px,1vw,13px);
  font-size:clamp(10px,1.18vw,14px);letter-spacing:.02em;line-height:1;
  gap:clamp(3px,.4vw,6px);white-space:nowrap;border-radius:999px;
}
#pq-adaptive-shell > .topbar.pq-universal-header .word-tracker b,
#pq-adaptive-shell > .topbar.pq-universal-header .pq-mistake-counter b{
  font-size:clamp(13px,1.38vw,17px);line-height:1;
}
#pq-adaptive-shell > .topbar.pq-universal-header .pq-mistake-counter span:first-child{
  font-size:clamp(14px,1.5vw,19px);
}
#pq-adaptive-shell > .topbar.pq-universal-header .scene-switch,
#pq-adaptive-shell > .topbar.pq-universal-header .pq-control-stack > .header-button{
  box-sizing:border-box;flex:0 0 var(--pq-hud-size);
  width:var(--pq-hud-size);min-width:var(--pq-hud-size);max-width:var(--pq-hud-size);
  height:var(--pq-hud-size);min-height:var(--pq-hud-size);max-height:var(--pq-hud-size);
  margin:0;padding:0;border-radius:50%;display:grid;place-items:center;
  font-size:clamp(20px,2.2vw,26px);line-height:1;
}
#pq-adaptive-shell > .topbar.pq-universal-header .scene-switch svg{
  width:76%;height:76%;display:block;
}
#pq-adaptive-shell > .topbar.pq-universal-header .pq-control-stack{
  display:flex;flex:0 0 auto;flex-direction:row;align-items:center;justify-content:flex-end;
  position:relative;isolation:isolate;gap:clamp(4px,.64vw,9px);
  width:auto;max-width:none;min-width:0;height:var(--pq-hud-size);
  margin:0;padding:0;
}
#pq-adaptive-shell > .topbar.pq-universal-header .pq-control-stack > .gp-site-return{
  width:var(--pq-hud-size);height:var(--pq-hud-size);
  min-width:var(--pq-hud-size);min-height:var(--pq-hud-size);
  max-width:var(--pq-hud-size);max-height:var(--pq-hud-size);
  margin:0;padding:0;border-radius:50%;overflow:hidden;
}
#pq-adaptive-shell > .topbar.pq-universal-header .pq-volume-popover{
  top:calc(var(--pq-hud-size) + 9px);right:calc(var(--pq-hud-size) + 8px);
  left:auto;width:min(230px,60vw);max-width:230px;min-width:155px;
  padding:11px 13px;border-radius:13px;
}
#pq-adaptive-shell > .topbar.pq-universal-header .pq-volume-popover::after{
  top:-5px;right:14px;left:auto;
  border-left:1px solid #c8edffbb;border-top:1px solid #c8edffbb;
  border-right:0;border-bottom:0;
}
#pq-adaptive-shell > .topbar.pq-universal-header .pq-volume-popover .volume-mute{
  width:36px;height:36px;min-width:36px;min-height:36px;
}
#pq-adaptive-shell > .topbar.pq-universal-header .pq-volume-popover .volume-slider{height:32px;}
/* For 4:3 devices the toolbar occupies the original reserved top band,
   so it never obscures the game artwork or changes the 16:9 scene size. */
#pq-adaptive-shell[data-layout="separate"] > .topbar.pq-universal-header{
  position:relative;top:auto;left:auto;right:auto;
  flex:0 0 56px;min-height:56px;height:56px;
  width:min(100%,calc(177.777778dvh - 284.45px));max-width:100%;
  padding:4px 8px;align-self:center;
  background:linear-gradient(110deg,#092e4fec,#064164dc);
  border:1px solid #d7f6ff6a;border-bottom:0;border-radius:13px 13px 0 0;
}
/* Wider devices: right-align to the scene rather than the sounds rail. The
   right inset is measured from the scene's actual right edge by game.js. */
#pq-adaptive-shell[data-layout="side"] > .topbar.pq-universal-header,
#pq-adaptive-shell.pq-touch-ui[data-layout="side"] > .topbar.pq-universal-header{
  right:var(--pq-header-right-inset,calc(var(--pq-rail) + 8px));
}
/* Never leave the toolbar active over scene-loading or result overlays. */
#pq-adaptive-shell:has(.screen-overlay:not(.hidden)) > .topbar.pq-universal-header{
  visibility:hidden;pointer-events:none;
}
@media (max-width:700px){
  #pq-adaptive-shell > .topbar.pq-universal-header .topbar-right,
  #pq-adaptive-shell > .topbar.pq-universal-header .pq-control-stack{gap:4px;}
  #pq-adaptive-shell > .topbar.pq-universal-header .word-tracker,
  #pq-adaptive-shell > .topbar.pq-universal-header .pq-mistake-counter{
    padding:0 6px;font-size:10px;
  }
}


/* v67: Performance fixes for iPhone/iPad and all iOS browsers.
   WebP tree animation: original 1280x720 canvas has all 289 frame rectangles
   inside x=0..625. The v67 lossless 640x720 VP8X crop retains every source
   frame, with HALF the transparent canvas area. Its 50%-width rendering in the
   same scene coordinates is pixel-for-pixel identical to the original. */
.express-tree-fallback.use-webp {
  left:0;
  top:0;
  width:50% !important;
  height:100% !important;
  object-fit:fill;
}
/* Blur over continuously changing full-screen video can trigger expensive
   WebKit offscreen repaints. Preserve the opaque/translucent interface,
   dimensions, artwork and animations; skip only the frosted-glass blur. */
:root.pq-ios-performance .word-tracker,
:root.pq-ios-performance .pq-mistake-counter,
:root.pq-ios-performance .header-button,
:root.pq-ios-performance .bottom-panel,
:root.pq-ios-performance .pq-volume-popover,
:root.pq-ios-performance .screen-overlay {
  -webkit-backdrop-filter:none !important;
  backdrop-filter:none !important;
}
/* Prevent costly large shadow recompositing around the entire moving wizard
   button; retain the same shadow on the illustrated sprite itself instead. */
:root.pq-ios-performance .bubble.wizard-choice,
:root.pq-ios-performance .bubble.wizard-choice:disabled,
:root.pq-ios-performance .bubble.wizard-choice:hover:not(:disabled) {
  filter:none;
}
:root.pq-ios-performance .bubble.wizard-choice .wizard-sprite {
  filter:drop-shadow(0 .3cqw .85cqw #14082dbf);
}

/* v68 iOS: GPU-assisted transparent video layers, correctly ordered over the
   passing train. H.264 is hardware-decoded; WebGL reconstructs the alpha matte.
   Only used on iOS when WebGL is available; all existing WebP fallbacks remain. */
.pq-alpha-canvas{display:none!important;pointer-events:none;mix-blend-mode:normal;opacity:1;}
html.pq-alpha-video .game.express-scene .pq-alpha-canvas.pq-alpha-visible{display:block!important;}
html.pq-alpha-video .game.express-scene video.express-tree,
html.pq-alpha-video .game.express-scene img.express-tree-fallback,
html.pq-alpha-video .game.express-scene .pq-signal-fallback{display:none!important;}
.pq-alpha-source{position:absolute!important;width:1px!important;height:1px!important;
  left:0!important;top:0!important;opacity:.001!important;pointer-events:none!important;
  z-index:-1!important;}
html.pq-alpha-video .express-tree.pq-alpha-canvas{width:50%!important;height:100%!important;left:0;top:0;object-fit:fill;}
/* Keep existing z-index/coordinates for every signal, including final frame. */
html.pq-alpha-video .express-front-loop.pq-alpha-canvas{z-index:7;}

/* v69: browser-fullscreen help. Unlike the stage, this sits in the real viewport. */
.pq-fullscreen-help{position:fixed;inset:0;z-index:30000;display:flex;align-items:center;justify-content:center;padding:calc(16px + env(safe-area-inset-top,0px)) calc(16px + env(safe-area-inset-right,0px)) calc(16px + env(safe-area-inset-bottom,0px)) calc(16px + env(safe-area-inset-left,0px));background:rgba(2,16,33,.86);overflow:auto;overscroll-behavior:contain}
.pq-fullscreen-help[hidden]{display:none!important}
.pq-fullscreen-help-card{width:min(92vw,440px);max-height:95%;overflow-y:auto;padding:clamp(20px,4vw,30px);border:2px solid #aeeaff;border-radius:21px;background:linear-gradient(145deg,#0a4a6b,#092b4a 70%,#172b54);box-shadow:0 18px 60px #000a;color:#fff;text-align:center}
.pq-fullscreen-help-symbol{width:44px;height:44px;line-height:40px;font-size:28px;border:2px solid #d6f8ff;border-radius:50%;margin:0 auto 12px;color:#ffe8a5}
.pq-fullscreen-help-card h2{margin:0 0 10px;font-size:clamp(21px,4vw,26px);line-height:1.2;color:#ffedac}
.pq-fullscreen-help-card p{font-size:clamp(14px,2.4vw,16px);line-height:1.5;margin:10px 0}
.pq-fullscreen-help-card ol{margin:8px 0 18px;padding-left:1.5em;text-align:left;font-size:clamp(13px,2.3vw,15px);line-height:1.5}
.pq-fullscreen-help-card li+li{margin-top:7px}
.pq-fullscreen-help-close{margin-top:8px;min-height:46px;padding:11px 24px;border:1px solid #fffae0;border-radius:999px;background:linear-gradient(180deg,#f8da82,#e7ab42);color:#163a59;font-size:14px;font-weight:900;letter-spacing:.04em;cursor:pointer}
.pq-fullscreen-help-close:focus-visible{outline:3px solid #fff;outline-offset:3px}

/* v70: freeze all CSS motion during the Firefox/iOS fullscreen help dialog.
   The fullscreen help itself remains fully interactive. */
body.pq-fullscreen-help-paused .game-shell *,
body.pq-fullscreen-help-paused .game-shell *::before,
body.pq-fullscreen-help-paused .game-shell *::after,
body.pq-fullscreen-help-paused #start-screen *,
body.pq-fullscreen-help-paused #scene-screen * {
  animation-play-state:paused !important;
  transition-property:none !important;
}

/* v71: Keep the new Express scene-selection illustration focused on the train. */
body > #scene-screen .scene-choice[data-scene="express"] img { object-position:center 63%; }
