/* Edge-to-edge gameplay with a focused, step-by-step phonics lesson. */
body.game-active{overflow:hidden}
body.game-active .header,body.game-active .classroom-nav,body.game-active>footer{display:none}
body.game-active #gameLayout{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;margin:0;padding:0;display:block;z-index:1}
body.game-active #gameLayout[hidden]{display:none}
body.game-active .left-panel,body.game-active .journey-card,body.game-active .rule-card{display:none}
body.game-active .game-column{position:fixed;inset:0;width:100vw;height:100dvh;margin:0;padding:0;display:block;max-width:none}
body.game-active .game-top{position:fixed;z-index:12;top:calc(9px + env(safe-area-inset-top));left:14px;right:14px;align-items:flex-start;padding:0}
body.game-active .game-top>div{display:grid;grid-template-columns:auto auto;align-items:center;gap:4px 12px;text-shadow:0 2px 16px #101a3e}
body.game-active .game-top .style-name{font-size:clamp(15px,2.2vw,22px);font-weight:900;letter-spacing:.02em}
body.game-active .game-top .level-label{font-size:clamp(16px,2.8vw,24px);font-weight:900;grid-row:2;grid-column:1}
body.game-active .game-top>div>p{grid-row:2;grid-column:2;font-size:clamp(20px,3.6vw,30px);font-weight:900;margin:0}
body.game-active .arena-wrap{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;bottom:auto;border:0;border-radius:0;box-shadow:none;overflow:hidden}
body.game-active .arena-wrap>canvas{position:absolute;inset:0;width:100vw;height:100dvh;max-width:none;aspect-ratio:auto}
body.game-active .arena-wrap>#game{z-index:0}
body.game-active .arena-wrap>#spheres{z-index:1;pointer-events:none}
body.game-active .arena-wrap>#effects{z-index:8;pointer-events:none}
body.game-active .arena-hud{top:calc(82px + env(safe-area-inset-top));z-index:9}
body.game-active .aim-instruction{top:auto;bottom:calc(158px + env(safe-area-inset-bottom));z-index:9;font-size:clamp(12px,1.7vw,16px);font-weight:900;color:#fff;text-shadow:0 2px 8px #162548}
body.game-active .number-tray{position:fixed;z-index:11;left:50%;bottom:calc(61px + env(safe-area-inset-bottom));transform:translateX(-50%);width:min(660px,calc(100vw - 24px));max-width:none}
body.game-active .game-tip{position:fixed;z-index:11;left:12px;right:12px;bottom:calc(120px + env(safe-area-inset-bottom));margin:0;color:white;font-size:clamp(14px,1.8vw,18px);font-weight:800;text-shadow:0 2px 8px #17294a}
body.game-active .game-footer{z-index:15}
body.game-active .overlay{position:fixed;inset:0;z-index:30}
body.game-active .overlay-content{width:min(520px,92vw);padding:clamp(26px,5vw,52px);border-radius:34px}
body.game-active .overlay h2{font-size:clamp(32px,6vw,54px);font-weight:950}
body.game-active .overlay .eyebrow{font-size:clamp(14px,2vw,18px);font-weight:900;letter-spacing:.12em}
body.game-active .overlay p:not(.eyebrow){font-size:clamp(17px,2.4vw,22px);line-height:1.5;font-weight:650}
body.game-active #roundBanner{z-index:20;top:25%}
body.game-active[data-mode=words] .arena-wrap{background:radial-gradient(ellipse at 50% 35%,#ffffff 0,#e6f7ff 43%,#c5e4ff 100%)}
body.game-active[data-mode=words] #game,body.game-active[data-mode=words] #spheres,body.game-active[data-mode=words] .arena-hud,body.game-active[data-mode=words] .aim-instruction,body.game-active[data-mode=words] .number-tray,body.game-active[data-mode=words] .game-tip,body.game-active[data-mode=words] #hearWord{display:none}
body.game-active[data-mode=words] .word-stage{position:absolute;inset:0;z-index:3;width:auto;height:auto;transform:none!important;display:flex;justify-content:flex-start;align-items:center;gap:clamp(8px,1.5vh,18px);overflow:auto;padding:calc(96px + env(safe-area-inset-top)) 18px calc(72px + env(safe-area-inset-bottom));perspective:1000px}
body.game-active[data-mode=words] .word-stage[hidden]{display:none}
body.game-active[data-mode=words] .word-set-label{font-size:clamp(13px,1.8vw,17px);font-weight:950;letter-spacing:.14em;color:#31577b}
body.game-active[data-mode=words] .word-set-track{gap:clamp(14px,3vw,28px);margin:0 0 clamp(4px,1vh,10px)}
body.game-active[data-mode=words] .word-set-track span{width:clamp(30px,5vh,44px);height:clamp(30px,5vh,44px);font-size:clamp(14px,2vw,18px);font-weight:950}
body.game-active[data-mode=words] .word-stage-heading{font-size:clamp(26px,5vw,48px);line-height:1.05;font-weight:950;color:#214d76!important;text-shadow:0 2px #fff,0 6px 0 #b1d8ec;min-height:0}
body.game-active[data-mode=words] .word-picture{width:min(31vh,250px);height:min(31vh,250px);min-height:145px;border-radius:30px;box-shadow:0 12px 0 #a8d0e4,0 22px 42px #3e76a430!important;transform:translateZ(22px)}
body.game-active[data-mode=words] .word-slots{display:flex;gap:clamp(8px,2vw,18px);margin:clamp(4px,1vh,12px) 0}
body.game-active[data-mode=words] .word-slot{width:clamp(66px,12vw,115px);height:clamp(72px,13vw,120px);font-size:clamp(42px,9vw,80px);border-radius:22px;animation:phonics-letter-in .45s cubic-bezier(.2,1.5,.4,1) both;animation-delay:calc(var(--tile)*70ms)}
@keyframes phonics-letter-in{from{opacity:0;transform:translateY(16px) rotateX(-30deg) scale(.7)}to{opacity:1;transform:translateY(0) rotateX(0) scale(1)}}
body.game-active[data-mode=words] .word-feedback{font-size:clamp(17px,2.6vw,24px);font-weight:850;color:#315e78!important;margin:0;min-height:1.2em}
body.game-active[data-mode=words] .phonics-controls{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;width:min(720px,100%);margin:0 auto}
body.game-active[data-mode=words] .phonics-controls .primary-button,body.game-active[data-mode=words] .phonics-controls .secondary-button{min-height:54px;font-size:clamp(16px,2.5vw,22px);font-weight:900;padding:13px 22px;border-radius:18px}
body.game-active[data-mode=words] .phonics-trace-pad{width:min(820px,94vw);height:clamp(100px,20vh,180px);background:linear-gradient(145deg,#f7fcff,#dcefff);border:3px dashed #75b7df;border-radius:24px;box-shadow:inset 0 5px 16px #5485aa20,0 7px 0 #b8d9e9;touch-action:none}
body.game-active[data-mode=words] .trace-hint{flex-basis:100%;color:#286493;font-size:clamp(15px,2vw,19px);font-weight:900;text-align:center}
body.game-active[data-mode=words] .phonics-write{width:min(420px,90vw);height:68px;border:3px solid #85c8e8;border-radius:18px;background:#fff;color:#214d76;text-align:center;font:900 clamp(28px,5vw,42px) Outfit,sans-serif;box-shadow:0 5px 0 #aed1e3}
body.game-active[data-mode=words] .phonics-write.wrong{border-color:#e06467;box-shadow:0 5px 0 #bc5153;animation:phonics-shake .25s ease-in-out 2}
body.game-active[data-mode=words] .phonics-write.right{border-color:#43bd72;box-shadow:0 5px 0 #299355}
body.game-active[data-mode=words] .write-word-label{flex-basis:100%;font-size:clamp(20px,3vw,28px);font-weight:950;color:#214d76;text-align:center}
body.game-active[data-mode=words] .word-success-badge{border-radius:999px;background:linear-gradient(120deg,#d4ffe6,#baf5d0);padding:13px 26px;color:#17653b;font-size:clamp(22px,3vw,30px);font-weight:950;box-shadow:0 5px 0 #79c28e}
@keyframes phonics-shake{25%{transform:translateX(-8px)}75%{transform:translateX(8px)}}
@media(max-width:700px){body.game-active .game-top{left:12px;right:12px}body.game-active .game-top .style-name{font-size:15px}body.game-active .game-top .level-label{font-size:15px}body.game-active .game-top>div>p{font-size:19px}body.game-active .number-tray{bottom:calc(59px + env(safe-area-inset-bottom));width:calc(100vw - 16px);padding:10px 12px}body.game-active .game-tip{bottom:calc(116px + env(safe-area-inset-bottom))}body.game-active[data-mode=words] .word-stage{padding-left:12px;padding-right:12px;padding-top:calc(83px + env(safe-area-inset-top));gap:8px}body.game-active[data-mode=words] .word-picture{width:min(24vh,190px);height:min(24vh,190px);min-height:112px}body.game-active[data-mode=words] .word-stage-heading{font-size:clamp(24px,7vw,34px)}body.game-active[data-mode=words] .word-slot{width:clamp(58px,18vw,85px);height:clamp(66px,19vw,92px);font-size:clamp(39px,12vw,62px)}body.game-active[data-mode=words] .phonics-controls{gap:8px}body.game-active[data-mode=words] .phonics-controls button{min-height:48px;padding:10px 15px}}
@media(prefers-reduced-motion:reduce){body.game-active[data-mode=words] .word-slot{animation:none}body.game-active[data-mode=words] .phonics-write.wrong{animation:none}}
