@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Nunito:wght@600;700;800;900&family=Edu+NSW+ACT+Hand+Pre:wght@400;500;600;700&display=swap');
/* Use the supplied handwriting family where installed, otherwise load the same family from Google Fonts.
   No font files are distributed in this ZIP. */
:root{color-scheme:dark;font-family:"Edu NSW ACT Hand Pre",cursive;color:#fff;font-synthesis:none}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#111e30;-webkit-tap-highlight-color:transparent}button,textarea,select,input{font:inherit}button{cursor:pointer;touch-action:manipulation}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:4px solid #fce46c;outline-offset:3px}button:disabled{cursor:default}#viewport{position:fixed;inset:0;overflow:hidden;isolation:isolate;background:radial-gradient(ellipse at 50% 30%,#355e76,#182a44 67%,#0d1424 100%)}#stage{position:absolute;width:1280px;height:720px;top:50%;left:50%;transform:translate(-50%,-50%) scale(var(--stage-scale,1));transform-origin:50% 50%;overflow:hidden;background:#122239;box-shadow:0 0 60px #09102180}.screen{position:absolute;inset:0;display:none;overflow:hidden}.screen.active{display:block}.hidden{display:none!important}
.menu-backdrop{position:absolute;inset:0;background-image:url('assets/junction-poster.webp');background-size:cover;background-position:center;filter:blur(12px) saturate(1.06);transform:scale(1.04)}.menu-overlay{position:absolute;inset:0;background:linear-gradient(115deg,#0c2440ee,#14264ac9 55%,#182148e8);box-shadow:inset 0 0 200px #04142870}.menu-header{position:relative;display:flex;justify-content:space-between;align-items:center;padding:17px 35px;z-index:2}.brand{color:#cfebfe;font-weight:700;letter-spacing:3.5px;font-size:16px;text-shadow:0 2px 10px #123}.brand-star{color:#ffe378;margin:0 5px}.header-tools{display:flex;gap:11px}.circle-btn{width:47px;height:47px;border-radius:50%;border:2px solid #ffffff9b;background:#152a43ba;box-shadow:0 5px 14px #09182b6e;color:white;display:grid;place-items:center;transition:transform .15s,background .15s}.circle-btn:hover{transform:scale(1.08);background:#1d4568}.circle-btn svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.title-block{position:relative;text-align:center;z-index:1;margin:4px auto 23px}.ribbon{display:inline-block;background:#e5a829;color:#39200e;border-radius:30px;padding:5px 24px;font-weight:700;letter-spacing:1.7px;font-size:12px;box-shadow:0 3px 0 #815419}.title-block h1{font-family:"Edu NSW ACT Hand Pre",cursive;font-size:79px;line-height:1.18;white-space:nowrap;letter-spacing:-2px;margin:-1px 0 -9px;color:#fff9e9;-webkit-text-stroke:1px #fff4d7;text-shadow:0 6px 0 #142743,0 10px 16px #031526aa}.title-block .or{display:inline-block;color:#ffbf4a;font-size:.58em;vertical-align:15px;margin:0 -2px}.title-block .waffle{color:#b8f27e}.question{color:#ffb943;display:inline-block;transform:rotate(11deg)}.title-block p{font-size:16px;letter-spacing:.1px;color:#f6f5e8;margin:5px 0 0;font-weight:700}.menu-section-label{position:relative;display:flex;align-items:center;justify-content:space-between;width:1110px;margin:0 auto 11px;font-size:14px;font-weight:700;letter-spacing:1.9px}.menu-small{font-size:11px;color:#b9cfde;letter-spacing:.8px}.scene-grid{position:relative;width:1110px;height:367px;margin:auto;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(2,1fr);gap:14px}.scene-tile{position:relative;text-align:left;border-radius:21px;overflow:hidden;padding:18px 22px;min-width:0;border:2px solid #ffffff25;color:#fff;box-shadow:0 8px 20px #07132865;background:#203a5b;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;isolation:isolate}.scene-tile.live{border-color:#d3ff83;box-shadow:0 0 0 3px #c0f26c2b,0 12px 25px #06142899;transition:transform .2s,filter .2s;cursor:pointer}.scene-tile.live:hover{transform:translateY(-4px);filter:brightness(1.08)}.scene-image{position:absolute;inset:0;background:url('assets/junction-poster.webp') center 54%/cover;z-index:-2}.scene-tile.live:before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(0deg,#071a35f7 5%,#06142ba6 46%,#0b1e3a20 100%)}.scene-tile strong{font-family:"Edu NSW ACT Hand Pre",cursive;font-size:26px;line-height:1.15;white-space:nowrap}.scene-tile small{font-size:13px;font-weight:700;color:#e5edf7}.scene-tile.live{padding-bottom:15px}.scene-tile.pending{background:linear-gradient(135deg,#314c68b8,#14283ecb);border-style:dashed;border-color:#d2dfe043;color:#d2deee}.pending strong{color:#dce8f5;font-size:24px}.pending small{color:#93aac0}.pending-icon{position:absolute;right:19px;top:24px;font-size:67px;font-weight:700;opacity:.12;line-height:1}.menu-footer{position:relative;margin:19px auto 0;width:1110px;display:flex;justify-content:space-between;align-items:center;font-size:11px;font-weight:700;letter-spacing:1.1px;color:#e1edf6c7}
.scene-video{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;background:#17506c}.game-wash{position:absolute;top:0;left:0;right:0;height:84px;pointer-events:none;background:linear-gradient(#051d31cf 3%,#051d3150 75%,transparent)}.game-header{position:absolute;top:12px;left:17px;right:17px;display:flex;align-items:center;gap:10px;z-index:8}.game-header .circle-btn{width:48px;height:48px;flex-shrink:0;background:#103047db;border-color:#f9ffffd1}.scene-name{display:flex;flex-direction:column;gap:1px;min-width:175px;line-height:1.15;text-shadow:0 2px 8px #071c2f}.scene-name strong{font-weight:700;font-size:17px;letter-spacing:.6px}.scene-name span{color:#e0f0f8;font-size:10px;letter-spacing:1.6px;font-weight:700}.hud-spacer{flex:1}.progress-hud,.stat-pill{height:47px;border-radius:15px;background:#062b42e9;display:flex;align-items:center;gap:9px;box-shadow:0 4px 14px #0b1f2580;padding:0 15px;border:2px solid #e2f5ed90;font-weight:700;white-space:nowrap}.progress-hud{flex-direction:column;gap:0;justify-content:center;padding:0 18px}.progress-hud span{font-size:9px;letter-spacing:1.5px;color:#aee3f9}.progress-hud strong{font-size:17px}.stat-pill{font-size:12px;letter-spacing:.5px}.stat-pill strong{font-size:22px;margin-left:2px}.stat-pill.success{border-color:#92e689;background:#1d5038e8}.stat-pill.errors{border-color:#ffb38c;background:#77422ce8}.stat-icon{font-size:20px;font-weight:700}.word-on-box{position:absolute;z-index:5;left:38.9%;top:56.5%;width:22.3%;height:12.2%;display:flex;align-items:center;justify-content:center;text-align:center;font-family:"Edu NSW ACT Hand Pre",cursive;font-weight:700;font-size:52px;line-height:1;letter-spacing:.3px;color:#122e4c;text-shadow:0 1px 0 #fff;pointer-events:none;white-space:nowrap;transform:translateZ(0)}.word-on-box.long{font-size:39px}.word-on-box.very-long{font-size:31px}.progress-dots{position:absolute;left:50%;top:88px;transform:translateX(-50%);display:flex;gap:6px;z-index:6;filter:drop-shadow(0 2px 4px #163f3b)}.progress-dots span{width:17px;height:8px;background:#092c47a9;border:1px solid #f5fffe9e;border-radius:9px}.progress-dots span.finished{background:#a8f66b;border-color:#e9ffd1}.progress-dots span.current{background:#ffce4b;border-color:#fff4b2}.guide-label{position:absolute;top:113px;left:50%;transform:translateX(-50%);z-index:7;border-radius:20px;padding:8px 17px;background:#0f2e48d8;border:1px solid #eef6f9a3;font-size:12px;letter-spacing:1.7px;font-weight:700;text-shadow:0 1px 2px #0007;white-space:nowrap;box-shadow:0 4px 12px #03142655}.road-hotspot{position:absolute;z-index:4;top:42%;height:35%;width:33%;background:transparent;border:0;cursor:pointer}.road-hotspot.left{left:1%}.road-hotspot.right{right:1%}.road-hotspot:focus-visible{outline:5px dashed #fff;outline-offset:-5px}.choice-bar{position:absolute;bottom:14px;left:18px;right:18px;display:flex;justify-content:space-between;align-items:end;z-index:7;pointer-events:none}.choice-bar>*{pointer-events:auto}.route-btn{height:82px;min-width:341px;display:flex;align-items:center;gap:15px;padding:7px 16px;border:3px solid #fff;border-radius:22px;box-shadow:0 8px 0 #142d3890,0 10px 19px #13252ab0;transition:transform .12s,filter .12s;color:#172d31;font-weight:700}.route-btn:hover{filter:brightness(1.07);transform:translateY(-2px)}.route-btn:active{transform:translateY(3px);box-shadow:0 3px 0 #142d3890}.route-btn.real{background:linear-gradient(110deg,#c9ec7a,#90d77a)}.route-btn.nonsense{background:linear-gradient(110deg,#b9dcff,#6dbafa);color:#153550;justify-content:flex-end}.route-btn span:not(.route-arrow):not(.route-mini){display:flex;flex-direction:column;align-items:flex-start;line-height:1.06}.route-btn.nonsense span:not(.route-arrow):not(.route-mini){align-items:flex-end}.route-btn small{font-size:11px;font-weight:700;letter-spacing:1.1px}.route-btn strong{font-family:"Edu NSW ACT Hand Pre",cursive;font-size:21px;line-height:1.2}.route-arrow{font-size:43px;line-height:1;font-family:system-ui;font-weight:700}.route-mini{display:none}.fork-icon{display:flex;flex-direction:column;align-items:center;color:white;font-size:29px;line-height:1;text-shadow:0 2px 5px #143d50;font-weight:700}.fork-icon small{font-size:9px;font-weight:700;letter-spacing:1.5px;margin-top:4px;text-shadow:0 1px 5px #1d2c3a}.game.choosing{}.game-header,.choice-bar{user-select:none}.correct-toast{position:absolute;top:22%;left:50%;transform:translateX(-50%) scale(.8);padding:17px 31px;background:#c4fb89;border:4px solid #fffff0;color:#22431e;border-radius:20px;font-weight:700;font-family:"Edu NSW ACT Hand Pre",cursive;font-size:29px;text-shadow:0 1px #fff;box-shadow:0 7px 0 #4e7531,0 12px 40px #14271999;opacity:0;pointer-events:none;z-index:10}.correct-toast.show{animation:popGood .85s ease both}@keyframes popGood{0%{opacity:0;transform:translateX(-50%) scale(.55)}23%{opacity:1;transform:translateX(-50%) scale(1.1)}60%{opacity:1;transform:translateX(-50%) scale(1)}100%{opacity:0;transform:translateX(-50%) scale(.96)}}
.results-backdrop{position:absolute;inset:0;z-index:20;background:#091324a3;backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center}.result-card{width:568px;text-align:center;padding:32px 35px 36px;border-radius:30px;border:4px solid #fff3cf;background:linear-gradient(145deg,#1a3854,#10273c);box-shadow:0 0 0 7px #081c2e66,0 22px 70px #051320c9;animation:resultIn .35s cubic-bezier(.2,1.3,.4,1) both}.result-card .eyebrow{color:#aee5f3;letter-spacing:2.6px;font-size:13px;font-weight:700}.result-symbol{width:70px;height:70px;border-radius:50%;margin:-5px auto 12px;display:flex;align-items:center;justify-content:center;font-family:"Edu NSW ACT Hand Pre",cursive;font-size:46px;font-weight:700}.stop-symbol{background:#f8bc53;color:#5b2a12;border:5px solid #fff3c4}.trophy{background:#c4f17f;color:#315728;border:5px solid #f1ffe3}.result-card h2{font-family:"Edu NSW ACT Hand Pre",cursive;font-size:61px;line-height:1.05;letter-spacing:-.7px;margin:5px 0 3px;color:#ffdf75;text-shadow:0 4px 0 #77502c}.complete-card h2{font-size:54px;color:#caf18d;text-shadow:0 4px 0 #335a40}.result-card h3{font-family:"Edu NSW ACT Hand Pre",cursive;font-size:28px;line-height:1.15;margin:3px 0;color:white}.result-card p{color:#d6e8f5;font-size:16px;font-weight:700;margin:12px 0 26px}.action-btn{border-radius:16px;padding:14px 26px;border:2px solid #fff;font-weight:700;letter-spacing:1px;font-size:14px;color:#143e2c;box-shadow:0 6px 0 #0005;transition:transform .15s}.action-btn:hover{transform:translateY(-2px)}.action-btn:active{transform:translateY(2px);box-shadow:0 2px 0 #0006}.action-btn.orange{background:#ffcc66;color:#51341a;min-width:235px}.action-btn.lime{background:#c8f188}.action-btn.outline{background:#152f45;color:white}.result-stats{display:flex;gap:12px;margin:15px 0 25px}.result-stats>div{border:2px solid #dbeef059;background:#092234ba;border-radius:16px;flex:1;padding:13px 2px;display:flex;flex-direction:column;gap:6px}.result-stats span{font-size:11px;font-weight:700;letter-spacing:.8px;color:#c3deeb}.result-stats strong{font-family:"Edu NSW ACT Hand Pre",cursive;font-size:36px;line-height:1;color:#f7e6a1}.result-actions{display:flex;justify-content:center;gap:12px}@keyframes resultIn{from{transform:translateY(30px) scale(.83);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}
.loading-overlay{position:absolute;inset:0;z-index:30;background:#0b2239ee;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px}.loading-overlay strong{font-family:"Edu NSW ACT Hand Pre",cursive;font-size:30px}.loading-overlay span{color:#c9e0ef;font-weight:700}.loader-wheel{height:77px;width:77px;border-radius:50%;border:9px solid #b2dcff40;border-top-color:#c7f48a;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
.sound-panel{position:absolute;right:24px;top:75px;z-index:50;width:304px;padding:19px 21px 20px;border-radius:21px;background:#0c2942f2;border:2px solid #dceaf6;box-shadow:0 12px 32px #081627c9}.sound-header{display:flex;align-items:center;justify-content:space-between;font-size:14px;letter-spacing:1px}.sound-header button{background:none;border:none;color:white;font-weight:700;font-size:20px}.sound-panel label{display:flex;flex-direction:column;gap:6px;margin:16px 0;color:#c5edfb;font-size:11px;letter-spacing:1px;font-weight:700}.sound-panel input{width:100%;accent-color:#bff283}.mute-toggle{background:#204965;border:1px solid #d5ecff;color:white;border-radius:11px;padding:10px;width:100%;font-size:11px;font-weight:700;letter-spacing:1px}#portraitMask{display:none;position:fixed;inset:0;z-index:1000;background:#0d2944;color:#fff;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:7vw}#portraitMask h2{font-family:"Edu NSW ACT Hand Pre",cursive;font-size:clamp(25px,8vw,50px);margin:12px 0 0;color:#cff58f}#portraitMask p{font-size:clamp(16px,4.5vw,21px);font-weight:700;max-width:380px}#portraitMask span{font-size:14px;color:#b9d7ee}.rotate-art{width:95px;height:95px;border:6px solid #dbf8b9;border-radius:20px;display:flex;align-items:center;justify-content:center;font-size:75px;color:#ffd874;transform:rotate(-14deg)}@media(orientation:portrait) and (max-width:1000px){#portraitMask{display:flex}#stage{visibility:hidden}}@media(prefers-reduced-motion:reduce){.loader-wheel{animation:none}*{scroll-behavior:auto!important}}


/* v1.1 — fitted landscape scene, with controls fully outside the animations */
#viewport{background:#0b2436 url('assets/junction-poster.webp') center center / cover no-repeat}
#stage{box-shadow:none}
#game.screen.active{display:flex;flex-direction:column;background:#0b263b;isolation:isolate}
#game .game-header{position:relative;top:auto;left:auto;right:auto;flex:0 0 68px;display:flex;align-items:center;gap:12px;padding:7px 23px;margin:0;background:linear-gradient(180deg,#173e55,#0c2539);border-bottom:2px solid #6f9dab;z-index:8}
#game .game-header .circle-btn{width:45px;height:45px}
#game .scene-name{min-width:180px}
#game .scene-name strong{font-size:16px}
#game .scene-name span{font-size:11px}
#game .progress-hud,#game .stat-pill{height:45px}
#game .progress-dots{position:relative;left:auto;top:auto;transform:none;display:flex;align-items:center;justify-content:center;gap:5px;z-index:auto;filter:none;min-width:124px}
#game .progress-dots span{width:11px;height:11px;border-radius:50%;border:1px solid #bed6d9}
#game .progress-dots span.finished{background:#baf181;border-color:#baf181}
#game .progress-dots span.current{background:#ffd45f;border-color:#fff2c7}
#game .scene-viewport{position:relative;flex:1 1 auto;min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;padding:8px 12px;background:radial-gradient(ellipse at center,#4e8a88 0%,#234e5e 60%,#0d2639 100%);overflow:hidden}
#game .video-frame{position:relative;flex:none;aspect-ratio:16/9;max-width:100%;max-height:100%;overflow:hidden;border:2px solid #d8f9f4c0;border-radius:9px;box-shadow:0 12px 26px #0017259a;background:#275666}
#game .scene-video{inset:0;width:100%;height:100%;object-fit:contain;display:block;border:0}
#game .word-on-box{left:38.25%;top:53.35%;width:23.55%;height:13.2%;font-size:53px;color:#193555;text-shadow:0 1px 0 #ffffffde;z-index:2}
#game .word-on-box.long{font-size:42px}
#game .word-on-box.very-long{font-size:32px}
#game .choice-bar{position:relative;bottom:auto;left:auto;right:auto;flex:0 0 102px;width:100%;padding:9px 26px 13px;display:flex;align-items:center;justify-content:space-between;gap:16px;z-index:7;pointer-events:auto;background:linear-gradient(180deg,#112e42,#0b2032);border-top:2px solid #83adb0;box-shadow:0 -8px 18px #00152155}
#game .choice-bar.inactive .route-btn{opacity:.5;filter:saturate(.55);cursor:default}
#game .route-btn{height:76px;flex:0 1 385px;min-width:0;max-width:415px;padding:7px 18px;gap:13px;border-width:3px;border-radius:19px;box-shadow:0 5px 0 #071924,0 7px 13px #04131cba;justify-content:center}
#game .route-btn:disabled:hover{transform:none;filter:saturate(.55)}
#game .route-btn strong{font-size:21px;white-space:nowrap}
#game .route-btn .route-arrow{font-size:39px}
#game .route-btn small{font-size:11px}
#game .fork-icon{flex:1;min-width:155px;max-width:220px;display:flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}
#game .fork-icon small{font-size:11px;letter-spacing:1.25px;margin:0;color:#cde7f2}
#game .guide-label{position:relative;top:auto;left:auto;transform:none;display:block;background:#193e56;border:1px solid #8bb4be;border-radius:12px;box-shadow:none;font-size:13px;letter-spacing:.7px;text-align:center;padding:7px 9px;white-space:nowrap}
#game .correct-toast{top:auto;bottom:25px;z-index:10;padding:10px 19px;font-size:24px;border-width:3px;box-shadow:0 4px 0 #4e7531,0 7px 18px #14271975}
#game .sound-panel{top:74px;right:18px}
#game .results-backdrop,#game .loading-overlay{z-index:30}
@media(orientation:portrait){#portraitMask{display:flex}#stage{visibility:hidden}}


/* v1.2 — visually centred delivery-box text and ride-away fade */
#game .word-on-box{
  top:55.9%; /* Optical centre of the white panel, including font ascenders */
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:1;
  transition:opacity .62s ease-out;
  will-change:opacity;
}
#game .word-on-box.departing{opacity:0}
#game .fork-icon{justify-content:center}


/* v1.3: The scene menu has no editable teacher word-list option. */
.menu-footer{justify-content:flex-end}

/* v1.4 — Whacky Washing scene and large white word-bearing shirt. */
.wash-tile .wash-image{background-image:url('assets/wash-poster.webp');background-position:38% 56%;}
.wash-tile 
.wash-tile.live{border-color:#ddc1ff;box-shadow:0 0 0 3px #d8c0fd33,0 12px 25px #06142899}
#game.washing-mode .scene-viewport{background:radial-gradient(ellipse at center,#9e85c0 0%,#594873 64%,#1a2845 100%)}
#game.washing-mode .video-frame{border-color:#e0cff3;box-shadow:0 12px 26px #15062b7a}
#game.washing-mode .choice-bar{border-top-color:#af8ccb;background:linear-gradient(180deg,#283554,#161e38)}
#game.washing-mode .game-header{border-bottom-color:#ad8fc9;background:linear-gradient(180deg,#34436a,#1a2846)}
#game.washing-mode .fork-icon .guide-label{background:#4a3766;border-color:#c4a4e4}
#game.washing-mode .word-on-box,#game:not(.washing-mode) .wash-shirt{display:none!important}
#game .wash-shirt{position:absolute;z-index:4;left:79.1%;top:54%;width:30%;aspect-ratio:240/230;transform:translate(-50%,-50%) scale(1);transform-origin:50% 50%;filter:drop-shadow(0 6px 7px #1d223a68);pointer-events:none;will-change:top,left,transform,opacity;display:block;opacity:1;}
#game .wash-shirt .shirt-shape{position:absolute;width:100%;height:100%;inset:0;overflow:visible}
#game .wash-shirt .shirt-word{position:absolute;left:31%;right:31%;top:39%;height:38%;display:flex;align-items:center;justify-content:center;text-align:center;font-family:"Edu NSW ACT Hand Pre",cursive;font-size:40px;font-weight:700;letter-spacing:0;line-height:1.04;color:#263958;white-space:nowrap;text-shadow:0 1px 1px #fff;}
#game .wash-shirt .shirt-word.smaller{font-size:34px}
#game .wash-shirt.to-real{animation:washShirtReal 3.25s cubic-bezier(.2,.1,.3,1) forwards}
#game .wash-shirt.to-nonsense{animation:washShirtNonsense 3.25s cubic-bezier(.2,.1,.3,1) forwards}
#game .wash-shirt.hidden-while-finished{opacity:0}
/* Opening door: ~0.8-1.2s; shirt arrives well before the door closes at ~3.5s. */
@keyframes washShirtReal{
  0%,19%{left:79.1%;top:54%;transform:translate(-50%,-50%) scale(1);opacity:1}
  65%{left:22.2%;top:70.4%;transform:translate(-50%,-50%) scale(.24) rotate(-8deg);opacity:1}
  78%,100%{left:22.2%;top:70.4%;transform:translate(-50%,-50%) scale(.12) rotate(-8deg);opacity:0}
}
@keyframes washShirtNonsense{
  0%,19%{left:79.1%;top:54%;transform:translate(-50%,-50%) scale(1);opacity:1}
  65%{left:46.8%;top:70.4%;transform:translate(-50%,-50%) scale(.24) rotate(8deg);opacity:1}
  78%,100%{left:46.8%;top:70.4%;transform:translate(-50%,-50%) scale(.12) rotate(8deg);opacity:0}
}
#game.washing-mode #realBtn{background:linear-gradient(110deg,#d9f7b0,#a4e289)}
#game.washing-mode #nonsenseBtn{background:linear-gradient(110deg,#e7c9fa,#bc96f3);color:#382454}
#game.washing-mode .correct-toast{background:#e3fbb1;border-color:#fff3e1;color:#234024}

/* v1.9 — gentle crossfade from the final motorcycle sort to the sunset.
   The final correct-route video holds its last frame beneath this preloaded video.
   Fade remains entirely inside the image; scene information and controls stay clear. */
#game .finale-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1.35s ease-in-out, visibility 0s linear 1.35s;
  will-change: opacity;
}
#game .finale-video.fading-in {
  visibility: visible;
  opacity: 1;
  transition: opacity 1.35s ease-in-out, visibility 0s;
}


/* v2.1 — celebratory hold and cinematic scene-complete presentation. */
#game.washing-mode .correct-toast.show {
  animation: cleanSortHold 1.8s ease-in-out both;
}
#game.washing-mode .correct-toast.final-sort.show {
  animation-duration: 2.45s;
}
@keyframes cleanSortHold {
  0% {opacity:0;transform:translateX(-50%) scale(.72)}
  12% {opacity:1;transform:translateX(-50%) scale(1.06)}
  22%,77% {opacity:1;transform:translateX(-50%) scale(1)}
  100% {opacity:0;transform:translateX(-50%) scale(.98)}
}
/* The exact last video frame lives beneath the results, regardless of whether
   the browser continues to render an HTML video after its ended event. */
#game .finale-still {
  position:absolute;inset:0;display:block;width:100%;height:100%;
  object-fit:contain;z-index:3;opacity:0;visibility:hidden;pointer-events:none;
}
#game .finale-still.frozen {opacity:1;visibility:visible}
/* Keep the outro image visible. Only the results card supplies contrast;
   there is no heavy full-screen blur or opaque replacement screen. */
#game #completeOverlay {
  background:rgba(7,16,29,.13);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  opacity:0;
  pointer-events:none;
  transition:opacity 1.25s ease-in-out;
}
#game #completeOverlay.revealed {opacity:1}
#game #completeOverlay.interactive {pointer-events:auto}
#game #completeOverlay .complete-card {
  animation:none;
  transform:translateY(14px) scale(.97);
  transition:transform 1.25s ease-out;
  background:linear-gradient(145deg,rgba(19,48,68,.91),rgba(7,28,48,.90));
  box-shadow:0 0 0 4px #081c2e55,0 18px 55px #061321ad;
}
#game #completeOverlay.revealed .complete-card {
  transform:translateY(0) scale(1);
}

