:root{
  --navy:#06154c; --navy2:#08256f; --blue:#074ab4; --cyan:#35cfff;
  --gold:#ffd126; --gold2:#ffb80b; --cream:#f5f4ff; --ink:#071b58;
  --green:#29cd67; --red:#ed3348;
}
*{box-sizing:border-box} html,body{margin:0;min-height:100%;font-family:Arial,Helvetica,sans-serif;background:#020412;color:white} button,input{font:inherit}.hidden{display:none!important}
.mobile-controlbar{display:none}

/* login */
.start-screen{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 50% 10%,#1744ba 0,#081553 50%,#020417 100%)}
.start-card{width:min(560px,94vw);padding:30px;border-radius:34px;background:linear-gradient(180deg,#0c3aa4,#06195d);border:3px solid #55cfff;box-shadow:0 0 50px #188eff88,inset 0 0 24px #7ce5ff2e;text-align:center}
.start-logo{display:flex;align-items:center;justify-content:center;gap:12px}.speech-logo{display:inline-grid;width:clamp(50px,5vw,74px);filter:drop-shadow(0 0 9px #29cfff)}.speech-logo svg{width:100%;height:auto}.start-logo strong{font-size:42px;font-style:italic;letter-spacing:-2px}.start-logo em{font-style:normal;color:var(--gold)}.start-sub{font-weight:800;margin:10px 0 24px}.start-card label{display:block;text-align:left;font-weight:900;margin:12px 0}.start-card input{width:100%;margin-top:6px;border:2px solid #8cb6f0;border-radius:15px;padding:14px;font-size:18px}.start-card button{width:100%;padding:15px;border:0;border-radius:19px;background:linear-gradient(#ffe45e,#ffba07);color:#071653;font-weight:1000;font-size:24px;box-shadow:0 6px 0 #6b4700;cursor:pointer}.start-error{margin-top:12px;padding:10px;border-radius:12px;background:#fff3f3;color:#a7192b;font-weight:900}

/* exact approved game proportions: 3:2 canvas, responsive without cropping */
.game{min-height:100vh;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#020412}
.game-shell{position:relative;width:min(100vw,calc(100vh * 1.5),1600px);aspect-ratio:3/2;overflow:hidden;border-radius:clamp(18px,2.3vw,38px);background:
 radial-gradient(circle at 16% 84%,#058aff38 0,transparent 24%),
 linear-gradient(180deg,#071a65 0,#0a3fa9 31%,#075fc8 72%,#062271 100%);
 border:2px solid #248be7;box-shadow:0 0 44px #000c,inset 0 0 34px #58d8ff33}
.game-shell:before{content:"";position:absolute;inset:0;pointer-events:none;background:
 linear-gradient(120deg,transparent 0 67%,#33b9ff15 67.3% 67.8%,transparent 68.1%),
 linear-gradient(24deg,transparent 0 38%,#4db8ff0e 38.3% 39%,transparent 39.2%);}

/* top HUD */
.topbar{position:relative;z-index:2;height:14%;display:grid;grid-template-columns:2.45fr 1.9fr .62fr .62fr;gap:1%;align-items:center;padding:1.05% 1.8%;background:linear-gradient(180deg,#0b2a88,#07175b);border-bottom:2px solid #3ed2ff;box-shadow:0 5px 16px #00103fa0}
.brand{display:flex;align-items:center;gap:2%}.brand .speech-logo{width:clamp(48px,4.8vw,74px)}.brand-title{font-size:clamp(28px,3.25vw,51px);font-weight:1000;font-style:italic;line-height:.86;letter-spacing:-2px;text-shadow:0 4px 0 #02113b}.brand-title span{color:var(--gold)}.brand-sub{margin-top:7px;font-size:clamp(11px,1.15vw,18px);font-weight:900;font-style:italic;white-space:nowrap}
.hud-meter,.hud-stat{height:78%;border:2px solid #3470cc;border-radius:20px;background:linear-gradient(180deg,#0a226f,#061448);box-shadow:inset 0 0 17px #277dff36,0 3px 9px #0006}.hud-meter{position:relative;padding:5px 14px}.hud-label,.hud-stat>span{text-align:center;display:block;font-weight:900;font-size:clamp(11px,1.1vw,17px)}.meter-row{display:flex;align-items:center;gap:9px;height:62%;padding-right:17%}.meter-track{height:58%;flex:1;border:3px solid #eefaff;border-radius:999px;background:#2c2a64;box-shadow:inset 0 0 7px #000c;overflow:hidden}.meter-fill{height:100%;width:0;border-radius:999px;background:linear-gradient(90deg,#32d15b,#99ed42 53%,#e7eb44);transition:width .25s}.meter-value{font-size:clamp(19px,2.05vw,33px);font-weight:1000;color:var(--gold);text-shadow:0 2px 0 #694000}.hud-stat{display:flex;flex-direction:column;justify-content:center}.hud-stat strong{text-align:center;color:var(--gold);font-size:clamp(18px,2vw,31px);line-height:1.02}.hud-stat:last-child strong{color:#fff}.hud-stat i{font-style:normal}

/* main two panels */
.main-grid{position:relative;z-index:2;height:70%;display:grid;grid-template-columns:2.1fr 1fr;gap:1.05%;padding:1.1% 1.2% 0}
.story-panel{overflow:hidden;border-radius:27px;border:2px solid #38caff;background:linear-gradient(180deg,#153bac,#092679 12%,#0752bd);box-shadow:0 0 26px #17beff57,inset 0 0 18px #6fdfff3b,0 7px 16px #001343b8}.story-heading{height:11.8%;display:flex;align-items:center}.story-tab{height:100%;min-width:30%;display:grid;place-items:center;padding:0 3%;clip-path:polygon(0 0,100% 0,86% 100%,0 100%);background:linear-gradient(180deg,#ffe65a,#ffc009);color:#06154b;font-weight:1000;font-style:italic;font-size:clamp(22px,2.8vw,43px);text-shadow:0 2px 0 #fff9}.watch-text{padding-left:3%;font-size:clamp(15px,1.8vw,28px);font-weight:1000;font-style:italic;text-shadow:0 2px 0 #061346}
.story-frames{height:88.2%;display:grid;grid-template-columns:repeat(3,1fr);gap:1.15%;padding:1.05% 1.2% 1.6%}.story-frame{position:relative;overflow:hidden;isolation:isolate;border-radius:20px;border:3px solid #e4f2ff;background:#123a8d;box-shadow:0 4px 11px #00133f,0 0 9px #2fd4ff66}.story-frame:before{content:"";position:absolute;inset:-7%;z-index:0;background-image:var(--frame-bg);background-size:cover;background-position:center;filter:blur(18px) brightness(.72) saturate(1.06);transform:scale(1.14);opacity:.72}.story-frame:after{content:"";position:absolute;inset:0;z-index:0;background:linear-gradient(180deg,#ffffff0b 0 62%,#09286b69 76%,#061749d1 100%)}
/* The actual story artwork is NEVER cropped or stretched. */
.story-frame>img{position:relative;z-index:1;display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:contain;object-position:center;background:#0a255f}.story-frame .caption{position:absolute;z-index:4;left:2%;right:2%;bottom:2%;height:18.8%;display:grid;place-items:center;padding:2% 4%;border:3px solid #07194f;border-radius:18px;background:#fbfbfff3;color:#081957;text-align:center;font-size:clamp(12px,1.45vw,22px);line-height:1.08;font-weight:1000;font-style:italic;box-shadow:0 3px 7px #00113f80}.frame-num{position:absolute;z-index:6;left:2%;top:2%;width:10%;aspect-ratio:1;display:grid;place-items:center;border-radius:10px;border:2px solid #79dfff;background:linear-gradient(#0a3a94,#061f5e);font-weight:1000;font-size:clamp(13px,1.45vw,22px)}.story-arrow{position:absolute;z-index:7;right:-7%;top:37%;font-size:clamp(30px,4vw,61px);line-height:1;color:#ffd923;text-shadow:-2px -2px 0 #061247,2px 2px 0 #061247,0 0 8px #fff}.story-frame:last-child .story-arrow{display:none}
/* real speech balloon; empty until the student selects a phrase */
.story-frame .speech{position:absolute;z-index:8;right:3%;top:4%;width:59%;min-height:23%;padding:5% 6%;display:grid;place-items:center;text-align:center;border:4px solid #08143e;border-radius:52% 48% 50% 50%;background:#fff;color:#101018;font-size:clamp(13px,1.7vw,26px);font-weight:1000;font-style:italic;line-height:1.05;filter:drop-shadow(0 4px 0 #e6b91f) drop-shadow(0 5px 5px #00144988)}.story-frame .speech:after{content:"";position:absolute;right:17%;bottom:-21%;width:18%;height:27%;background:#fff;clip-path:polygon(0 0,100% 0,28% 100%);filter:drop-shadow(1px 2px 0 #08143e)}.story-frame .speech.empty{color:transparent}.story-frame .speech.native-bubble{top:5%;right:2%;width:60%;min-height:22%;border:0;background:transparent;filter:none;padding:4% 5%;border-radius:0}.story-frame .speech.native-bubble:after{display:none}

/* answer panel */
.choice-panel{overflow:hidden;border-radius:36px;border:3px solid #d5ebff;background:linear-gradient(180deg,#fff,#f2f5ff 44%,#e5ebff);color:var(--ink);padding:2.8% 3.2%;box-shadow:0 6px 17px #00164ea6,inset 0 0 17px #fff}.choice-title{border-radius:31px 19px 31px 19px;padding:3% 4%;background:linear-gradient(180deg,#0b48a8,#062573);color:#fff;text-align:center;font-size:clamp(19px,2.12vw,33px);font-weight:1000;font-style:italic;text-shadow:0 2px 0 #0005;box-shadow:inset 0 1px 0 #ffffff88}.feelings{display:grid;grid-template-columns:repeat(3,1fr);gap:2.5%;margin:3.3% 0 4.6%}.feelings button{min-height:clamp(90px,10.5vh,138px);padding:4% 2%;border:2px solid #a2b3e5;border-radius:22px;background:linear-gradient(#fff,#edf2ff);color:#071957;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;font-size:clamp(12px,1.28vw,20px);font-weight:1000;cursor:pointer;box-shadow:inset 0 1px 0 #fff,0 3px 8px #294d9230}.feel-emoji{font-size:clamp(33px,4vw,60px);line-height:1}.enc-pair{display:inline-flex!important;flex-direction:row!important;align-items:center;justify-content:center;gap:.06em;white-space:nowrap}.enc-face,.enc-thumb{display:inline-block;font-size:1em;line-height:1;transform:none}.feelings button.selected{border:5px solid var(--gold);background:linear-gradient(#173e99,#08246b);color:#fff;box-shadow:0 0 14px #ffd72e9e,inset 0 0 13px #2875d243}.feelings button.eliminated{opacity:.3;text-decoration:line-through}.expression-title{margin-top:1.5%}.expressions{display:grid;gap:2.25%;margin-top:3.8%}.expressions button{position:relative;min-height:clamp(50px,6.45vh,72px);padding:0 7% 0 18%;border:2px solid #9eafe0;border-radius:22px;background:linear-gradient(#fff,#edf2ff);color:#071957;text-align:left;font-size:clamp(14px,1.5vw,23px);font-weight:1000;font-style:italic;cursor:pointer;box-shadow:inset 0 1px 0 #fff}.expressions button:before{content:"";position:absolute;left:6%;top:50%;transform:translateY(-50%);width:8%;aspect-ratio:1;border:4px solid #667bb3;border-radius:50%;background:#fff}.expressions button.selected{border-color:#f5a500;background:linear-gradient(90deg,#fff4a6,#ffd130);box-shadow:0 0 8px #ffc51688}.expressions button.selected:before{background:#071950;border-color:#071950;box-shadow:inset 0 0 0 5px #fff}.expressions button.eliminated{opacity:.28;text-decoration:line-through}.expressions button.eliminated:after{content:"✕";position:absolute;right:6%;color:#e82d42;font-size:1.5em}

/* bottom: no circular fake coach portrait; only real toggle + action */
.bottombar{position:relative;z-index:4;height:16%;display:grid;grid-template-columns:1fr 1.5fr 1fr;align-items:center;padding:0 2.5%}.submit-btn,.next-btn{grid-column:2;justify-self:center;min-width:70%;padding:1.5% 7%;border:3px solid #241600;border-radius:27px;background:linear-gradient(#ffe35d,#ffbd09);color:#07164f;font-size:clamp(22px,2.75vw,42px);font-weight:1000;font-style:italic;box-shadow:0 7px 0 #392500,0 0 20px #ffcf337c,inset 0 1px 0 #fff9;cursor:pointer}.next-btn{background:linear-gradient(#59e984,#17b94e);border-color:#064e24;color:#fff;box-shadow:0 7px 0 #063a1c}.coach-toggle{grid-column:3;justify-self:end;display:flex;align-items:center;gap:10px;padding:7px 11px 7px 16px;border:2px solid #32c6ff;border-radius:999px;background:linear-gradient(#0d388e,#071c61);color:#fff;font-size:clamp(14px,1.45vw,22px);font-weight:1000;box-shadow:0 0 16px #22c9ff83,inset 0 1px 0 #ffffff48;cursor:pointer}.coach-switch{position:relative;width:clamp(86px,7vw,112px);height:clamp(38px,3.4vw,50px);display:flex;align-items:center;padding:0 36px 0 12px;border-radius:999px;background:#10c85a;box-shadow:inset 0 0 0 2px #70ffab}.coach-switch b{font-size:.8em}.coach-knob{position:absolute;right:4px;width:clamp(30px,2.7vw,40px);height:clamp(30px,2.7vw,40px);border-radius:50%;background:#fff;box-shadow:0 2px 5px #064d2b6c}.coach-toggle[aria-pressed="false"] .coach-switch{background:#6e7d9b;padding-left:38px;padding-right:8px}.coach-toggle[aria-pressed="false"] .coach-knob{right:auto;left:4px}

/* floating coach: full character protruding over interface; never a circle */
.feedback{position:absolute;z-index:60;left:.9%;bottom:.8%;max-width:46%;display:flex;align-items:flex-end;filter:drop-shadow(0 10px 14px #00113db5);pointer-events:auto}.feedback.coach-disabled{display:none!important}.feedback>img{position:relative;z-index:3;width:clamp(105px,10.5vw,155px);max-height:280px;height:auto;object-fit:contain;object-position:center bottom;border:0!important;border-radius:0!important;box-shadow:none!important;margin-right:-18px;filter:drop-shadow(0 8px 7px #00113d80)}.feedback-bubble{position:relative;min-width:285px;max-width:390px;padding:15px 42px 16px 27px;border:4px solid #e93447;border-radius:30px;background:linear-gradient(#fff,#fff1f2);color:#081b58;box-shadow:0 7px 16px #00164d66}.feedback-bubble:before{content:"";position:absolute;left:-30px;bottom:27px;width:35px;height:32px;background:inherit;clip-path:polygon(100% 0,100% 100%,0 55%);filter:drop-shadow(-2px 2px 0 #e93447)}.feedback.correct .feedback-bubble{border-color:#14b758;background:linear-gradient(#fff,#effff4)}.feedback.correct .feedback-bubble:before{filter:drop-shadow(-2px 2px 0 #14b758)}.feedback-title{color:#df263b;font-size:clamp(20px,1.85vw,30px);font-weight:1000;font-style:italic}.feedback.correct .feedback-title{color:#07994a}.feedback-text{margin-top:6px;font-size:clamp(12px,1.08vw,17px);font-weight:900;line-height:1.22}.feedback-close{position:absolute;right:11px;top:8px;border:0;background:transparent;color:#173c90;font-size:28px;font-weight:1000;cursor:pointer}

@media(max-width:900px) and (orientation:portrait){body{overflow:auto}.game{align-items:flex-start;overflow:auto}.game-shell{width:100%;height:auto;min-height:100vh;aspect-ratio:auto;border-radius:0}.topbar{height:auto;grid-template-columns:1fr 1fr;gap:8px;padding:10px}.brand{grid-column:1/3}.brand-sub{white-space:normal}.hud-meter{min-height:78px}.main-grid{height:auto;grid-template-columns:1fr;padding:10px}.story-panel{min-height:650px}.story-frames{min-height:560px}.choice-panel{margin-top:8px}.bottombar{height:auto;min-height:120px;grid-template-columns:1fr 1fr;padding:12px}.submit-btn,.next-btn{grid-column:1;min-width:92%}.coach-toggle{grid-column:2}.feedback{position:fixed;left:6px;right:6px;bottom:6px;max-width:98vw}.feedback>img{width:105px;max-height:190px}.feedback-bubble{min-width:0;max-width:calc(100vw - 112px);padding:14px 38px 14px 18px}.hud-stat:last-child{display:none}}


/* build marker — intentionally small and unobtrusive */
.version-tag{position:fixed;right:8px;bottom:6px;z-index:120;color:#dbeaff;background:#06194dcc;border:1px solid #55cfff99;border-radius:999px;padding:3px 8px;font:800 11px/1.2 Arial,sans-serif;letter-spacing:.04em;opacity:.72;pointer-events:none;box-shadow:0 0 8px #31c8ff55}

.target-badge{position:absolute;top:10px;right:10px;z-index:7;background:linear-gradient(180deg,#ffd947,#f4a900);color:#071a54;border:2px solid #fff8c9;border-radius:999px;padding:5px 10px;font:900 11px/1 Arial,sans-serif;letter-spacing:.04em;box-shadow:0 2px 0 #7b5300,0 0 10px #ffd84a99;pointer-events:none;white-space:nowrap}


/* v13 responsive layout corrections */
.game{padding:clamp(6px,1vw,16px)}
.game-shell{width:min(calc(100vw - 12px),calc((100vh - 12px)*1.5),1600px);max-width:100%;}
.topbar{grid-template-columns:minmax(0,2.35fr) minmax(190px,1.55fr) repeat(2,minmax(68px,.55fr));gap:.7%;padding:.8% 1.25%}
.hud-meter{overflow:hidden;padding:5px 9px}.meter-row{gap:6px;padding-right:0}.meter-track{min-width:52px}.meter-value{flex:0 0 auto;font-size:clamp(18px,min(2vw,3vh),31px)}
.meter-star{flex:0 0 auto;display:grid;place-items:center;width:clamp(30px,min(3.4vw,5vh),50px);height:clamp(30px,min(3.4vw,5vh),50px);font-size:clamp(28px,min(3.4vw,5vh),50px);line-height:1;color:#ffd72d;text-shadow:0 2px 0 #a56300,0 0 6px #fff5;transform:none}
.brand-title{font-size:clamp(26px,min(3.1vw,4.7vh),48px)}
.brand-sub{font-size:clamp(10px,min(1.08vw,1.7vh),17px);white-space:normal}
.hud-label,.hud-stat>span{font-size:clamp(10px,min(1.03vw,1.6vh),16px)}
.hud-stat strong{font-size:clamp(17px,min(1.9vw,3vh),30px)}

.main-grid{height:73%;grid-template-columns:minmax(0,2.08fr) minmax(320px,.98fr);gap:.9%;padding:.8% .9% 0}
.story-panel{border-radius:clamp(18px,2vw,27px)}
.story-heading{height:11%}.story-tab{font-size:clamp(20px,min(2.65vw,4vh),40px)}.watch-text{font-size:clamp(14px,min(1.7vw,2.6vh),26px)}
.story-frames{height:89%;align-items:stretch;gap:1%;padding:.8% 1% 1%}
.story-frame{display:flex;flex-direction:column;min-width:0;border-radius:18px}
.story-frame:before{inset:0;filter:blur(16px) brightness(.68) saturate(1.05);transform:scale(1.08)}
.story-frame>img{position:relative;z-index:1;display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:contain;object-position:center;background:#0a255f;margin:0;flex:0 0 auto}
.story-frame .caption{position:relative;z-index:4;left:auto;right:auto;bottom:auto;height:auto;min-height:0;flex:1;margin:2.2%;padding:3% 4%;border-radius:16px;font-size:clamp(11px,min(1.26vw,1.95vh),20px);line-height:1.06;overflow:hidden}
.frame-num{left:2%;top:2%;width:10%;font-size:clamp(12px,min(1.3vw,2vh),20px)}
.story-arrow{right:-7%;top:28%;font-size:clamp(28px,min(3.6vw,5.5vh),55px)}
.story-frame .speech{top:3%;right:3%;width:58%;min-height:19%;padding:4%;font-size:clamp(11px,min(1.45vw,2.2vh),22px)}
.target-badge{top:4%;right:auto;left:50%;transform:translateX(-50%);padding:5px 12px;font:900 clamp(10px,min(.95vw,1.45vh),14px)/1 Arial,sans-serif;letter-spacing:.02em;background:linear-gradient(180deg,#ffd947,#f4a900)}
.target-badge.right{left:auto;right:5%;transform:none}.target-badge.center{left:50%;right:auto;transform:translateX(-50%)}

.choice-panel{display:flex;flex-direction:column;min-width:0;padding:1.6% 2.2%;border-radius:clamp(22px,2.4vw,34px)}
.choice-tools{display:flex;justify-content:flex-end;align-items:center;min-height:clamp(34px,4.2vh,50px);margin-bottom:1.2%}
.choice-title{flex:0 0 auto;border-radius:25px 17px 25px 17px;padding:2.2% 3%;font-size:clamp(18px,min(1.95vw,2.95vh),30px);line-height:1.12}
.feelings{flex:0 0 auto;gap:2%;margin:2.3% 0 3%}.feelings button{min-width:0;min-height:clamp(76px,9.2vh,118px);padding:3% 1%;font-size:clamp(11px,min(1.05vw,1.62vh),17px)}.feel-emoji{font-size:clamp(30px,min(3.6vw,5.4vh),52px)}
.expression-title{margin-top:.5%}.expressions{flex:1;min-height:0;display:grid;grid-template-rows:repeat(4,minmax(0,1fr));gap:1.8%;margin-top:2.5%}.expressions button{min-height:0;max-width:100%;padding:1.5% 5% 1.5% 16%;font-size:clamp(12px,min(1.22vw,1.85vh),19px);line-height:1.08;overflow-wrap:anywhere}

.bottombar{height:13%;display:flex;align-items:center;justify-content:center;padding:.5% 2% 1.2%;overflow:visible}
.submit-btn,.next-btn{grid-column:auto;min-width:0;width:min(54%,680px);max-width:calc(100% - 24px);padding:clamp(9px,1.1vh,15px) clamp(22px,4vw,58px);font-size:clamp(20px,min(2.45vw,3.7vh),38px);line-height:1;border-radius:24px;white-space:nowrap}
.coach-toggle{grid-column:auto;justify-self:auto;gap:7px;padding:4px 7px 4px 11px;font-size:clamp(12px,min(1.05vw,1.6vh),17px)}
.coach-switch{width:clamp(72px,5.8vw,92px);height:clamp(31px,2.7vw,39px);padding:0 30px 0 10px}.coach-knob{width:clamp(25px,2.1vw,32px);height:clamp(25px,2.1vw,32px)}
.feedback{left:1%;bottom:1%;max-width:min(42%,560px)}.feedback>img{width:clamp(84px,min(8vw,12vh),124px);max-height:220px;margin-right:-13px}.feedback-bubble{min-width:240px;max-width:350px;padding:12px 38px 13px 22px;border-width:3px;border-radius:24px}.feedback-title{font-size:clamp(18px,min(1.55vw,2.35vh),25px)}.feedback-text{font-size:clamp(11px,min(.95vw,1.45vh),15px)}

@media(max-width:1100px){
  .topbar{grid-template-columns:minmax(0,2.1fr) minmax(160px,1.25fr) repeat(2,minmax(58px,.5fr));gap:5px;padding:6px 8px}
  .brand .speech-logo{width:44px}.brand-title{font-size:clamp(23px,3.3vw,36px)}.brand-sub{font-size:11px}
  .main-grid{grid-template-columns:minmax(0,1.9fr) minmax(290px,1fr);gap:7px;padding:7px 7px 0}
  .choice-panel{padding:7px}.choice-title{font-size:clamp(17px,2.3vw,24px)}
  .feelings button{font-size:clamp(10px,1.45vw,14px)}.expressions button{font-size:clamp(11px,1.55vw,16px)}
  .submit-btn,.next-btn{width:min(62%,560px);font-size:clamp(19px,2.8vw,31px)}
}

@media(max-width:900px) and (orientation:portrait){
  body{overflow:auto}.game{align-items:flex-start;overflow:auto;padding:0}.game-shell{width:100%;height:auto;min-height:100vh;aspect-ratio:auto;border-radius:0;overflow:visible}
  .topbar{height:auto;grid-template-columns:1fr 1fr 1fr;gap:7px;padding:9px}.brand{grid-column:1/4}.hud-meter{grid-column:1/4;min-height:66px}.hud-stat{min-height:62px}.hud-stat:last-child{display:flex}
  .main-grid{height:auto;grid-template-columns:1fr;padding:8px}.story-panel{min-height:0}.story-heading{height:62px}.story-frames{height:auto;grid-template-columns:1fr;gap:10px;padding:10px}.story-frame{width:min(520px,100%);margin:auto}.story-arrow{display:none}.story-frame>img{width:100%;height:auto}.story-frame .caption{min-height:86px}.target-badge{font-size:12px}
  .choice-panel{margin-top:8px;padding:10px}.choice-tools{min-height:44px}.feelings button{min-height:92px}.expressions{grid-template-rows:none}.expressions button{min-height:56px;font-size:15px}
  .bottombar{height:auto;min-height:92px;padding:12px}.submit-btn,.next-btn{width:min(94%,560px);max-width:94%;font-size:clamp(22px,7vw,34px);white-space:normal}
  .feedback{position:fixed;left:5px;right:5px;bottom:5px;max-width:none}.feedback>img{width:88px;max-height:160px}.feedback-bubble{min-width:0;max-width:calc(100vw - 95px);padding:12px 34px 12px 15px}.feedback-title{font-size:19px}.feedback-text{font-size:13px}
}

/* v14 — larger complete scenes and compact proportional captions */
.story-frame{
  display:flex;
  flex-direction:column;
  min-width:0;
  background:#08245c;
}
.story-frame:before,.story-frame:after{display:none}
.story-visual{
  position:relative;
  isolation:isolate;
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  background:#08245c;
}
.story-visual:before{
  content:"";
  position:absolute;
  inset:-7%;
  z-index:0;
  background-image:var(--scene-image);
  background-size:cover;
  background-position:center;
  filter:blur(18px) brightness(.62) saturate(1.08);
  transform:scale(1.12);
}
.story-visual:after{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  background:linear-gradient(180deg,#06143b10 0 78%,#06143b66 100%);
  pointer-events:none;
}
.story-image{
  position:relative;
  z-index:1;
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center;
  background:transparent;
}
.story-frame>img{display:none}
.story-frame .caption{
  position:relative;
  z-index:4;
  left:auto;
  right:auto;
  bottom:auto;
  flex:0 0 auto;
  width:auto;
  height:auto;
  min-height:clamp(64px,9.8vh,96px);
  max-height:22%;
  margin:2.2%;
  padding:2.5% 4%;
  border-radius:15px;
  display:grid;
  place-items:center;
  font-size:clamp(12px,min(1.3vw,2vh),20px);
  line-height:1.08;
  overflow:hidden;
}
.story-visual .frame-num{left:2.5%;top:2.5%}
.story-visual .speech{top:3%;right:3%}
.story-visual .target-badge{top:4%}
.story-arrow{top:34%}

@media(max-width:900px) and (orientation:portrait){
  .story-visual{flex:none;min-height:clamp(250px,58vw,360px)}
  .story-image{height:100%;object-fit:contain}
  .story-frame .caption{min-height:72px;max-height:none;margin:8px;padding:12px 16px}
}

/* v15 — full viewport, filled scenes, visible character names, mobile-safe */
html,body{width:100%;min-height:100%;margin:0;background:#07164a}
body{overflow:hidden}
.game{width:100vw;min-height:100dvh;padding:0;align-items:stretch;justify-content:stretch;background:#07164a}
.game-shell{width:100vw;height:100dvh;max-width:none;aspect-ratio:auto;border-radius:0}

.story-visual{flex:1 1 auto;min-height:0;background:#102451}
.story-visual:before,.story-visual:after{display:none}
.story-image{width:100%;height:100%;object-fit:cover;object-position:50% 42%;background:#102451}
.story-frame.frame-1 .story-image{object-position:50% 45%}
.story-frame.frame-2 .story-image{object-position:50% 44%}
.story-frame.frame-3 .story-image{object-position:50% 40%}

.story-frame>.target-badge,
.story-frame>.target-badge.right,
.story-frame>.target-badge.center{
  position:relative;
  inset:auto;
  left:auto;
  right:auto;
  top:auto;
  transform:none;
  z-index:8;
  display:block;
  align-self:stretch;
  flex:0 0 auto;
  margin:0 2.2%;
  padding:7px 12px;
  border-radius:0 0 13px 13px;
  text-align:center;
  font:1000 clamp(12px,min(1.25vw,1.9vh),19px)/1 Arial,sans-serif;
  letter-spacing:.035em;
  box-shadow:0 3px 0 #7b5300;
}
.story-frame>.target-badge+.caption{margin-top:7px}
.story-frame .caption{flex:0 0 auto;min-height:clamp(58px,8.5vh,84px);max-height:20%;margin:2%;padding:2% 3.5%}
.story-visual .speech{z-index:9;top:3%;right:3%;max-height:34%;overflow:hidden}
.story-arrow{top:41%}

@media(max-width:900px){
  .mobile-controlbar{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 10px;background:#07175b;border-bottom:2px solid #3ed2ff}
  .mobile-controlbar .student-menu-btn,.mobile-controlbar .coach-toggle{position:static;width:auto;max-width:48%;margin:0;font-size:11px;padding:7px 9px}
  .choice-tools,.bottombar .student-menu-btn{display:none}
  body{overflow:auto;background:#07164a}
  .game{width:100%;min-height:100dvh;height:auto;overflow:visible;padding:0}
  .game-shell{width:100%;height:auto;min-height:100dvh;max-width:none;overflow:visible;border-radius:0}
  .topbar{height:auto;min-height:0;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;padding:9px}
  .brand{grid-column:1/-1}.hud-meter{grid-column:1/-1;min-height:68px}.hud-stat{min-height:58px}
  .main-grid{height:auto;grid-template-columns:1fr;padding:8px;gap:8px}
  .story-panel{min-height:0;height:auto}.story-heading{height:58px}
  .story-frames{height:auto;min-height:0;grid-template-columns:1fr;gap:12px;padding:10px}
  .story-frame{width:min(560px,100%);height:auto;min-height:0;margin:auto}
  .story-visual{flex:none;width:100%;height:auto;aspect-ratio:4/3;min-height:0}
  .story-image{width:100%;height:100%;object-fit:cover;object-position:50% 42%}
  .story-frame>.target-badge{margin:0 8px;padding:8px 12px;font-size:15px}
  .story-frame .caption{min-height:68px;max-height:none;margin:8px;padding:12px 15px;font-size:clamp(15px,4.4vw,20px)}
  .story-arrow{display:none}
  .choice-panel{margin-top:0;padding:10px}.choice-tools{min-height:44px}
  .feelings{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.feelings button{min-width:0}
  .expressions{grid-template-rows:none}.expressions button{min-height:58px;font-size:15px}
  .bottombar{height:auto;min-height:92px;padding:10px;display:grid;grid-template-columns:1fr}
  .submit-btn,.next-btn{grid-column:1;width:min(94%,560px);max-width:94%;white-space:normal}
  .coach-toggle{position:absolute;right:10px;top:10px}
}

/* v31 — simplified completion certificate */
.result-screen{min-height:100vh;padding:clamp(18px,4vw,42px);display:flex;flex-direction:column;align-items:center;justify-content:center;background:radial-gradient(circle at 50% 0,#d9e9ff 0,#f4f8ff 62%,#dbe8fb 100%)}
.result-card{position:relative;overflow:hidden;width:min(920px,100%);aspect-ratio:16/9;min-height:440px;border:5px solid #58c7ff;border-radius:30px;background:linear-gradient(145deg,#071d68 0%,#0c42a5 60%,#0879c1 100%);box-shadow:0 22px 55px #09225c55;color:#fff}
.result-card:before,.result-card:after{content:"";position:absolute;border-radius:50%;background:#65d9ff22}.result-card:before{width:360px;height:360px;right:-120px;top:-160px}.result-card:after{width:260px;height:260px;left:-100px;bottom:-140px}
.result-card-top{position:relative;z-index:1;display:flex;align-items:center;justify-content:space-between;padding:24px 30px 16px;border-bottom:1px solid #8de4ff66}.result-brand{font-size:29px;font-weight:1000;letter-spacing:-1px}.result-brand span{color:#ffd735}.result-complete{padding:8px 16px;border-radius:999px;background:#25c76f;color:#042c24;font-size:13px;font-weight:1000;letter-spacing:.6px}
.result-card-body{position:relative;z-index:1;padding:22px 32px}.result-eyebrow{text-align:center;color:#9ee8ff;font-size:14px;font-weight:900;letter-spacing:2px}.result-card-body h1{text-align:center;margin:4px 0 6px;font-size:clamp(30px,4vw,43px);line-height:1.05}.result-card-body>p{text-align:center;margin:0 0 22px;color:#d5ebff;font-size:15px}
.result-scores{display:grid;grid-template-columns:repeat(2,1fr);gap:13px}.result-scores>div{padding:16px 8px 13px;border:1px solid #a6e6ff88;border-radius:18px;background:#f7fbff14;text-align:center;box-shadow:inset 0 1px #fff3}.result-scores b{display:block;color:#ffd735;font-size:26px}.result-scores>div:last-child b{color:#ffad3d}.result-scores strong{display:block;margin-top:2px;color:#ffd735;font-size:31px;line-height:1}.result-scores small{display:block;margin-top:6px;color:#d8efff;font-size:12px;font-weight:900;letter-spacing:.7px;text-transform:uppercase}
.result-meta{display:flex;justify-content:space-between;gap:15px;margin-top:19px;padding:12px 16px;border-radius:14px;background:#03165066;color:#e4f4ff;font-size:13px}.result-meta strong{color:#fff}.result-card-footer{position:absolute;z-index:1;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:space-between;padding:10px 30px;background:#03144c99;color:#aee8ff;font-size:11px}.result-card-footer span:last-child{color:#ffd735;font-size:22px}
.result-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:18px}.result-actions button{min-height:48px;padding:10px 22px;border-radius:12px;font-size:15px;font-weight:1000}.result-actions #downloadResult{border:2px solid #c49a00;background:#ffd735;color:#082365;box-shadow:0 4px 0 #ad8300}
@media(max-width:650px){.result-screen{padding:12px}.result-card{aspect-ratio:auto;min-height:500px;border-width:3px;border-radius:22px}.result-card-top{padding:16px 15px 12px}.result-brand{font-size:20px}.result-complete{padding:6px 9px;font-size:9px}.result-card-body{padding:17px 15px}.result-card-body h1{font-size:28px}.result-card-body>p{font-size:12px;margin-bottom:15px}.result-scores{gap:6px}.result-scores>div{padding:12px 3px}.result-scores strong{font-size:24px}.result-scores small{font-size:8px}.result-meta{flex-direction:column;gap:5px;font-size:11px}.result-card-footer{padding:8px 15px;font-size:8px}.result-actions{width:100%}.result-actions button{flex:1 1 220px}}

@media(max-width:520px){
  .brand-title{font-size:clamp(24px,9vw,38px)}
  .brand-sub{font-size:12px}.hud-meter{padding:7px}.hud-stat strong{font-size:20px}
  .story-tab{font-size:clamp(22px,8vw,34px)}.watch-text{font-size:clamp(15px,5vw,22px)}
  .choice-title{font-size:clamp(18px,5.6vw,25px)}
  .feelings button{min-height:88px;font-size:12px}.feel-emoji{font-size:34px}
  .feedback{left:4px;right:4px;bottom:4px;max-width:calc(100vw - 8px)}
}

@media(max-height:560px) and (orientation:landscape){
  body{overflow:auto}.game,.game-shell{height:auto;min-height:100vh;overflow:visible}
  .topbar{min-height:90px}.main-grid{height:auto;min-height:520px}.bottombar{min-height:78px}
}

/* v17 — audited balloons remain visible without covering the speaker's face */
.story-visual .speech.speech-position-bottom-left,
.story-visual .speech.speech-position-bottom-right{
  top:auto;
  bottom:4%;
  width:48%;
  min-height:18%;
  max-height:30%;
  padding:4% 5%;
  overflow:hidden;
}
.story-visual .speech.speech-position-bottom-left{left:3%;right:auto}
.story-visual .speech.speech-position-bottom-right{right:3%;left:auto}
.story-visual .speech.speech-position-bottom-left:after,
.story-visual .speech.speech-position-bottom-right:after{
  top:-22%;
  bottom:auto;
  width:18%;
  height:28%;
  clip-path:polygon(28% 0,0 100%,100% 100%);
}
.story-visual .speech.speech-position-bottom-left:after{left:auto;right:12%}
.story-visual .speech.speech-position-bottom-right:after{left:12%;right:auto}

@media(max-width:520px){
  .story-visual .speech.speech-position-bottom-left,
  .story-visual .speech.speech-position-bottom-right{width:52%;font-size:13px}
}

/* v20 — explicit navigation and narrow-screen containment */
.student-menu-btn{position:absolute;z-index:12;top:7px;right:8px;padding:7px 11px;border:2px solid #46d2ff;border-radius:999px;background:#071958e8;color:#fff;font-weight:900;font-size:12px;cursor:pointer;box-shadow:0 0 10px #29cfff77}
.exit-dialog{width:min(520px,calc(100vw - 28px));border:3px solid #55cfff;border-radius:24px;padding:24px;background:linear-gradient(180deg,#0c3a9f,#061758);color:#fff;box-shadow:0 20px 70px #000b}.exit-dialog::backdrop{background:#01051dcc}.exit-dialog h2{margin:0 0 10px;font-size:26px}.exit-dialog p{font-weight:700;line-height:1.4}.exit-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}.exit-actions button{padding:11px 16px;border:2px solid #b9dcff;border-radius:14px;background:#fff;color:#071958;font-weight:900;cursor:pointer}.exit-actions .danger{border-color:#ff8793;background:#d92e43;color:#fff}.exit-error{margin:10px 0;padding:9px;border-radius:10px;background:#fff;color:#a7192b;font-weight:900}

@media(max-width:900px){
  .story-image{object-fit:contain;background:#102451}
  .expressions button{padding-left:52px;min-width:0;overflow-wrap:anywhere}
  .expressions button:before{left:14px;width:22px;height:22px;aspect-ratio:auto;border-width:3px}
  .feedback{bottom:calc(92px + env(safe-area-inset-bottom))}
  .student-menu-btn{position:relative;grid-column:1/-1;grid-row:1;justify-self:end;top:auto;right:auto;margin:0 0 2px}
  .brand{grid-row:2}
}

/* v21 — menu action participates in layout and never covers the game */
.bottombar{display:grid;grid-template-columns:minmax(180px,1fr) minmax(320px,2fr) minmax(180px,1fr);gap:12px}
.student-menu-btn{position:static;z-index:auto;grid-column:1;grid-row:1;justify-self:start;max-width:240px;padding:9px 14px;border:2px solid #46d2ff;border-radius:999px;background:#071958;color:#fff;font-weight:900;font-size:13px;cursor:pointer;box-shadow:0 0 10px #29cfff55}
.submit-btn,.next-btn{grid-column:2;grid-row:1}
@media(max-width:900px){.bottombar{grid-template-columns:1fr;gap:8px;padding-bottom:calc(10px + env(safe-area-inset-bottom))}.submit-btn,.next-btn{grid-column:1;grid-row:1}.student-menu-btn{position:static;grid-column:1;grid-row:2;justify-self:center;width:min(94%,560px);max-width:94%;margin:0}.brand{grid-row:auto}.feedback{bottom:calc(142px + env(safe-area-inset-bottom))}}

/* v23 — current student identity remains visible without overlaying game controls */
.desktop-player-name{grid-column:3;grid-row:1;justify-self:end;max-width:100%;padding-right:42px;color:#fff;font-size:clamp(12px,1.05vw,16px);font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:right}
.mobile-player-name{display:none}
.translation-dialog{border-color:#ffcc31;text-align:center}.translation-dialog h2{color:#ffe05a}.translation-dialog .exit-actions{justify-content:center}
@media(max-width:900px){
  .mobile-controlbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.8fr) minmax(0,1fr);justify-content:normal}
  .mobile-controlbar .student-menu-btn{grid-column:1;grid-row:1;justify-self:start;width:auto;max-width:100%}
  .mobile-player-name{display:block;grid-column:2;min-width:0;color:#fff;font-size:clamp(10px,2.8vw,13px);font-weight:900;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mobile-controlbar .coach-toggle{grid-column:3;justify-self:end;width:auto;max-width:100%}
  .desktop-player-name{display:none}
}
