/* The film remains decorative; the existing game UI carries all progress text. */
.student-adventure{position:relative;isolation:isolate;overflow:hidden;aspect-ratio:16/9;width:min(100%,620px);margin:12px auto 28px;border-radius:26px;background:#eee8d7}.student-adventure[hidden]{display:none!important}.student-adventure .adventure-video{display:block;width:100%;height:100%;object-fit:contain}#student:has(.student-adventure:not([hidden])) .student-heading .student-bunny{display:none}#student:has(.student-adventure:not([hidden])) .student-heading{padding-right:0}#student:has(.student-adventure:not([hidden])) #finish>img{display:none}.adventure-unavailable .adventure-video{object-fit:contain}@media(max-width:600px){.student-adventure{border-radius:20px;margin:10px auto 22px}}
#student:has(.student-adventure:not([hidden])) .student-heading{padding:20px 0 10px;min-height:0;text-align:center}

/* Film and exercises share one clipped card rather than two floating panels. */
#student>.game-shell{padding:0;overflow:hidden}
#student>.game-shell::after{display:none}
.game-shell>.student-adventure{width:100%;aspect-ratio:16/9;max-height:none;margin:0;border-radius:0;background:#fffdf2}
.game-shell>.game-content{padding:26px 28px 28px}
@media(max-width:600px){.game-shell>.student-adventure{width:100%;margin:0;border-radius:0}.game-shell>.game-content{padding:20px 14px 22px}}

/* Eight pairs form a 4 × 4 board; shorter lessons never get duplicate filler cards. */
#student #board .card.matched{background:#f0dfcc;color:#70523d;border-color:transparent;box-shadow:none;opacity:1}
#student #board .card.matched::after{content:none;display:none}
#student #board{grid-template-columns:repeat(var(--board-columns,4),minmax(0,1fr))}
@media(max-width:600px){#student #board{gap:7px}#student #board .card{min-height:86px;padding:12px 5px;font-size:clamp(15px,4.5vw,22px);border-radius:18px}#student #board .card.reading{font-size:clamp(12px,3.5vw,16px)}#student #board .card img{width:38px;max-width:75%}}

.game-shell>.student-adventure>.adventure-video{position:absolute;inset:0;display:block;width:100%;height:100%;max-width:none;max-height:none;object-fit:contain}

#student[data-game=memory] .game-content>.scorebar,#student[data-game=memory] .game-content>.progress{display:none}
#student[data-game=memory] #play-area{margin-top:22px}

#student #lesson-meta{display:none}

/* On phones, the student game is an edge-to-edge surface. */
@media(max-width:600px){
 main:has(>#student:not(.hidden)){padding-inline:0}
 #student>.game-shell{width:100%;max-width:none;margin:0;border:0;border-radius:0;box-shadow:none}
 #student>.game-shell>.student-adventure{border-radius:0}
 #student>.game-shell>.game-content{padding:20px 14px max(22px,env(safe-area-inset-bottom))}
}

#student[data-game=memory] #restart{display:none}

#student[data-game=memory] #game-help{display:block;line-height:1.7;margin-top:7px}

#game-name:has(ruby){padding-top:12px;line-height:1.8}
#game-name .game-title-reading{ruby-position:over;margin-inline-end:3px}
#game-name .game-title-reading rt{font-size:10px;font-weight:400;letter-spacing:0;color:#7c8d70}

#student[data-game=memory] #game-help{display:none}

@font-face{font-family:BunihopRounded;src:url('assets/fonts/GenSenRounded2TW-M.woff') format('woff');font-weight:500;font-style:normal;font-display:swap}
#student .student-heading #game-title{font-family:BunihopRounded,'Arial Rounded MT Bold','PingFang TC','Microsoft YaHei',sans-serif;font-weight:500;font-size:clamp(24px,4.5vw,36px);letter-spacing:0;line-height:2.1;margin:12px 14px 6px;overflow-wrap:anywhere}
#game-title .lesson-title-reading{ruby-position:over;margin-inline:2px}
#game-title .lesson-title-reading rt{font-family:BunihopRounded,'PingFang TC',sans-serif;font-size:11px;font-weight:400;letter-spacing:0;color:#829174}
@media(max-width:600px){#student .student-heading #game-title{font-size:26px;margin:10px 12px 4px}#game-title .lesson-title-reading rt{font-size:10px}}

#student[data-game=memory] .game-heading{justify-content:center;text-align:center}
#student[data-game=memory] .game-heading>div{width:100%}
#student[data-game=memory] #game-name{text-align:center}

@font-face{font-family:JFOpenHuninn;src:url('assets/fonts/jf-openhuninn-2.1.woff') format('woff');font-weight:400;font-style:normal;font-display:swap}
#student{--heading-rounded:JFOpenHuninn,BunihopRounded,'PingFang TC',sans-serif}
html[lang=zh-Hans] #student{--heading-rounded:BunihopRounded,'Microsoft YaHei',sans-serif}
#student .student-heading #game-title,#student #game-name,#student #game-title rt{font-family:var(--heading-rounded);font-weight:400}

/* White karaoke opening occupies exactly the film's frame. */
.adventure-intro{position:absolute;inset:0;z-index:5;width:100%;height:100%;margin:0;padding:0;border:0;border-radius:0;background:#fff;color:#3c6045;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:22px;box-shadow:none;cursor:default;opacity:1;transition:opacity .8s ease}
.adventure-intro:hover{background:#fff;box-shadow:none;transform:none}
.adventure-intro.intro-waiting{cursor:pointer}
.adventure-intro.intro-leaving{opacity:0;pointer-events:none}
.intro-pending>.adventure-video{visibility:hidden}
.intro-words{position:relative;display:grid;grid-template-columns:repeat(var(--intro-count,4),1fr);gap:12px;font-family:var(--heading-rounded);font-size:clamp(32px,6vw,58px);line-height:1.6;letter-spacing:0;animation:intro-appear .35s ease both}
.intro-character{min-width:1.2em;text-align:center;transition:color .12s}
.intro-character.is-reading{color:#8ca862}
.intro-character ruby{ruby-position:over}
.intro-character rt{font-size:12px;font-weight:400;color:#8c9a7a}
.intro-dot{position:absolute;left:calc((var(--intro-index,0) + .5)*100% / var(--intro-count,4));top:-30px;width:9px;height:9px;border-radius:50%;background:#deaa86;transform:translate(-50%,var(--intro-hop,0px));transition:left .13s ease;pointer-events:none}
.intro-hint{font-size:12px;font-family:var(--heading-rounded);font-weight:400;color:#8c9a7a;position:absolute;bottom:12%;letter-spacing:1px}.intro-hint[hidden]{display:none}
@keyframes intro-appear{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.adventure-intro{transition:none}.intro-words{animation:none}.intro-dot{transition:none;transform:translateX(-50%)}}

#student .student-heading #game-title{font-weight:700;font-synthesis:weight}
#student #game-title rt{font-weight:400;font-synthesis:none}

/* The opening is a scene, so it must not inherit the site's pill button shape. */
#student>.game-shell{border-radius:0}
#student #student-adventure{background:#f2f1e7}
#student #student-adventure>.adventure-intro{inset:0;width:100%;height:100%;max-width:none;border:0;border-radius:0;background:#f2f1e7;box-shadow:none;padding:0;outline-offset:-5px}
#student #student-adventure>.adventure-intro:hover{background:#f2f1e7;transform:none;box-shadow:none}
#student .intro-words{font-size:clamp(50px,7vw,82px);font-weight:700;font-synthesis:weight;gap:14px}
#student .intro-character rt{font-size:clamp(12px,1.5vw,16px);font-weight:400;font-synthesis:none}
#student .intro-dot{width:10px;height:10px;top:-32px}
#student[data-game=memory] .game-heading{display:none}
#student[data-game=memory] #play-area{margin-top:0}
@media(max-width:600px){#student .intro-words{font-size:clamp(40px,12vw,58px);gap:10px}#student .intro-character rt{font-size:12px}#student[data-game=memory] .game-content{padding-top:18px}}

/* Keep spoken game feedback available to assistive technology without a visible caption row. */
#student[data-game=memory] #game-status{position:absolute;width:1px;height:1px;min-height:0;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body:has(#student:not(.hidden)){background:#fffdf2;min-height:100dvh;display:flex;flex-direction:column}
body:has(#student:not(.hidden))>main{flex:1;width:100%;display:flex;flex-direction:column}
#student:not(.hidden){flex:1;display:flex;flex-direction:column}
#student>.game-shell{flex:1;width:100%;margin-bottom:0;border-radius:0;box-shadow:none;background:#fffdf2}

/* Tablet uses the same edge-to-edge game surface as mobile. */
@media(min-width:601px) and (max-width:1024px){
 body:has(#student:not(.hidden))>main{max-width:none;padding-inline:0}
 #student>.game-shell{max-width:none;width:100%;margin-inline:0;border:0;border-radius:0;box-shadow:none}
 #student>.game-shell>.student-adventure{width:100%;margin:0;border-radius:0}
 #student>.game-shell>.game-content{padding:24px 20px max(24px,env(safe-area-inset-bottom))}
}

/* Explicit width prevents the student header shrinking around its contents. */
body:has(#student:not(.hidden))>.topbar{display:flex;width:100%;max-width:1240px;box-sizing:border-box;margin:0 auto;padding:12px 20px;justify-content:space-between;align-items:center;flex-wrap:nowrap;gap:16px}
body:has(#student:not(.hidden))>.topbar>.brand{margin-right:auto;flex:0 1 auto;min-width:0}
body:has(#student:not(.hidden))>.topbar>.language-control{margin:0 0 0 auto;flex:0 0 auto}
@media(max-width:1024px){body:has(#student:not(.hidden))>.topbar{max-width:none}}
@media(max-width:600px){body:has(#student:not(.hidden))>.topbar{padding:10px 14px;gap:10px}}

/* Three transparent objects form a compact progress rail inside the film. */
.adventure-milestones{position:absolute;right:14px;top:50%;transform:translateY(-50%);z-index:2;display:flex;flex-direction:column;gap:12px;list-style:none;padding:0;margin:0;pointer-events:none;transition:opacity .3s}
.adventure-milestones[hidden]{display:none}
.adventure-milestones li{position:relative;display:grid;place-items:center;width:56px;height:56px;border-radius:50%;border:2px solid transparent;background:radial-gradient(circle,#fffdf2d9 0%,#fffdf280 55%,transparent 72%);transition:background .35s,border-color .35s}
.adventure-milestones img{display:block;width:90%;height:90%;object-fit:contain;opacity:.28;filter:grayscale(1);transition:filter .4s,opacity .4s,transform .35s}
.adventure-milestones .is-current img{opacity:.65;filter:grayscale(.5)}
.adventure-milestones .is-current{border-color:#fffdf2a8}
.adventure-milestones .is-complete{border-color:#abc68d;background:radial-gradient(circle,#fff3cfe8,#e8efcb99 65%,transparent 73%);animation:milestone-light .65s ease both}
.adventure-milestones .is-complete img{opacity:1;filter:none}
.adventure-milestones .is-complete::after{content:'';position:absolute;right:0;bottom:2px;width:8px;height:8px;border-radius:50%;background:#87a76b;box-shadow:0 0 0 2px #fff9e8}
.intro-pending .adventure-milestones{opacity:0}
@keyframes milestone-light{0%{transform:scale(.88)}45%{transform:scale(1.14)}100%{transform:scale(1)}}
@media(max-width:600px){.adventure-milestones{right:8px;gap:7px}.adventure-milestones li{width:40px;height:40px}.adventure-milestones .is-complete::after{width:6px;height:6px;bottom:1px}}
@media(prefers-reduced-motion:reduce){.adventure-milestones,.adventure-milestones li,.adventure-milestones img{transition:none}.adventure-milestones .is-complete{animation:none}}

/* Completion is communicated by the object color and a subtle halo only. */
.adventure-milestones li,.adventure-milestones .is-current{border-color:transparent;background:none;box-shadow:none}
.adventure-milestones img,.adventure-milestones .is-current img{opacity:.8;filter:grayscale(1) brightness(.48)}
.adventure-milestones .is-complete{border-color:transparent;background:radial-gradient(circle,#fff0b76b 0%,#f5efc847 48%,transparent 73%);box-shadow:0 0 12px 2px #fff0b73d}
.adventure-milestones .is-complete img{opacity:1;filter:drop-shadow(0 1px 5px #ffedb778)}
.adventure-milestones .is-complete::after{content:none;display:none}

.adventure-milestones li{width:64px;height:64px}
@media(max-width:600px){.adventure-milestones li{width:46px;height:46px}}

.adventure-milestones[data-film=garden]{display:grid;grid-template-columns:repeat(2,46px);gap:8px;right:10px}
.adventure-milestones[data-film=garden] li{width:46px;height:46px}
@media(max-width:600px){.adventure-milestones[data-film=garden]{grid-template-columns:repeat(2,34px);gap:5px;right:6px}.adventure-milestones[data-film=garden] li{width:34px;height:34px}}

#finish h2:has(ruby){line-height:2.2}#finish .finish-title-reading{ruby-position:over;margin-inline:2px}#finish .finish-title-reading rt{font-family:var(--heading-rounded);font-size:11px;font-weight:400;letter-spacing:0;color:#829174}@media(max-width:600px){#finish .finish-title-reading rt{font-size:10px}}

/* Reading challenge uses the same uninterrupted film-and-exercise surface. */
#student[data-game=quiz] .game-heading,
#student[data-game=quiz] .game-content>.scorebar,
#student[data-game=quiz] .game-content>.progress{display:none}
#student[data-game=quiz] #play-area{margin-top:0}
#student[data-game=quiz] .game-content{background:#fffdf2}

/* Sage choices remain distinct against the warm cream exercise surface. */
#student[data-game=quiz] .answer{background:#dce5cb;color:#304d38;border:1px solid #c3d0b0;box-shadow:none;opacity:1}
#student[data-game=quiz] .answer:focus-visible{outline:3px solid #6d8d57;outline-offset:3px}
@media(hover:hover){#student[data-game=quiz] .answer:hover:not(:disabled){background:#ccdabb;border-color:#aebe98}}
#student[data-game=quiz] .answer.correct{background:#abc58f;border-color:#91ac74;color:#29462f}
#student[data-game=quiz] .answer.wrong{background:#ecc8b1;border-color:#d5a98e;color:#703e2c}

/* Desktop stacks a compact film above the exercise within the viewport. */
@media(min-width:1025px) and (min-height:600px){
 body:has(#student:is([data-game=memory],[data-game=quiz],[data-game=spell]):not(.hidden)){height:100dvh;min-height:0}
 body:has(#student:is([data-game=memory],[data-game=quiz],[data-game=spell]):not(.hidden))>.topbar{max-width:1640px;flex-shrink:0;padding-block:8px}
 body:has(#student:is([data-game=memory],[data-game=quiz],[data-game=spell]):not(.hidden))>main{max-width:1640px;min-height:0;padding:0 24px 18px}
 #student:is([data-game=memory],[data-game=quiz],[data-game=spell]):not(.hidden){min-height:0}
 #student:is([data-game=memory],[data-game=quiz],[data-game=spell]) .student-heading{flex-shrink:0;padding:2px 0 8px;min-height:0}
 #student:is([data-game=memory],[data-game=quiz],[data-game=spell]) .student-heading #game-title{font-size:clamp(24px,3.6dvh,34px);line-height:1.7;margin:4px 12px}
 #student:is([data-game=memory],[data-game=quiz],[data-game=spell]) .game-nav{flex-shrink:0;margin-bottom:8px}
 #student:is([data-game=memory],[data-game=quiz],[data-game=spell])>.game-shell{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;min-height:0;flex:1;border:0}
 #student:is([data-game=memory],[data-game=quiz],[data-game=spell])>.game-shell>.student-adventure{height:100%;min-height:0;aspect-ratio:auto;margin:0}
 #student:is([data-game=memory],[data-game=quiz],[data-game=spell])>.game-shell>.student-adventure>.adventure-video{object-fit:cover;object-position:center}
 #student:is([data-game=memory],[data-game=quiz],[data-game=spell])>.game-shell>.game-content{display:flex;flex-direction:column;justify-content:center;min-width:0;min-height:0;padding:12px 24px 16px;overflow:visible}
 #student:is([data-game=memory],[data-game=quiz],[data-game=spell]) .intro-words{font-size:clamp(40px,4.5vw,68px);gap:10px}
 #student[data-game=quiz]>.game-shell{grid-template-rows:minmax(0,1fr) min(310px,46dvh)}
 #student[data-game=quiz] .prompt{font-size:clamp(28px,4.5dvh,42px);line-height:1.2;margin:5px 0 10px}
 #student[data-game=quiz] .answers{width:100%;max-width:760px;gap:8px 12px}
 #student[data-game=quiz] .answer{min-height:clamp(44px,6.4dvh,58px);padding:8px 12px;font-size:clamp(18px,2.5dvh,22px)}
 #student[data-game=quiz] .next{margin-top:10px;min-height:40px}
 #student[data-game=quiz] #game-status{margin-top:6px;min-height:20px;font-size:14px}
 #student[data-game=memory]>.game-shell{grid-template-rows:minmax(0,1fr) minmax(240px,48dvh)}
 #student[data-game=memory] #play-area{flex:1;min-height:0}
 #student[data-game=memory] #board{height:100%;grid-auto-rows:minmax(0,1fr);gap:clamp(8px,1.6dvh,14px)}
 #student[data-game=memory] #board .card{min-width:0;min-height:0;padding:8px 4px;font-size:clamp(18px,3.5dvh,28px);border-radius:24px;letter-spacing:0}
 #student[data-game=memory] #board .card.reading{font-size:clamp(14px,2.7dvh,21px)}
 #student[data-game=memory] #board .card img{width:clamp(34px,5dvh,48px);height:auto;max-height:70%;object-fit:contain}
 #student:is([data-game=memory],[data-game=quiz],[data-game=spell]) .game-content:has(#finish:not(.hidden)) #play-area{display:none}
 #student:is([data-game=memory],[data-game=quiz],[data-game=spell]) #finish{margin:0;padding-block:8px}
 #student:is([data-game=memory],[data-game=quiz],[data-game=spell]) #finish h2{font-size:clamp(22px,3.5dvh,30px)}
}

/* A rounded, prominent word anchors the reading challenge above its choices. */
#student[data-game=quiz] .prompt{font-family:var(--heading-rounded);font-weight:700;font-synthesis:weight;font-size:clamp(44px,7vw,64px);line-height:1.2;letter-spacing:2px;margin:0 0 14px}
@media(min-width:1025px) and (min-height:600px){
 #student[data-game=quiz]>.game-shell>.game-content{justify-content:flex-start;padding-top:6px}
 #student[data-game=quiz] .prompt{font-size:clamp(48px,7.5dvh,72px);line-height:1.15;margin:0 0 12px}
}

/* Teacher desktop zoom must not shrink the viewport-sized student surface. */
html:has(#student:not(.hidden)){background:#fffdf2}
body:has(#student:not(.hidden)){zoom:1;background:#fffdf2}

/* Correct answers stay unmistakable while the next question loads. */
#student[data-game=quiz] .answer.correct{background:#376647;border-color:#2e563c;color:#fffdf2;box-shadow:0 0 0 2px #b1c89a;opacity:1}

/* Let the answer row size to its contents; reserve the review button's slot. */
@media(min-width:1025px) and (min-height:600px){
 #student[data-game=quiz]>.game-shell{grid-template-rows:minmax(0,1fr) max-content}
 #student[data-game=quiz]>.game-shell>.game-content{padding:6px 24px 18px}
 #student[data-game=quiz] #play-area{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto 54px;min-height:0}
 #student[data-game=quiz] .question{padding:0 5px}
 #student[data-game=quiz] .next{grid-row:2;justify-self:center;align-self:start;margin:10px 0 0;min-height:44px}
 #student[data-game=quiz] #game-status{flex-shrink:0;line-height:1.5;min-height:21px;margin-top:4px}
}

/* Word building shares the cream surface, rounded type and sage interaction colors. */
#student[data-game=spell] .game-heading,
#student[data-game=spell] .game-content>.scorebar,
#student[data-game=spell] .game-content>.progress{display:none}
#student[data-game=spell] #play-area{margin:0}
#student[data-game=spell] .game-content{background:#fffdf2}
#student[data-game=spell] .question{padding:0}
#student[data-game=spell] .prompt.reading{font-family:var(--heading-rounded);font-size:clamp(27px,5vw,42px);font-weight:700;font-synthesis:weight;line-height:1.35;letter-spacing:1px;margin:0 0 18px}
#student[data-game=spell] .slots,#student[data-game=spell] .tiles{gap:9px;margin:0;align-items:center}
#student[data-game=spell] .slots{margin-bottom:18px}
#student[data-game=spell] .tiles{margin-bottom:20px}
#student[data-game=spell] .slot,#student[data-game=spell] .tile{width:56px;height:60px;min-height:60px;border-radius:18px!important;font-family:var(--heading-rounded);font-size:30px;font-weight:700;font-synthesis:weight;box-shadow:none;color:#34563d;opacity:1}
#student[data-game=spell] .slot{background:#edf0e0;border:2px dashed #b6c59f!important}
#student[data-game=spell] .slot.filled{background:#e9d8bf;border:2px solid #d0b896!important;color:#654c32}
#student[data-game=spell] .tile{background:#dce5cb;border:1px solid #c3d0b0!important}
#student[data-game=spell] .tile.is-used{opacity:.25}
#student[data-game=spell] .tile:focus-visible,#student[data-game=spell] .slot:focus-visible{outline:3px solid #6d8d57;outline-offset:3px}
#student[data-game=spell] .spell-controls{display:flex;justify-content:center;align-items:center;gap:12px}
#student[data-game=spell] .spell-controls button{min-height:44px;padding:10px 22px}
#student[data-game=spell] .spell-controls .quiet{background:#edf0e0;color:#647759}
#student[data-game=spell] #check-answer{background:#376647;color:#fffdf2}
#student[data-game=spell] #check-answer:disabled{background:#dce5cb;color:#79896a;opacity:.7}
#student[data-game=spell] .spell-question[data-result] .spell-controls{visibility:hidden;pointer-events:none}
#student[data-game=spell] .spell-question[data-result=correct] .slot.filled{background:#376647;border-color:#376647!important;color:#fffdf2}
#student[data-game=spell] .spell-question[data-result=wrong] .slot.filled{background:#ecc8b1;border-color:#d5a98e!important;color:#703e2c}
#student[data-game=spell] #game-status{margin-top:8px;line-height:1.5;font-size:14px}
@media(hover:hover){#student[data-game=spell] .tile:hover:not(:disabled){background:#ccdabb}}
@media(max-width:600px){
 #student[data-game=spell] .game-content{padding-top:18px}
 #student[data-game=spell] .prompt.reading{font-size:clamp(25px,6.7vw,34px)}
 #student[data-game=spell] .slot,#student[data-game=spell] .tile{width:46px;height:52px;min-height:52px;font-size:27px;border-radius:15px!important}
 #student[data-game=spell] .slots,#student[data-game=spell] .tiles{gap:7px}
}
@media(min-width:1025px) and (min-height:600px){
 #student[data-game=spell]>.game-shell{grid-template-rows:minmax(0,1fr) max-content}
 #student[data-game=spell]>.game-shell>.game-content{justify-content:flex-start;padding:10px 24px 16px}
 #student[data-game=spell] #play-area{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto 48px}
 #student[data-game=spell] .prompt.reading{font-size:clamp(28px,5dvh,42px);margin-bottom:12px}
 #student[data-game=spell] .slot,#student[data-game=spell] .tile{width:52px;height:54px;min-height:54px;font-size:29px}
 #student[data-game=spell] .slots{margin-bottom:12px}
 #student[data-game=spell] .tiles{margin-bottom:12px}
 #student[data-game=spell] .next{grid-row:2;justify-self:center;align-self:start;min-height:44px;margin:4px 0 0}
 #student[data-game=spell] #game-status{flex-shrink:0;min-height:21px;margin-top:4px}
}

/* Larger character pieces and two language-independent actions for young players. */
#student[data-game=spell] .prompt.reading{font-size:clamp(32px,5.6vw,50px)}
#student[data-game=spell] .slot,#student[data-game=spell] .tile{width:64px;height:68px;min-height:68px;font-size:36px}
#student[data-game=spell] .spell-controls{gap:18px}
#student[data-game=spell] .spell-controls button{display:grid;place-items:center;width:60px;height:60px;min-height:60px;padding:0;flex-shrink:0}
.spell-action-icon{display:block;width:32px;height:32px;background:currentColor;mask:center/contain no-repeat;-webkit-mask:center/contain no-repeat}
.spell-reset .spell-action-icon{mask-image:url('assets/icons/rotate-ccw.svg');-webkit-mask-image:url('assets/icons/rotate-ccw.svg')}
.spell-check .spell-action-icon{mask-image:url('assets/icons/check.svg');-webkit-mask-image:url('assets/icons/check.svg')}
@media(max-width:600px){
 #student[data-game=spell] .prompt.reading{font-size:clamp(29px,7.6vw,38px)}
 #student[data-game=spell] .slot,#student[data-game=spell] .tile{width:52px;height:58px;min-height:58px;font-size:31px}
 #student[data-game=spell] .spell-controls button{width:56px;height:56px;min-height:56px}
}
@media(min-width:1025px) and (min-height:600px){
 #student[data-game=spell] .prompt.reading{font-size:clamp(34px,5.8dvh,50px)}
 #student[data-game=spell] .slot,#student[data-game=spell] .tile{width:64px;height:66px;min-height:66px;font-size:36px}
}

/* Keep correction feedback in the same action row as the two icon buttons. */
#student[data-game=spell] .spell-controls{min-height:60px}
#student[data-game=spell] .spell-question[data-result=wrong] .spell-controls,
#student[data-game=spell] .spell-question[data-result=corrected] .spell-controls{visibility:visible;pointer-events:auto}
#student[data-game=spell] .spell-question[data-result] .spell-controls>.spell-reset,
#student[data-game=spell] .spell-question[data-result] .spell-controls>.spell-check{display:none}
#student[data-game=spell] .spell-controls>.next{width:auto;min-width:154px;height:60px;min-height:60px;padding:10px 24px;margin:0;align-self:center}
#student[data-game=spell] .spell-question[data-result=corrected] .slot.filled{background:#376647;border-color:#376647!important;color:#fffdf2}
.spell-correction-indicator{width:36px;height:36px;background:#bc8061;mask:url('assets/icons/circle-x.svg') center/contain no-repeat;-webkit-mask:url('assets/icons/circle-x.svg') center/contain no-repeat;animation:spell-error-notice .45s ease both}
.spell-motion-layer{position:fixed;inset:0;z-index:100;pointer-events:none}
.spell-flying{position:absolute;display:grid;place-items:center;border-radius:18px;line-height:1;box-sizing:border-box;box-shadow:0 5px 16px #48613d20}
.spell-flying.returning{background:#ecc8b1;color:#703e2c;border:2px solid #d5a98e}
.spell-flying.correcting{background:#dce5cb;color:#34563d;border:1px solid #c3d0b0}
@keyframes spell-error-notice{0%,100%{transform:translateX(0)}25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
@media(min-width:1025px) and (min-height:600px){#student[data-game=spell] #play-area{display:block}}
@media(max-width:600px){#student[data-game=spell] .spell-controls{min-height:56px}#student[data-game=spell] .spell-controls>.next{height:56px;min-height:56px}}
@media(prefers-reduced-motion:reduce){.spell-correction-indicator{animation:none}}
#student[data-game=spell] .spell-question[data-result=wrong] .slot.filled.is-position-correct{background:#376647;border-color:#376647!important;color:#fffdf2}
#student[data-game=spell] .spell-controls>.next.spell-next{width:60px;min-width:60px;height:60px;min-height:60px;padding:0}
.spell-next .spell-action-icon{mask-image:url('assets/icons/arrow-right.svg');-webkit-mask-image:url('assets/icons/arrow-right.svg')}
.spell-next.spell-finish .spell-action-icon{mask-image:url('assets/icons/flag.svg');-webkit-mask-image:url('assets/icons/flag.svg')}
@media(max-width:600px){#student[data-game=spell] .spell-controls>.next.spell-next{width:56px;min-width:56px;height:56px;min-height:56px}}
#student[data-game=spell] .spell-question[data-result=correct] .spell-controls{visibility:visible}
.spell-success{display:grid;place-items:center;width:60px;height:60px;border-radius:50%;background:#376647;color:#fffdf2;animation:spell-success-pop .55s cubic-bezier(.2,.8,.2,1) both}
.spell-success .spell-action-icon{mask-image:url('assets/icons/check.svg');-webkit-mask-image:url('assets/icons/check.svg');animation:spell-check-reveal .35s .1s ease-out both}
@keyframes spell-success-pop{0%{opacity:0;transform:scale(.5)}65%{opacity:1;transform:scale(1.13)}100%{opacity:1;transform:scale(1)}}
@keyframes spell-check-reveal{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}
@media(max-width:600px){.spell-success{width:56px;height:56px}}
@media(prefers-reduced-motion:reduce){.spell-success,.spell-success .spell-action-icon{animation:none}}

/* Saved native reverse loops share the same full-bleed frame. */
.student-adventure>.adventure-video[hidden]{display:none!important}
.scene-loop-video{z-index:1}
.adventure-milestones.scene-milestones{z-index:2}
.scene-milestones[data-count="6"],.scene-milestones[data-count="8"]{display:grid;grid-template-columns:repeat(2,46px);gap:8px;right:10px}
.scene-milestones[data-count="6"] li,.scene-milestones[data-count="8"] li{width:46px;height:46px}
@media(max-width:600px){.scene-milestones[data-count="6"],.scene-milestones[data-count="8"]{grid-template-columns:repeat(2,34px);gap:5px;right:6px}.scene-milestones[data-count="6"] li,.scene-milestones[data-count="8"] li{width:34px;height:34px}}