/* v2.2 — Karate Chaos, scene 3 of 6. All controls stay outside the artwork. */
.karate-tile .karate-image {background-image:url('assets/karate-poster.webp');background-position:50% 43%}
.karate-tile.live {border-color:#ffd497;box-shadow:0 0 0 3px #f0ad632f,0 12px 25px #06142899}

#game.karate-mode .scene-viewport {background:radial-gradient(ellipse at center,#b9774e 0%,#6f472e 60%,#382822 100%)}
#game.karate-mode .video-frame {border-color:#e4bf91;box-shadow:0 12px 26px #361e0d99}
#game.karate-mode .game-header {border-bottom-color:#d49c64;background:linear-gradient(180deg,#653f31,#34251f)}
#game.karate-mode .choice-bar {border-top-color:#b47c50;background:linear-gradient(180deg,#5c3f2b,#2d241f)}
#game.karate-mode .guide-label {background:#67452c;border-color:#e8b67a}
#game.karate-mode #realBtn {background:linear-gradient(110deg,#f1e5ae,#d8c477);color:#463b1f}
#game.karate-mode #nonsenseBtn {background:linear-gradient(110deg,#ffc59c,#e9a47b);color:#583023}
#game.karate-mode .word-on-box {
  display:flex!important;
  left:10.3%;top:35.55%;width:18.1%;height:14.6%;
  align-items:center;justify-content:center;
  font-size:54px;line-height:1;color:#183344;text-shadow:none;
  letter-spacing:0;z-index:4;
  transition:opacity .55s ease-out;
}
#game.karate-mode .correct-toast {background:#ffe3a7;border-color:#fff7df;color:#573923}
#game.karate-mode .wash-shirt {display:none!important}

