/* Global Mali type system */
:root{font-family:'Mali',cursive;font-synthesis:weight}
html,body,button,input,select,textarea,table{font-family:'Mali',cursive}
body{line-height:1.55}
h1,h2,h3,h4,b,strong,.btn,.plain{font-weight:700;line-height:1.35}
input,textarea,select{line-height:1.55}

/* Homepage adventure composition */
.role-public .page:has(.home-adventure){width:100%;min-height:0;margin:0;padding:0}
.home-adventure{position:relative;isolation:isolate;min-height:calc(100vh - 78px);overflow:hidden;background:#4ac3f5}
.home-scene{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;z-index:-3;filter:saturate(1.12) brightness(1.05)}
.home-adventure:after{content:"";position:absolute;inset:0;z-index:-2;background:linear-gradient(90deg,rgba(236,251,255,.82) 0%,rgba(238,252,255,.5) 34%,rgba(255,255,255,.02) 62%),linear-gradient(0deg,rgba(4,84,142,.16),transparent 34%)}
.home-glow{position:absolute;z-index:-1;left:2%;top:8%;width:54%;height:69%;border-radius:50%;background:radial-gradient(circle,#fff9 0 18%,#fff4 43%,transparent 70%);filter:blur(10px)}
.home-music-toggle{position:absolute;z-index:24;right:3.2%;top:112px;display:flex;align-items:center;gap:8px;padding:9px 15px 9px 9px;border:3px solid #fff;border-radius:999px;color:#16477f;background:#ffffffdf;box-shadow:0 6px 0 #78bce1,0 12px 25px #164f7733;backdrop-filter:blur(12px);cursor:pointer;transition:.2s transform,.2s background}.home-music-toggle:hover{transform:translateY(-3px)}.home-music-toggle span{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:linear-gradient(#ffe768,#ffb71b);font-size:20px;box-shadow:inset 0 2px #fff9}.home-music-toggle b{font-size:13px}.home-music-toggle.playing{color:#fff;background:linear-gradient(#52baff,#2678ec);box-shadow:0 6px 0 #1756ad,0 12px 25px #164f7740}.home-music-toggle.playing span{animation:musicBounce .8s ease-in-out infinite alternate}@keyframes musicBounce{to{transform:rotate(10deg) scale(1.12)}}
.home-nav{position:relative;z-index:20;display:grid;grid-template-columns:minmax(300px,1fr) auto minmax(180px,.55fr);align-items:center;gap:20px;width:calc(100% - 48px);min-height:78px;margin:18px auto;padding:8px 14px;background:#f8fdffe8;border:3px solid #fff;border-radius:30px;box-shadow:0 10px 30px #17558a3b;backdrop-filter:blur(15px)}
.school-sign{display:flex;align-items:center;gap:12px;min-width:0;color:#0b3b7d}.school-sign>span{font-size:42px;filter:drop-shadow(0 4px 3px #174a7444)}.school-sign div{display:grid;min-width:0}.school-sign b{font-size:18px;white-space:nowrap}.school-sign small{font-size:11px;font-weight:600;white-space:nowrap}
.home-nav nav{display:flex;align-items:center;gap:4px}.home-nav nav a{display:flex;align-items:center;gap:7px;padding:12px 14px;border-radius:17px;color:#123f83;font-weight:700;white-space:nowrap;transition:.2s transform,.2s background,.2s box-shadow}.home-nav nav a:hover,.home-nav nav a.active{transform:translateY(-2px);background:linear-gradient(#fff,#dff4ff);box-shadow:0 6px 15px #1e659827}.home-login{justify-self:end;display:flex;align-items:center;gap:8px;padding:7px 14px 7px 8px;border-radius:999px;background:#fff;color:#153f7d;box-shadow:0 4px 12px #25577b2b}.home-login>span{display:grid;place-items:center;width:43px;height:43px;border-radius:50%;background:#d9f2ff;font-size:28px}
.home-copy{--px:0px;--py:0px;position:relative;z-index:6;width:min(610px,48vw);margin:5vh 0 255px 8.5vw;text-align:center;transform:translate(var(--px),var(--py));transition:transform .25s ease-out}.home-rainbow{position:absolute;left:50%;top:-80px;transform:translateX(-50%);font-size:155px;line-height:1;filter:drop-shadow(0 8px 5px #246a9b33)}.home-rainbow i{position:absolute;left:50%;top:-5px;color:#ffd335;font-size:40px;font-style:normal;text-shadow:0 3px 0 #e59713}.home-copy h1{position:relative;margin:0}.home-copy h1>span{display:block;color:#ffc735;font-size:clamp(65px,7.4vw,126px);font-weight:800;letter-spacing:-.07em;line-height:.92;-webkit-text-stroke:9px #0757b4;paint-order:stroke fill;text-shadow:0 5px 0 #fff,0 12px 0 #08357d,0 18px 28px #0a497e59}.home-copy h1>small{display:inline-block;margin-top:14px;padding:12px 46px;color:#fff;font-size:clamp(23px,2.4vw,38px);font-weight:700;line-height:1.25;background:linear-gradient(#bf6a31,#8c3c13);border:4px solid #dc8b48;border-radius:18px 24px 16px 22px;box-shadow:0 8px 0 #642b0e,0 15px 25px #183c5f3f;text-shadow:0 3px 2px #53250e}.home-copy p{margin:22px 0 16px;color:#082e72;font-size:clamp(17px,1.5vw,24px);font-weight:700;text-shadow:0 2px 0 #fff,0 0 10px #fff}
.home-actions{display:grid;gap:13px;width:min(430px,90%);margin:auto}.home-actions form{margin:0}.home-btn{width:100%;height:76px;display:grid;grid-template-columns:62px 1fr 28px;align-items:center;border:3px solid #fff;border-radius:25px;color:#fff;font-size:25px;font-weight:700;cursor:pointer;box-shadow:inset 0 4px 3px #fff8,0 8px 0 #a80d59,0 15px 27px #184e7e46;transition:.18s transform,.18s filter}.home-btn:hover{transform:translateY(-4px) scale(1.015);filter:saturate(1.12)}.home-btn:active{transform:translateY(4px);box-shadow:inset 0 3px 3px #fff7,0 3px 0 #8d174e}.home-btn i{font-size:35px;font-style:normal}.home-btn b{font-size:42px}.home-btn.primary{background:linear-gradient(#ff69aa,#f01278)}.home-btn.guest{color:#133d79;background:linear-gradient(#ffeb5d,#ffb514);box-shadow:inset 0 4px 3px #fff9,0 8px 0 #d17e09,0 15px 27px #184e7e3d}.teacher-entry{justify-self:center;padding:8px 17px;color:#0d3a75;background:#ffffffd9;border:2px solid #fff;border-radius:999px;font-weight:700;box-shadow:0 5px 14px #194d7628}
.home-cast{--px:0px;--py:0px;position:absolute;z-index:5;right:3.5%;bottom:168px;width:min(56vw,850px);height:68%;pointer-events:none;transform:translate(var(--px),var(--py));transition:transform .25s ease-out}.home-cast>img{position:absolute;right:0;bottom:-2%;width:100%;max-height:100%;object-fit:contain;object-position:right bottom;filter:drop-shadow(0 22px 22px #11477158)}.home-cat{position:absolute;left:1%;bottom:-2%;width:230px;height:310px;background:url('../images/cat-adventure-sprites.png') 0 0/768px 512px no-repeat;filter:drop-shadow(0 15px 12px #154c704b);transform:scale(.82);transform-origin:left bottom}.speech-bubble{position:absolute;right:2%;top:13%;padding:13px 20px;color:#0d3d7f;text-align:center;background:#fff;border:4px solid #b7e7ff;border-radius:50%;font-size:18px;font-weight:700;box-shadow:0 7px 0 #7bc7ed;transform:rotate(5deg)}
.floating-star{position:absolute;z-index:4;color:#ffd322;font-size:42px;text-shadow:0 4px 0 #e3910b;animation:homeTwinkle 2.4s ease-in-out infinite}.star-a{right:43%;top:18%}.star-b{right:5%;top:25%;animation-delay:-1s}.floating-balloon{position:absolute;z-index:2;right:37%;top:13%;font-size:70px;animation:homeFloat 5s ease-in-out infinite;filter:drop-shadow(0 8px 7px #1b578147)}
.home-features{position:absolute;z-index:15;left:2.7%;right:2.7%;bottom:24px;display:grid;grid-template-columns:repeat(3,1fr);gap:22px}.feature-card{min-height:132px;display:grid;grid-template-columns:145px 1fr 45px;align-items:center;padding:14px 18px;border:4px solid #fff;border-radius:30px;background:linear-gradient(135deg,#fff1f8f5,#fffafde8);box-shadow:0 8px 0 #e99bbf,0 18px 33px #154d763c;transition:.2s transform,.2s filter}.feature-card:hover{transform:translateY(-7px);filter:saturate(1.08)}.feature-card.playing{background:linear-gradient(135deg,#effff5f5,#f9fffbe8);box-shadow:0 8px 0 #6fcf91,0 18px 33px #154d763c}.feature-card.rewarding{background:linear-gradient(135deg,#f8f2fff5,#fffdf7e8);box-shadow:0 8px 0 #a994e9,0 18px 33px #154d763c}.feature-visual{font-size:58px;text-align:center;filter:drop-shadow(0 8px 5px #17456b36)}.feature-card>span:nth-child(2){display:grid}.feature-card b{font-size:22px}.feature-card small{color:#456489;font-size:15px;font-weight:500}.feature-card>i{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;color:#fff;background:#f32583;font:700 34px/1 'Mali',cursive;box-shadow:inset 0 2px 2px #fff9,0 4px 0 #b9145d}.feature-card.playing>i{background:#10cb7b;box-shadow:inset 0 2px 2px #fff9,0 4px 0 #0d945b}.feature-card.rewarding>i{background:#8b46ef;box-shadow:inset 0 2px 2px #fff9,0 4px 0 #6130ad}
.role-public footer{position:relative;z-index:20;background:linear-gradient(90deg,#062d69,#075299,#062d69);border-top:3px solid #5bc9ff}
@keyframes homeTwinkle{50%{transform:scale(.65) rotate(20deg);opacity:.45}}@keyframes homeFloat{50%{transform:translateY(-17px) rotate(4deg)}}

@media(max-width:1180px){.home-nav{grid-template-columns:1fr auto}.home-nav nav{grid-row:2;grid-column:1/-1;justify-content:center}.home-login{grid-column:2}.home-copy{margin-left:4vw;width:52vw}.home-cast{right:-7%;width:62vw}.home-cat{display:none}.feature-card{grid-template-columns:100px 1fr 40px}.feature-visual{font-size:48px}}
@media(min-width:801px) and (max-width:1100px){
  .home-adventure{min-height:1180px}
  .home-music-toggle{position:relative;top:auto;right:auto;width:max-content;margin:8px 18px 0 auto}
  .home-copy{width:min(650px,82%);margin:105px auto 0}
  .home-copy h1>span{font-size:clamp(70px,10vw,98px)}
  .home-copy h1>small{font-size:clamp(23px,3.5vw,32px)}
  .home-cast{position:relative;right:auto;bottom:auto;width:min(760px,88%);height:430px;margin:-25px 0 0 auto}
  .home-cast>img{right:0}
  .speech-bubble{right:4%;top:8%}
  .home-features{position:relative;left:auto;right:auto;bottom:auto;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:-5px 18px 38px}
  .feature-card{min-width:0;min-height:168px;grid-template-columns:minmax(0,1fr) 38px;grid-template-rows:auto 1fr;padding:12px 14px;column-gap:7px;border-radius:24px}
  .feature-visual{grid-column:1/-1;font-size:43px;line-height:1.15}
  .feature-card>span:nth-child(2){grid-column:1;min-width:0;align-self:center}
  .feature-card b{font-size:17px;line-height:1.35}
  .feature-card small{font-size:12px;line-height:1.55}
  .feature-card>i{grid-column:2;grid-row:2;align-self:center;width:34px;height:34px;font-size:28px}
}
@media(max-width:800px){.home-adventure{min-height:1250px}.home-nav{width:calc(100% - 20px);margin:10px auto;grid-template-columns:1fr auto;gap:8px;border-radius:22px}.school-sign small{white-space:normal}.home-nav nav{overflow-x:auto;justify-content:flex-start;width:100%;padding-bottom:2px}.home-nav nav a{padding:9px 12px}.home-nav nav a span{font-size:13px}.home-login b{display:none}.home-music-toggle{position:relative;top:auto;right:auto;z-index:21;width:max-content;margin:8px 12px 0 auto;padding:6px 12px 6px 7px}.home-music-toggle span{width:30px;height:30px;font-size:17px}.home-music-toggle b{font-size:11px}.home-copy{width:92%;margin:100px auto 0}.home-copy h1>span{font-size:clamp(55px,14vw,88px)}.home-copy h1>small{font-size:21px;padding:10px 25px}.home-rainbow{font-size:125px}.home-actions{width:min(430px,94%)}.home-cast{position:relative;right:auto;bottom:auto;width:min(720px,110%);height:440px;margin:5px -5% 0 auto}.home-cast>img{right:0}.speech-bubble{right:8%;top:6%}.home-features{position:relative;left:auto;right:auto;bottom:auto;grid-template-columns:1fr;margin:0 16px 35px}.feature-card{min-height:116px;grid-template-columns:100px 1fr 42px}.floating-balloon{right:10%;top:17%}.star-a{left:8%;top:26%}}
@media(max-width:520px){.home-adventure{min-height:1170px}.home-nav{padding:7px}.school-sign>span{font-size:31px}.school-sign b{font-size:12px}.school-sign small{font-size:9px}.home-login>span{width:36px;height:36px;font-size:23px}.home-nav nav a{font-size:17px}.home-nav nav a span{display:none}.home-copy{margin-top:100px}.home-copy h1>span{font-size:50px;-webkit-text-stroke-width:6px}.home-copy h1>small{font-size:16px;border-width:3px}.home-copy p{font-size:15px}.home-btn{height:64px;grid-template-columns:48px 1fr 25px;font-size:19px}.home-btn i{font-size:29px}.home-cast{height:330px;margin-top:20px}.speech-bubble{font-size:12px;padding:9px 13px}.feature-card{grid-template-columns:72px 1fr 36px;padding:10px;min-height:105px}.feature-visual{font-size:37px}.feature-card b{font-size:17px}.feature-card small{font-size:12px}.feature-card>i{width:34px;height:34px;font-size:28px}}
@media(prefers-reduced-motion:reduce){.home-copy,.home-cast{transform:none!important}}

/* Mobile reading practice: keep the whole activity between both navigation bars. */
@media(max-width:600px){
  html:has(.practice),body:has(.practice){height:100%;height:100dvh;overflow:hidden}
  body:has(.practice) .sky{display:none}
  body:has(.practice) .topbar{position:relative;top:0;height:64px;min-height:64px;padding:7px 12px;border-bottom-width:2px}
  body:has(.practice) .brand-mini{gap:7px;font-size:17px}
  body:has(.practice) .brand-mini span{width:40px;height:40px;border-radius:13px}
  body:has(.practice) .topbar .plain{padding:8px 10px;font-size:13px}
  body:has(.practice) .page{width:100%;height:calc(100dvh - 64px);min-height:0;margin:0;padding:7px 9px calc(67px + env(safe-area-inset-bottom));overflow:hidden}
  body:has(.practice)>footer{display:none}
  body:has(.practice) .bottom-nav{height:62px;padding:6px 8px calc(5px + env(safe-area-inset-bottom));box-shadow:0 -5px 18px #224f7a24}
  body:has(.practice) .bottom-nav a{font-size:17px;line-height:1.1}
  body:has(.practice) .bottom-nav small{font-size:9px}
  .practice{height:100%;display:grid;grid-template-rows:62px minmax(0,1fr) 0 42px;gap:7px;overflow:hidden}
  .practice-head{height:62px;grid-template-columns:46px minmax(0,1fr) auto;gap:8px;padding:6px 9px;border-width:2px;border-radius:19px}
  .practice-head .circle-back{width:43px;height:43px;border-width:2px;font-size:23px;box-shadow:0 4px 0 #83b8db}
  .practice-head>div{gap:2px}
  .practice-head .eyebrow{font-size:11px;letter-spacing:0}
  .practice-head .progress{height:11px;border-width:2px;min-width:0}
  .practice-head .progress i{height:7px}
  .practice-head>strong{font-size:12px;white-space:nowrap}
  .practice-layout{height:100%;min-height:0;display:grid;grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto;gap:7px;margin:0}
  .practice-layout .word-card{height:100%;min-height:0;margin:0;display:grid;grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto;border-width:2px;border-radius:22px}
  .practice-layout .word-image{height:auto!important;min-height:0;overflow:hidden}
  .practice-layout .word-image img{width:100%;height:100%;padding:5px;object-fit:contain}
  .practice-layout .word-copy{min-height:86px;padding:5px 10px 8px}
  .practice-layout .word-copy .eyebrow{display:none}
  .practice-layout .word-copy h1{margin:0;font-size:clamp(38px,12vw,54px);line-height:1.05}
  .practice-layout .word-copy p{margin:5px 0 0;font-size:14px;line-height:1.35}
  .practice-panel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:9px;border-width:2px;border-radius:20px;box-shadow:0 5px 0 #cbd9df,0 10px 20px #28597e25}
  .practice-panel>b{grid-column:1/-1;font-size:15px;line-height:1.2}
  .practice-panel .btn{width:100%;min-height:43px;padding:5px 7px;border-width:1px;border-radius:13px;font-size:13px;line-height:1.15;box-shadow:inset 0 2px 1px #ffffffa6,0 4px 0 color-mix(in srgb,currentColor 35%,#27336b)}
  #record-status{position:fixed;z-index:45;left:50%;bottom:68px;transform:translateX(-50%);width:max-content;max-width:90vw;margin:0;padding:6px 12px;border-radius:999px;background:#17335eea;color:#fff;text-align:center;font-size:12px}
  #record-status:empty{display:none}
  .practice-nav{height:42px;margin:0;display:block}
  .practice-nav .btn{width:100%;height:38px;min-height:38px;padding:5px 12px;border-width:1px;border-radius:14px;font-size:13px;box-shadow:0 4px 0 #173d74}
}
@media(max-width:600px) and (max-height:720px){
  body:has(.practice) .topbar{height:56px;min-height:56px}
  body:has(.practice) .brand-mini span{width:34px;height:34px}
  body:has(.practice) .page{height:calc(100dvh - 56px);padding-top:5px;padding-bottom:58px}
  body:has(.practice) .bottom-nav{height:54px}
  .practice{grid-template-rows:54px minmax(0,1fr) 0 36px;gap:5px}
  .practice-head{height:54px}
  .practice-head .circle-back{width:38px;height:38px}
  .practice-layout{gap:5px}
  .practice-layout .word-copy{min-height:70px}
  .practice-layout .word-copy h1{font-size:35px}
  .practice-layout .word-copy p{font-size:12px}
  .practice-panel{gap:5px;padding:6px}
  .practice-panel>b{font-size:13px}
  .practice-panel .btn{min-height:36px;font-size:11px}
  .practice-nav,.practice-nav .btn{height:33px;min-height:33px}
}

/* Recording state, locked progression, and game answer feedback */
.btn:disabled,.btn[aria-disabled="true"]{cursor:not-allowed;transform:none;filter:grayscale(.35);opacity:.58;box-shadow:inset 0 2px 1px #ffffff8c,0 3px 0 #7f8fa3}
.record-status{min-height:30px;margin:10px 0 0;padding:6px 12px;text-align:center;border-radius:14px;color:#496986;font-weight:700;transition:.2s}
.record-status.recording{color:#a51f4c;background:#ffe6ef;animation:recordPulse 1s ease-in-out infinite}
.record-status.sending{color:#195e9f;background:#e5f4ff}
.record-status.success{color:#167747;background:#e7fff0}
.record-status.error{color:#a53c25;background:#fff0e8}
#record-status.recording{color:#fff;background:#c92f60}
#record-status.sending{color:#fff;background:#237bc7}
#record-status.success{color:#fff;background:#178452}
#record-status.error{color:#fff;background:#b3452c}
@keyframes recordPulse{50%{box-shadow:0 0 0 6px #ff4c8030}}
.game-board{position:relative;overflow:hidden}
.game-board button.choice-correct{border-color:#21c56d!important;background:#e5fff0!important;box-shadow:0 0 0 7px #42db8a52,0 7px 0 #149850!important;animation:correctBounce .55s ease}
.game-board button.choice-wrong{border-color:#ff5472!important;background:#fff0f3!important;box-shadow:0 0 0 7px #ff54723d,0 7px 0 #bf2f4b!important;animation:wrongShake .42s ease}
.answer-pop{position:absolute;z-index:8;left:50%;top:50%;transform:translate(-50%,-50%);display:grid;place-items:center;min-width:190px;padding:20px 30px;border:5px solid #fff;border-radius:30px;color:#fff;box-shadow:0 18px 50px #163f6b50;animation:answerPop .85s ease both;pointer-events:none}
.answer-pop.correct{background:linear-gradient(145deg,#79ec87,#19b962)}
.answer-pop.wrong{background:linear-gradient(145deg,#ff8298,#ea365e)}
.answer-pop b{font-size:70px;line-height:.9}.answer-pop span{font-size:24px;font-weight:800}
.answer-particle{position:absolute;z-index:9;left:50%;top:58%;font-style:normal;font-size:30px;pointer-events:none;animation:answerBurst 1s ease-out both}
@keyframes correctBounce{45%{transform:scale(1.09) rotate(-1deg)}75%{transform:scale(.97)}}
@keyframes wrongShake{20%,60%{transform:translateX(-10px)}40%,80%{transform:translateX(10px)}}
@keyframes answerPop{0%{opacity:0;transform:translate(-50%,-50%) scale(.45) rotate(-8deg)}35%{opacity:1;transform:translate(-50%,-50%) scale(1.08) rotate(2deg)}100%{opacity:0;transform:translate(-50%,-58%) scale(1)}}
@keyframes answerBurst{to{opacity:0;transform:translate(var(--x),var(--y)) rotate(180deg) scale(1.5)}}
@media(prefers-reduced-motion:reduce){.record-status.recording,.game-board button.choice-correct,.game-board button.choice-wrong,.answer-pop,.answer-particle{animation-duration:.01ms!important}}

/* Full-screen reading practice: every control stays inside one viewport. */
html:has(.practice),body:has(.practice){height:100%;height:100dvh;overflow:hidden}
body:has(.practice) .sky{display:none}
body:has(.practice) .topbar{position:relative;top:0;flex:0 0 auto}
body:has(.practice) .page{height:calc(100dvh - 88px);min-height:0;padding:10px 0 8px;overflow:hidden}
body:has(.practice)>footer{display:none}
.practice{height:100%;max-width:1120px;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:9px;overflow:hidden}
.practice-head{min-height:64px;padding:8px 16px}
.practice-head .eyebrow,.practice-head>strong,.practice-panel>b,.practice-layout .word-copy h1,.practice-layout .word-copy p{-webkit-text-stroke:.35px #fff;paint-order:stroke fill;text-shadow:0 2px 0 #fff,0 3px 7px #173d7440}
.practice-layout{min-height:0;height:100%;margin:0;grid-template-columns:minmax(0,1.72fr) minmax(250px,.82fr);gap:16px}
.practice-layout .word-card{height:100%;min-height:0;margin:0;display:grid;grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto;overflow:hidden}
.practice-layout .word-image{height:auto;min-height:0;overflow:hidden;display:flex;align-items:center;justify-content:center;background:linear-gradient(145deg,#effcff,#e8f4ff)}
.practice-layout .word-image img{display:block!important;width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;padding:8px;object-fit:contain!important;object-position:center!important;flex:0 1 auto}
.practice-layout .word-copy{min-height:108px;padding:7px 14px 10px}
.practice-layout .word-copy h1{margin:0;font-size:clamp(44px,6.2vh,72px);line-height:1.05}
.practice-layout .word-copy p{margin:5px 0 0;font-size:clamp(14px,1.8vh,19px);line-height:1.3}
.practice-panel{min-height:0;gap:clamp(8px,1.5vh,15px);padding:clamp(12px,2vh,22px)}
.practice-panel>b{font-size:clamp(17px,2.1vh,23px)}
.practice-panel .btn{flex:1 1 0;min-height:48px;padding:8px 12px;font-size:clamp(14px,1.9vh,20px)}
.practice-bottom{min-height:49px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px}
#record-status{min-height:38px;margin:0;padding:8px 13px;display:flex;align-items:center;justify-content:center;line-height:1.25}
.practice-nav{height:auto;margin:0;justify-content:flex-end}
.practice-nav .btn{min-height:40px;padding:8px 18px}
.practice-credit{display:flex;justify-content:center;gap:12px;min-height:18px;color:#174778;font-size:11px;line-height:1.2;text-align:center;text-shadow:0 1px 0 #fff}

@media(max-width:600px){
  body:has(.practice) .page{height:calc(100dvh - 64px);padding:6px 8px calc(63px + env(safe-area-inset-bottom))}
  .practice{grid-template-rows:58px minmax(0,1fr) auto 14px;gap:5px}
  .practice-head{height:58px;min-height:58px}
  .practice-layout{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto;gap:5px}
  .practice-layout .word-card{grid-template-rows:minmax(0,1fr) auto}
  .practice-layout .word-image img{padding:4px}
  .practice-layout .word-copy{min-height:72px;padding:3px 8px 6px}
  .practice-layout .word-copy h1{font-size:clamp(34px,10.5vw,48px)}
  .practice-layout .word-copy p{margin-top:2px;font-size:clamp(11px,3vw,14px);line-height:1.2}
  .practice-panel{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;padding:6px}
  .practice-panel>b{grid-column:1/-1;font-size:13px}
  .practice-panel .btn{min-height:36px;padding:4px 5px;font-size:clamp(10px,3vw,13px);line-height:1.1}
  .practice-bottom{min-height:38px;grid-template-columns:minmax(0,1fr) auto;gap:5px}
  #record-status{position:static;transform:none;width:auto;max-width:none;min-height:34px;margin:0;padding:4px 7px;border-radius:12px;font-size:clamp(9px,2.55vw,12px);line-height:1.15;background:#ffffffd9;color:#315b83}
  #record-status.recording,#record-status.sending,#record-status.success,#record-status.error{color:#fff}
  .practice-nav,.practice-nav .btn{width:auto;height:34px;min-height:34px}
  .practice-nav .btn{padding:4px 8px;font-size:11px;white-space:nowrap}
  .practice-credit{min-height:14px;gap:5px;font-size:8px;white-space:nowrap}
  .practice-credit span{display:none}
}

@media(max-width:600px) and (max-height:720px){
  body:has(.practice) .page{height:calc(100dvh - 56px);padding:4px 6px calc(55px + env(safe-area-inset-bottom))}
  .practice{grid-template-rows:50px minmax(0,1fr) auto 12px;gap:3px}
  .practice-head{height:50px;min-height:50px}
  .practice-layout,.practice-panel{gap:3px}
  .practice-layout .word-copy{min-height:58px;padding:2px 6px 4px}
  .practice-layout .word-copy h1{font-size:31px}
  .practice-layout .word-copy p{font-size:10px}
  .practice-panel{padding:4px}
  .practice-panel>b{font-size:11px}
  .practice-panel .btn{min-height:30px;font-size:10px}
  .practice-bottom{min-height:30px}
  #record-status{min-height:29px;font-size:9px}
  .practice-nav,.practice-nav .btn{height:29px;min-height:29px}
  .practice-credit{font-size:7px}
}

/* Quiz hub and assessment flow */
.quiz-page-title{margin-bottom:18px}.quiz-intro{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:22px;padding:18px 28px;border:4px solid #fff;border-radius:28px;background:linear-gradient(125deg,#e8f7ffed,#fff9dbed);box-shadow:0 8px 0 #9fc9e4,0 18px 35px #28597e28}.quiz-intro:after{content:"";position:absolute;right:10%;top:-70px;width:220px;height:180px;border-radius:50%;background:#fff7;filter:blur(5px)}.quiz-intro>div:first-child{z-index:1;display:flex;align-items:center;gap:18px}.quiz-intro>div:first-child>span{font-size:54px;filter:drop-shadow(0 7px 4px #28547830)}.quiz-intro p{display:grid;gap:3px;margin:0}.quiz-intro p b{font-size:22px}.quiz-intro p small{color:#587491;font-size:15px}.quiz-intro-stars{z-index:1;white-space:nowrap;font-size:29px;letter-spacing:5px;animation:quizStars 2.2s ease-in-out infinite alternate}@keyframes quizStars{to{transform:translateY(-5px) rotate(2deg);filter:drop-shadow(0 5px 6px #f0b31380)}}
.quiz-mode-grid{gap:24px}.quiz-mode{position:relative;isolation:isolate;overflow:hidden;min-height:350px;padding:31px 24px 24px;border-width:5px;box-shadow:0 9px 0 #9bbfd7,0 20px 38px #214f7938;transform:translateZ(0)}.quiz-mode:before{content:"";position:absolute;z-index:-1;left:-35%;right:-35%;bottom:-56%;height:72%;border-radius:50%;background:#fff9}.quiz-mode:after{content:"✦";position:absolute;right:18px;top:54px;color:#fff;font-size:27px;text-shadow:0 3px 7px #3274a155}.quiz-mode:hover{transform:translateY(-8px) rotate(-.4deg);box-shadow:0 14px 0 #8fb9d4,0 28px 45px #214f7940}.quiz-mode.pretest{background:linear-gradient(150deg,#ffffff,#cffff0)}.quiz-mode.practice{background:linear-gradient(150deg,#fffef5,#ffe885)}.quiz-mode.posttest{background:linear-gradient(150deg,#fffaff,#dec7ff)}.quiz-step{position:absolute;left:17px;top:15px;padding:5px 12px;border-radius:999px;color:#fff;background:#238cd9;font-size:12px;font-style:normal;font-weight:800;box-shadow:0 4px 0 #17619a}.quiz-mode.practice .quiz-step{background:#e5a817;box-shadow:0 4px 0 #a8750a}.quiz-mode.posttest .quiz-step{background:#8b55dc;box-shadow:0 4px 0 #6032aa}.quiz-mode .quiz-mode-icon{display:grid;place-items:center;width:112px;height:112px;margin:22px auto 4px;border-radius:36px;background:#ffffffbc;border:3px solid #fff;font-size:65px;box-shadow:inset 0 4px 7px #fff,0 9px 0 #b5d7df,0 17px 25px #234f752b}.quiz-mode.practice .quiz-mode-icon{box-shadow:inset 0 4px 7px #fff,0 9px 0 #e1b52c,0 17px 25px #7a5a182d}.quiz-mode.posttest .quiz-mode-icon{box-shadow:inset 0 4px 7px #fff,0 9px 0 #a889dc,0 17px 25px #5740772d}.quiz-mode h2{font-size:24px;color:#123e78}.quiz-mode p{margin:0;color:#274f78;font-weight:700}.quiz-mode>small{margin:7px 0 20px;color:#617b94;line-height:1.55}.quiz-mode>b{width:100%;margin-top:auto;padding:12px 10px;border:3px solid #fff;border-radius:17px;color:#fff;background:linear-gradient(#51b8fb,#2575e8);box-shadow:0 5px 0 #1957aa}.quiz-mode.practice>b{color:#684600;background:linear-gradient(#ffe36c,#ffb624);box-shadow:0 5px 0 #c77c0d}.quiz-mode.posttest>b{background:linear-gradient(#bc86ff,#824de7);box-shadow:0 5px 0 #5830aa}.quiz-mode>b i{font-style:normal;font-size:20px}.quiz-note{border:2px solid #fff;box-shadow:0 8px 24px #2b5b8120;text-align:center}
.quiz-shell>header{background:linear-gradient(135deg,#ffffffee,#ecf8ffee)}.quiz-shell>header strong{border:2px solid #fff;color:#174e89;background:linear-gradient(#fff,#e5f4ff);box-shadow:0 5px 0 #a3c9e0;font-weight:800}.quiz-shell>.progress{height:16px;margin:13px 8px 0;border:3px solid #fff;box-shadow:0 4px 10px #24557b25}.quiz-board{position:relative;overflow:hidden}.quiz-board:before{content:"★";position:absolute;right:22px;top:17px;color:#ffcf2d;font-size:33px;opacity:.75}.quiz-prompt{display:flex;align-items:center;justify-content:center;gap:12px;margin-bottom:8px}.quiz-prompt span{display:grid;place-items:center;width:54px;height:54px;border-radius:18px;background:#e5f5ff;font-size:29px;box-shadow:0 5px 0 #9ccae7}.quiz-prompt h2{margin:0;color:#123c76;font-size:25px}.quiz-board button.quiz-selected{border-color:#20c977!important;background:#e6fff1!important;box-shadow:0 0 0 7px #36d98a42,0 7px 0 #169b5b!important;transform:scale(1.035)}#quiz-feedback{min-height:34px;padding:7px;text-align:center;color:#16794a;font-weight:800}.quiz-record-status{display:block;width:max-content;max-width:100%;min-height:35px;margin:17px auto 0;padding:7px 15px;border-radius:999px;color:#536f8a;background:#edf5fa;font-weight:700}.quiz-record-status.recording{color:#fff;background:#c92f60;animation:recordPulse 1s ease-in-out infinite}.quiz-record-status.success{color:#fff;background:#178452}.quiz-record-status.error{color:#fff;background:#b3452c}.quiz-loading,.quiz-error{min-height:420px;display:grid;place-content:center;justify-items:center;gap:12px}.quiz-loading span,.quiz-error>span{font-size:70px}.quiz-loading b{font-size:25px}.quiz-error p{margin:0 0 12px}.quiz-result{padding:40px 10px}.quiz-result>small{display:block;width:max-content;max-width:100%;margin:8px auto 18px;padding:8px 14px;border-radius:999px;color:#27704d;background:#e8fff1;font-weight:700}.quiz-result>small.upload-warning{color:#9b4e20;background:#fff1df}
@media(max-width:900px){.quiz-mode-grid{grid-template-columns:1fr;max-width:650px;margin:auto}.quiz-mode{min-height:250px;display:grid;grid-template-columns:125px 1fr;grid-template-rows:auto auto auto 1fr;column-gap:22px;text-align:left;align-items:center}.quiz-mode .quiz-mode-icon{grid-row:1/5;margin:20px auto}.quiz-mode h2,.quiz-mode p,.quiz-mode>small{margin-left:0;margin-right:0}.quiz-mode>b{grid-column:2;text-align:center}.quiz-note{max-width:650px;margin-left:auto;margin-right:auto}}
@media(max-width:600px){.quiz-intro{padding:14px 16px}.quiz-intro-stars{display:none}.quiz-intro>div:first-child>span{font-size:40px}.quiz-intro p b{font-size:17px}.quiz-intro p small{font-size:12px}.quiz-mode{min-height:310px;display:flex;text-align:center;padding:28px 18px 20px}.quiz-mode .quiz-mode-icon{width:94px;height:94px;margin:22px auto 3px;font-size:54px}.quiz-mode h2{font-size:21px}.quiz-board{min-height:480px;padding:15px}.quiz-prompt{align-items:flex-start}.quiz-prompt span{width:43px;height:43px;font-size:23px;flex:0 0 auto}.quiz-prompt h2{font-size:20px;text-align:left}.quiz-shell>header{gap:10px;padding:10px}.quiz-shell>header h1{font-size:20px}.quiz-shell>header strong{padding:8px;font-size:12px}.quiz-actions{flex-direction:column}.quiz-actions .btn{width:100%}.quiz-result{padding:30px 3px}.quiz-result>strong{font-size:58px}}

/* Student dashboard — 3D pet system */
.dashboard-panels.pet-only{grid-template-columns:1fr}.pet-card{position:relative;isolation:isolate;overflow:hidden;padding:16px;border:4px solid #fff;border-radius:30px;background:linear-gradient(155deg,#f4fdff 0,#dff9ff 48%,#fff9d8 100%);box-shadow:0 9px 0 #67afd2,0 20px 38px #174d7635}.pet-card:before{content:"";position:absolute;z-index:-1;inset:0;background:radial-gradient(circle at 15% 15%,#fff 0 3px,transparent 4px),radial-gradient(circle at 88% 24%,#fff9 0 4px,transparent 5px);background-size:55px 55px,83px 83px;opacity:.55}.pet-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.pet-card-head>div{display:flex;align-items:center;gap:8px}.pet-card-head>div>span{font-size:36px;filter:drop-shadow(0 5px 3px #1f61864a)}.pet-card-head p{display:grid;margin:0;line-height:1.15;text-align:left;font-weight:inherit}.pet-card-head small{font-weight:800;color:#2879a3}.pet-card-head strong{font-size:21px;color:#0d4680}.pet-level{flex:0 0 auto;padding:7px 10px;border:2px solid #fff;border-radius:999px;color:#fff;background:linear-gradient(#ff91bf,#ef3f88);box-shadow:0 4px 0 #b82465;font-size:12px}.pet-aquarium{position:relative;display:block;overflow:hidden;width:100%;height:230px;padding:0;border:4px solid #fff;border-radius:28px;background:linear-gradient(180deg,#6be7ff,#21bce5 58%,#0e91c4);box-shadow:inset 0 9px 20px #fff8,inset 0 -20px 30px #076d9a45,0 8px 0 #2386b0,0 15px 25px #1b6e9338;cursor:pointer}.pet-aquarium:before{content:"";position:absolute;z-index:2;inset:0;background:linear-gradient(112deg,#fff0 25%,#fff5 42%,#fff0 57%);transform:translateX(-90%);animation:petWaterShine 5.5s ease-in-out infinite}.pet-aquarium:after{content:"";position:absolute;z-index:3;left:-10%;right:-10%;bottom:-21px;height:60px;border-radius:50%;background:radial-gradient(ellipse at 50% 0,#fffbd1 0 9%,#eccd71 10% 16%,#45b98f 17% 20%,transparent 21%);opacity:.8}.pet-aquarium img{position:relative;z-index:1;width:100%;height:100%;object-fit:cover;pointer-events:none;filter:saturate(1.06) drop-shadow(0 10px 10px #10577742);transition:filter .25s}.water-light{position:absolute;z-index:2;top:-35%;width:24%;height:150%;background:linear-gradient(90deg,transparent,#fff4,transparent);transform:rotate(16deg);pointer-events:none}.water-light.one{left:12%;animation:waterRay 4s ease-in-out infinite alternate}.water-light.two{right:7%;animation:waterRay 5.5s -2s ease-in-out infinite alternate}.pet-bubble{position:absolute;z-index:4;bottom:-20px;width:15px;height:15px;border:2px solid #fff9;border-radius:50%;box-shadow:inset 2px 2px 3px #fff8;animation:petBubble 4.2s linear infinite}.pet-bubble.b1{left:13%}.pet-bubble.b2{left:75%;width:10px;height:10px;animation-delay:-1.5s}.pet-bubble.b3{left:88%;width:21px;height:21px;animation-delay:-3s}.pet-touch-tip{position:absolute;z-index:5;right:10px;bottom:9px;padding:5px 9px;border:2px solid #fff;border-radius:999px;color:#fff;background:#074e80b8;font-size:10px;font-weight:800;backdrop-filter:blur(5px)}.pet-particles{position:absolute;z-index:8;inset:0;pointer-events:none}.pet-particle{position:absolute;left:var(--left);top:var(--top);font-style:normal;font-size:var(--size);animation:petParticle 1.15s ease-out forwards}.pet-aquarium.pet-swim img{animation:petSwim .95s ease-in-out}.pet-aquarium.pet-jump img{animation:petJump .9s ease-in-out}.pet-aquarium.pet-spin img{animation:petSpin .9s ease-in-out}.pet-aquarium.pet-wiggle img{animation:petWiggle .78s ease-in-out}.pet-aquarium.is-evolving{animation:petEvolution 1.35s ease-in-out}.pet-aquarium.is-evolving img{filter:saturate(1.25) drop-shadow(0 0 24px #fff) drop-shadow(0 0 35px #ffe15d)}.pet-card>.pet-status{display:grid;justify-content:normal;gap:7px;margin-top:13px;padding:11px;border:2px solid #fff;border-radius:20px;background:#ffffffb8;box-shadow:inset 0 3px 8px #4385a51c;font-size:inherit}.pet-status-line{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;font-weight:800}.pet-status-line strong{color:#0b5798}.pet-progress{height:17px;padding:2px;border:2px solid #fff;border-radius:999px;background:#b9d8e4;box-shadow:inset 0 2px 4px #1a5b7c4a}.pet-progress i{display:block;height:100%;min-width:5px;border-radius:inherit;background:linear-gradient(90deg,#20dc7c,#74e584 62%,#fff04f);box-shadow:0 0 9px #3de985;transition:width 1s ease}.pet-next small{color:#608197;text-align:right}.pet-totals{display:grid;grid-template-columns:1fr 1fr;gap:6px}.pet-totals span{padding:7px;border-radius:12px;background:#fff;color:#37627e;font-size:10px;font-weight:700;text-align:center}.pet-totals b{color:#104b82;font-size:13px}.pet-name-form{display:grid;gap:5px;margin-top:10px}.pet-name-form label{font-size:11px;color:#285c7d}.pet-name-form>div{display:grid;grid-template-columns:1fr auto;gap:6px}.pet-name-form input{min-width:0;height:37px;padding:7px 10px;border-width:2px;border-radius:12px;font-size:12px}.pet-name-form button,.pet-celebration button{border:2px solid #fff;border-radius:12px;padding:6px 11px;color:#fff;background:linear-gradient(#55c6ff,#167cdd);box-shadow:0 4px 0 #12549a;font-weight:800;cursor:pointer}.pet-name-form>small{min-height:15px;color:#218057;font-size:10px}.pet-notice{margin:10px 0 0;padding:8px;border-radius:12px;background:#fff6cd;color:#805b13;text-align:center;font-size:10px;font-weight:700}.pet-notice.error{background:#ffe8e8;color:#a53a3a}.pet-collection{margin-top:7px;border-radius:16px;background:#fff9}.pet-collection summary{padding:9px 11px;cursor:pointer;color:#164e7d;font-size:12px;font-weight:800;list-style:none}.pet-collection summary::-webkit-details-marker{display:none}.pet-collection summary b{float:right;color:#8b4fd1}.pet-collection-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:0 8px 9px}.owned-pet,.unlock-pet{min-width:0;display:grid;place-items:center;align-content:center;min-height:87px;padding:5px;border:2px solid #fff;border-radius:14px;background:linear-gradient(#e9fbff,#cceffa);box-shadow:0 4px 0 #8bc1d4;text-align:center}.owned-pet img{width:50px;height:50px;border-radius:50%;object-fit:cover}.owned-pet span,.unlock-pet b{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px}.owned-pet small,.unlock-pet small{font-size:8px}.unlock-pet{filter:grayscale(.75);opacity:.7;background:#eef1f4;box-shadow:0 4px 0 #b0bbc3}.unlock-pet>span{font-size:32px}.unlock-pet.unlocked{filter:none;opacity:1;background:linear-gradient(#fffbdc,#ffdda0);box-shadow:0 4px 0 #dea843}.pet-card>.pet-celebration{position:fixed;z-index:120;inset:0;display:grid;place-items:center;justify-content:normal;padding:20px;background:#082e62b8;backdrop-filter:blur(8px);font-size:inherit}.pet-card>.pet-celebration[hidden]{display:none}.pet-celebration>div{position:relative;z-index:2;width:min(420px,92vw);padding:30px;text-align:center;border:5px solid #fff;border-radius:36px;background:linear-gradient(150deg,#fff,#fff2aa);box-shadow:0 12px 0 #e49d22,0 30px 70px #001d45;animation:celebrationPop .65s cubic-bezier(.2,1.35,.4,1)}.pet-celebration>div>span{position:absolute;right:16px;top:10px;font-size:54px}.pet-celebration img{width:180px;height:180px;border:4px solid #fff;border-radius:50%;object-fit:cover;box-shadow:0 8px 0 #79c8dd}.pet-celebration h2{margin:8px 0 0;color:#e67b12;font-size:38px}.pet-celebration p{font-weight:700;line-height:1.7}.pet-celebration p b{color:#9a4fcf}.pet-confetti{position:fixed;z-index:1;left:var(--x);top:-30px;width:12px;height:19px;border-radius:4px;background:var(--color);animation:petConfetti var(--duration) var(--delay) linear forwards}.pet-star-gain{position:absolute;z-index:15;left:var(--x);top:65%;font-size:25px;pointer-events:none;animation:petStarGain 1.35s var(--delay) ease-out both}
@keyframes petWaterShine{50%,100%{transform:translateX(430%)}}@keyframes waterRay{to{transform:translateX(22px) rotate(9deg);opacity:.35}}@keyframes petBubble{to{bottom:110%;transform:translateX(22px);opacity:0}}@keyframes petParticle{to{opacity:0;transform:translate(var(--move-x),-95px) rotate(140deg) scale(1.55)}}@keyframes petSwim{45%{transform:translateX(11%) scale(.93)}70%{transform:translateX(-5%)}}@keyframes petJump{45%{transform:translateY(-25px) rotate(-3deg) scale(1.05)}}@keyframes petSpin{55%{transform:rotateY(180deg) scale(.9)}}@keyframes petWiggle{20%,60%{transform:rotate(-4deg)}40%,80%{transform:rotate(4deg)}}@keyframes petEvolution{0%,100%{transform:scale(1)}35%{transform:scale(.92);filter:brightness(1.5)}60%{transform:scale(1.06);box-shadow:0 0 0 12px #fff7,0 0 45px #ffef75}}@keyframes celebrationPop{from{opacity:0;transform:scale(.45) rotate(-8deg)}}@keyframes petConfetti{to{top:108vh;transform:translateX(var(--drift)) rotate(720deg)}}@keyframes petStarGain{0%{opacity:0;transform:translateY(20px) scale(.5)}35%{opacity:1}100%{opacity:0;transform:translateY(-170px) rotate(45deg) scale(1.5)}}
@media(max-width:1100px) and (min-width:801px){.dashboard-panels{grid-template-columns:1fr}.pet-card{display:grid;grid-template-columns:minmax(300px,.85fr) 1.15fr;gap:12px 18px}.pet-card-head{grid-column:1/-1}.pet-aquarium{grid-row:2/6;height:300px}.pet-status,.pet-name-form,.pet-collection{margin-top:0}.pet-collection-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:800px){.pet-card{max-width:620px;margin:auto}.pet-aquarium{height:min(55vw,300px)}.pet-card-head strong{font-size:19px}.pet-collection-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:520px){.pet-card{padding:12px;border-radius:24px}.pet-card-head>div>span{font-size:30px}.pet-card-head strong{font-size:17px}.pet-level{font-size:10px}.pet-aquarium{height:58vw;min-height:205px;border-radius:22px}.pet-totals{grid-template-columns:1fr}.pet-collection-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.pet-status-line{font-size:11px}.pet-celebration>div{padding:24px 16px}}
@media(prefers-reduced-motion:reduce){.pet-aquarium:before,.water-light,.pet-bubble,.pet-aquarium img,.pet-aquarium.is-evolving,.pet-particle,.pet-confetti,.pet-star-gain{animation-duration:.01ms!important;animation-iteration-count:1!important}}
