@font-face{font-family:class;src:url(/assets/fonts/notosanssc.woff2)}*{box-sizing:border-box}body{margin:0;background:#fff8ee;color:#493426;font:18px class,sans-serif}main{max-width:1120px;margin:auto;padding:24px;min-height:100vh}h1{font-size:32px}button,select,input,textarea{font:inherit;border:2px solid #cfc4e1;border-radius:16px;padding:12px;min-height:56px}button{cursor:pointer;background:#fffdf8;color:inherit;margin:5px;box-shadow:0 3px 0 #d8c9b9}button.primary{background:#ffdc67}button:disabled{opacity:.5;cursor:wait}button:focus-visible,input:focus-visible{outline:4px solid #729eaa}textarea{width:100%;height:160px}label{display:inline-flex;gap:10px;align-items:center;margin:10px}input[type=checkbox]{width:26px;min-height:26px}section,.panel{background:#fffaf1ed;border-radius:24px;padding:22px;margin:16px 0;box-shadow:0 5px 18px #593b2420}.split{display:grid;grid-template-columns:1fr 1fr;gap:20px}.chip{display:inline-block;background:#e2efe2;border-radius:30px;padding:5px 12px;margin:5px}.chip button{min-height:44px;padding:2px 10px}.code{font-size:100px;letter-spacing:16px;font-weight:bold}.lobby{background:linear-gradient(#ffffff55,#ffffff44),url(/assets/foundations/lobby.webp) center/cover}.podium{background:linear-gradient(#ffffff66,#ffffff66),url(/assets/foundations/podium.webp) center/cover}.avatar{display:inline-flex;width:64px;height:64px;border-radius:50%;align-items:center;justify-content:center;font-size:38px;background:#d9eddd}.a1{background:#f9dce6}.a2{background:#fff0bf}.a3{background:#dceafa}.players{display:flex;flex-wrap:wrap;gap:15px}.player{background:#fffaf1e8;padding:12px;border-radius:20px}.prompt{min-height:160px;display:flex;align-items:center;justify-content:center;gap:20px}.picture{font-size:70px}.countdown{font-size:100px;text-align:center}.status{min-height:36px;color:#684d80}.choice{min-width:100px;min-height:80px;font-size:30px}.recap{position:fixed;bottom:18px;right:18px;background:#e6f5da;border-radius:20px;padding:16px}small{font-size:15px}@media(max-width:700px){main{padding:12px}.split{grid-template-columns:1fr}.code{font-size:64px;letter-spacing:10px}h1{font-size:26px}label{margin:6px}}

label:has(textarea){display:block;width:100%;margin:0}label:has(textarea) textarea{display:block;margin-top:12px}.suggestion{padding:10px 0;border-bottom:1px dashed #cfc4e1}
[hidden]{display:none!important}
.kart-room{max-width:1280px;padding:12px}.kart-hud{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.kart-hud h1{font-size:26px;margin:4px}.rank-bar{background:#fffaf1;border-radius:24px;padding:10px;font-size:17px}.kart-stage{position:relative;background:#dbecc7;border-radius:24px;overflow:hidden}.kart-stage canvas{display:block;width:100%;height:min(64vh,560px);touch-action:none}.kart-prompt{position:absolute;left:12px;bottom:90px;border-radius:20px;background:#fffaf1ed}.kart-prompt .prompt{min-height:88px;padding:0 10px}.kart-prompt .picture{font-size:48px}.kart-controls{display:flex;align-items:center;justify-content:space-between;background:#fff8ee}.kart-controls button{width:72px;height:72px;font-size:32px}.kart-controls span{font-size:16px}.kart-status{font-size:18px;color:#694e86}.race-code{padding:16px;font-weight:bold}.kart-recap{padding:12px;background:#fff8d9;border-radius:18px;font-size:16px;pointer-events:none}@media(max-width:600px){.kart-controls span{max-width:150px;font-size:13px}.kart-hud h1{font-size:22px}.kart-stage canvas{height:auto;aspect-ratio:600/520}.kart-prompt{bottom:90px}.kart-prompt .prompt{min-height:64px}.kart-prompt .picture{font-size:36px}.rank-bar{font-size:14px}}

.kart-room:has(.race-code) .kart-prompt{top:8px;right:8px;left:auto;bottom:auto}.word-results{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:8px}.word-results p{margin:0;padding:12px;background:#fffaf1;border-radius:12px}

.kart-room:not(:has(.race-code)) .kart-prompt{position:static;min-height:88px;display:flex;justify-content:center}.kart-stage canvas{height:min(58vh,500px)}@media(max-width:600px){.kart-room:not(:has(.race-code)) .kart-prompt{min-height:64px}.kart-stage canvas{height:auto}}

@font-face{font-family:'LXGW WenKai';src:url(/assets/fonts/lxgwwenkai.woff2)}
.join-url{font-size:clamp(24px,4vw,48px);font-weight:bold;overflow-wrap:anywhere}.join-room{max-width:1000px;text-align:center}.join-room section{padding:40px;min-height:65vh;display:flex;flex-direction:column;justify-content:center;align-items:center}.join-room input{font-size:32px;width:190px}.kart-controls span{font-size:20px}.kart-recap{font-size:26px;padding:16px}.podium-steps{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:center;gap:14px;background:radial-gradient(circle at 10% 20%,#ffdc67 2px,transparent 4px),radial-gradient(circle at 70% 40%,#cfc4e1 3px,transparent 5px);background-size:47px 53px,61px 67px}.podium-steps .player{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:22%;padding:20px}.podium-steps .place-1{order:2;min-height:220px;background:#fff0bf}.podium-steps .place-2{order:1;min-height:175px;background:#dceafa}.podium-steps .place-3{order:3;min-height:135px;background:#f9dce6}@media(max-width:600px){.kart-controls span{font-size:16px}.kart-recap{font-size:22px}.podium-steps .player{padding:10px;min-width:25%}}

.teacher-review{background:#fffaf1ed;padding:22px;border-radius:24px;margin:16px 0}.teacher-review summary{cursor:pointer;font-size:26px;font-weight:bold}

.join-room label:has(#code){flex-direction:column;width:100%}.join-room #code{font-size:clamp(44px,8vw,72px);width:min(100%,360px);min-height:108px;letter-spacing:.18em;text-align:center;font-weight:bold;text-transform:uppercase}.join-room section{padding:24px}

.prompt .text-card{font-size:28px;max-width:240px;overflow-wrap:anywhere;text-align:center;line-height:1.4}.kart-prompt{max-width:calc(100% - 24px)}.kart-prompt .prompt{flex-wrap:wrap;gap:8px}.kart-prompt .text-card{font-size:24px;max-width:220px}
/* Procedural chase view, with the learning prompt above the road. */
.kart-room{max-width:none!important;padding:0!important;position:relative;background:#dcf4ff;min-height:100dvh}.kart-hud{position:relative;z-index:2;display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:12px 24px;background:#ffffffed;border-radius:0 0 24px 24px;box-shadow:0 4px 0 #c6dcfa}.kart-hud h1{font-size:23px;margin:0}.treasure{font-size:25px;font-weight:bold;color:#234f99}.rank-bar:empty{display:none}.kart-stage{position:relative!important}.kart-stage>canvas{display:block;width:100%!important;height:calc(100dvh - 175px)!important;min-height:400px;max-height:none!important;border-radius:0!important;touch-action:none}.kart-prompt{position:absolute!important;top:12px;left:50%;transform:translateX(-50%);z-index:3;background:#ffffffed;border-radius:24px;padding:8px}.kart-prompt .prompt{margin:0;padding:0}.kart-prompt button{font-size:36px;min-height:72px;min-width:92px;background:#ffdf45;border:4px solid white;box-shadow:0 4px 0 #d4a727}.kart-controls{position:absolute!important;bottom:20px;left:3%;width:94%;z-index:3;display:flex;justify-content:space-between;align-items:end}.kart-controls button{width:88px;height:76px;font-size:40px;background:#fffdf4ed;border:4px solid white;border-radius:24px;color:#2858a5;box-shadow:0 5px 0 #9bbaf0}.kart-controls span{font-size:16px;background:#ffffffda;padding:8px;border-radius:16px}.kart-progress{position:relative;height:18px;background:#d8e9ff;border:3px solid white;border-radius:20px;width:calc(100% - 24px);margin:4px 12px 12px}.kart-progress>span{display:block;height:100%;background:#5fcf83;border-radius:20px}.kart-progress>b{position:absolute;top:-8px;transform:translateX(-100%);font-size:24px;white-space:nowrap}.podium-canvas{width:100%;height:420px;display:block;border-radius:24px}.my-coins{font-size:26px;color:#926000}.kart-recap{z-index:5}.kart-status{font-size:18px}@media(max-width:600px){.kart-hud{padding:8px;gap:8px}.kart-hud h1{font-size:18px}.treasure{font-size:20px}.kart-controls span{display:none}.kart-stage>canvas{height:calc(100dvh - 180px)!important}.podium-canvas{height:330px}}
.kart-room .kart-prompt{bottom:auto!important;right:auto;width:max-content;min-height:0!important;max-width:calc(100% - 24px)}.kart-room .kart-prompt:empty{display:none}.kart-room .kart-prompt .prompt{min-height:80px}.kart-room:has(.race-code) .kart-prompt{left:auto;right:12px!important;transform:none}.kart-controls{background:transparent;pointer-events:none}.kart-controls>*{pointer-events:auto}.kart-controls button:disabled{opacity:1}.kart-recap{max-width:100%}
/* Floating toy-world HUD, matching the approved prototype. */
.kart-room .kart-hud{position:absolute;top:18px;left:18px;width:calc(100% - 36px);padding:0;background:transparent;box-shadow:none;gap:12px;flex-wrap:nowrap}.kart-hud h1{display:none}.kart-hud .treasure{display:contents}.heart-pill,.coin-pill,.streak-pill,.kart-hud>span:not(.treasure){background:#ffffffed;border:3px solid white;border-radius:32px;box-shadow:0 5px 0 #95b5d5;padding:10px 16px;white-space:nowrap;font-weight:bold;color:#223979}.heart-pill{order:0}.coin-pill{order:3}.streak-pill{position:absolute;top:72px;left:0;font-size:23px;min-width:100px}.kart-hud>span:not(.treasure):not(.kart-status){order:1;background:#4687f6;color:white;font-size:18px}.kart-hud .kart-status{position:absolute;top:74px;right:0;padding:6px 12px;font-size:16px}.kart-status:empty{display:none}.kart-hud .kart-progress{order:2;flex:1;min-width:80px;margin:0 12px;height:26px;background:#5a7fa2a0;box-shadow:0 4px 0 #95b5d5}.kart-progress>span{background:linear-gradient(90deg,#ffe34c,#ff9160,#ff5f9e)}.kart-stage>canvas{height:100dvh!important;min-height:500px}.kart-room .kart-prompt{top:110px}.kart-room .kart-prompt:has(.prompt>button:only-child){background:transparent;padding:0}.kart-prompt button{border-radius:50%;background:#2c9cfa;box-shadow:0 6px 0 #3f81c4,0 0 0 12px #ffffff55;min-width:88px;height:88px}.kart-controls button{border-radius:50%;font-size:40px;box-shadow:0 6px 0 #869cb9}.kart-controls span{opacity:.85}.kart-room:has(.race-code) .kart-hud .treasure{display:block;max-width:70%;font-size:18px;background:#ffffffdc;border-radius:20px;padding:10px}.kart-room:has(.race-code) .kart-prompt{top:90px}.webgl-fallback{position:absolute;top:180px;background:white;padding:8px;border-radius:16px}@media(max-width:600px){.kart-room .kart-hud{top:10px;left:8px;width:calc(100% - 16px);gap:6px}.heart-pill,.coin-pill,.streak-pill,.kart-hud>span:not(.treasure){font-size:17px;padding:7px 9px}.kart-hud>span:not(.treasure):not(.kart-status){font-size:14px}.kart-hud .kart-progress{position:absolute;top:50px;left:0;width:100%;margin:0;height:20px}.streak-pill{top:88px;font-size:18px;min-width:75px}.kart-hud .kart-status{top:88px;max-width:48%;white-space:normal}.kart-room .kart-prompt{top:155px}.kart-stage>canvas{height:100dvh!important}}
.podium:has(.podium-canvas){position:relative;max-width:none;padding:16px;min-height:100dvh;isolation:isolate}.podium:has(.podium-canvas)>.podium-canvas{position:absolute;inset:0;z-index:-1;width:100%;height:100dvh;border-radius:0}.podium:has(.podium-canvas)>h1,.podium:has(.podium-canvas)>p:not(.my-coins){display:none}.podium:has(.podium-canvas)>h2{position:absolute;top:8px;left:50%;transform:translateX(-50%);margin:0;background:#ffffffed;border-radius:30px;padding:10px 22px;white-space:nowrap}.podium:has(.podium-canvas)>.my-coins{position:absolute;top:64px;right:16px;background:white;padding:10px 18px;border-radius:28px}.podium:has(.podium-canvas)>.podium-steps{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);width:min(920px,96%);margin:0;padding:12px;max-height:26vh;overflow:auto;box-shadow:none}.podium:has(.podium-canvas) .podium-steps .player{min-height:0;padding:10px 20px;min-width:23%}.podium:has(.podium-canvas) .podium-steps .avatar{width:42px;height:42px;font-size:30px}.podium:has(.podium-canvas)>.teacher-review{position:absolute;top:150px;right:12px;max-width:440px;max-height:55vh;overflow:auto;background:#ffffffed;padding:12px;border-radius:20px}.podium:has(.podium-canvas)>button{margin-top:70px;background:#fffffff0}.podium:has(.podium-canvas)>.race-code{position:absolute;top:16px;left:12px;background:white;border-radius:24px}@media(max-width:600px){.podium:has(.podium-canvas)>h2{font-size:19px}.podium:has(.podium-canvas) .podium-steps .player{padding:8px;min-width:28%}.podium:has(.podium-canvas)>.my-coins{font-size:20px}}

.review-link{display:inline-block;font-size:15px;margin:12px}

.kart-hud{font-family:class,'Noto Sans CJK SC','Microsoft YaHei',sans-serif}.kart-hud .kart-status{overflow-wrap:anywhere;line-height:1.25}
/* setup: word import */
.word-import{align-items:start}.word-import>section{margin:0;min-width:0}
.import-label{display:block!important;margin:0!important}.import-label>span{display:block;font-size:22px;font-weight:bold}.import-label>small{display:block;font-size:16px;color:#7a6656;margin-top:2px}
.import-paste textarea{height:190px;resize:vertical;line-height:1.55;background:#fffdf8;border:2px dashed #d9cbb6;border-radius:18px;padding:14px 16px;transition:border-color .15s,background .15s}.import-paste textarea:focus{border-style:solid;border-color:#729eaa;background:#fff;outline:none}.import-paste.drag textarea{border-color:#729eaa;background:#eef6f7}.import-paste.has-image textarea{opacity:.55}
.import-shot{display:flex;align-items:center;gap:12px;margin-top:10px;padding:8px 8px 8px 10px;background:#fff;border:2px solid #e8dfd0;border-radius:16px}.import-shot img{width:60px;height:60px;object-fit:cover;border-radius:10px;flex:none;background:#f3ede4}.import-shot span{flex:1;min-width:0;font-size:15px;line-height:1.35}.import-shot button{margin:0;min-width:44px;min-height:44px;padding:0;box-shadow:none;border-color:transparent;font-size:22px;color:#8a7766}
.import-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}.import-actions button{margin:0;min-height:56px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;line-height:1.2;padding:8px 16px}.import-actions small{font-size:13px;opacity:.75;font-weight:normal}.import-pick{flex:1 1 180px;border-style:dashed;background:#fff}.import-go{flex:1.3 1 180px;font-weight:bold;font-size:20px}.import-go.busy{opacity:.8;cursor:progress}
.import-msg{margin:10px 2px 0;color:#9a4b2f;font-size:16px}.import-msg:empty{display:none}
.import-hint,.import-privacy{margin:10px 2px 0;font-size:15px;line-height:1.4;color:#7a6656}.import-privacy{display:flex;gap:8px;align-items:baseline}.import-privacy::before{content:'';flex:none;width:8px;height:8px;border-radius:50%;background:#e8a25c;transform:translateY(-1px)}
.import-list h2{margin:0 0 10px;font-size:22px}
.import-note{margin:0 0 12px;padding:10px 14px;border-radius:14px;font-size:16px;line-height:1.45;background:#f3ede4;color:#5d4a3b}.import-note.ai{background:#e8f4fd;color:#2f5670}.import-note.calm{background:#fff3c4;color:#6b5420}.import-note.warn{background:#ffe7d6;color:#8a3b17;font-weight:bold}.import-note.empty{background:transparent;border:2px dashed #e3d8c8;color:#9a8878;text-align:center;padding:28px 14px}
.word-rows{display:flex;flex-direction:column;gap:8px}
.word-rows .word-row{display:grid;grid-template-columns:minmax(92px,38%) minmax(0,1fr) 44px;align-items:center;gap:10px;margin:0;padding:6px 6px 6px 14px;background:#fff;border:2px solid #efe6d8;border-radius:16px;min-height:60px;transition:border-color .2s,box-shadow .2s}
.word-text{display:flex;flex-direction:column;min-width:0}.word-zh{font-family:'LXGW WenKai',class,sans-serif;font-size:28px;line-height:1.15;color:#3a2a1f;overflow-wrap:anywhere}.word-py{font-size:15px;color:#7a6656;overflow-wrap:anywhere}
.word-row .word-en{font-size:17px;min-width:0;overflow-wrap:anywhere}span.word-en{padding-left:12px}.import-paste textarea::placeholder,.word-import input::placeholder{color:#b3a493}
.word-row button.word-edit{margin:0;min-height:44px;padding:6px 10px;justify-self:start;max-width:100%;text-align:left;background:transparent;border:2px solid transparent;border-radius:12px;box-shadow:none;cursor:text}.word-row button.word-edit:hover,.word-row button.word-edit:focus-visible{background:#faf5ec;border-color:#e8dfd0}.word-pen{margin-left:8px;font-size:14px;color:#b3a28f}
.word-row input.word-en{width:100%;min-height:44px;padding:6px 12px;border:2px dashed #d9b98a;border-radius:12px;background:#fffbeb}.word-row input.word-en:focus{border-style:solid;border-color:#729eaa;background:#fff;outline:none}
.word-row .word-remove{margin:0;width:44px;min-height:44px;padding:0;border:0;border-radius:12px;background:transparent;box-shadow:none;color:#a8978a;font-size:22px}.word-row .word-remove:hover{background:#fbe9e4;color:#a2462c}
.word-rows .word-row.missing{border-color:#e8a25c;background:#fff6ea;box-shadow:0 0 0 4px #ffdcae}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.import-add{display:flex;gap:8px;margin-top:14px}.import-add input{flex:1;min-width:0;min-height:52px}.import-add button{margin:0;min-height:52px;flex:none}
.import-list .import-audio{display:block;width:100%;margin:14px 0 0}.import-list .suggestion{display:flex;flex-wrap:wrap;align-items:center;gap:4px}
@media(max-width:700px){.import-label>span{font-size:18px}.import-list h2{font-size:20px}.word-import{gap:12px}.word-import>section{padding:16px}.import-paste textarea{height:150px}.word-rows .word-row{grid-template-columns:minmax(76px,29%) minmax(0,1fr) 44px;gap:6px;padding-left:10px}.import-add button{padding:8px 12px}.word-row input.word-en{padding:6px 10px}.word-zh{font-size:24px}}
/* join and lobby redesign */
@font-face{font-family:'Baloo 2';src:url(/assets/fonts/baloo2.woff2) format('woff2');font-weight:400 800;font-display:swap}
main.join-room,main.kid-lobby,main.host-lobby{--ink:#1f2a44;--ink-soft:#56627e;--line:#dce7f4;--sky:#4aa8ff;--sky-deep:#2f7fd8;--sun:#ffc83d;--sun-deep:#d99a00;--leaf:#58c27d;--coral:#e8603f;--round:'Baloo 2','LXGW WenKai',class,sans-serif;--hand:'LXGW WenKai',class,sans-serif;font-family:var(--round);max-width:none;margin:0;min-height:100dvh;color:var(--ink);overflow-x:hidden;background:linear-gradient(180deg,#ffffffb8 0%,#ffffff50 42%,#ffffff00 70%),url(/assets/foundations/lobby.webp) center 88%/cover no-repeat,#f7cfe0}
main.join-room :is(h1,h2,p),main.kid-lobby :is(h1,h2,p),main.host-lobby :is(h1,h2,p){margin:0}
main.join-room button,main.kid-lobby button,main.host-lobby button{margin:0;font-family:var(--round);-webkit-tap-highlight-color:transparent;touch-action:manipulation}
main.join-room button:focus-visible,main.kid-lobby button:focus-visible,main.host-lobby button:focus-visible{outline:4px solid var(--sky-deep);outline-offset:3px}
main.join-room button.primary,main.host-lobby button.primary{min-height:72px;padding:0 40px;border:4px solid #fff;border-radius:999px;background:var(--sun);color:#3d2b00;font:800 26px/1.1 var(--round);box-shadow:0 7px 0 var(--sun-deep),0 14px 26px #d99a0040;transition:transform .12s,box-shadow .12s,background .2s}
main.join-room button.primary:active:not(:disabled),main.host-lobby button.primary:active{transform:translateY(5px);box-shadow:0 2px 0 var(--sun-deep)}
main.join-room button.primary:disabled{opacity:1;cursor:not-allowed;background:#e8eef6;color:#97a5ba;box-shadow:0 6px 0 #cfd9e6}
main.join-room button.primary.busy{cursor:progress;background:#ffe08a;color:#7a5a00}

/* student join: one card on the toy-world backdrop */
main.join-room{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:clamp(14px,3vh,32px) 16px;text-align:center}
main.join-room>h1{font:800 36px/1.2 var(--round);background:#ffffffee;padding:18px 36px;border-radius:28px;box-shadow:0 8px 0 #c9dcf2}
main.join-room>.status{background:#ffffffdd;padding:10px 18px;border-radius:18px}
main.join-room>button{min-height:64px;padding:0 32px;border:4px solid #fff;border-radius:999px;background:#fff;font-size:22px;box-shadow:0 6px 0 #c9dcf2}
.join-room .join-card{position:relative;display:flex;flex-direction:column;align-items:center;gap:clamp(10px,2vh,18px);width:min(580px,100%);min-height:0;margin:0;padding:clamp(22px,4.5vh,44px) clamp(18px,4vw,48px);background:#fffffff2;border:4px solid #fff;border-radius:40px;box-shadow:0 10px 0 #c9dcf2,0 28px 60px #3a4f8a30;color:var(--ink)}
.join-card h1{font:800 clamp(30px,5.4vh,46px)/1.15 var(--round);letter-spacing:.01em}
.join-help{font:500 clamp(18px,2.6vh,22px)/1.35 var(--hand);color:var(--ink-soft)}
.join-card .status{min-height:0;font-size:19px;line-height:1.4;color:var(--coral);font-weight:bold}.join-card .status:empty{display:none}
.join-pals{display:flex;gap:12px;margin-top:calc(-1 * clamp(22px,4.5vh,44px) - 38px)}
.join-pals .pal{display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;font-size:36px;border:4px solid #fff;box-shadow:0 6px 0 #0000001a;animation:join-bob 2.6s ease-in-out infinite}
.pal.a0,.join-room .avatar.a0,.lobby .avatar.a0{background:#d6f0dc}.pal.a1,.join-room .avatar.a1,.lobby .avatar.a1{background:#fbdce8}.pal.a2,.join-room .avatar.a2,.lobby .avatar.a2{background:#fff0b8}.pal.a3,.join-room .avatar.a3,.lobby .avatar.a3{background:#d9e9fb}
.code-boxes{position:relative;display:grid;grid-template-columns:repeat(4,1fr);gap:clamp(8px,2vw,16px);width:min(100%,440px);margin-top:4px}
.code-cell{display:flex;align-items:center;justify-content:center;aspect-ratio:4/5;max-height:22vh;background:#f3f8ff;border:4px solid var(--line);border-radius:24px;font:800 clamp(46px,9.5vh,76px)/1 var(--round);color:var(--ink);box-shadow:inset 0 -7px 0 #e1ecf8;transition:border-color .15s,background .15s,transform .15s}
.code-cell.filled{background:#fff;border-color:#9ccbf6;transform:translateY(-2px)}
.code-cell.active{border-color:var(--sky);box-shadow:inset 0 -7px 0 #e1ecf8,0 0 0 6px #4aa8ff33}
.code-cell.active:empty::after{content:'';width:5px;height:46%;border-radius:3px;background:var(--sky);animation:join-blink 1.1s steps(1) infinite}
.join-room .code-boxes #code{position:absolute;inset:0;width:100%;height:100%;min-height:0;margin:0;padding:0;border:0;opacity:.01;font-size:16px;letter-spacing:0;color:transparent;caret-color:transparent;background:transparent;cursor:text;outline:none}
.code-boxes #code::selection{background:transparent}
.code-boxes.checking .code-cell{border-color:var(--sky);animation:join-wait 1s ease-in-out infinite}
.code-boxes.bad .code-cell{border-color:#f2a08a;background:#fff5f1}
.code-boxes.shake{animation:join-shake .45s}
.join-wait p{font:600 22px var(--hand);color:var(--ink-soft)}

/* who are you */
.join-room .who-step{width:min(1000px,100%);align-items:stretch;gap:clamp(10px,2.2vh,20px);padding:clamp(16px,3vh,30px) clamp(16px,3vw,36px)}
.who-top{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px}
.who-top h1{font-size:clamp(28px,5vh,42px)}
.change-code{justify-self:start;display:inline-flex;align-items:center;gap:8px;min-height:56px;padding:0 20px;background:#fff;border:3px solid var(--line);border-radius:999px;color:var(--ink-soft);font-size:17px;font-weight:700;white-space:nowrap;box-shadow:0 4px 0 var(--line)}
.change-code .arrow{font-size:22px;line-height:1}
.room-chip{justify-self:end;display:inline-flex;align-items:center;gap:10px;padding:8px 18px;background:var(--ink);color:#fff;border-radius:999px;font-size:15px;white-space:nowrap}
.room-chip b{font:800 26px/1 var(--round);letter-spacing:.14em}
.pick-block h2{font:700 clamp(18px,2.6vh,21px)/1.3 var(--round);color:var(--ink-soft);text-align:left;margin:0 0 10px 4px}
.name-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:clamp(10px,1.6vh,14px)}
.join-room button.name-tile{position:relative;min-height:clamp(64px,11vh,88px);padding:6px;border:4px solid #fff;border-radius:24px;font:400 clamp(30px,5vh,40px)/1.1 var(--hand);color:var(--ink);box-shadow:0 6px 0 #d6e2f0;transition:transform .12s,box-shadow .12s,border-color .12s}
.name-tile:nth-child(8n+1){background:#e4f2ff}.name-tile:nth-child(8n+2){background:#fff1c9}.name-tile:nth-child(8n+3){background:#fde3ec}.name-tile:nth-child(8n+4){background:#e3f5e6}.name-tile:nth-child(8n+5){background:#efe6fb}.name-tile:nth-child(8n+6){background:#ffe7d6}.name-tile:nth-child(8n+7){background:#e0f4f6}.name-tile:nth-child(8n+8){background:#f6f0dc}
.join-room button.name-tile:hover{transform:translateY(-2px)}
.join-room button.name-tile:active{transform:translateY(4px);box-shadow:0 2px 0 #d6e2f0}
.join-room button.name-tile[aria-pressed=true]{border-color:var(--sky-deep);box-shadow:0 6px 0 var(--sky-deep),0 0 0 5px #4aa8ff40;transform:translateY(-3px)}
.join-room button[aria-pressed=true]::after{content:'✓';position:absolute;top:-10px;right:-10px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:var(--leaf);color:#fff;font:800 19px/1 var(--round);border:3px solid #fff;box-shadow:0 2px 6px #0003;animation:join-pop .3s cubic-bezier(.3,1.6,.5,1)}
.who-lower{display:grid;grid-template-columns:auto 1fr;align-items:end;gap:clamp(16px,3vw,40px)}
.animal-row{display:flex;gap:clamp(10px,1.6vw,18px)}
.join-room .who-step button.avatar{position:relative;width:clamp(72px,12vh,96px);height:clamp(72px,12vh,96px);min-height:0;padding:0;border:4px solid #fff;border-radius:50%;font-size:clamp(42px,7vh,56px);line-height:1;box-shadow:0 6px 0 #0000001c;transition:transform .15s,box-shadow .15s}
.join-room .who-step button.avatar:hover{transform:translateY(-3px) rotate(-4deg)}
.join-room .who-step button.avatar[aria-pressed=true]{border-color:var(--sky-deep);box-shadow:0 6px 0 var(--sky-deep),0 0 0 6px #4aa8ff40;transform:scale(1.08)}
.join-room .who-step button.avatar[aria-pressed=true]::after{top:-6px;right:-6px}
.who-go{display:flex;align-items:center;justify-content:flex-end;gap:16px}
.me-preview{display:flex;align-items:center;gap:10px;padding:6px 18px 6px 6px;border-radius:999px;background:#f3f8ff;border:3px dashed #c9d9ec;min-height:64px;transition:background .2s,border-color .2s}
.me-preview.ready{background:#fff8dc;border:3px solid #ffe08a}
.me-preview .preview-avatar{display:flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;font-size:30px;background:#fff;color:#a5b6cc;font-weight:800}
.me-preview .preview-avatar.empty{border:3px dashed #c9d9ec;font-size:22px}
.preview-name{font:400 28px/1 var(--hand);text-align:left;white-space:nowrap}.preview-name:empty{display:none}.me-preview:not(.ready):has(.preview-name:empty){padding-right:6px}
.join-room .who-go button.primary{min-width:min(300px,100%)}
.join-room .who-go button.primary:not(:disabled){animation:join-ready .5s cubic-bezier(.3,1.6,.5,1)}

/* waiting lobby, student and projector */
main.kid-lobby,main.host-lobby{display:flex;flex-direction:column;gap:14px;padding:16px max(20px,calc(50vw - 600px)) 24px}
.lobby-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.game-pill{background:#ffffffee;padding:10px 20px;border-radius:999px;font:700 20px/1.2 var(--round);color:var(--ink);box-shadow:0 5px 0 #c9dcf2}
.lobby-bar .room-chip{padding:10px 20px}
main.kid-lobby .status:empty,main.host-lobby .status:empty{display:none}
main.kid-lobby .status,main.host-lobby .status{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:6;max-width:calc(100% - 32px);min-height:0;background:#fff;padding:8px 18px;border-radius:999px;color:var(--ink);font-weight:bold;box-shadow:0 4px 0 #c9dcf2}
.kid-hero{display:flex;flex-direction:column;align-items:center;gap:10px;margin:0;padding:clamp(20px,4vh,36px) 24px;background:#ffffffeb;border:4px solid #fff;border-radius:40px;box-shadow:0 10px 0 #c9dcf2,0 24px 50px #3a4f8a26;text-align:center}
.me-stage{position:relative;display:flex;flex-direction:column;align-items:center;padding-top:clamp(14px,3vh,26px)}
.kid-hero .me-big{position:relative;width:clamp(120px,22vh,176px);height:clamp(120px,22vh,176px);font-size:clamp(72px,13vh,108px);border:6px solid #fff;box-shadow:inset 0 -10px 0 #0000000d;animation:kid-bounce 1.8s ease-in-out infinite;transform-origin:50% 100%}
.me-shadow{position:absolute;bottom:-12px;width:clamp(96px,17vh,140px);height:18px;border-radius:50%;background:radial-gradient(closest-side,#1f2a4433,#1f2a4400);animation:kid-shadow 1.8s ease-in-out infinite}
.me-name{font:400 clamp(36px,6vh,52px)/1.1 var(--hand);color:var(--ink)}
.me-wait{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px;font:700 clamp(20px,3vh,26px)/1.3 var(--round);color:var(--ink-soft)}
.dots{display:inline-flex;gap:5px}.dots b{width:9px;height:9px;border-radius:50%;background:var(--sky);animation:join-dot 1.2s ease-in-out infinite}.dots b:nth-child(2){animation-delay:.15s}.dots b:nth-child(3){animation-delay:.3s}
.lobby .countdown{font:800 clamp(80px,16vh,150px)/1 var(--round);color:var(--sky-deep)}
.class-list{margin:0;padding:16px 20px 20px;background:#ffffffe0;border-radius:30px;box-shadow:0 8px 0 #c9dcf2}
.class-count{font:800 22px/1.3 var(--round);color:var(--ink);margin:0 0 12px 4px}
.lobby .players{display:grid;grid-template-columns:repeat(auto-fill,minmax(196px,1fr));gap:12px}
.lobby .player{position:relative;display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;column-gap:10px;align-items:center;padding:8px 12px 8px 8px;background:#fff;border:3px solid #eef3fa;border-radius:22px;box-shadow:0 4px 0 #dfe8f3;text-align:left}
.lobby .player .avatar{grid-row:1/3;width:52px;height:52px;font-size:30px;border:3px solid #fff;box-shadow:0 3px 0 #0000001a}
.lobby .player p{font:400 24px/1.15 var(--hand);color:var(--ink);overflow-wrap:anywhere;align-self:end}
.lobby .player small{font-size:14px;color:#7c879c;align-self:start;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.lobby .player small.ready{color:#3f9a5e}.lobby .player small.ready::before{content:'';display:inline-block;width:8px;height:8px;margin-right:6px;border-radius:50%;background:var(--leaf);vertical-align:1px}
.lobby .player.away{opacity:.55}
.lobby .player.me{border-color:var(--sun);background:#fffbea}
.me-tag{position:absolute;top:-9px;right:10px;padding:2px 10px;border-radius:999px;background:var(--sun);color:#3d2b00;font:800 13px/1.4 var(--round)}
.lobby .player.pop{animation:join-pop .55s cubic-bezier(.3,1.6,.5,1) both}
.class-empty{grid-column:1/-1;padding:14px;border:3px dashed #d4e0ee;border-radius:20px;color:#7c879c;font:600 19px var(--round);text-align:center}

/* projector */
.lobby-actions{display:flex;align-items:center;gap:12px;margin-left:auto}
.lobby-actions button:not(.primary){min-height:56px;padding:0 22px;background:#ffffffee;border:3px solid #fff;border-radius:999px;color:var(--ink-soft);font-size:18px;font-weight:700;box-shadow:0 5px 0 #c9dcf2}
main.host-lobby .lobby-actions button.primary{min-height:64px;padding:0 44px}
.join-panel{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:clamp(16px,2.4vw,32px);margin:0;padding:clamp(18px,3.4vh,32px) clamp(20px,3vw,40px);background:#fffffff2;border:4px solid #fff;border-radius:40px;box-shadow:0 10px 0 #c9dcf2,0 28px 60px #3a4f8a26}
.join-panel.no-qr{grid-template-columns:1fr}
.join-how{display:flex;flex-direction:column;align-items:flex-start;gap:clamp(8px,1.6vh,14px);min-width:0}
.join-how h1{font:800 clamp(34px,6vh,52px)/1.1 var(--round);color:var(--ink)}
.how-step{display:flex;align-items:baseline;flex-wrap:wrap;column-gap:12px;row-gap:2px;min-width:0}
.step-n{display:inline-flex;align-items:center;justify-content:center;flex:none;width:36px;height:36px;border-radius:50%;background:var(--sky);color:#fff;font:800 20px/1 var(--round);transform:translateY(-3px)}
.step-t{font:600 clamp(19px,2.8vh,24px)/1.3 var(--round);color:var(--ink-soft)}
.join-address{font:800 clamp(22px,2.7vw,38px)/1.2 var(--round);color:var(--sky-deep);overflow-wrap:anywhere}
.join-panel .code{display:inline-flex;gap:clamp(8px,1.2vw,14px);padding:clamp(10px,1.6vh,16px);background:var(--ink);border-radius:30px;box-shadow:0 8px 0 #0f1830;letter-spacing:0;font-size:inherit}
.join-panel .code span{display:flex;align-items:center;justify-content:center;width:1.02em;padding:.14em 0 .04em;background:#2c3b62;border-radius:20px;color:#fff;font:800 min(17vh,9.6vw,140px)/1 var(--round)}
.join-or{display:flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:50%;background:#f0f5fb;color:#7c879c;font:700 15px/1.1 var(--round);text-align:center}
.qr-card{display:flex;flex-direction:column;align-items:center;gap:6px;margin:0;padding:12px 12px 10px;background:#fff;border:3px solid var(--line);border-radius:26px}
.qr-card canvas{display:block;width:clamp(180px,34vh,320px);height:clamp(180px,34vh,320px);image-rendering:crisp-edges;image-rendering:pixelated;border-radius:8px}
.qr-card figcaption{font:800 clamp(18px,2.8vh,24px)/1.2 var(--round);color:var(--ink)}
.join-panel .countdown{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffe0;border-radius:36px;font-size:clamp(120px,30vh,260px)}
.pause-card{margin:0;padding:28px;text-align:center;background:#ffffffee;border-radius:36px;box-shadow:0 10px 0 #c9dcf2}.pause-card h2{font:800 44px/1.2 var(--round)}

@keyframes join-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}
@keyframes join-blink{50%{opacity:0}}
@keyframes join-wait{50%{transform:translateY(-4px)}}
@keyframes join-shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-14px)}40%{transform:translateX(12px)}60%{transform:translateX(-8px)}80%{transform:translateX(5px)}}
@keyframes join-pop{0%{transform:scale(.4);opacity:0}100%{transform:scale(1);opacity:1}}
@keyframes join-ready{0%{transform:scale(.94)}60%{transform:scale(1.05)}100%{transform:scale(1)}}
@keyframes join-dot{0%,100%{transform:translateY(0);opacity:.5}40%{transform:translateY(-6px);opacity:1}}
@keyframes kid-shadow{0%,100%{transform:scale(1);opacity:1}40%,60%{transform:scale(.72);opacity:.6}88%{transform:scale(1)}}
@keyframes kid-bounce{0%,100%{transform:translateY(0) scale(1.04,.96)}40%{transform:translateY(-22px) scale(.97,1.03)}60%{transform:translateY(-22px) scale(.98,1.02)}88%{transform:translateY(0) scale(1.02,.98)}}
@media(max-height:700px){.join-pals .pal{width:54px;height:54px;font-size:30px}.join-pals{margin-top:calc(-1 * clamp(22px,4.5vh,44px) - 32px)}}
@media(max-width:1100px){.join-panel .code span{font-size:min(14vh,9vw,124px)}.lobby-actions button:not(.primary){padding:0 16px}}
@media(max-width:700px){
 main.join-room{padding:16px 12px}
 main.join-room:has(.who-step){justify-content:flex-start}
 .join-room .join-card{border-radius:32px}
 .join-room .who-step{padding:16px 14px 0}
 .who-top{grid-template-columns:1fr auto}.who-top h1{grid-column:1/-1;grid-row:2}
 .change-code{min-height:48px;padding:0 14px;font-size:14px}.change-code .arrow{font-size:18px}.who-top .room-chip small{display:none}.who-top h1,.join-card h1{font-size:28px}
 .name-grid{grid-template-columns:repeat(2,1fr)}
 .join-room button.name-tile{min-height:58px;font-size:30px}
 .who-lower{grid-template-columns:1fr;gap:12px}
 .animal-row{justify-content:space-between}
 .join-room .who-step button.avatar{width:68px;height:68px;font-size:40px}
 .who-go{position:sticky;bottom:0;margin:0 -14px;padding:12px 14px 14px;background:#ffffffee;border-radius:0 0 28px 28px;box-shadow:0 -6px 16px #3a4f8a14;justify-content:space-between}
 .join-room .who-go button.primary{flex:1;min-width:0;min-height:60px;padding:0 12px;font-size:19px;white-space:nowrap}
 .who-go{gap:10px}.me-preview{padding:4px 12px 4px 4px;min-height:52px}.me-preview .preview-avatar{width:40px;height:40px;font-size:24px}.preview-name{font-size:21px}
 main.kid-lobby,main.host-lobby{padding:12px}
 .lobby .players{grid-template-columns:repeat(2,minmax(0,1fr))}.lobby .player small.ready{font-size:0}.lobby .player small.ready::before{margin:0}
 .join-panel{grid-template-columns:1fr;justify-items:center}.join-or{display:none}
}
@media(prefers-reduced-motion:reduce){main.join-room *,main.kid-lobby *,main.host-lobby *{animation:none!important;transition:none!important}}
.word-row button.word-zh-edit{margin:0 0 0 -8px;min-height:44px;padding:4px 8px;justify-self:start;max-width:calc(100% + 8px);text-align:left;align-items:flex-start;background:transparent;border:2px solid transparent;border-radius:12px;box-shadow:none;cursor:text}.word-row button.word-zh-edit:hover,.word-row button.word-zh-edit:focus-visible{background:#faf5ec;border-color:#e8dfd0}.word-zh-line{display:flex;align-items:baseline;min-width:0}.word-zh-line .word-pen{flex:none}
.word-row input.word-zh-input{width:100%;min-width:0;min-height:44px;padding:4px 10px;font-family:'LXGW WenKai',class,sans-serif;font-size:24px;border:2px dashed #d9b98a;border-radius:12px;background:#fffbeb}.word-row input.word-zh-input:focus{border-style:solid;border-color:#729eaa;background:#fff;outline:none}.word-rows .word-row.busy{opacity:.65;cursor:progress}.word-row.busy input{cursor:progress}
@media(max-width:700px){.word-row input.word-zh-input{font-size:20px;padding:4px 6px}}
/* HALFSTAR-2: the half star is a whole star outline, the left half gold; sized like the emoji stars beside it. */
.half-star{display:inline-block;width:1.2em;height:1.2em;vertical-align:-.22em}
/* PODIUM-ROWS-1: rows after the third are compact and live in their own framed list. It is a whole number of rows
   tall and snaps row by row, so no row is ever cut in half; a big class scrolls inside it. */
.podium-rest{position:relative;order:4;flex-basis:100%;display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));grid-auto-rows:44px;gap:6px;max-height:44px;overflow-y:auto;overscroll-behavior:contain;scroll-snap-type:y mandatory;border-radius:16px;outline:3px solid #ffffffd0;outline-offset:3px;scrollbar-width:thin}
.podium-rest:focus-visible{outline:4px solid #729eaa}
.podium .podium-steps .podium-rest .player{flex-direction:row;justify-content:flex-start;gap:8px;min-width:0;min-height:0;height:44px;padding:0 12px;background:#fffffff0;border-radius:14px;scroll-snap-align:start;white-space:nowrap;overflow:hidden;font-size:16px}
.podium .podium-steps .podium-rest .avatar{flex:none;width:30px;height:30px;font-size:20px}
.podium:has(.podium-canvas)>.podium-steps:not(.coop-results){max-height:none;overflow:visible}
@media(min-height:800px){.podium-rest{max-height:94px}}@media(min-height:1100px){.podium-rest{max-height:144px}}
/* CAPTION-1: an edited meaning sits small under the prompt picture, two lines at most. */
.picture-stack{display:inline-flex;flex-direction:column;align-items:center;gap:2px}.prompt-caption{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:17px;font-weight:bold;line-height:1.2;color:#223979;max-width:200px;overflow-wrap:anywhere;text-align:center}@media(max-width:600px){.prompt-caption{font-size:14px;max-width:150px}}
/* END-CONFIRM-1: End round asks first, in the button's own place, no dialog. These rules are for the plain room page only
   (room.js marks its question room-end-confirm); Word Kart and the 3D projector HUD style their own. */
.room-end-confirm{display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px 10px;max-width:100%;padding:6px 8px 6px 14px;border:3px solid #ffd27a;border-radius:22px;background:#fff8e6;color:var(--ink,#2d3436);font-weight:700;vertical-align:middle}
.room-end-confirm .end-confirm-ask{font-size:17px}
/* END-CONFIRM-2: End it looks dimmed for the short moment it ignores taps after the question opens (room.js, kart.js, hud.js). */
.end-confirm-yes.end-confirm-wait{opacity:.6}
.room-end-confirm button{margin:0;min-height:48px;padding:0 18px;border-radius:999px;font-weight:800}
.room-end-confirm button.end-confirm-yes{background:#fff;border:3px solid #e8a33c;color:#8a4b00}
.room-end-confirm button.end-confirm-no{background:var(--sun,#ffc531);border:3px solid #fff;color:#3d2b00}
.lobby-actions .room-end-confirm button:not(.primary).end-confirm-no{background:var(--sun,#ffc531);color:#3d2b00}
/* PODIUM-HINT-1: a list of children that scrolls fades at its bottom edge and counts who is below. */
.podium-steps:has(>.podium-more){position:relative}
.podium .podium-steps.rest-scrolls{padding-bottom:34px}
.podium-rest.has-more{-webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 14px),#0000);mask-image:linear-gradient(to bottom,#000 calc(100% - 14px),#0000)}
.podium-steps>.podium-more{position:absolute;z-index:2;transform:translateX(-50%);margin:0;min-height:0;height:22px;padding:0 12px;border:2px solid #fff;border-radius:999px;background:#5ba4cf;color:#fff;font-size:13px;font-weight:800;line-height:18px;white-space:nowrap;box-shadow:0 2px 6px #2d343633}
.podium-steps>.podium-more[hidden]{display:none}
.podium-steps>.podium-more:focus-visible{outline:3px solid #2d3436;outline-offset:2px}
/* PODIUM-STARS-1: on the projector podium the teacher's controls sit in one bar along the bottom edge, below the list of
   children, so they never cover a racer's stars or name tag at the top of the 3D scene. Child devices have no controls. */
.podium:has(.podium-canvas):has(>button):not(:has(.coop-end)){display:flex;flex-wrap:wrap;align-content:flex-end;justify-content:center;align-items:center;gap:6px 10px;padding-bottom:10px}
.podium:has(.podium-canvas):has(>button):not(:has(.coop-end))>button{margin:0;min-height:48px;padding:0 18px;font-size:17px}
.podium:has(.podium-canvas):has(>button):not(:has(.coop-end))>.review-link{margin:0 6px;padding:10px 14px;background:#ffffffe6;border-radius:999px}
.podium:has(.podium-canvas):has(>button):not(:has(.coop-end))>.podium-steps{bottom:68px}
@media(max-width:760px){.podium:has(.podium-canvas):has(>button):not(:has(.coop-end))>.podium-steps{bottom:124px}}
/* END-CONFIRM-1 on a narrow screen: the question takes its own row above the other lobby buttons. */
@media(max-width:600px){.lobby-actions:has(.room-end-confirm){flex-wrap:wrap;justify-content:flex-end}.lobby-actions .room-end-confirm{flex:1 1 100%}}
.kart-room .kart-hud .kart-recap{position:absolute;top:150px;left:50%;transform:translateX(-50%);width:max-content;max-width:min(560px,calc(100% - 8px));text-align:center;line-height:1.3;border:3px solid white;box-shadow:0 5px 0 #95b5d5;white-space:normal}
@media(min-width:601px){.kart-room .kart-hud .kart-status{max-width:calc(50% - 60px);white-space:normal;text-align:right}}
.kart-room .kart-prompt .listen-mute-hint{position:absolute;right:calc(100% + 10px);top:50%;transform:translateY(-50%);width:max-content;max-width:min(260px,calc(50vw - 64px));padding:8px 12px;border:3px solid #ffe89a;border-radius:16px;background:#fffbeb;box-shadow:0 4px 0 #95b5d5;color:#223979;font-size:16px;line-height:1.25;text-align:center;white-space:normal;pointer-events:none}
.kart-room .kart-prompt .end-confirm:not([hidden]){display:inline-flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:8px}
.kart-room .kart-prompt .end-confirm-ask{font-size:20px;font-weight:bold;color:#223979}
.kart-room .kart-prompt .end-confirm button{font-size:24px;min-height:64px;height:auto;min-width:0;border-radius:32px;padding:8px 18px;color:white}
.kart-room .kart-prompt .end-confirm-yes{background:#e8603f;box-shadow:0 5px 0 #b84a30}
.kart-room .kart-prompt .end-confirm-no{background:#2c9cfa;box-shadow:0 5px 0 #3f81c4}
@media(max-width:600px){.kart-room .kart-prompt .listen-mute-hint{font-size:13px;padding:6px 8px;right:calc(100% + 6px);max-width:calc(50vw - 60px)}.kart-room .kart-prompt .end-confirm-ask{font-size:16px;flex-basis:100%;text-align:right}.kart-room .kart-prompt .end-confirm button{font-size:18px;min-height:52px;padding:6px 12px}}
.kart-room .kart-prompt .listen-mute-hint.on-right{right:auto;left:calc(100% + 10px)}
.kart-room .kart-prompt .listen-mute-hint.below{right:auto;left:50%;top:calc(100% + 8px);transform:translateX(-50%)}
@media(max-width:600px){.kart-room:has(.race-code) .kart-prompt>button{font-size:20px;height:auto;min-height:52px;border-radius:28px;padding:6px 14px}.kart-room:has(.race-code) .kart-hud .kart-progress{display:none}}
/* LENGTH-1: a plain, non-blocking line under the laps when the round will be shorter or the list is long. */
.length-note{flex:1 1 100%;margin:4px 0 8px;padding:10px 14px;border-radius:14px;background:#fff3c4;color:#6b5420;font-size:16px;line-height:1.45;white-space:pre-line}.length-note[hidden]{display:none}
.word-memory{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0 0 12px;padding:10px 14px;border-radius:14px;background:#f3ede4;color:#5d4a3b}.word-memory[hidden],.word-memory [hidden]{display:none}.word-memory .memory-line{flex:1 1 100%;margin:0;font-size:16px;line-height:1.45;font-weight:bold}.word-memory .memory-kept{flex:1 1 180px;font-size:14px;line-height:1.4;color:#7a6755}.word-memory .memory-clear{flex:0 0 auto;min-height:44px;padding:8px 16px;border-radius:12px;border:2px solid #d9cbb8;background:#fff;color:#5d4a3b;font:inherit;font-size:16px;cursor:pointer}
/* RECAP-1: "My words" on a child's own podium. A pill under the treasure pill (or inside the class dragon's own row) opens a
   card over the podium: not full screen on a tablet or laptop, nearly full width on a phone, its list scrolls inside it and
   its header (with the close button) always stays in view. Practice is the warm sun colour, never red. */
.recap-pill-box{margin:12px 0;text-align:center}
.podium:has(.podium-canvas)>.recap-pill-box{position:absolute;top:158px;right:16px;margin:0}
/* RECAP-2: on the class dragon ending the pill sits in the top left corner under the class message, clear of the dragon
   (centred, it sat on the dragon's head) and of the children's animals, which stand lower down on the grass. */
.podium:has(.coop-end)>.recap-pill-box{position:absolute;top:134px;left:16px;right:auto;margin:0}
button.recap-pill{margin:0;min-height:52px;padding:8px 20px;border:4px solid #fff;border-radius:999px;background:#fffbeb;color:#5c4100;font-weight:800;font-size:20px;box-shadow:0 5px 0 #e3c46a;white-space:nowrap}
button.recap-pill:focus-visible{outline:4px solid #2f7fd8;outline-offset:3px}
.recap-pill.pulse{animation:recap-pulse 1.1s ease-in-out .7s 1 both}
.recap-layer{--ink:#1f2a44;--ink-soft:#56627e;--sun:#ffc83d;--sun-deep:#d99a00;--sky-deep:#2f7fd8;--hand:'LXGW WenKai',class,sans-serif;position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:16px;background:#1f2a4430}
.recap-card{display:flex;flex-direction:column;width:min(760px,100%);max-height:min(86dvh,720px);margin:0;padding:0;background:#fff;border:4px solid #fff;border-radius:32px;box-shadow:0 10px 0 #c9dcf2,0 28px 60px #3a4f8a40;color:var(--ink);overflow:hidden;animation:recap-in .28s cubic-bezier(.3,1.4,.5,1) both}
.recap-card:focus{outline:none}.recap-card:focus-visible{outline:4px solid var(--sky-deep);outline-offset:2px}
.recap-head{flex:none;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 18px 12px 24px;border-bottom:3px solid #f1ece2;background:#fffdf8}
.recap-titles{min-width:0}
.recap-title{margin:0;font-size:24px;line-height:1.2}
.recap-score{margin:4px 0 0;font-size:19px;font-weight:700;color:#8a5a00}
button.recap-close{flex:none;margin:0;width:56px;height:56px;min-height:56px;padding:0;border:3px solid #e8dfd0;border-radius:50%;background:#fff;color:var(--ink-soft);font-size:24px;font-weight:800;box-shadow:0 3px 0 #e8dfd0}
button.recap-close:focus-visible,button.recap-tile:focus-visible{outline:4px solid var(--sky-deep);outline-offset:3px}
.recap-grid{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));grid-auto-rows:min-content;align-content:start;gap:12px;padding:16px 18px 20px}
button.recap-tile{position:relative;display:block;width:100%;margin:0;min-height:150px;padding:32px 10px 12px;border:3px solid #eef3fa;border-radius:24px;background:#fff;color:var(--ink);box-shadow:0 5px 0 #dfe8f3;text-align:center;animation:recap-pop .42s cubic-bezier(.3,1.6,.5,1) both;animation-delay:calc(var(--i,0) * 55ms)}
button.recap-tile[aria-disabled=true]{cursor:default}
.recap-tile-body{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:100%}
.recap-tile.star{border-color:#ffe08a;background:#fffbea}
.recap-tile.practice{border-color:#ffd27a;background:#fff6dc;box-shadow:0 5px 0 #f0c45c}
.recap-tile.unmet{background:#f6f7f9;border-color:#eceff3;box-shadow:0 5px 0 #e3e7ec;color:#8a93a6}
.recap-tile.unmet .recap-zh{opacity:.55}
.recap-zh{display:block;font-family:var(--hand);font-size:44px;line-height:1.15;overflow-wrap:anywhere}.recap-zh.long-3{font-size:36px}.recap-zh.long-4{font-size:30px}
.recap-py{font-size:17px;color:var(--ink-soft)}
.recap-en{font-size:16px;color:var(--ink-soft);overflow-wrap:anywhere}
.recap-badge{display:flex;flex-direction:column;align-items:center;margin-top:6px;max-width:100%;font-size:13px;font-weight:800;line-height:1.25}
.recap-tile.star .recap-badge{position:absolute;top:6px;left:10px;margin:0;font-size:22px;line-height:1}
.recap-tile.practice .recap-badge{padding:3px 12px;border-radius:16px;background:var(--sun);color:#3d2b00}
.recap-tile.unmet .recap-badge{padding:3px 12px;border-radius:16px;border:2px dashed #cfd6e0;color:#7c879c}
.recap-sound{position:absolute;top:6px;right:10px;font-size:16px;line-height:1;opacity:.75}
@keyframes recap-pulse{0%,100%{transform:scale(1);box-shadow:0 5px 0 #e3c46a}45%{transform:scale(1.08);box-shadow:0 5px 0 #e3c46a,0 0 0 10px #ffc83d40}}
@keyframes recap-in{0%{transform:translateY(16px) scale(.97);opacity:0}100%{transform:none;opacity:1}}
@keyframes recap-pop{0%{transform:scale(.6);opacity:0}100%{transform:scale(1);opacity:1}}
@media(max-width:600px){
 .podium:has(.podium-canvas)>.recap-pill-box{top:142px;right:10px}
 .podium:has(.coop-end)>.recap-pill-box{right:auto;left:10px}
 button.recap-pill{font-size:17px;min-height:48px;padding:6px 14px}
 .recap-layer{padding:8px;align-items:center}
 .recap-card{max-height:calc(100dvh - 16px);border-radius:26px}
 .recap-head{padding:14px 12px 10px 16px}.recap-title{font-size:21px}.recap-score{font-size:17px}
 .recap-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px}
 button.recap-tile{min-height:128px}.recap-zh{font-size:38px}.recap-zh.long-3{font-size:32px}.recap-zh.long-4{font-size:26px}
}
/* PRACTICE-1: the practice of a child's missed words, in the same card as "My words". One word at a time, big and in 楷体,
   three meaning buttons (one column on a phone), a gentle sun colour for a miss and green for the right one, never red. */
.recap-foot{flex:none;display:flex;justify-content:center;padding:12px 18px 16px;border-top:3px solid #f1ece2;background:#fffdf8}
button.practice-start,button.practice-flip{margin:0;min-height:60px;padding:8px 28px;border:4px solid #fff;border-radius:999px;background:var(--sun);color:#3d2b00;font-weight:800;font-size:21px;box-shadow:0 5px 0 var(--sun-deep)}
.practice-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;align-items:center;gap:14px;padding:22px 20px 26px;text-align:center}
.practice-face{display:flex;flex-direction:column;align-items:center;gap:8px}
.practice-zh{font-family:var(--hand);font-size:104px;line-height:1.08;color:var(--ink);overflow-wrap:anywhere}.practice-zh.long-3{font-size:84px}.practice-zh.long-4{font-size:64px}
.practice-py{font-size:24px;color:var(--ink-soft)}
button.practice-hear{margin:0;min-height:52px;padding:6px 20px;border:3px solid #cfe0f5;border-radius:999px;background:#eef5ff;color:#223979;font-weight:800;font-size:18px;box-shadow:0 3px 0 #cfe0f5}
.practice-ask{margin:0;font-size:20px;font-weight:800;color:var(--ink-soft)}
.practice-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;width:100%}
button.practice-choice{margin:0;min-height:76px;padding:10px 12px;border:3px solid #dce7f4;border-radius:22px;background:#fff;color:var(--ink);font-size:21px;font-weight:700;line-height:1.25;box-shadow:0 5px 0 #dfe8f3;overflow-wrap:anywhere}
button.practice-choice:disabled{cursor:default;opacity:1;color:var(--ink)}
.practice-choices[data-done] button.practice-choice:not(.right):not(.wrong){opacity:.5}
button.practice-choice.right{border-color:#8fd17f;background:#e9f8e4;box-shadow:0 5px 0 #a9dd9b}
button.practice-choice.wrong{border-color:#ffd27a;background:#fff6dc;box-shadow:0 5px 0 #f0c45c}
.practice-say{margin:0;min-height:1.3em;font-size:21px;font-weight:800;line-height:1.3}.practice-say.good{color:#2f7a2a}.practice-say.kind{color:#7a5200}.practice-say.meaning{color:var(--ink);font-size:24px}
button.practice-next{margin:0;min-height:60px;padding:8px 32px;border:4px solid #fff;border-radius:999px;background:var(--sky-deep);color:#fff;font-weight:800;font-size:21px;box-shadow:0 5px 0 #1f5fa8}
button.practice-start:focus-visible,button.practice-flip:focus-visible,button.practice-hear:focus-visible,button.practice-choice:focus-visible,button.practice-next:focus-visible{outline:4px solid var(--sky-deep);outline-offset:3px}
button.practice-next:focus-visible{outline-color:#1f2a44}
.practice-cheer{font-size:72px;line-height:1}.practice-done{margin:0;font-size:30px;font-weight:800}.practice-sum{margin:0;font-size:19px;color:var(--ink-soft)}
@media(max-width:600px){
 .practice-body{padding:16px 12px 20px;gap:12px}
 .practice-zh{font-size:84px}.practice-zh.long-3{font-size:68px}.practice-zh.long-4{font-size:52px}
 .practice-choices{grid-template-columns:1fr;gap:10px}
 button.practice-choice{min-height:60px;font-size:20px}
}
/* TREASURE-1: the treasure pill, the sticker shop button and "my shelf" stand in one column at the top right of a child's
   race podium (the My words pill joins the bottom of it), clear of the title and of the steps along the bottom edge. The
   shop is a card like My words. Locked stickers are grey with a lock, bought ones green; never red. */
.treasure-box{display:flex;flex-direction:column;align-items:center;gap:10px;margin:12px 0}
.podium:has(.podium-canvas)>.treasure-box{position:absolute;top:80px;right:16px;margin:0;align-items:flex-end;max-width:calc(100% - 32px)}
.treasure-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}
.treasure-box .my-coins{margin:0;background:#fff;padding:10px 18px;border-radius:28px;font-size:20px;white-space:nowrap}
.treasure-box>.recap-pill-box{margin:0}
button.shop-pill{margin:0;min-height:52px;padding:8px 18px;border:4px solid #fff;border-radius:999px;background:#eef5ff;color:#223979;font-weight:800;font-size:19px;box-shadow:0 5px 0 #95b5d5;white-space:nowrap}
button.shop-pill:focus-visible{outline:4px solid #2f7fd8;outline-offset:3px}
.my-shelf{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:2px 4px;max-width:260px;padding:4px 12px;border:3px solid #fff;border-radius:22px;background:#fffbeb;box-shadow:0 4px 0 #e3c46a}
.shelf-sticker{font-size:28px;line-height:1.25}
.shop-grid{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));grid-auto-rows:min-content;gap:12px;padding:16px 18px 20px}
button.sticker{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;margin:0;min-height:140px;padding:12px 8px;border:3px solid #eef3fa;border-radius:24px;background:#fff;color:var(--ink);box-shadow:0 5px 0 #dfe8f3;text-align:center;animation:recap-pop .42s cubic-bezier(.3,1.6,.5,1) both;animation-delay:calc(var(--i,0) * 45ms)}
button.sticker.ready{border-color:#ffe08a;background:#fffbea;box-shadow:0 5px 0 #f0c45c}
button.sticker.owned{border-color:#a9dd9b;background:#e9f8e4;box-shadow:0 5px 0 #a9dd9b;cursor:default}
button.sticker.locked{background:#f6f7f9;border-color:#eceff3;box-shadow:0 5px 0 #e3e7ec;color:#7c879c;cursor:default}
button.sticker.locked .sticker-icon{filter:grayscale(1);opacity:.45}
button.sticker:focus-visible{outline:4px solid var(--sky-deep);outline-offset:3px}
.sticker-icon{font-size:52px;line-height:1.1}
.sticker-name{font-size:17px;font-weight:800;line-height:1.2;overflow-wrap:anywhere}
.sticker-price{font-size:16px;font-weight:800;padding:2px 12px;border-radius:14px;background:#fff6dc;color:#7a5200}
.sticker.owned .sticker-price{background:#d3f0ca;color:#2f6b2a}.sticker.locked .sticker-price{background:#eceff3;color:#6f7a8c}
button.sticker.pop,.shelf-sticker.pop{animation:sticker-pop .55s cubic-bezier(.3,1.6,.5,1) both}
.practice-coins{margin:0;font-size:19px;font-weight:800;color:#7a5200}
@keyframes sticker-pop{0%{transform:scale(.5)}60%{transform:scale(1.18)}100%{transform:scale(1)}}
@media(max-width:600px){
 .podium:has(.podium-canvas)>.treasure-box{top:64px;right:10px;gap:8px;max-width:calc(100% - 20px)}
 .treasure-box .my-coins{font-size:16px;padding:8px 12px}
 button.shop-pill{min-height:48px;font-size:16px;padding:6px 12px}
 .my-shelf{max-width:200px}.shelf-sticker{font-size:24px}
 .shop-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px}
 button.sticker{min-height:124px}.sticker-icon{font-size:44px}
}
/* TREASURE-1 follow-up: the 3D podium draws stars and name tags over each step. In landscape the column is narrow and
   stacked in the top right corner, right of the third step; in portrait (iPad and phone) it is one wrapping row just under
   the title, above the stars. So it never covers a star or a name tag. */
.podium:has(.podium-canvas)>.treasure-box{width:min(210px,calc(100% - 32px));align-items:stretch}
.podium:has(.podium-canvas)>.treasure-box .treasure-row{flex-direction:column;align-items:stretch;gap:8px}
.podium:has(.podium-canvas)>.treasure-box .my-coins{white-space:normal;text-align:center;line-height:1.25;border-radius:22px;padding:8px 12px;font-size:18px}
.podium:has(.podium-canvas)>.treasure-box button.shop-pill,.podium:has(.podium-canvas)>.treasure-box button.recap-pill{width:100%;white-space:normal;line-height:1.2;font-size:18px;padding:6px 12px}
.podium:has(.podium-canvas)>.treasure-box .my-shelf{max-width:none;justify-content:center}
@media(max-width:820px){
 .podium:has(.podium-canvas)>.treasure-box{top:72px;left:8px;right:8px;width:auto;max-width:none;flex-direction:row;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px 8px}
 .podium:has(.podium-canvas)>.treasure-box .treasure-row{flex-direction:row;flex-wrap:nowrap;gap:8px}
 .podium:has(.podium-canvas)>.treasure-box .my-coins,.podium:has(.podium-canvas)>.treasure-box button.shop-pill,.podium:has(.podium-canvas)>.treasure-box button.recap-pill{width:auto;white-space:nowrap;font-size:16px;min-height:44px;padding:6px 12px}
 .podium:has(.podium-canvas)>.treasure-box .my-shelf{padding:2px 10px}.podium:has(.podium-canvas)>.treasure-box .shelf-sticker{font-size:22px}
}
@media(max-width:400px){.podium:has(.podium-canvas)>.treasure-box .my-coins,.podium:has(.podium-canvas)>.treasure-box button.shop-pill,.podium:has(.podium-canvas)>.treasure-box button.recap-pill{font-size:14px;padding:6px 10px}}
@media(prefers-reduced-motion:reduce){button.sticker,button.sticker.pop,.shelf-sticker.pop{animation:none}}
@media(prefers-reduced-motion:reduce){.recap-pill.pulse,.recap-card,button.recap-tile{animation:none}}
.shop-grid .sticker-set{grid-column:1/-1;display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:6px 2px 0;font-size:19px;color:#5a4a7a}
.shop-grid .sticker-set:first-child{margin-top:0}.sticker-set small{font-size:15px;font-weight:800;color:#7a6a95}
.sticker-set.done small{color:#2f8a2a}.sticker-set.pop{animation:sticker-pop .55s cubic-bezier(.3,1.6,.5,1) both}
.set-done{flex:none;white-space:normal;overflow-wrap:anywhere;margin:0 18px;padding:0 14px;max-height:0;overflow:hidden;border-radius:16px;background:#e9f8e4;color:#2f6b2a;font-weight:800;text-align:center;transition:max-height .25s,padding .25s}
.set-done.on{max-height:140px;padding:8px 14px;margin-top:10px;margin-bottom:4px;animation:set-done-in .3s ease-out both}
@keyframes set-done-in{from{opacity:0}to{opacity:1}}
.podium-quiet{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px 14px;margin:8px auto;font-size:16px;color:#6f6a7c}
.podium-quiet .quiet-count{font-weight:600}
.wait-recap{position:fixed;left:50%;bottom:112px;transform:translateX(-50%);z-index:15;display:flex;flex-direction:column;align-items:center;gap:6px;max-width:calc(100% - 24px);padding:10px 16px 12px;border:3px solid #fff;border-radius:26px;background:#ffffffed;box-shadow:0 5px 0 #95b5d5;text-align:center}
.wait-recap-say{font-size:16px;font-weight:800;color:#223979}
@media(max-width:600px){.wait-recap{bottom:104px;padding:8px 12px}.wait-recap-say{font-size:14px}}
.teacher-review-page .review-back{display:inline-block;margin:4px 0 8px;font-weight:800}
.teacher-review-page .review-word.ok{color:#5f6b5a}.review-again-box{background:#fffbeb}.review-again{font-weight:800}
.podium:has(.podium-canvas)>.podium-quiet{position:absolute;top:76px;left:12px;max-width:min(280px,40%);margin:0;justify-content:flex-start;padding:6px 12px;border-radius:18px;background:#ffffffd9;font-size:15px;z-index:1}
/* GUESS-1 (Word kart): the right word after a wrong lane, a bar that runs down for the lock, and the coins that fly off. */
.kart-reveal{position:absolute;left:50%;top:104px;transform:translateX(-50%) scale(.9);z-index:6;display:flex;flex-direction:column;align-items:center;gap:2px;background:#fffdf3;border:4px solid #fff;border-radius:26px;padding:10px 26px 14px;box-shadow:0 6px 0 #7fbf8a,0 0 0 6px #49b36b55;color:#1f5c2e;opacity:0;pointer-events:none;transition:opacity .2s;overflow:hidden;max-width:calc(100% - 24px)}
.kart-reveal.on{transition:none;opacity:1;transform:translateX(-50%) scale(1)}
@media(max-width:600px){.kart-reveal{top:150px;padding:6px 18px 10px}.kart-reveal-word{font-size:36px}}
.kart-reveal-say{font-size:16px;font-weight:bold}.kart-reveal-word{font-family:'LXGW WenKai',class,'Noto Sans CJK SC',sans-serif;font-size:46px;line-height:1.15;overflow-wrap:anywhere;text-align:center}
.kart-reveal-bar{position:absolute;left:0;bottom:0;height:6px;width:100%;background:#49b36b;transform-origin:left;animation:kart-lock linear forwards}
@keyframes kart-lock{to{transform:scaleX(0)}}
.kart-locked .kart-controls{opacity:.45;filter:grayscale(.6)}
.coin-pill{position:relative}
.kart-coin-loss{position:absolute;bottom:-10px;left:-22px;z-index:4;padding:1px 7px;border-radius:12px;background:#fff;border:2px solid #f4b5ad;font-size:16px;line-height:1.2;font-weight:bold;color:#c0392b;text-shadow:0 2px 0 #fff;animation:kart-coins-off 1.1s ease-out forwards;pointer-events:none}
@keyframes kart-coins-off{0%{opacity:1;transform:translate(0,0) scale(1.15)}70%{opacity:1}100%{opacity:0;transform:translate(-34px,-8px) scale(.9) rotate(-12deg)}}
.streak-pill.tired>span{opacity:.3!important}.streak-pill.tired small{color:#5b6b8a;font-size:15px;margin-left:4px}
.choice.right{background:#dff5e3;border-color:#49b36b;box-shadow:0 0 0 4px #49b36b66;opacity:1}
/* FX-1: the kart's first-try streak badge, under the streak pill. Gold and cream only. FX-MOTION-1: no pop when reduced motion is asked for. */
.kart-room .kart-hud .kart-cheer{position:absolute;top:128px;left:0;padding:6px 14px;border-radius:22px;background:#fffbeb;border:3px solid #ffe89a;box-shadow:0 4px 0 #ecca6b;color:#7a5400;font-weight:bold;font-size:18px;white-space:nowrap;pointer-events:none;opacity:0;transform:scale(.6);transition:opacity .2s,transform .2s}
.kart-room .kart-hud .kart-cheer.on{opacity:1;transform:scale(1);animation:kart-cheer-pop .45s}
.kart-room .kart-hud .kart-cheer.level2{background:#fff3c4;border-color:#ffd23f;font-size:20px}
@keyframes kart-cheer-pop{0%{transform:scale(.6)}55%{transform:scale(1.18)}100%{transform:scale(1)}}
@media(max-width:600px){.kart-room .kart-hud .kart-cheer{top:126px;font-size:15px;padding:4px 10px}}
@media(prefers-reduced-motion:reduce){.kart-room .kart-hud .kart-cheer,.kart-room .kart-hud .kart-cheer.on{animation:none;transition:none;transform:none}}
/* HOST-STRIP-1: the projector's per-child strip in the 3D race games. It is its own band under the game view (the view gets
   the rest of the height), so it never covers the course, the room code or Pause and End. Two rows at most; more children
   scroll inside it. Progress and three gentle marks only: finished, offline, needs a hand. Never red. */
.fun-host-view>.fun-stage:has(>.fun-kids:not(:empty)){display:flex;flex-direction:column}
.fun-host-view>.fun-stage:has(>.fun-kids:not(:empty))>canvas{flex:1 1 auto;min-height:0;height:auto}
.fun-kids{flex:none;display:flex;flex-wrap:wrap;align-content:flex-start;gap:6px;max-height:96px;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;padding:7px 12px;background:#ffffffe6;border-top:3px solid #fff;box-shadow:0 -4px 0 #95b5d5}
.fun-kids:empty{display:none}
/* More children below the two rows: a soft shade at the bottom edge says the strip scrolls. */
.fun-kids.more{box-shadow:0 -4px 0 #95b5d5,inset 0 -16px 12px -10px #5a7fa2a0}
.fun-kid{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 12px;border-radius:999px;background:#eef5ff;border:2px solid #cfe0f5;color:#223979;font-size:17px;line-height:1;white-space:nowrap}
.fun-kid b{font-weight:800}
.fun-kid-count{color:#4a5f86;font-variant-numeric:tabular-nums}
.fun-kid-mark{font-weight:800}
.fun-kid.done{background:#e9f8e4;border-color:#a9dd9b}.fun-kid.done .fun-kid-mark{color:#2f8a2a}
.fun-kid.away{background:#f1f2f5;border-color:#d8dce3;color:#6f7a8c}.fun-kid.away .fun-kid-count{color:#8a93a6}
.fun-kid.help{background:#fff3c4;border-color:#ffc83d;color:#5c4100}
/* PILL-LINK-1: the teacher's review links look like the room's other buttons, not raw blue links. */
.review-link,.review-back{display:inline-flex;align-items:center;min-height:56px;margin:5px;padding:10px 18px;border:2px solid #cfc4e1;border-radius:16px;background:#fffdf8;box-shadow:0 3px 0 #d8c9b9;color:inherit;text-decoration:none;font-size:18px;font-weight:normal}
.review-link:focus-visible,.review-back:focus-visible{outline:4px solid #729eaa}
/* SIDEWAYS-1: Word kart on a phone held sideways (844x390 and similar): the road is the screen height (no 500px floor that
   pushed the arrows off the bottom), the prompt card sits in the right column so the signs keep the middle, smaller pills
   and arrows, and the long hint goes. */
@media (orientation:landscape) and (max-height:500px){
.kart-stage>canvas{min-height:0!important;height:100dvh!important}
.kart-room .kart-hud{top:6px!important;left:8px!important;width:calc(100% - 16px)!important;gap:6px!important}
.kart-room .kart-hud span{font-size:14px!important;padding:4px 10px!important}
.kart-room .kart-prompt{top:56px!important;right:8px!important;left:auto!important;transform:none!important;max-width:24%;padding:4px!important}
.kart-room .kart-prompt .prompt{min-height:0!important;flex-direction:column}
.kart-room .kart-prompt .picture{font-size:36px}.kart-room .kart-prompt .text-card{font-size:18px;max-width:100%}
.kart-room .kart-prompt button{min-width:52px;width:52px;height:52px;font-size:22px}
.kart-controls{bottom:8px!important}.kart-controls button{width:56px!important;height:56px!important;font-size:26px!important}.kart-controls span{display:none!important}
.kart-reveal{top:44px!important;padding:4px 16px 8px}
.kart-room:has(.race-code) .kart-prompt{top:44px!important}
}
/* PROJECTOR-SAFE-1: the teacher-only switch is a small pill, not one of the big round race buttons. */
.kart-room .kart-prompt .fun-kids-toggle{font-size:15px;min-height:44px;height:auto;min-width:0;width:auto;border-radius:22px;padding:6px 14px;background:#f3f0ff;color:#3b2a7a;border:2px solid #cfc6ff;box-shadow:0 3px 0 #b9aef0}
.kart-kids{flex-basis:100%;font-size:15px;background:#ffffffe6;border-radius:16px;padding:6px 12px;color:#223979}
.kart-kids[hidden]{display:none}
/* SIDEWAYS-1: the "while you wait" box sits at the side (landscape) or under the top pills (upright), never over the
   child's own kart or character in the middle of the road. */
@media (orientation:landscape){.wait-recap{top:150px;bottom:auto;max-width:min(420px,40%)}}
@media (orientation:landscape) and (max-height:500px){.wait-recap{top:44px;padding:4px 10px 6px;max-width:34%;gap:2px}.wait-recap-say{font-size:12px}.wait-recap .recap-pill{font-size:15px;min-height:40px;padding:4px 12px}}
@media (orientation:portrait){.wait-recap{top:170px;bottom:auto}}
.kart-controls[hidden]{display:none!important}
/* SIDEWAYS-1: the child's waiting room on a phone held sideways: the "me" card sits beside the class list in one row, so
   both fit the short screen instead of the list being pushed below the bottom edge. */
@media (orientation:landscape) and (max-height:500px){
main.kid-lobby{display:grid;grid-template-columns:minmax(220px,38%) 1fr;grid-template-rows:auto 1fr;gap:10px;padding:8px 16px;min-height:100dvh;align-items:start}
main.kid-lobby>.lobby-bar{grid-column:1/-1}
main.kid-lobby .kid-hero{padding:10px 12px;border-radius:28px;gap:4px}
main.kid-lobby .kid-hero .me-big{width:72px;height:72px;font-size:44px}
main.kid-lobby .me-shadow{width:60px}
main.kid-lobby .me-stage{padding-top:4px}
main.kid-lobby .me-name{font-size:28px}
main.kid-lobby .me-wait{font-size:16px}
main.kid-lobby .class-list{padding:10px 12px;max-height:calc(100dvh - 90px);overflow-y:auto}
main.kid-lobby .lobby .players,main.kid-lobby .players{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
}
.wait-recap .recap-pill{max-width:100%;white-space:normal}
/* GAME-NAME-1: the game's own name, small, at the start of the end-of-round title line (one line, so the title does not grow) */
.podium-game{font-size:14px;font-weight:800;color:#56627e;margin-right:10px;vertical-align:middle;white-space:nowrap}
@media (max-width:600px){.podium-game{display:none}}
/* PODIUM-RANK-1: a child's own place on their own device, big and kind, and the teacher's private list of every child.
   Over a 3D podium the steps already carry each name tag, so the top-3 cards stay for screen readers only (in place order)
   and nothing sits on the step numbers; without WebGL the canvas is removed and the cards show as before. */
.my-place{display:flex;align-items:center;justify-content:center;gap:12px;width:max-content;max-width:calc(100% - 24px);margin:12px auto;padding:8px 20px;background:#fffffff2;border-radius:24px;box-shadow:0 4px 0 #c6dcfa}
.my-place .avatar{flex:none;width:48px;height:48px;font-size:34px}
.my-place-words{display:flex;flex-direction:column;align-items:flex-start;line-height:1.2}
.my-place-rank{font-size:28px;color:#234f99}
.my-place-of{font-size:16px;color:#56627e}
.my-place.no-place .my-place-rank{font-size:22px}
.podium:has(.podium-canvas)>.my-place{position:absolute;bottom:10px;left:50%;transform:translateX(-50%);margin:0;z-index:1}
.podium:has(.podium-canvas)>.podium-steps:not(.coop-results)>.player{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;min-width:0;min-height:0}
.podium:has(.podium-canvas)>.podium-steps:not(.coop-results):not(:has(.podium-rest)){background:none;padding:0;min-height:1px;pointer-events:none}
.podium-steps .player.me{outline:4px solid #5ba4cf;outline-offset:-4px}
.end-kids h2{margin:0 0 8px}
.end-kid{display:flex;align-items:center;gap:10px;padding:4px 0;border-top:1px solid #eee5f6;font-size:17px}
.end-kid .avatar{flex:none;width:32px;height:32px;font-size:22px}
.end-kid-place{min-width:64px}.end-kid-name{flex:1}.end-kid-done{color:#56627e;font-size:14px}
.end-kid.quiet{color:#6f6a7c}
@media(max-height:500px){.my-place{padding:4px 14px;gap:8px}.my-place .avatar{width:36px;height:36px;font-size:26px}.my-place-rank{font-size:22px}.my-place-of{font-size:14px}}
.podium-rule span{display:inline-block;padding:4px 14px;border-radius:999px;background:#ffffffe6;font-size:16px;color:#493426}
.my-place .podium-rule{margin:2px 0 0}.my-place .podium-rule span{padding:0;background:none;font-size:14px;color:#56627e}
.podium:has(.podium-canvas):has(>button)>.podium-rule{display:block;order:-1;flex:0 0 100%;margin:0;text-align:center}
@media(max-height:500px){.my-place .podium-rule span{font-size:12px}}
/* PODIUM-RANK-1: a tie can put more than three children in places 1 to 3; the extra ones are in the list under the steps.
   That list and the child's own card (or the teacher's rule and buttons) share the bottom edge in one column, so neither
   covers the other, however many button rows there are. */
.podium:has(.podium-canvas):not(:has(>button)):not(:has(.coop-end)){display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:8px;padding-bottom:10px}
.podium:has(.podium-canvas):not(:has(>button))>.my-place{position:static;transform:none;margin:0}
.podium:has(.podium-canvas)>.podium-steps:not(.coop-results){position:static;transform:none;width:min(920px,96%);margin:0}
.podium:has(.podium-canvas):has(>button):not(:has(.coop-end))>.podium-steps:not(.coop-results){order:-2;flex:0 0 min(920px,96%)}
.podium:has(.podium-canvas):not(:has(>button))>.podium-steps:has(.podium-rest){background:none;padding:0}
@media(min-aspect-ratio:1/1){.podium:has(.podium-canvas):not(:has(>button))>.podium-steps:has(.podium-rest){width:min(560px,calc(100% - 500px))}}
@media(max-height:500px){.podium .podium-steps .podium-rest{grid-auto-rows:36px;max-height:36px}.podium .podium-steps .podium-rest .player{height:36px}}
@media(min-aspect-ratio:1/1) and (max-height:500px){.podium:has(.podium-canvas):not(:has(>button))>.podium-steps:has(.podium-rest){position:absolute;top:76px;bottom:auto;left:12px;width:200px}.podium:has(.podium-canvas):not(:has(>button)) .podium-steps .podium-rest{grid-template-columns:1fr}}
/* TIE-LIST-1: the tie list under the podium never covers a step number. On a narrow screen its rows sit two to a line, so a
   tie that spills two or more children under the steps takes one row there, not one per child, and the stack of list, rule
   and buttons stays below the numbers (scripts/test-tie-list-browser.mjs measures it at 1366x768, 1024x768, 768x1024 and 390x844). */
@media(max-width:600px){.podium .podium-steps .podium-rest{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}}