/* v2.8 — Blackbeard's Bedlam: pirate ship sorting / word written on blank flag. */
.pirate-tile .pirate-image{background-image:url('assets/pirate-poster.webp');background-position:50% 48%}
.pirate-tile.live{border-color:#ffe0a0;box-shadow:0 0 0 3px #ecbc623f,0 12px 25px #06142899}
#game.pirate-mode .scene-viewport{background:radial-gradient(ellipse at center,#7faac3 0%,#286c88 58%,#123344 100%)}
#game.pirate-mode .video-frame{border-color:#f6df9e;box-shadow:0 12px 30px #001624a1}
#game.pirate-mode .game-header{border-bottom-color:#be934e;background:linear-gradient(180deg,#254b67,#143248)}
#game.pirate-mode .choice-bar{border-top-color:#be934e;background:linear-gradient(180deg,#234861,#132c40)}
#game.pirate-mode .guide-label{background:#3f5666;border-color:#f6d69a}
#game.pirate-mode #realBtn{background:linear-gradient(110deg,#ffedb0,#e9c973);color:#493813}
#game.pirate-mode #nonsenseBtn{background:linear-gradient(110deg,#d0eafc,#8cc5de);color:#163d57}
#game.pirate-mode .word-on-box{
 /* The safe centre of the WHITE FLAG, not the pole. Coordinates are relative
    to the entire video and allow for all phases of the flag's flutter. */
 left:24%;top:20.4%;width:13.2%;height:10%;
 display:flex!important;align-items:center;justify-content:center;
 color:#263a42;font-size:54px;z-index:5;line-height:1;
 letter-spacing:0;white-space:nowrap;transform:none;text-shadow:0 1px 1px #ffffffb8;
}
#game.pirate-mode .correct-toast{background:#ffebaa;border-color:#fff6de;color:#4e3b12}
#game.pirate-mode .wash-shirt{display:none!important}

