/* English Fun: consistent with the STEAM board, improved listen-and-speak exercises. */
:root{--ink:#27366a;--gold:#e8ac35}
.brand-mark .toy-svg{width:50px;height:50px}
.stage-heading{background:#fffdf9;border:4px solid #ffe09a;border-radius:24px;padding:22px 24px;margin:14px auto 24px;box-shadow:0 6px 0 #efc46e;max-width:930px}
.stage-heading h2{font-size:25px;margin:9px 0;color:#4155a1}.stage-heading p{margin:6px 0;color:#7585aa}
.english-stages{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:19px 0 24px}
.stage-pill{min-height:112px;display:flex;flex-direction:column;gap:5px;align-items:flex-start;justify-content:center;text-align:left;background:#fff;border:3px solid #dfeaff;border-radius:19px;padding:12px 15px;box-shadow:0 5px 0 #c7dced;color:#526c9b}
.stage-pill b{font-size:16px}.stage-pill small{font-size:13px;font-weight:700;line-height:1.3;color:#8290ad;min-height:34px}.stage-pill span{font-size:11px;background:#f6efff;color:#8a67b9;border-radius:14px;padding:4px 9px}.stage-pill.active{border-color:#f8ba52;background:#fff7e6;box-shadow:0 5px 0 #f0bf68}
.english-focus{min-height:70px;display:grid;place-items:center;margin:4px 0}.written-word{font-size:clamp(27px,4vw,45px);letter-spacing:.2px;line-height:1.15;font-weight:1000;color:#4059a4;background:#eaf6ff;border:3px solid #d0eafd;border-radius:22px;padding:13px 25px;text-align:center}
.listen-hint{text-align:center;font-weight:800;color:#6882ac;font-size:16px;margin:12px auto}.category-target{font-size:22px;background:#fff1cc;color:#a37026;border-radius:18px;padding:13px 19px;border:2px solid #f9d78e;text-align:center;font-weight:900}.category-target span{font-size:14px;display:block;color:#ad8a56}
.choice-card .item-label{overflow-wrap:anywhere}.choice-card .toy-svg{max-width:105px;max-height:105px}.choice-card[disabled]{opacity:.56}.choices-four{grid-template-columns:repeat(4,minmax(0,1fr));max-width:910px;gap:13px}.choices-four .choice-card{min-height:162px}.choices-four .toy-svg{width:94px;height:94px}
.match-card.matched{background:#eaf9ef;border-color:#86dab2}.audio-circle{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:#e1f4ff;font-size:24px;flex:none}.match-card:focus-visible{outline:4px solid #b78def}
.memory-tiles{max-width:610px;margin:15px auto;display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.memory-tile{display:grid;place-items:center;min-height:132px;border:4px solid #ded9ff;background:#e4d5ff;border-radius:22px;box-shadow:0 5px 0 #baa9e5}.memory-tile.flipped{background:#fff;box-shadow:0 5px 0 #caddea;border-color:#bce6fd}.memory-tile.matched{background:#eafcf3;border-color:#71d8ac}.memory-tile .toy-svg{width:92px;height:92px}.card-back{font-size:50px;color:#fff;text-shadow:0 3px #8d73c7}
.speaking-panel{max-width:740px;margin:8px auto;padding:20px;background:linear-gradient(140deg,#e4faff,#fff6e5);border:4px solid #cae5fa;border-radius:26px;display:flex;flex-direction:column;align-items:center;gap:15px}.speaking-picture{width:190px;height:180px;display:grid;place-items:center;background:#fff;border:3px solid #d4e8fb;border-radius:25px}.speaking-picture .toy-svg{max-width:160px;max-height:160px}.speaking-panel p{color:#61779c;font-size:18px;text-align:center;margin:0}.speak-translation{font-size:15px;color:#61769c}.soft-disclaimer{font-size:12px;line-height:1.5;text-align:center;color:#72839f}
.story-board{max-width:850px;margin:12px auto}.story-board>p{text-align:center;color:#6e7fa2;font-size:15px}.story-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.story-tile{display:flex;flex-direction:column;gap:8px;align-items:stretch}.story-tile .choice-card{min-height:162px}.sound-chip{min-height:60px;padding:9px;border:2px solid #c6def3;border-radius:15px;background:#e8f7ff;color:#3579af;font-size:14px;font-weight:900}.story-sequence{display:flex;justify-content:center;gap:11px;margin:18px auto}.story-slot{flex:1;max-width:170px;border:3px dashed #c9d7ec;border-radius:16px;background:#fff9e7;min-height:82px;display:grid;place-items:center;padding:6px;font-size:18px;color:#5471aa}.story-slot span{display:flex;align-items:center;gap:4px}.story-slot .toy-svg{width:47px;height:47px}
.feedback{border-radius:18px;padding:13px 17px;text-align:center;margin:18px 0;color:#47618a;font-size:16px;font-weight:900}.feedback.good{background:#e0faef;border:2px solid #80dfac;color:#178668}.feedback.retry{background:#fff2d7;border:2px solid #f1c975;color:#9b772b}.feedback.neutral{background:#eaf4ff;border:2px solid #bfdef4;color:#4e7ba4}
.game-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:16px;margin:23px 0 4px}.game-actions button{min-width:170px}.game-shell .question-note{margin-bottom:9px}.puzzle-stage{min-height:270px}
.drag-card{touch-action:none}.drag-card .toy-svg{width:85px;height:85px}.drag-ghost{z-index:5000}
.brand-name{line-height:1.15}.topbar{align-items:center}.section-head .section-tag{flex:none}
@media(max-width:980px){.english-stages{grid-template-columns:repeat(3,minmax(0,1fr))}.choices-four{grid-template-columns:repeat(2,1fr)}}
@media(max-width:680px){.english-stages{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stage-pill{min-height:105px}.stage-pill b{font-size:14px}.stage-pill small{font-size:11px}.hero-content{padding:25px 24px}.story-options{gap:6px}.story-tile .choice-card{min-height:135px;padding:5px 3px}.story-tile .choice-card .toy-svg{width:74px;height:74px}.sound-chip{font-size:12px}.speaking-panel{padding:14px}.speaking-panel .written-word{font-size:27px}.memory-tile{min-height:103px}.memory-tile .toy-svg{max-width:72px;max-height:72px}.choices-four .choice-card{min-height:132px}.choices-four .toy-svg{max-width:80px;max-height:80px}.brand-name{font-size:17px}.brand-name span{font-size:12px}.game-actions{gap:10px}.game-actions button{flex:1;min-width:134px}.story-slot{min-height:66px}.english-focus{min-height:57px}}
@media(max-width:385px){.stage-pill{padding:10px}.choice-card .toy-svg{max-width:75px}.choices-four .choice-card{min-height:120px}.choices-four{gap:7px}.chapter-title .chapter-title-icon{width:85px;height:85px}.game-actions button{min-width:124px;font-size:15px}.story-options .choice-card{min-height:122px}}
/* Tránh ba thẻ trí nhớ mở rộng quá chiều ngang trên điện thoại 320px. */
.memory-tiles{grid-template-columns:repeat(3,minmax(0,1fr))}
.memory-tile{min-width:0;padding:5px}
.memory-tile .toy-svg{max-width:100%}


/* v1.6 — Phóng to khung học (desktop + mobile, có fallback cho iOS Safari). */
.game-topline{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.study-fullscreen-btn{min-width:148px;min-height:48px;margin-left:auto;padding:8px 13px;border:2px solid #b3dffa;border-radius:15px;background:linear-gradient(180deg,#effaff,#dcefff);color:#305e9f;font-size:14px;font-weight:1000;box-shadow:0 4px 0 #a2c9e9;touch-action:manipulation;white-space:nowrap}
.study-fullscreen-btn:hover{background:#d7f4ff}
.study-fullscreen-btn:active{transform:translateY(2px);box-shadow:0 2px 0 #a2c9e9}
.study-fullscreen-btn:focus-visible{outline:4px solid #8361e8;outline-offset:2px}

/* #app là phần tử fullscreen ổn định, kể cả khi render câu hỏi tiếp theo. */
html.study-fullscreen,html.study-fullscreen body{height:100%;overflow:hidden;overscroll-behavior:none}
html.study-fullscreen #app{position:fixed;inset:0;z-index:2500;width:100%;height:100vh;height:100dvh;min-height:0;overflow:hidden;background:linear-gradient(180deg,#bceeff,#e6f8ff 55%,#f8f8ff)}
html.study-fullscreen #app:fullscreen{width:100vw;height:100vh;height:100dvh;background:linear-gradient(180deg,#bceeff,#e6f8ff 55%,#f8f8ff)}
html.study-fullscreen .page-wrap{width:100%;max-width:none;height:100%;min-height:0;margin:0;padding:0;display:flex;flex-direction:column}
html.study-fullscreen .page-wrap>.topbar,html.study-fullscreen .page-wrap>.page-footer,html.study-fullscreen .crumbs{display:none}
html.study-fullscreen .page-wrap>main{flex:1;min-height:0;overflow:hidden}
html.study-fullscreen .game-screen{width:100%;height:100%;max-height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:calc(9px + env(safe-area-inset-top,0px)) max(10px,env(safe-area-inset-right,0px)) calc(16px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px))}
html.study-fullscreen .game-shell{width:100%;max-width:1500px;min-height:100%;display:flex;flex-direction:column;margin:0 auto;padding:clamp(14px,2vw,30px);border-width:5px;border-radius:24px;box-shadow:0 5px 0 #e4a93b,0 12px 28px #3b6e9f26}
html.study-fullscreen .puzzle-stage{flex:1;min-height:230px}
html.study-fullscreen .game-actions{margin-top:auto;padding-top:13px}
html.study-fullscreen .toast{z-index:4000;bottom:max(20px,env(safe-area-inset-bottom,0px))}
@media(max-width:720px){
 .study-fullscreen-btn{margin-left:auto;min-width:115px;min-height:45px;padding:7px 10px;font-size:12px}
 html.study-fullscreen .game-shell{padding:14px 11px 18px;border-width:4px;border-radius:20px}
 html.study-fullscreen .question-heading h1{font-size:clamp(20px,5.6vw,26px)}
 html.study-fullscreen .game-actions{gap:9px}
 html.study-fullscreen .game-actions button{min-height:55px}
}
@media(max-width:375px){.study-fullscreen-btn{min-width:106px;font-size:11px}.game-topline{gap:5px}}
