:root{font-family:system-ui,-apple-system,'PingFang SC',sans-serif;color:#425e65;background:#f8f3e8;font-size:18px}*{box-sizing:border-box}body{margin:0;height:100dvh;display:flex;flex-direction:column;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);overflow:hidden;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:none}button,select{font:inherit;color:inherit}button{cursor:pointer;touch-action:none;background:#f3f7ed;border:2px solid #a4bbc0;border-radius:18px;min-width:48px;min-height:48px;padding:8px 14px}button:disabled{cursor:default;opacity:.5}button:focus-visible{outline:3px solid #376e95;outline-offset:4px}button:active{transform:none}header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 18px;flex:0 0 64px}header>span{margin-right:auto;font-size:19px}header>div{display:flex;gap:10px}header button{font-size:24px;border:0;background:transparent}main{position:relative;display:flex;flex:1;min-height:0;margin:0 16px 8px;border:1px solid #e7dfcc;border-radius:28px;background:#fbf7ed;overflow:hidden}#surface{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column}#surface>svg{display:block;width:100%;height:100%;touch-action:none}#targets{position:absolute;inset:0;pointer-events:none}#targets .hit{position:absolute;padding:0;border:0;border-radius:50%;background:transparent;pointer-events:auto;min-width:44px;min-height:44px}#targets .hit .socket-hit,#targets .hit .socket-hint{position:absolute;width:1px;height:1px;pointer-events:none}#controls{position:absolute;inset:auto 0 12px;display:flex;gap:20px;align-items:center;justify-content:center;pointer-events:none}#controls>*{pointer-events:auto}#controls:empty{display:none}#status{min-height:18px;font-size:12px;text-align:center;margin:0 8px 5px;color:#756a56}#status:empty{min-height:0;margin:0}.menu-art{width:min(440px,70vw);height:clamp(130px,27vh,240px)}.menu-art svg{width:100%;height:100%}.scene-title{font-size:clamp(23px,4vw,32px);font-weight:600;margin:4px 0 16px}.choices{display:flex;justify-content:center;gap:36px;padding:8px 0 82px}.picture-choice{min-height:160px;width:170px}.picture-choice .choice-art{width:110px;height:90px}.picture-choice svg{width:100%;height:100%}.choice-symbol{line-height:1}.choice-label{font-size:19px}.language{height:100%;width:100%;display:flex;flex-direction:column;align-items:center;padding:10px 8px 150px}.language svg{flex:1;min-height:0;width:100%}.language .note{margin:0;min-height:26px;font-size:20px}.language-controls .picture-choice{width:118px;min-height:110px;padding:8px 8px 25px;border-radius:22px}.language-controls .choice-art{height:43px;width:60px}.language-controls .choice-symbol{font-size:39px}.language-controls .choice-label{font-size:16px}.language-controls{padding-bottom:62px!important}.guided-hands{z-index:30}.guided-hand{z-index:31}.listening-outline{fill:none;stroke:#337fa7;stroke-width:6;pointer-events:none}.rest-symbol{font-size:96px;color:#71899a}.cheer-svg{max-height:52vh}.finished-album{height:110px;width:min(600px,90%)}.finish-title{font-size:27px;margin:0}.small-cheer{height:85px;width:140px}dialog{border:2px solid #b4c3ba;border-radius:24px;padding:24px;width:min(520px,94vw);max-height:90dvh;color:#425e65;background:#fffaf1;overflow:auto;touch-action:pan-y;z-index:60}dialog::backdrop{background:#435b6260}dialog label{display:block;margin:15px 0}dialog button,dialog a{display:block;margin:12px 0}dialog p{line-height:1.6}dialog select{max-width:100%}.save-error{color:#925a3c}#config{font-size:15px}
@media(max-width:560px){header{padding:6px 8px;flex-basis:58px;gap:4px}header>span{font-size:16px}header>div{gap:0}header button{padding:4px 8px}main{margin:0 6px 6px;border-radius:22px}.picture-choice{width:132px;min-height:152px}.choices{gap:24px;padding-bottom:80px}.picture-choice .choice-art{width:90px;height:78px}.menu-art{height:190px}.language{padding-bottom:145px}.language-controls{gap:14px!important}.language-controls .picture-choice{width:105px}.finished-album{height:90px}}
@media(max-height:500px) and (min-aspect-ratio:4/5){header{flex-basis:48px;padding:0 12px}main{margin-bottom:2px}.menu-art{position:absolute;left:calc(50% - 300px);width:250px;height:190px}.landing .scene-title{margin-left:260px;font-size:22px}.landing .choices{margin-left:260px}.choices{padding-bottom:58px;gap:30px}.picture-choice{width:145px;min-height:119px;padding:6px 8px 22px}.picture-choice .choice-art{height:60px;width:75px}.choice-symbol{font-size:54px}.choice-label{font-size:16px}.language{padding:0 145px 8px 0}.language-controls{inset:10px 18px auto auto!important;flex-direction:column;gap:10px!important;padding-bottom:0!important}.language-controls .picture-choice{width:105px;min-height:87px;padding:4px 6px 20px}.language-controls .choice-art{height:28px}.language-controls .choice-symbol{font-size:28px}.language .note{font-size:16px}.small-cheer{height:45px}.finish-title{font-size:20px}.finished-album{height:55px}.rest-symbol{font-size:50px}}
[hidden]{display:none!important}
.language-accepted{filter:drop-shadow(0 0 4px #528fa4)}
#targets .language-picture-hit{border-radius:24px}
#targets .language-picture-cued{box-shadow:inset 0 0 0 3px #79a5b5}
#review-status{font-size:14px;line-height:1.5}
#guided-word-settings{min-width:0;margin:18px 0;border:1px solid #b4c3ba;border-radius:16px;padding:12px}
#guided-word-settings select{display:block;width:100%;min-height:44px;font:inherit;font-size:16px;margin-top:6px}
#guided-word-preview{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
#guided-word-preview>div{text-align:center;font-size:14px;overflow-wrap:anywhere}
#guided-word-preview img{display:block;width:100%;height:64px;object-fit:contain;margin-bottom:5px}
#guided-word-editors{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px}
#guided-word-editors fieldset{min-width:0;padding:8px;border:1px solid #d7d4c4;border-radius:12px}
#guided-word-editors label{margin:10px 0}#guided-word-note,#guided-word-status,#guided-words-current{font-size:14px;line-height:1.6}
@media(max-width:560px){#guided-word-preview{grid-template-columns:repeat(3,minmax(0,1fr))}#guided-word-editors{grid-template-columns:1fr}}
#surface>.small-cheer{width:140px;height:85px;flex:0 0 85px}.finished-album{flex:0 0 100px}.finished-album svg{display:block;width:100%;height:100%}.finish-title{margin:2px 0 6px}
@media(max-height:500px) and (min-aspect-ratio:4/5){#surface>.small-cheer{width:95px;height:45px;flex-basis:45px}.finished-album{flex-basis:55px}}
@media(max-height:500px) and (min-aspect-ratio:4/5){.language-controls.manual-navigation{gap:72px!important}}
/* Stable focus: only waiting content is faded; no opacity transition on errors. */
.guided-choice-focus .guided-other-choice{opacity:var(--other-opacity);filter:saturate(var(--other-saturation))}
.guided-choice-focus #egg-slots{opacity:var(--album-opacity)}
/* Three separate rows: original picture/album, optional invitation, navigation. */
#surface.language-surface{height:calc(100% - 148px);align-self:flex-start}
.language{padding:4px 8px 0;position:relative}
.language>svg{flex:1 1 0;min-height:0;display:block;width:100%}
.language .note{position:absolute;bottom:84px;left:0;right:0;text-align:center;font-size:22px;pointer-events:none}
.response-slot{flex:0 0 82px;width:100%;display:flex;align-items:center;justify-content:center}
#gacha-response{--response-emphasis:0;display:flex;align-items:center;justify-content:center;gap:10px;height:72px;width:280px;max-width:90%;padding:3px 14px;border:3px solid #89aeb9;border-radius:22px;background:#f4f8f3;box-shadow:0 0 0 calc(var(--response-emphasis)*4px) #5b96aa45;isolation:isolate;cursor:default}
#gacha-response::after{content:'';position:absolute;pointer-events:none}
#gacha-response.response-touched{background:#e7f0ed}
.response-child{display:block;width:53px;height:58px;flex:none}
.response-child>svg{display:block;width:100%;height:100%}
.response-meter{width:174px;height:61px;flex:none}
.language-controls{padding-bottom:0!important;bottom:14px!important;gap:24px!important}
.language-controls .picture-choice{min-height:108px}
.language-controls .picture-choice .choice-art{height:43px;width:60px}
.language-controls.manual-navigation{padding-bottom:60px!important;bottom:0!important}
#surface.language-surface:has(+ #targets + .manual-navigation){height:calc(100% - 204px)}
@media(max-width:560px){.response-slot{flex-basis:76px}#gacha-response{height:66px;width:264px}.response-child{height:53px;width:48px}.response-meter{height:56px;width:160px}.language .note{bottom:78px}.language-controls{gap:16px!important}}
@media(max-height:500px) and (min-aspect-ratio:4/5){
 #surface.language-surface,#surface.language-surface:has(+ #targets + .manual-navigation){height:100%;width:calc(100% - 150px)}
 .language{padding:0 4px 2px}.response-slot{flex-basis:62px}#gacha-response{height:58px;width:246px;border-radius:18px;gap:8px}.response-child{height:47px;width:43px}.response-meter{height:50px;width:143px}.language .note{bottom:62px;font-size:18px}
 .language-controls{inset:10px 18px auto auto!important;padding-bottom:0!important;gap:14px!important}.language-controls.manual-navigation{gap:72px!important;padding-bottom:0!important}
 .language-controls .picture-choice{min-height:87px}.language-controls .picture-choice .choice-art{height:28px;width:60px}
}
/* Native tap highlights must not survive navigation onto a newly opened answer. */
#main button,.guided-hand{-webkit-tap-highlight-color:transparent}

/* Target practice uses the existing adult dialog and a quiet status below the stage. */
#target-live{flex:0 0 auto;min-height:88px;display:flex;align-items:center;justify-content:center;gap:12px;padding:6px 18px;background:#fffaf0;color:#496f7e;font-size:14px;pointer-events:none}
#target-live-info{min-width:0;max-width:720px;flex:1}#target-live-heard{margin:4px 0;line-height:1.4;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}#target-live-heard[data-state="matched"]{color:#35634b}
#target-live:has(#target-status[hidden]){display:none}#target-status{margin:4px 0;line-height:1.4}#target-open-settings{pointer-events:auto;min-height:44px;font-size:14px;padding:6px 12px;white-space:normal}
#target-words{display:flex;flex-wrap:wrap;gap:6px 18px}#target-words label{display:flex;align-items:center;gap:6px;min-height:44px}#target-words input{width:auto}
#target-settings,#target-adult{border:1px solid #c8d8d4;border-radius:14px;padding:12px;margin:14px 0;min-width:0}#target-settings p,#target-adult p{font-size:14px;line-height:1.6;overflow-wrap:anywhere}#target-mode{max-width:100%;width:100%;min-height:44px;font-size:16px}.target-adult-actions{display:flex;flex-wrap:wrap;gap:8px}.target-adult-actions button{min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere}#target-heard{white-space:pre-wrap}
@media(max-width:480px){.target-adult-actions button{width:100%;margin:0}#target-status{font-size:13px}#target-live{gap:4px;padding:3px 8px}}

@media(max-height:500px) and (min-aspect-ratio:4/5){#target-live{min-height:64px;padding:3px 12px;font-size:12px}#target-status,#target-live-heard{margin:2px 0}#target-open-settings{flex:0 0 150px}}

/* Naming keeps the host navigation and uses the isolated classroom layout. */
#gacha-classroom{position:absolute;inset:0;z-index:5}
body.classroom-visible #surface,body.classroom-visible #targets,body.classroom-visible #controls,body.classroom-visible #hands,body.classroom-visible #target-live,body.classroom-visible #asr-live{display:none!important}
#classroom-start-notice{font-size:14px;background:#edf3f6;padding:12px;border-radius:12px}
#classroom-settings{min-width:0;border:1px solid #b4c3ba;border-radius:16px;padding:12px}
#classroom-current button{white-space:normal}

#asr-controls .integrated-cloud-copy{display:none}#asr-controls.integrated-cloud>p{display:none}#asr-controls.integrated-cloud .integrated-cloud-copy,#asr-controls.integrated-cloud #asr-setting-state{display:block}#asr-controls.integrated-cloud #asr-history-settings{display:none}

/* Adult-only, page-memory history. The title and return action stay outside scrolling content. */
#recognition-history-dialog{width:min(760px,94vw);padding:0;overflow:hidden}
#recognition-history-dialog[open]{display:flex;flex-direction:column}
.recognition-heading{flex:none;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:16px 20px;border-bottom:1px solid #c8d8d4;background:#fffaf1}
.recognition-heading h2{font-size:21px;margin:0}.recognition-heading button{margin:0;white-space:normal;font-size:16px}
.recognition-actions{display:flex;flex-wrap:wrap;gap:8px;max-width:100%}
#recognition-history-download-status{flex-basis:100%;margin:0;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
#recognition-history-scroll{min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;padding:0 20px 20px;font-size:15px;line-height:1.6;overflow-wrap:anywhere}
#recognition-history-list{list-style:none;padding:0;margin:18px 0}
.recognition-entry{padding:16px;margin:14px 0;border:1px solid #b4c3ba;border-radius:14px;background:#fffdf8}
.recognition-entry h3{font-size:18px;line-height:1.5;margin:0 0 8px}.recognition-entry p{margin:6px 0}
.recognition-task{font-size:13px;color:#59686a}.recognition-status{font-weight:650}
.recognition-text{white-space:pre-wrap;overflow-wrap:anywhere;user-select:text;-webkit-user-select:text;padding:10px;border-left:3px solid #7195a1;background:#f1f5f4}
.recognition-metrics{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 10px;margin:12px 0}.recognition-metrics dd{margin:0;text-align:right}
@media(max-width:480px){.recognition-heading{padding:12px}.recognition-heading h2{font-size:20px}#recognition-history-scroll{padding:0 12px 12px}.recognition-entry{padding:12px}.recognition-heading button{width:100%}}