/* Fishing Frenzy — merged as scene five from v2.10 */
.fishing-tile .fishing-image{background-image:url('assets/fishing-poster.webp');background-position:50% 45%}
.fishing-tile.live{border-color:#9df2d9;box-shadow:0 0 0 3px #80e9b82b,0 12px 25px #06142899}
#game.fishing-mode .scene-viewport{background:radial-gradient(ellipse at center,#6cba9c 0%,#266d72 62%,#123544 100%)}
#game.fishing-mode .video-frame{border-color:#b9f0d4;box-shadow:0 12px 26px #102f2799}
#game.fishing-mode .game-header{border-bottom-color:#77ba9a;background:linear-gradient(180deg,#265b53,#173633)}
#game.fishing-mode .choice-bar{border-top-color:#6fae96;background:linear-gradient(180deg,#275a52,#102c35)}
#game.fishing-mode .guide-label{background:#2e6a51;border-color:#aae8ae}
#game.fishing-mode #realBtn{background:linear-gradient(110deg,#d8f2a2,#a1da7e);color:#234128}
#game.fishing-mode #nonsenseBtn{background:linear-gradient(110deg,#b9f2f5,#7ec7e9);color:#153a48}
#game.fishing-mode .word-on-box{
  display:flex!important;left:59.85%;top:45.35%;width:17.4%;height:10.75%;
  font-size:52px;letter-spacing:0;color:#253b37;text-shadow:none;z-index:4;
  font-family:"Edu NSW ACT Hand Pre",cursive;
  transition:opacity .6s ease-out;
}
#game.fishing-mode .wash-shirt{display:none!important}
#game.fishing-mode .correct-toast{background:#c9f9b4;border-color:#f4ffe4;color:#28502e}

/* v2.10 — Hold Fishing Frenzy's “GREAT CATCH!” text for longer, without
   altering the other scenes or delaying the next word after the banner fades. */
#game.fishing-mode .correct-toast.show {
  animation: fishingCatchHold 2.05s ease-in-out both;
}
@keyframes fishingCatchHold {
  0% {opacity:0;transform:translateX(-50%) scale(.73)}
  12% {opacity:1;transform:translateX(-50%) scale(1.06)}
  22%,85% {opacity:1;transform:translateX(-50%) scale(1)}
  100% {opacity:0;transform:translateX(-50%) scale(.98)}
}


/* v3.2 — Hoop-Shoot Havoc: sixth and final scene. All controls remain
   outside the court film; the word uses the empty black central scoreboard. */
.basketball-tile .basketball-image{background-image:url('assets/basketball-poster.webp');background-position:center 46%}
.basketball-tile.live{border-color:#ffd15c;box-shadow:0 0 0 3px #ffca5433,0 12px 25px #06142899}
#game.basketball-mode .scene-viewport{background:radial-gradient(ellipse at center,#254b99 0%,#10295b 63%,#06132f 100%)}
#game.basketball-mode .video-frame{border-color:#ffcb61;box-shadow:0 12px 30px #000e2cb0}
#game.basketball-mode .game-header{border-bottom-color:#d89b30;background:linear-gradient(180deg,#16386e,#0b2251)}
#game.basketball-mode .choice-bar{border-top-color:#d89b30;background:linear-gradient(180deg,#173970,#0c1d40)}
#game.basketball-mode .guide-label{background:#173c74;border-color:#ffdf88}
#game.basketball-mode #realBtn{background:linear-gradient(110deg,#ffeab0,#ffcb63);color:#493312}
#game.basketball-mode #nonsenseBtn{background:linear-gradient(110deg,#bde7ff,#70bbf5);color:#123652}
#game.basketball-mode .word-on-box{
  display:flex!important;left:39%;top:6.1%;width:22%;height:12.5%;
  align-items:center;justify-content:center;font-size:60px;
  line-height:1;color:#fffcdd;text-shadow:0 0 3px #000,0 0 11px #f5d57d90;
  letter-spacing:.3px;white-space:nowrap;z-index:5;
  transition:opacity .55s ease-out;
}
#game.basketball-mode .wash-shirt{display:none!important}
#game.basketball-mode .correct-toast{background:#fff2a0;border-color:#fff9e3;color:#534212}


/* v3.3 — supplied Edu NSW ACT Hand Pre family: readable handwriting across all six scenes.
   All word sizes are fitted at runtime to the *actual* font metrics after loading. */
:root{font-family:"Edu NSW ACT Hand Pre",cursive;font-synthesis:none}
button,input,select,textarea{font-family:inherit}
.title-block h1{font-family:inherit;font-size:78px;font-weight:700;letter-spacing:-2.6px;line-height:1.13}
.scene-tile strong{font-family:inherit;font-size:28px;line-height:1.07;font-weight:700;letter-spacing:-.35px}
.scene-tile small{font-size:15px;font-weight:600;line-height:1.1}
#game .scene-name strong{font-size:19px;letter-spacing:.1px}
#game .scene-name span{font-size:12px;letter-spacing:.8px}
#game .route-btn strong{font-family:inherit;font-size:25px;line-height:1.06;letter-spacing:-.35px}
#game .route-btn small{font-size:13px;letter-spacing:.25px}
#game .progress-hud span,#game .stat-pill{letter-spacing:.25px}
#game .progress-hud strong,#game .stat-pill strong{font-size:22px}
#game .guide-label{font-size:16px;letter-spacing:0}
#game .word-on-box{font-family:"Edu NSW ACT Hand Pre",cursive!important;font-weight:700!important;font-size:53px;line-height:1.02;letter-spacing:0!important;white-space:nowrap;padding:0 3px;overflow:visible}
/* Optical vertical centres for the supplied handwriting font (the video frame is 16:9). */
#game:not(.karate-mode):not(.pirate-mode):not(.fishing-mode):not(.basketball-mode) .word-on-box{top:55.2%;height:13.2%}
#game.karate-mode .word-on-box{top:35.0%;height:14.6%}
#game.pirate-mode .word-on-box{top:20.0%;height:10.0%}
#game.fishing-mode .word-on-box{top:45.0%;height:10.75%}
#game.basketball-mode .word-on-box{top:5.8%;height:12.5%}
#game .wash-shirt .shirt-word{font-family:"Edu NSW ACT Hand Pre",cursive!important;font-weight:700!important;font-size:47px;line-height:1.04;letter-spacing:0;top:37%;height:38%;left:31%;right:31%;padding:0 1px}
#game .wash-shirt .shirt-word.smaller{font-size:43px}
#game .correct-toast,#game .result-card,#game .result-card h2,#game .result-card h3,#game .action-btn{font-family:"Edu NSW ACT Hand Pre",cursive}
/* Clear hierarchy and breathing room with the larger handwritten letterforms. */
.menu-section-label{color:#eff8ff;text-shadow:0 2px 6px #081c33a0}
#game .scene-name{min-width:210px}
#game .route-btn span:not(.route-arrow):not(.route-mini){gap:4px;justify-content:center;min-width:0}
#game .route-btn small{display:block;font-size:13px;line-height:1.18}
#game .route-btn strong{display:block;font-size:24px;line-height:1.23;margin-top:2px}
#game .progress-hud span{font-size:11px;letter-spacing:0}

/* v3.4 — branded opening, full-screen PLAY, original Galactic Phonics roundel */
#welcome,#intro{background:#060b20;isolation:isolate}
.welcome-art{position:absolute;inset:0;background:url('assets/gp-intro-poster.jpg') center center /cover no-repeat;opacity:.48;transform:scale(1.015)}
.welcome-shade{position:absolute;inset:0;background:radial-gradient(ellipse 65% 65% at 50% 42%,#19335b63 0%,#06112bd6 86%),linear-gradient(180deg,#0d2130a8,#071126d8)}
.welcome-content{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;padding:40px 28px;z-index:2}
.welcome-kicker{font-weight:700;letter-spacing:4px;font-size:16px;color:#ffdf86;text-shadow:0 2px 12px #091b2c}
#welcomeTitle{font-size:clamp(56px,7.2vw,91px);font-weight:700;line-height:1.12;letter-spacing:-1px;margin:15px 0 6px;color:#f8fcf6;text-shadow:0 6px 0 #0b2851,0 12px 32px #061020}
#welcomeTitle span{font-size:.6em;color:#ffd56c}#welcomeTitle .welcome-question{font-size:1em;color:#b4f77e}
.welcome-content p{font-size:23px;color:#eff6f1;font-weight:600;margin:9px 0 32px;text-shadow:0 2px 8px #081527}
.welcome-play{font-family:inherit;font-weight:700;font-size:34px;letter-spacing:2px;color:#122b36;background:linear-gradient(140deg,#dcffaa,#9feb80);border:4px solid #f7ffda;box-shadow:0 8px 0 #487747,0 13px 28px #031a299e;border-radius:24px;min-width:273px;min-height:92px;display:flex;align-items:center;justify-content:center;gap:24px;transition:transform .18s,filter .18s}
.welcome-play:hover{transform:translateY(-3px);filter:brightness(1.08)}.welcome-play:active{transform:translateY(4px);box-shadow:0 4px 0 #487747}
.welcome-play span{font:700 42px system-ui,sans-serif}
.welcome-hint{margin-top:31px;font-size:13px;letter-spacing:1.9px;color:#cfdeeb;font-weight:600}
.welcome-gp-link{position:absolute;z-index:4;top:22px;right:34px;width:62px;height:62px}
.gp-link{display:grid;place-items:center;text-decoration:none;border-radius:50%;flex:0 0 auto;box-shadow:0 4px 15px #050e2896;transition:transform .18s,filter .18s;background:#fff}
.gp-link:hover{transform:scale(1.08);filter:brightness(1.08)}
.gp-link img{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}
.circle-btn.gp-link{padding:0;overflow:hidden;border:2px solid #f4f6ee}
#game .game-header .circle-btn.gp-link{width:45px;height:45px}
.gp-link:focus-visible{outline:4px solid #ffe178;outline-offset:4px}
.intro-video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#02030b}
.intro-skip{position:absolute;bottom:25px;right:28px;z-index:2;background:#0d2845b8;color:#f4f7ff;border:1px solid #f3f6ffc0;border-radius:22px;padding:9px 19px;font-size:13px;font-weight:700;letter-spacing:1px}
.intro-skip:hover{background:#1b456a}


/* v3.5 — Handwriting ONLY on the children's actual word stimuli.
   All navigation, instructions, result feedback and choice labels return to the
   original friendly game typography. No supplied font binaries are distributed. */
:root { font-family:"Nunito","Trebuchet MS",system-ui,sans-serif; }
button,input,select,textarea { font-family:inherit; }
.title-block h1,
.scene-tile strong,
#game .route-btn strong,
#game .correct-toast,
#game .result-card h2,
#game .result-card h3,
#welcomeTitle {font-family:"Baloo 2","Arial Rounded MT Bold",system-ui,sans-serif;}
#game .result-card, #game .action-btn {font-family:"Nunito","Trebuchet MS",system-ui,sans-serif;}
.title-block h1{font-size:79px;line-height:1.16;letter-spacing:-2px}
.scene-tile strong{font-size:26px;line-height:1.13;letter-spacing:0}
.scene-tile small{font-size:13px;font-weight:800;line-height:1.15}
#game .word-on-box,
#game .wash-shirt .shirt-word {
  font-family:"Edu NSW ACT Hand Pre",cursive!important;
  font-weight:700!important;
  letter-spacing:0!important;
}

/* Larger film, smaller interface: free vertical space without cropping or
   covering the 16:9 animations, and keep both answer choices outside the film. */
#game .game-header {
  flex:0 0 50px;
  padding:4px 15px;
  gap:9px;
  border-bottom-width:1px;
}
#game .game-header .circle-btn,
#game .game-header .circle-btn.gp-link {width:37px;height:37px;border-width:2px;}
#game .game-header .circle-btn svg{width:21px;height:21px}
#game .scene-name {min-width:170px;gap:0;line-height:1.08}
#game .scene-name strong {font-size:15px;letter-spacing:.15px}
#game .scene-name span {font-size:9px;letter-spacing:.9px}
#game .progress-hud,#game .stat-pill {height:37px;padding:0 11px;border-width:1px;border-radius:11px;gap:6px}
#game .progress-hud {padding:0 14px}
#game .progress-hud span {font-size:9px;line-height:1.05}
#game .progress-hud strong {font-size:18px;line-height:1.1}
#game .stat-pill {font-size:11px;letter-spacing:.2px}
#game .stat-pill .stat-icon{font-size:16px}
#game .stat-pill strong{font-size:19px}
#game .progress-dots {gap:4px;min-width:111px}
#game .progress-dots span {width:10px;height:10px}
#game .scene-viewport{padding:3px 5px}
#game .video-frame {border-width:1px;border-radius:6px;box-shadow:0 5px 15px #00172577}
#game .choice-bar {
  flex:0 0 68px;
  padding:5px 21px 6px;
  gap:10px;
  border-top-width:1px;
  box-shadow:0 -4px 12px #00152155;
}
#game .route-btn {
  height:56px;
  flex:0 1 403px;
  max-width:422px;
  padding:5px 14px;
  gap:10px;
  border-width:2px;
  border-radius:15px;
  box-shadow:0 3px 0 #071924,0 5px 8px #04131c99;
}
#game .route-btn strong {font-size:20px;line-height:1.06;letter-spacing:0}
#game .route-btn small {font-size:10px;line-height:1.1;letter-spacing:.55px}
#game .route-btn span:not(.route-arrow):not(.route-mini){gap:1px}
#game .route-btn .route-arrow{font-size:32px}
#game .fork-icon{min-width:115px;max-width:155px;flex:1}
#game .guide-label {font-size:12px;letter-spacing:.5px;padding:6px 9px;border-radius:10px}
#game .correct-toast {bottom:12px;font-size:23px}
#game .sound-panel{top:51px}

/* Remaining non-word interface surfaces: never use the handwriting face. */
#game .result-symbol,#game .result-stats strong,#game .loading-overlay strong,#portraitMask h2{font-family:"Baloo 2","Arial Rounded MT Bold",system-ui,sans-serif;}


/* v3.6 — cinematic scene layout: 16:9 animation + adaptive right-hand info rail.
   The same realBtn / nonsenseBtn are now large touch-friendly arrow overlays
   over the film, and automatically disappear while the chosen action runs. */
#game.screen.active {
  display:grid;
  grid-template-columns:minmax(0,1fr) var(--rail-width,136px);
  grid-template-rows:minmax(0,1fr);
}
#game .scene-viewport {
  grid-column:1;
  grid-row:1;
  min-width:0;
  min-height:0;
  width:100%;
  height:100%;
  padding:2px;
  justify-content:center;
  align-items:center;
}
#game .video-frame {
  max-width:100%;
  max-height:100%;
  aspect-ratio:16/9;
  border:1px solid #d8f9f4b0;
  box-shadow:0 4px 12px #03162999;
  overflow:hidden;
}
#game .game-header {
  grid-column:2;
  grid-row:1;
  position:relative;
  width:100%;height:100%;min-width:0;min-height:0;
  inset:auto;
  margin:0;
  border-bottom:0;
  border-left:2px solid #769dae;
  padding:12px 9px 12px;
  display:flex;
  flex:initial;
  flex-direction:column;
  align-items:stretch;
  gap:13px;
  overflow:hidden;
  background:linear-gradient(155deg,#1a405c,#091a30);
  box-shadow:-8px 0 20px #020f1e7d;
}
#game .rail-top-buttons,
#game .rail-bottom-buttons {display:flex;align-items:center;justify-content:space-around;gap:5px;}
#game .game-header .circle-btn,#game .game-header .circle-btn.gp-link {
  width:var(--rail-icon-size,48px);height:var(--rail-icon-size,48px);min-width:0;flex:0 0 var(--rail-icon-size,48px);padding:0;
  border-width:2px;
}
#game .game-header .circle-btn svg {width:50%;height:50%}
#game .game-header .gp-link img {width:100%;height:100%;object-fit:cover}
#game .scene-name {min-width:0;width:100%;text-align:center;gap:4px;line-height:1.14}
#game .scene-name strong {font:800 15px/1.12 "Nunito",system-ui,sans-serif;letter-spacing:.15px;overflow-wrap:break-word}
#game .scene-name span {font-size:10px;letter-spacing:.4px;opacity:.75}
#game .rail-counters {display:flex;flex-direction:column;gap:8px;width:100%;}
#game .progress-hud {
  width:100%;height:69px;min-width:0;
  padding:6px 4px;border:1px solid #99c8dd;border-radius:14px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;
}
#game .progress-hud span {font:800 10px "Nunito",system-ui,sans-serif;letter-spacing:1px}
#game .progress-hud strong {font:900 25px/1.1 "Nunito",system-ui,sans-serif}
#game .rail-scoreline {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;width:100%}
#game .stat-pill {
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:1px;width:100%;height:80px;min-width:0;margin:0;
  padding:5px 1px;border-width:1px;border-radius:12px;
}
#game .stat-pill span:nth-of-type(2) {font:800 9px "Nunito",system-ui,sans-serif;letter-spacing:0}
#game .stat-pill .stat-icon {font-size:14px;line-height:1}
#game .stat-pill strong {font:900 23px/1.1 "Nunito",system-ui,sans-serif;margin:0}
#game .rail-progress {display:flex;flex-direction:column;align-items:center;gap:8px;min-width:0;width:100%;}
#game .rail-progress>span {color:#b9d3e6;font:800 10px "Nunito",system-ui,sans-serif;letter-spacing:1px}
#game .progress-dots {
  position:relative;transform:none;left:auto;top:auto;
  min-width:0;display:grid;grid-template-columns:repeat(5,13px);
  justify-content:center;gap:6px;width:100%;
}
#game .progress-dots span {width:13px;height:13px;border-radius:50%}
#game .rail-spacer {flex:1;min-height:4px}
#game .rail-hint {font:800 10px/1.35 "Nunito",system-ui,sans-serif;text-align:center;letter-spacing:.6px;color:#bfddeb}
#game .choice-bar {
  position:absolute;
  inset:0;
  display:block;
  z-index:8;
  width:100%;height:100%;
  margin:0;padding:0;
  border:0;background:transparent;box-shadow:none;
  pointer-events:none;
}
#game .choice-bar>* {pointer-events:none}
#game .choice-bar .fork-icon {display:none!important}
#game .choice-bar .route-btn {
  position:absolute;
  top:82%;
  width:126px;height:90px;
  max-width:none;min-width:0;
  padding:5px 11px;
  border:3px solid #fcffec;
  border-radius:23px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:0;
  font:900 18px "Nunito",system-ui,sans-serif;
  backdrop-filter:blur(4px);
  box-shadow:0 5px 0 #112330aa,0 7px 20px #081e2988;
  pointer-events:auto;
  opacity:.94;
  transition:opacity .25s ease,filter .15s ease,box-shadow .15s ease;
  transform:translate(-50%,-50%);
}
#game .choice-bar .route-btn.real {left:13%;background:#bdf58dde;color:#193b21}
#game .choice-bar .route-btn.nonsense {left:87%;background:#a9e6ffdf;color:#122e4c}
#game .route-btn .route-arrow {font:900 42px/1 system-ui,sans-serif;flex:0 0 auto}
#game .route-btn .arrow-short {font:900 16px/1 "Nunito",system-ui,sans-serif;letter-spacing:-.5px}
#game .route-btn .route-choice-data {display:none!important}
#game .choice-bar .route-btn.nonsense {flex-direction:column-reverse}
#game .choice-bar .route-btn:hover:not(:disabled) {
  filter:brightness(1.08);
  transform:translate(-50%,-50%);
  box-shadow:0 5px 0 #112330aa,0 0 0 5px #fff5;
  opacity:1;
}
#game .choice-bar .route-btn:active:not(:disabled){transform:translate(-50%,-49%) scale(.97)}
#game .choice-bar.inactive .route-btn,
#game .choice-bar .route-btn:disabled {
  opacity:0;pointer-events:none;visibility:hidden;
}
/* Per-scene positions keep the transparent arrows close to the answer destinations. */
#game.washing-mode #realBtn {left:22%;top:88%}
#game.washing-mode #nonsenseBtn {left:48%;top:88%}
#game.karate-mode #realBtn {left:20%;top:83%}
#game.karate-mode #nonsenseBtn {left:79%;top:83%}
#game.pirate-mode #realBtn {left:15%;top:85%}
#game.pirate-mode #nonsenseBtn {left:85%;top:85%}
#game.fishing-mode #realBtn {left:20%;top:83%}
#game.fishing-mode #nonsenseBtn {left:81%;top:83%}
#game.basketball-mode #realBtn {left:14%;top:80%}
#game.basketball-mode #nonsenseBtn {left:86%;top:80%}
#game .results-backdrop,#game .loading-overlay{right:var(--rail-width,136px)}
#game .correct-toast {bottom:14%;left:calc((100% - var(--rail-width,136px))/2)}
#game .sound-panel {right:calc(var(--rail-width,136px) + 6px);top:14px}
@media (prefers-reduced-motion:reduce) {
  #game .choice-bar .route-btn {transition:none}
}

/* Larger readable info and 44px physical touch targets on extra-wide phones. */
#stage.wide-side-rail #game .game-header {padding:14px 16px;gap:12px}
#stage.wide-side-rail #game .scene-name strong {font-size:23px}
#stage.wide-side-rail #game .scene-name span {font-size:15px}
#stage.wide-side-rail #game .progress-hud {height:88px}
#stage.wide-side-rail #game .progress-hud span {font-size:15px}
#stage.wide-side-rail #game .progress-hud strong {font-size:34px}
#stage.wide-side-rail #game .stat-pill {height:93px}
#stage.wide-side-rail #game .stat-pill span:nth-of-type(2) {font-size:14px}
#stage.wide-side-rail #game .stat-pill strong {font-size:34px}
#stage.wide-side-rail #game .rail-progress>span,#stage.wide-side-rail #game .rail-hint {font-size:14px}
#stage.wide-side-rail #game .progress-dots {grid-template-columns:repeat(10,15px);gap:7px}
#stage.wide-side-rail #game .progress-dots span {height:15px;width:15px}

/* v3.7 — a shared six-scene illustrated backdrop, legible destination arrows,
   a configurable handwritten grapheme label, and real per-scene loading bars. */
#menu .menu-backdrop {
  background-image:url('assets/menu-background.webp');
  background-position:center;
  background-size:cover;
  filter:none;
  transform:none;
}
#menu .menu-overlay {
  background:linear-gradient(180deg,rgba(5,22,37,.22) 0%,rgba(8,27,45,.37) 45%,rgba(4,15,32,.46) 100%);
  box-shadow:inset 0 0 90px rgba(3,14,29,.22);
}
#menu .menu-header,#menu .title-block,#menu .menu-section-label,#menu .scene-grid,#menu .menu-footer {z-index:2}
#menu .title-block h1 {text-shadow:0 4px 0 #0b2448,0 8px 18px #041426,0 0 10px #09202b}
#menu .ribbon {box-shadow:0 3px 0 #815419,0 0 10px #152a43}
#menu .menu-section-label {text-shadow:0 2px 4px #071725,0 0 8px #0c2537;color:#f9fcff;gap:16px;}
#menu .word-set-label {
  font:700 29px/1 "Edu NSW ACT Hand Pre",cursive;
  letter-spacing:0;
  color:#122c3a;
  text-shadow:none;
  background:linear-gradient(135deg,#fff6cb,#fce29a);
  border:2px solid #fff9d7;
  border-radius:18px;
  padding:5px 19px 8px;
  box-shadow:0 4px 0 #7b6237,0 5px 16px #08152b8a;
  white-space:nowrap;
  transform:rotate(-1.5deg);
}
#menu .scene-tile {box-shadow:0 7px 22px #061a34c9;}
#menu .scene-tile.live:before {background:linear-gradient(0deg,#071a35fa 1%,#06142b9e 51%,#0b1e3a0f 100%)}
#menu .scene-tile.live {border-color:#e4ffd5}
#game .choice-bar .route-btn {
  width:138px;height:94px;
  border:3px solid #fff;
  border-radius:21px;
  backdrop-filter:blur(6px);
  opacity:1;
  box-shadow:0 5px 0 #081f2bda,0 8px 20px #041629d9,0 0 0 4px #ffffff48;
}
#game .choice-bar .route-btn.real {background:rgba(192,248,155,.94);color:#173e1c}
#game .choice-bar .route-btn.nonsense {background:rgba(153,223,255,.94);color:#123a60}
#game .choice-bar .route-btn .route-arrow {
  display:flex;align-items:center;justify-content:center;
  width:66px;height:52px;
  font:900 51px/1 system-ui,sans-serif;
  background:rgba(255,255,255,.77);
  border-radius:15px;
  border:2px solid rgba(255,255,255,.9);
  text-shadow:0 2px 1px #ffffffd0;
  box-shadow:inset 0 1px 4px #ffffffa8,0 2px 5px #001b306b;
  transform:translateZ(0);
}
#game .choice-bar .route-btn .arrow-short {font:900 17px/1.1 "Nunito",system-ui,sans-serif;letter-spacing:-.25px;margin-top:3px}
#game .choice-bar .route-btn:hover:not(:disabled) {box-shadow:0 6px 0 #081f2b,0 8px 26px #001225,0 0 0 5px #fff9}
#game .loading-overlay {
  background:linear-gradient(145deg,rgba(9,27,51,.97),rgba(6,24,42,.97));
  gap:12px;
  padding:35px 46px;
  text-align:center;
}
#game .loading-emblem {color:#ffe18a;text-shadow:0 0 20px #f5df6a88;font:900 48px/1 "Baloo 2",sans-serif}
#game .loading-overlay strong {font-size:clamp(18px,2.5vw,29px);line-height:1.1;max-width:90%}
#game .loading-overlay #loadingText {font:800 15px/1.25 "Nunito",sans-serif;color:#d9eaff;max-width:95%}
#game .loading-track {
  width:min(520px,82%);height:27px;
  margin:7px 0 0;
  border:3px solid #d2eaff;border-radius:18px;
  background:#071628;
  box-shadow:inset 0 2px 4px #020e23,0 0 20px #a2f5aa33;
  overflow:hidden;
}
#game .loading-fill {
  width:0;height:100%;border-radius:14px;
  background:linear-gradient(90deg,#94db74,#baf19b 59%,#f0f4a7);
  transition:width .18s ease-out;
}
#game .loading-percent {font:900 25px "Nunito",sans-serif;letter-spacing:.5px;color:#ecffd4}
#game .loading-actions {display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;margin-top:10px}
#game .loading-actions button {border:2px solid #dbefff;border-radius:11px;background:#1a405e;color:white;font:800 13px "Nunito",sans-serif;padding:10px 17px;min-height:42px;}
#game .loading-actions button#retryLoadBtn {background:#d5f8a3;border-color:#fff5d8;color:#163529}
#game .loading-actions button[hidden] {display:none}
#game .loading-overlay #loadingHeading {color:#fff9ec!important;text-shadow:0 2px 10px #050c24;font-weight:900}

/* v3.8 — centre the title in the illustrated background's green clearing. */
#menu .title-block {
  position:absolute;top:30.5%;left:50%;transform:translateX(-50%);
  margin:0;width:min(810px,72%);min-height:116px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:5px 18px 10px;border-radius:32px;
  background:radial-gradient(ellipse,rgba(12,60,44,.47),rgba(12,60,44,.26) 72%,transparent 100%);
}
#menu .title-block h1 {font:800 66px/1.04 "Baloo 2",system-ui,sans-serif;letter-spacing:-1.3px;margin:3px 0 0;white-space:nowrap}
#menu .title-block .or{font-size:.63em;vertical-align:11px}
#menu .title-block p {font:800 13px/1.2 "Nunito",system-ui,sans-serif;margin:2px 0 0}
#menu .title-block .ribbon {font:900 10px/1.15 "Nunito",system-ui,sans-serif;letter-spacing:1.1px;padding:5px 18px}
#menu .menu-section-label {position:absolute;top:51.1%;left:50%;transform:translateX(-50%);margin:0;width:92%;}
#menu .scene-grid {position:absolute;top:57.3%;left:50%;transform:translateX(-50%);width:92%;height:36%;grid-template-rows:repeat(2,minmax(0,1fr));gap:9px;}
#menu .scene-tile {border-radius:15px;padding:10px 14px!important}
#menu .scene-tile strong {font:800 22px/1.04 "Baloo 2",system-ui,sans-serif;white-space:nowrap}
#menu .scene-tile small{font:800 11px/1.2 "Nunito",system-ui,sans-serif}
#menu .menu-footer {position:absolute;bottom:1.1%;left:50%;transform:translateX(-50%);margin:0;width:92%}
/* Thick, softly bent cartoon arrows with rounded ends and a white highlight. */
#game .choice-bar .route-btn {border:4px solid #fafffc;border-radius:25px;box-shadow:0 7px 0 #123144ee,0 13px 25px #061f32bb,0 0 0 4px #ffffff4a}
#game .route-btn .cartoon-arrow {display:block;flex:0 0 auto;width:83px;height:60px;background:transparent;border:0;box-shadow:none;border-radius:0;filter:drop-shadow(0 4px 1px #183a4a78);overflow:visible}
#game .cartoon-arrow .arrow-shadow{fill:#16354d;stroke:#16354d;stroke-width:9;stroke-linejoin:round}
#game .cartoon-arrow .arrow-body{fill:#f6ffdb;stroke:#15334c;stroke-width:5;stroke-linejoin:round;stroke-linecap:round}
#game .cartoon-arrow .arrow-shine{fill:none;stroke:#fff;stroke-width:5;stroke-linecap:round;stroke-linejoin:round}
#game .route-btn.real .cartoon-arrow .arrow-body{fill:#eaff96}
#game .route-btn.nonsense .cartoon-arrow .arrow-body{fill:#eff8ff}
#game .choice-bar .route-btn .arrow-short{font-size:19px;letter-spacing:0;font-weight:900}
/* Status stays in the sidebar throughout the complete successful motorbike film. */
#game .rail-right-way {display:none;align-items:center;justify-content:center;gap:5px;flex-wrap:wrap;text-align:center;font:900 19px/1.1 "Baloo 2",system-ui,sans-serif;color:#203e21;background:#d5fca5;border:3px solid #fff7d5;border-radius:17px;padding:9px 4px;box-shadow:0 5px 0 #527841;max-width:100%;}
#game .rail-right-way.visible {display:flex;animation:railSuccessIn .22s ease-out both}
#game .rail-right-way span{font-size:26px;line-height:1}
@keyframes railSuccessIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}
#stage.wide-side-rail #game .rail-right-way{font-size:26px;padding:14px 6px}
/* Soft blackout crossfade allows one mobile-friendly decoder, no second action video. */
#game .video-transition-mask {position:absolute;inset:0;z-index:4;pointer-events:none;opacity:0;background:linear-gradient(130deg,rgba(6,24,35,.93),rgba(10,37,55,.93));transition:opacity .26s ease-in-out;}
#game .video-transition-mask.active {opacity:1}
#game .resume-video-btn {position:absolute;z-index:12;left:50%;top:50%;transform:translate(-50%,-50%);min-width:270px;max-width:85%;padding:18px 24px;border:3px solid #fffad3;border-radius:22px;background:#eafa9c;color:#15334c;box-shadow:0 8px 0 #315f48;font:900 22px/1.15 "Baloo 2",system-ui,sans-serif;text-align:center}
#game .resume-video-btn[hidden]{display:none}
/* Retry must be legible after viewport scaling on landscape mobiles. */
#game #retryBtn{font:900 39px/1.05 "Baloo 2",system-ui,sans-serif;min-height:79px;padding:15px 30px;white-space:nowrap;letter-spacing:.1px}
#game .wrong-card{padding:25px 27px 27px}
#game .wrong-card h2{margin:5px 0}

/* v3.9: restore full-size scene tiles; keep the word-set badge on its own row. */
#menu .menu-backdrop{background-image:url('assets/menu-background.webp')!important;background-position:center!important;background-size:cover!important;}
#menu .menu-overlay{background:linear-gradient(180deg,rgba(4,20,34,.40),rgba(6,22,36,.41) 32%,rgba(3,15,29,.48) 100%);}
#menu .title-block{top:14.3%;min-height:112px;width:min(830px,75%);background:radial-gradient(ellipse,rgba(9,45,37,.66),rgba(8,40,36,.43) 74%,transparent);}
#menu .title-block h1{font-size:62px;}
#menu .title-block p{font-size:13px;}
#menu .menu-section-label{top:35.9%;width:1110px;max-width:90%;height:42px;align-items:center;z-index:4;}
#menu .scene-grid{top:42%;width:1110px;height:367px;max-width:90%;gap:14px;}
#menu .scene-tile{border-radius:19px;padding:16px 20px!important;}
#menu .scene-tile strong{font-size:27px;}
#menu .scene-tile small{font-size:13px;}
#menu .word-set-label{display:inline-flex;align-items:center;justify-content:center;
  position:relative;flex:0 0 auto;margin:0;font-size:28px;line-height:1;
  padding:7px 21px 9px;white-space:nowrap;transform:none;}
#menu .menu-footer{bottom:.8%;}
/* Remove only the inner boxed background around each arrow. Retain the larger outer tap surface. */
#game .choice-bar .route-btn .cartoon-arrow{
  background:none!important;border:0!important;border-radius:0!important;
  box-shadow:none!important;backdrop-filter:none!important;
  width:84px!important;height:61px!important;padding:0!important;
}
#game .choice-bar .route-btn .cartoon-arrow .arrow-body{stroke-width:5.5;}
#game #startLoadedSceneBtn{background:#ceefa3;color:#19342c;font-size:18px;font-weight:900;}
/* Keep the word-set badge safely clear of the restored large scene tiles. */
#menu .menu-section-label{top:34.5%;}

/* v4.0: darken the new six-scene artwork without hiding the illustrated details.
   Lower only the title; reserve the word-set row and scene tiles as before. */
#menu .menu-overlay{
  background:linear-gradient(180deg,rgba(3,15,28,.55) 0%,rgba(5,21,34,.57) 38%,rgba(2,14,27,.59) 100%);
}
#menu .title-block{top:16.0%;}


/* v4.2: FIX BLANK SCENES ON MOBILE AND DESKTOP.
   The selection bar became a full-frame transparent click layer in v3.6.
   Older scene-specific rules still painted opaque gradients across that
   full frame for washing, karate, pirate, fishing and basketball.
   As a result, videos could play normally behind a coloured covering.
   Keep the full-frame click targets but NEVER paint the bar itself. */
#game .video-frame #choiceBar {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* v4.3: success feedback belongs in the information rail, not over the film. */
#game .correct-toast {display:none!important}
#game .rail-right-way {overflow-wrap:break-word;hyphens:none;box-sizing:border-box;min-width:0;width:100%;padding:11px 5px;line-height:1.04}
#stage:not(.wide-side-rail) #game .rail-right-way {font-size:clamp(15px,1.55vw,19px)}


/* v4.4 — motion and feedback. Keep videos unobstructed and the side rail compact. */
#game .progress-dots span {transition:background-color .28s ease,border-color .28s ease,transform .28s ease,box-shadow .28s ease;}
#game .progress-dots span.just-sorted{animation:wordDotPop .6s cubic-bezier(.22,1.5,.4,1) both;}
@keyframes wordDotPop{0%{transform:scale(.65)}42%{transform:scale(1.65);box-shadow:0 0 0 5px #c1ff8888}100%{transform:scale(1);box-shadow:0 0 0 0 #c1ff8800}}
#game .choice-bar.acknowledging .route-btn.is-picked,
#game .choice-bar.acknowledging.inactive .route-btn.is-picked,
#game .choice-bar.acknowledging .route-btn.is-picked:disabled{visibility:visible!important;opacity:1!important;filter:brightness(1.2);pointer-events:none;animation:arrowConfirm .17s cubic-bezier(.2,1.2,.4,1) both;}
@keyframes arrowConfirm{0%{transform:translate(-50%,-50%) scale(1)}55%{transform:translate(-50%,-50%) scale(1.11)}100%{transform:translate(-50%,-50%) scale(1.035)}}
#game .scene-instruction{display:none;min-width:0;text-align:center;color:#eafbf1;background:linear-gradient(135deg,#18775dc9,#123953);border:1px solid #c9eed3b8;border-radius:12px;padding:7px 4px;font:800 clamp(10px,1.1vw,13px)/1.2 "Nunito",system-ui,sans-serif;box-shadow:0 3px 9px #0018;}
#game .scene-instruction.visible{display:block;animation:instructionIn .32s ease-out both;}
#game .scene-instruction.leaving{animation:instructionOut .35s ease-in both;}
@keyframes instructionIn{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
@keyframes instructionOut{to{opacity:0;transform:translateY(-4px)}}
/* The handwriting font stays restricted to real and nonsense words. */
#game .word-on-box.word-arriving{animation:sceneWordEntrance .42s ease-out both;}
#game .wash-shirt.word-arriving{animation:shirtWordEntrance .42s ease-out both;}
@keyframes sceneWordEntrance{from{opacity:0;filter:blur(3px);scale:.93}to{opacity:1;filter:blur(0);scale:1}}
@keyframes shirtWordEntrance{from{opacity:0;filter:blur(3px);scale:.94}to{opacity:1;filter:blur(0);scale:1}}
#menu .scene-tile{position:relative}
#menu .scene-completed-mark{position:absolute;top:7px;right:8px;z-index:8;display:none;place-items:center;width:30px;height:30px;border-radius:50%;border:2px solid white;background:#278b4f;color:#fff;font:900 21px/1 "Nunito",system-ui,sans-serif;box-shadow:0 3px 8px #0019;pointer-events:none;}
#menu .scene-tile.scene-finished .scene-completed-mark{display:grid;animation:stampIn .25s ease-out both}
@keyframes stampIn{from{transform:rotate(-12deg) scale(.6);opacity:0}to{transform:rotate(0) scale(1);opacity:1}}
#game .completion-stars{display:flex;gap:6px;align-items:center;justify-content:center;line-height:1;font-size:clamp(24px,3.5vw,42px);margin:1px auto 5px;color:#7d8b91;}
#game .completion-stars span.earned{color:#ffd54d;text-shadow:0 2px 2px #53370b,0 0 6px #ffb23f66;}
#game .completion-stars.celebrate span.earned{animation:starReveal .5s cubic-bezier(.24,1.5,.4,1) both;}
#game .completion-stars.celebrate span:nth-child(2){animation-delay:.12s}
#game .completion-stars.celebrate span:nth-child(3){animation-delay:.24s}
@keyframes starReveal{from{opacity:.3;transform:scale(.45) rotate(-20deg)}to{opacity:1;transform:scale(1) rotate(0)}}
@media (max-height:420px){#game .scene-instruction{font-size:10px;padding:4px 2px;}#game .completion-stars{font-size:24px;margin:0}}
@media (prefers-reduced-motion:reduce){#game .progress-dots span.just-sorted,#game .choice-bar .route-btn.is-picked,#game .scene-instruction.visible,#game .scene-instruction.leaving,#game .word-on-box.word-arriving,#game .wash-shirt.word-arriving,#game .completion-stars.celebrate span.earned{animation:none!important}}

/* v4.5 — interface typeface remains separate from pupil word lettering. */
#game .correct-toast,
#game .result-card h2,
#game .result-card h3,
#game .loading-overlay strong {
  font-family:"Baloo 2","Arial Rounded MT Bold",system-ui,sans-serif;
}
#game .result-card p,
#game .result-stats,
#game .action-btn {
  font-family:"Nunito","Trebuchet MS",system-ui,sans-serif;
}
/* The Edu NSW ACT Hand Pre family is reserved for #wordOnBox, #shirtWord,
   and the deliberately version-specific #wordSetLabel. */
