/* Bé Học Tiếng Anh: thiết kế cho iPad (ngang và dọc), vẫn dùng được trên điện thoại. Một màn hình không cuộn (trừ bộ hình dán và bảng ba mẹ).
   Cỡ chữ gốc theo cạnh ngắn của màn hình (rem), nên mọi thứ tự to nhỏ theo máy. */
@font-face{font-family:Baloo;src:url('./assets/fonts/baloo-2-latin-500-normal.woff2') format('woff2');font-weight:500;font-display:swap}
@font-face{font-family:Baloo;src:url('./assets/fonts/baloo-2-vietnamese-500-normal.woff2') format('woff2');font-weight:500;font-display:swap;unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:Baloo;src:url('./assets/fonts/baloo-2-latin-700-normal.woff2') format('woff2');font-weight:700;font-display:swap}
@font-face{font-family:Baloo;src:url('./assets/fonts/baloo-2-vietnamese-700-normal.woff2') format('woff2');font-weight:700;font-display:swap;unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
/* Andika: phông dành cho trẻ tập đọc (chữ a, g một tầng như chữ viết tay) cho các từ tiếng Anh */
@font-face{font-family:Andika;src:url('./assets/fonts/andika-latin-400-normal.woff2') format('woff2');font-weight:400;font-display:swap}
@font-face{font-family:Andika;src:url('./assets/fonts/andika-latin-700-normal.woff2') format('woff2');font-weight:700;font-display:swap}

:root{--ink:#27306b;--ink2:#5b6494;--card:#fff;--line:#dfe8ff;--green:#3ccf6e;--green-d:#21a04e;--orange:#ff9a3d;--orange-d:#e0701a;--blue:#3aa7ff;--blue-d:#1f7fd6;--pink:#ff6fb1;--red:#ff5a5f;--gold:#ffc928;--gold-d:#e39a00;--unit:#ff9a3d;
  font-size:clamp(13px,2.05vmin,26px);font-family:Baloo,"Baloo 2",ui-rounded,system-ui,sans-serif;font-weight:500;color:var(--ink)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;overscroll-behavior:none;touch-action:manipulation}
body{background:#bfeaff;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
img{-webkit-user-drag:none;user-drag:none;pointer-events:none}
button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:pointer;touch-action:manipulation}
button:disabled{cursor:default}
[hidden]{display:none!important}
.en{font-family:Andika,Baloo,sans-serif;font-weight:700;letter-spacing:.01em}

/* ---------- nền trời ---------- */
.sky{position:fixed;inset:0;background:linear-gradient(180deg,#8fd8ff 0%,#c9f0ff 46%,#eafcff 70%,#d9f7d0 100%);overflow:hidden;z-index:0}
.sky .sun{position:absolute;right:7%;top:6%;width:9rem;height:9rem;border-radius:50%;background:radial-gradient(circle at 38% 36%,#fffbd1,#ffe45c 55%,#ffc928);box-shadow:0 0 0 1.4rem rgba(255,235,120,.28),0 0 0 3rem rgba(255,235,120,.14);animation:sun 6s ease-in-out infinite}
.sky .cloud{position:absolute;width:16rem;height:5rem;border-radius:5rem;background:#fff;opacity:.9;filter:drop-shadow(0 .5rem 0 rgba(120,180,230,.18))}
.sky .cloud::before,.sky .cloud::after{content:"";position:absolute;background:#fff;border-radius:50%}
.sky .cloud::before{width:7rem;height:7rem;left:2.2rem;top:-3.3rem}.sky .cloud::after{width:5.4rem;height:5.4rem;right:2.4rem;top:-2.2rem}
.sky .c1{left:-4%;top:12%;animation:drift 38s linear infinite}.sky .c2{left:38%;top:5%;transform:scale(.7);animation:drift 52s linear infinite reverse}.sky .c3{right:-6%;top:30%;transform:scale(.85);animation:drift 46s linear infinite}
.sky .hill{position:absolute;bottom:-18vh;border-radius:50%;}
.sky .h1{left:-20%;width:90%;height:44vh;background:linear-gradient(180deg,#a6e98c,#7fd36b)}
.sky .h2{right:-25%;width:100%;height:50vh;background:linear-gradient(180deg,#8fe079,#62c452)}
body:not([data-screen="start"]):not([data-screen="who"]) .sky .sun{opacity:.55}
@keyframes drift{from{translate:0 0}50%{translate:6vw 0}to{translate:0 0}}
@keyframes sun{50%{transform:scale(1.05)}}

/* ---------- khung chung ---------- */
.screen{position:fixed;inset:0;z-index:1;display:flex;flex-direction:column;padding:max(.9rem,env(safe-area-inset-top)) max(1rem,env(safe-area-inset-right)) max(.9rem,env(safe-area-inset-bottom)) max(1rem,env(safe-area-inset-left))}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:.6rem;min-height:3.6rem;padding:.5rem 1.7rem;border-radius:1.3rem;font-weight:700;font-size:1.35rem;color:#fff;background:var(--blue);box-shadow:0 .42rem 0 var(--blue-d);transition:transform .08s,box-shadow .08s;line-height:1.1}
.btn:active:not(:disabled){transform:translateY(.3rem);box-shadow:0 .12rem 0 var(--blue-d)}
.btn.green{background:var(--green);box-shadow:0 .42rem 0 var(--green-d)}.btn.green:active:not(:disabled){box-shadow:0 .12rem 0 var(--green-d)}
.btn.orange{background:var(--orange);box-shadow:0 .42rem 0 var(--orange-d)}.btn.orange:active:not(:disabled){box-shadow:0 .12rem 0 var(--orange-d)}
.btn.white{background:#fff;color:var(--ink);box-shadow:0 .42rem 0 #c8dcf5}.btn.white:active:not(:disabled){box-shadow:0 .12rem 0 #c8dcf5}
.btn.red{background:var(--red);box-shadow:0 .42rem 0 #c93338}
.btn.small{min-height:2.9rem;font-size:1.1rem;padding:.3rem 1.1rem;border-radius:1rem}
.btn.huge{min-height:5rem;font-size:2rem;padding:.6rem 3rem;border-radius:1.8rem}
.btn:disabled{filter:grayscale(.7);opacity:.55}
.round{width:3.4rem;height:3.4rem;border-radius:50%;background:#fff;color:var(--ink2);display:grid;place-items:center;box-shadow:0 .28rem 0 #c8dcf5;flex:none}
.round:active{transform:translateY(.2rem);box-shadow:0 .08rem 0 #c8dcf5}

/* ---------- màn hình mở đầu ---------- */
.start{align-items:center;justify-content:center;gap:1.2rem;text-align:center}
.logo{margin:0;line-height:.95;display:flex;flex-direction:column;align-items:center}
.logo small{font-size:2.3rem;font-weight:700;color:#fff;text-shadow:0 .16rem 0 #2f8fd6,0 .34rem .5rem rgba(20,80,140,.25);letter-spacing:.04em}
.logo b{font-size:5.4rem;font-weight:700;display:flex;gap:.05em;flex-wrap:wrap;justify-content:center}
.logo b span{display:inline-block;color:#fff;-webkit-text-stroke:.14rem #27306b;paint-order:stroke fill;text-shadow:0 .34rem 0 #27306b;animation:hop 2.4s ease-in-out infinite}
.logo b span:nth-child(1){color:#ff6f6f}.logo b span:nth-child(2){color:#ffb23e;animation-delay:.1s}.logo b span:nth-child(3){color:#ffe14d;animation-delay:.2s}.logo b span:nth-child(4){color:#74e083;animation-delay:.3s}.logo b span:nth-child(5){color:#5cc4ff;animation-delay:.4s}
.logo b span:nth-child(6){color:#b79bff;animation-delay:.5s}.logo b span:nth-child(7){color:#ff8fc8;animation-delay:.6s}.logo b span:nth-child(8){color:#ff6f6f;animation-delay:.7s}
@keyframes hop{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-.5rem)}}
.hero{position:relative;width:min(17rem,34vh);aspect-ratio:1}
.chip-big{width:100%;height:100%;object-fit:contain;animation:bob 1.9s ease-in-out infinite;filter:drop-shadow(0 1rem .7rem rgba(40,90,60,.22))}
.abc{position:absolute;font-family:Andika,Baloo,sans-serif;font-weight:700;font-size:2.6rem;width:3.6rem;height:3.6rem;border-radius:1rem;display:grid;place-items:center;color:#fff;box-shadow:0 .3rem 0 rgba(0,0,0,.18);animation:bob 2.6s ease-in-out infinite}
.abc.a{left:-22%;top:4%;background:#ff6f6f;rotate:-10deg}.abc.b{right:-24%;top:20%;background:#3aa7ff;rotate:9deg;animation-delay:.5s}.abc.c{left:-30%;bottom:8%;background:#3ccf6e;rotate:7deg;animation-delay:1s}
.tagline{margin:0;font-size:1.15rem;color:var(--ink2);font-weight:700}
@keyframes bob{50%{transform:translateY(-.7rem)}}

/* ---------- chọn bé ---------- */
.who{align-items:center;justify-content:center;gap:1.4rem}
.title{margin:0;font-size:2.4rem;font-weight:700;color:#fff;text-shadow:0 .16rem 0 #2f8fd6,0 .34rem .5rem rgba(20,80,140,.25);text-align:center;line-height:1.1}
.kids{display:flex;flex-wrap:wrap;justify-content:center;gap:1.2rem;max-width:62rem;max-height:62vh;overflow:auto;padding:.6rem}
.kid{width:11.5rem;padding:1rem .8rem .9rem;border-radius:1.8rem;background:#fff;box-shadow:0 .5rem 0 #c8dcf5;display:flex;flex-direction:column;align-items:center;gap:.25rem;position:relative}
.kid:active{transform:translateY(.3rem);box-shadow:0 .2rem 0 #c8dcf5}
.kid img{width:6.6rem;height:6.6rem}
.kid b{font-size:1.45rem;line-height:1.1;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kid small{font-size:.95rem;color:var(--ink2)}
.kid .stars{display:flex;align-items:center;gap:.25rem;font-weight:700;color:var(--gold-d)}.kid .stars img{width:1.4rem;height:1.4rem}
.kid.add{background:rgba(255,255,255,.55);box-shadow:0 .5rem 0 rgba(140,190,235,.6);border:.22rem dashed #8cc3ee;justify-content:center;min-height:12.5rem}
.kid.add i{font-style:normal;font-size:4rem;line-height:1;color:var(--blue-d)}
.note{margin:0;font-size:1.05rem;color:var(--ink2);text-align:center;max-width:40rem;background:rgba(255,255,255,.7);padding:.5rem 1rem;border-radius:1rem}
.note button{color:var(--blue-d);font-weight:700;text-decoration:underline}

/* ---------- trang chính: 10 bài ---------- */
.home{gap:.9rem}
.topbar{display:flex;align-items:center;gap:.7rem;flex:none}
.chip{display:flex;align-items:center;gap:.5rem;height:3.4rem;padding:0 1rem 0 .4rem;border-radius:2rem;background:#fff;box-shadow:0 .28rem 0 #c8dcf5;font-weight:700;font-size:1.25rem;min-width:0}
.chip img{width:2.7rem;height:2.7rem;flex:none}.chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chip.kidchip .trk{width:1.7rem;height:1.7rem;opacity:.9}
.chip.stat{padding:0 .9rem 0 .5rem;font-size:1.35rem}.chip.stat img{width:2.1rem;height:2.1rem}
.chip.kidchip:active{transform:translateY(.2rem);box-shadow:0 .08rem 0 #c8dcf5}
.spacer{flex:1}
.tool{display:flex;flex-direction:column;align-items:center;justify-content:center;width:4.6rem;height:4.2rem;border-radius:1.2rem;background:#fff;box-shadow:0 .28rem 0 #c8dcf5;font-size:.82rem;font-weight:700;line-height:1;gap:.12rem;position:relative;flex:none}
.tool img{width:2.4rem;height:2.4rem}.tool:active{transform:translateY(.2rem);box-shadow:0 .08rem 0 #c8dcf5}
.tool .dot{position:absolute;top:-.35rem;right:-.35rem;min-width:1.5rem;height:1.5rem;border-radius:1rem;background:var(--red);color:#fff;font-size:.85rem;display:grid;place-items:center;padding:0 .3rem;box-shadow:0 .12rem 0 #c93338}
/* 20 bài = 4 hàng: lưới cuộn dọc. Cột phải là minmax(0,1fr): Safari lấy cỡ gốc của ảnh (512px) làm bề rộng tối thiểu của cột nên cột phình ra ngoài màn hình. Chiều cao hàng chọn để luôn thấy trọn hai hàng và ló một phần hàng thứ ba (bé biết là còn bài bên dưới). */
.units{flex:1;min-height:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-auto-rows:13.5rem;grid-auto-rows:max(13.5rem,calc((var(--vh,1vh)*100 - 9.6rem)/2.25));align-content:start;gap:1rem;padding:1.5rem .5rem 1.3rem;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}
.unit{position:relative;border-radius:1.8rem;background:#fff;box-shadow:0 .5rem 0 rgba(120,160,215,.5);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.1rem;padding:.6rem .4rem .7rem;min-height:0;overflow:visible;border:.3rem solid #fff;background:linear-gradient(180deg,#fff 0%,#fff 58%,color-mix(in srgb,var(--unit) 16%,#fff) 100%)}
.unit:active{transform:translateY(.3rem);box-shadow:0 .2rem 0 rgba(120,160,215,.5)}
.unit .no{position:absolute;top:-.5rem;left:-.5rem;width:2.5rem;height:2.5rem;border-radius:50%;background:var(--unit);color:#fff;font-weight:700;font-size:1.3rem;display:grid;place-items:center;box-shadow:0 .2rem 0 rgba(0,0,0,.18)}
.unit .pic{height:46%;min-height:0;aspect-ratio:1;object-fit:contain;filter:drop-shadow(0 .4rem .35rem rgba(0,0,0,.14))}
.unit b{font-family:Andika,Baloo,sans-serif;font-size:1.45rem;line-height:1.05;color:var(--ink);text-align:center}
.unit .mini{display:flex;gap:.2rem;margin-top:.25rem}
.unit .mini i{width:1.25rem;height:1.25rem;border-radius:50%;background:#e4ebfa;display:block;position:relative}
.unit .mini i.s1,.unit .mini i.s2,.unit .mini i.s3{background:var(--gold);box-shadow:inset 0 -.14rem 0 var(--gold-d)}
.unit .mini i.s1{background:linear-gradient(90deg,var(--gold) 34%,#e4ebfa 34%)}.unit .mini i.s2{background:linear-gradient(90deg,var(--gold) 67%,#e4ebfa 67%)}
.unit.locked{background:#f4f7fd;box-shadow:0 .5rem 0 rgba(150,170,205,.45)}
.unit.locked .pic{filter:grayscale(.9) opacity(.5)}.unit.locked b{color:#8a93b8}.unit.locked small{color:#a3abc9}.unit.locked .no{background:#b4bdd6}
.unit .lock{position:absolute;right:.5rem;top:.5rem;width:2.2rem;height:2.2rem}
.unit.now{border-color:var(--unit);animation:nudge 1.8s ease-in-out infinite}
.unit .here{position:absolute;right:-.5rem;top:-1.3rem;width:3.4rem;height:3.4rem;animation:bob 1.2s ease-in-out infinite;filter:drop-shadow(0 .3rem .2rem rgba(0,0,0,.2))}
.unit.done .crown{position:absolute;right:.4rem;top:.4rem;width:2rem;height:2rem}
@keyframes nudge{50%{transform:translateY(-.35rem)}}

/* ---------- hộp thoại ---------- */
.modal{position:fixed;inset:0;z-index:20;background:rgba(30,45,110,.45);display:grid;place-items:center;padding:1rem;animation:fade .18s}
.sheet{width:min(46rem,100%);max-height:calc(var(--vh,1vh)*100 - 2rem);overflow:auto;background:#fff;border-radius:2rem;padding:1.4rem 1.5rem 1.5rem;box-shadow:0 1rem 3rem rgba(20,30,90,.35);position:relative;animation:pop-in .28s cubic-bezier(.2,1.4,.4,1);-webkit-overflow-scrolling:touch}
.sheet.wide{width:min(58rem,100%)}
.sheet h2{margin:0 0 .2rem;font-size:1.9rem;line-height:1.1;padding-right:3.4rem}
.sheet h3{margin:1.1rem 0 .4rem;font-size:1.2rem;color:var(--ink2)}
.sheet .x{position:absolute;right:1rem;top:1rem;background:#eef3ff;box-shadow:none}
.sheet p{margin:.3rem 0;font-size:1.1rem;color:var(--ink2);line-height:1.35}
.row{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center}
.actions{display:flex;flex-wrap:wrap;gap:.8rem;justify-content:flex-end;margin-top:1.3rem}
@keyframes fade{from{opacity:0}}
@keyframes pop-in{from{transform:scale(.86);opacity:0}}

/* bảng của một bài */
.unit-head{display:flex;align-items:center;gap:1rem}
.unit-head img{width:6rem;height:6rem;flex:none;filter:drop-shadow(0 .4rem .35rem rgba(0,0,0,.14))}
.unit-head h2 b{font-family:Andika,Baloo,sans-serif}
.words-strip{display:flex;gap:.5rem;margin:.9rem 0 .2rem;justify-content:space-between}
.words-strip button{flex:1;min-width:0;aspect-ratio:1;border-radius:1.1rem;background:#f3f7ff;display:grid;place-items:center;padding:.35rem;max-width:6.2rem}
.words-strip .art{width:100%;height:100%}
.words-strip button:active{transform:scale(.94)}
.parts{display:grid;grid-template-columns:repeat(auto-fit,minmax(7.2rem,1fr));gap:.8rem;margin-top:1rem}
.part{border-radius:1.5rem;background:var(--unit);color:#fff;padding:.9rem .6rem .8rem;display:flex;flex-direction:column;align-items:center;gap:.2rem;box-shadow:0 .42rem 0 rgba(0,0,0,.25);box-shadow:0 .42rem 0 color-mix(in srgb,var(--unit) 70%,#000);font-weight:700;font-size:1.3rem;position:relative;white-space:nowrap;min-width:0}
.part:active:not(:disabled){transform:translateY(.3rem);box-shadow:0 .12rem 0 color-mix(in srgb,var(--unit) 70%,#000)}
.part img.icon{width:3.8rem;height:3.8rem;filter:drop-shadow(0 .25rem .2rem rgba(0,0,0,.2))}
.part:disabled{background:#cfd6e6;box-shadow:0 .42rem 0 #aab3c8}
.part:disabled img.icon{filter:grayscale(1) opacity(.55)}
.part .lock{position:absolute;right:.5rem;top:.5rem;width:1.8rem;height:1.8rem}
.part.next{animation:nudge 1.5s ease-in-out infinite}
.stars3{display:flex;gap:.15rem;height:1.6rem}.stars3 img{width:1.6rem;height:1.6rem}.stars3 img.off{filter:grayscale(1) brightness(1.5) opacity(.55)}

/* ---------- bài học ---------- */
.lesson{gap:.6rem}
.lesson-top{display:flex;align-items:center;gap:.9rem;flex:none}
.bar{flex:1;height:1.7rem;border-radius:1rem;background:#fff;box-shadow:inset 0 .18rem 0 #d6e2f7;position:relative}
.bar i{position:absolute;left:.22rem;top:.22rem;bottom:.22rem;width:0;min-width:1.2rem;border-radius:1rem;background:linear-gradient(180deg,#7be495,var(--green));transition:width .45s cubic-bezier(.3,1.3,.5,1)}
.bar img{position:absolute;top:50%;left:0;width:2.9rem;height:2.9rem;translate:-50% -55%;transition:left .45s cubic-bezier(.3,1.3,.5,1)}
.lesson-name{font-weight:700;font-size:1.05rem;color:var(--ink2);background:#fff;border-radius:1rem;padding:.35rem .9rem;white-space:nowrap;box-shadow:0 .2rem 0 #c8dcf5}
.stage{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.3rem;position:relative}
.lesson-bottom{flex:none;display:flex;align-items:flex-end;gap:.6rem;min-height:5.4rem}
.mascot{width:5.2rem;height:5.2rem;flex:none}.mascot img{width:100%;height:100%;filter:drop-shadow(0 .4rem .3rem rgba(40,90,60,.25))}
.mascot.talk img{animation:talk .42s ease-in-out infinite}.mascot.yay img{animation:yay .6s cubic-bezier(.3,1.6,.5,1)}.mascot.oops img{animation:shake .45s}
@keyframes talk{50%{transform:translateY(-.35rem) rotate(-4deg)}}
@keyframes yay{30%{transform:translateY(-1.6rem) scale(1.12) rotate(8deg)}60%{transform:translateY(0) scale(.95)}}
.bubble{position:relative;align-self:center;max-width:min(32rem,56vw);background:#fff;border-radius:1.3rem;padding:.55rem 1rem;font-size:1.12rem;line-height:1.25;box-shadow:0 .28rem 0 #c8dcf5;color:var(--ink)}
.bubble b{display:block;font-size:1.3rem;line-height:1.15}
.bubble::before{content:"";position:absolute;left:-.55rem;bottom:1rem;border:.6rem solid transparent;border-right-color:#fff;border-left:0}
.next{margin-left:auto;min-height:4.4rem;font-size:1.7rem;padding:.4rem 2.2rem;animation:pop-in .3s}

.art{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:contain}
img.art{filter:drop-shadow(0 .5rem .4rem rgba(0,0,0,.14))}
svg.art{filter:drop-shadow(0 .5rem .4rem rgba(0,0,0,.16));overflow:visible}
.art.num{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.04em;container-type:size}
.art.num b{font-size:6.5rem;font-size:62cqh;line-height:.9;font-weight:700;color:#3aa7ff;-webkit-text-stroke:.05em #1c4f9c;paint-order:stroke fill;text-shadow:0 .06em 0 #1c4f9c}
.art.num span{display:flex;gap:.25rem;gap:2cqw;justify-content:center;flex-wrap:wrap;max-width:96%;max-width:96cqw}
.art.num span i{width:1rem;height:1rem;width:12cqw;height:12cqw;border-radius:50%;background:radial-gradient(circle at 35% 30%,#ffe98a,#ffc928 60%,#f0a400);box-shadow:0 .1em 0 #c98300}
.art.scene{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;align-content:center;gap:2%}
.art.scene img{width:46%;height:auto;aspect-ratio:1;object-fit:contain;filter:drop-shadow(0 .3rem .25rem rgba(0,0,0,.14))}
.art.scene[data-n="1"] img{width:78%}.art.scene[data-n="3"] img,.art.scene[data-n="4"] img{width:44%}.art.scene[data-n="5"] img,.art.scene[data-n="6"] img,.art.scene[data-n="7"] img,.art.scene[data-n="8"] img,.art.scene[data-n="9"] img{width:30%}.art.scene[data-n="10"] img,.art.scene[data-n="11"] img,.art.scene[data-n="12"] img{width:22.5%}

/* học từ mới */
.learn{display:flex;flex-direction:column;align-items:center;gap:.5rem;animation:pop-in .35s cubic-bezier(.2,1.4,.4,1)}
.learn .frame{display:grid;place-items:center;width:min(21rem,44vh,70vw);aspect-ratio:1;border-radius:2.6rem;background:#fff;background:radial-gradient(circle at 50% 42%,#fff 0%,#fff 46%,color-mix(in srgb,var(--unit) 22%,#fff) 100%);box-shadow:0 .7rem 0 rgba(120,160,215,.45);padding:1.6rem;position:relative;border:.4rem solid #fff}
.learn .frame.say{animation:say .5s ease-in-out}
@keyframes say{40%{transform:scale(1.06) rotate(-1.5deg)}}
/* Bé chưa biết chữ: không có chữ, hình thật to. Bé mới biết chữ: hình nhỏ lại, mặt chữ là chính (mỗi chữ cái một ô chạm được). */
.learn.listen{gap:1rem}.learn.listen .frame{width:min(27rem,calc(var(--vh,1vh)*52),74vw)}
.learn.read .frame{width:min(17rem,calc(var(--vh,1vh)*31),52vw);border-radius:2rem;padding:1.1rem}
.spellrow{display:flex;justify-content:center;align-items:flex-end;gap:.4rem;margin:.5rem 0 .1rem;font-size:4.2rem;font-size:min(4.2rem,calc(84vw/var(--n,4)/1.42))}
.spellrow .space{width:.35em}
.ltr{font-size:1em;line-height:1.05;min-width:1.12em;padding:.06em .16em .16em;border-radius:.26em;background:#fff;color:var(--ink);box-shadow:0 .1em 0 rgba(120,160,215,.5);text-align:center}
.ltr:active{transform:translateY(.06em);box-shadow:0 .03em 0 rgba(120,160,215,.5)}
.ltr.lit{animation:lit .6s ease-out}
@keyframes lit{0%{transform:none}35%{transform:translateY(-.16em) scale(1.12);background:var(--unit);color:#fff;box-shadow:0 .16em 0 rgba(0,0,0,.18)}100%{transform:none}}
.learn .tools{display:flex;gap:.8rem;margin-top:.3rem}
.sound{width:4.4rem;height:4.4rem;border-radius:50%;background:var(--blue);color:#fff;display:grid;place-items:center;box-shadow:0 .36rem 0 var(--blue-d);flex:none}
.sound:active{transform:translateY(.25rem);box-shadow:0 .1rem 0 var(--blue-d)}
.sound.big{width:7rem;height:7rem;box-shadow:0 .5rem 0 var(--blue-d)}.sound.big svg{width:3.6rem;height:3.6rem}
.sound.slow{background:#8e7bff;box-shadow:0 .36rem 0 #6a55e0}.sound.slow img{width:3rem;height:3rem}
.sound.kid{background:var(--orange);box-shadow:0 .36rem 0 var(--orange-d)}.sound.kid img{width:3rem;height:3rem}
.sound.playing{animation:ring 0.9s ease-out infinite}
@keyframes ring{0%{box-shadow:0 .36rem 0 var(--blue-d),0 0 0 0 rgba(58,167,255,.55)}100%{box-shadow:0 .36rem 0 var(--blue-d),0 0 0 1.4rem rgba(58,167,255,0)}}
.sentence{font-size:2.6rem;line-height:1.15;margin:0;text-align:center;color:var(--ink)}
.sentence.small{font-size:1.9rem;color:var(--ink2)}

/* câu hỏi chọn đáp án */
.prompt{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.6rem 1.2rem;flex:none;min-height:7rem} /* hẹp quá thì hình xuống một hàng riêng thay vì bị đẩy ra khỏi màn hình */
.prompt .pic{display:grid;place-items:center;width:min(13rem,26vh);aspect-ratio:1;border-radius:2rem;background:#fff;padding:1rem;box-shadow:0 .5rem 0 rgba(120,160,215,.45);border:.3rem solid #fff}
.prompt .big-word{font-size:4.6rem;font-size:min(4.6rem,calc((92vw - 4rem)/(var(--n,4)*.62)));max-width:96vw;line-height:1;margin:0;background:#fff;border-radius:1.6rem;padding:.6rem 2rem .8rem;box-shadow:0 .5rem 0 rgba(120,160,215,.45)}
.prompt .gap-word{font-size:4.2rem;font-size:min(4.2rem,calc(88vw/var(--n,4)/.95));line-height:1;margin:0;display:flex;gap:.12em;align-items:flex-end}
.prompt .gap-word i{font-style:normal;display:inline-block;min-width:.75em;text-align:center}
.prompt .gap-word i.blank{border-bottom:.09em solid var(--orange);color:transparent;min-width:.9em;margin:0 .04em}
.prompt .gap-word i.blank.filled{color:var(--green-d);border-color:var(--green);animation:pop-in .3s}
.prompt .gap-word i.space{min-width:.4em}
.options{--max:15rem;display:flex;flex-wrap:wrap;justify-content:center;align-content:center;gap:1.1rem;width:100%;--cols:3;--rows:1;--side:min(calc((100vw - 3rem - (var(--cols) - 1)*1.1rem)/var(--cols)),calc((var(--vh,1vh)*100 - 23rem)/var(--rows)),var(--max))}
.options[data-n="2"]{--cols:2;--max:18rem}.options[data-n="3"]{--max:17rem}.options[data-n="4"]{--cols:4}.options[data-n="5"]{--cols:5}
.opt{width:var(--side);height:var(--side);border-radius:1.9rem;background:#fff;border:.32rem solid #fff;box-shadow:0 .55rem 0 rgba(120,160,215,.5);padding:calc(var(--side)*.08);position:relative;display:grid;place-items:center;animation:pop-in .35s cubic-bezier(.2,1.4,.4,1) backwards;transition:transform .1s,opacity .25s}
.opt:nth-child(2){animation-delay:.06s}.opt:nth-child(3){animation-delay:.12s}.opt:nth-child(4){animation-delay:.18s}.opt:nth-child(5){animation-delay:.24s}
.opt:active:not(:disabled){transform:translateY(.3rem) scale(.98);box-shadow:0 .22rem 0 rgba(120,160,215,.5)}
.opt.text{height:auto;min-height:5.6rem;width:auto;min-width:min(13rem,28vw);padding:.7rem 1.6rem .9rem;font-size:3.1rem;line-height:1}
.opt.letter{width:min(var(--side),9.5rem);height:min(var(--side),9.5rem);font-size:5.2rem;line-height:1;padding:0 0 .12em;display:grid;place-items:center}
.opt.right{border-color:var(--green);background:#eafff0;box-shadow:0 .55rem 0 var(--green-d);animation:yes .5s cubic-bezier(.3,1.6,.5,1)}
.opt.wrong{border-color:#ffc2c4;background:#fff3f3;box-shadow:0 .3rem 0 #f0b4b6;opacity:.45;animation:shake .4s}
.opt.hint{border-color:var(--gold);animation:glow 1s ease-in-out infinite}
.opt .tick{position:absolute;right:-.6rem;top:-.6rem;width:2.6rem;height:2.6rem;border-radius:50%;background:var(--green);color:#fff;display:grid;place-items:center;box-shadow:0 .2rem 0 var(--green-d);animation:pop-in .3s}
@keyframes yes{40%{transform:scale(1.12) rotate(2deg)}}
@keyframes shake{20%{transform:translateX(-.5rem)}40%{transform:translateX(.5rem)}60%{transform:translateX(-.35rem)}80%{transform:translateX(.25rem)}}
@keyframes glow{50%{box-shadow:0 .55rem 0 var(--gold-d),0 0 0 .7rem rgba(255,201,40,.35)}}

/* bong bóng */
.options.pop{gap:1.4rem .9rem;--side:min(calc((100vw - 3rem - 4*.9rem)/5),calc(var(--vh,1vh)*100 - 26rem),12.5rem);padding-bottom:2.4rem}
.opt.balloon{border-radius:50% 50% 50% 50%/46% 46% 54% 54%;height:calc(var(--side)*1.14);padding:calc(var(--side)*.16) calc(var(--side)*.15) calc(var(--side)*.2);border:0;background:radial-gradient(circle at 32% 26%,rgba(255,255,255,.95) 0,rgba(255,255,255,.6) 14%,var(--b) 46%,var(--b) 100%);background:radial-gradient(circle at 32% 26%,rgba(255,255,255,.95) 0,rgba(255,255,255,.6) 14%,var(--b) 46%,color-mix(in srgb,var(--b) 72%,#000) 100%);box-shadow:none;animation:float 3.2s ease-in-out infinite;overflow:visible}
.opt.balloon:nth-child(odd){animation-duration:3.8s;animation-delay:-1.2s}.opt.balloon:nth-child(3n){animation-duration:4.3s;animation-delay:-2s}
.opt.balloon::after{content:"";position:absolute;left:50%;top:99%;width:.16rem;height:2.6rem;background:rgba(40,50,110,.35);translate:-50% 0;border-radius:.2rem}
.opt.balloon::before{content:"";position:absolute;left:50%;top:97%;width:.9rem;height:.6rem;background:var(--b);background:color-mix(in srgb,var(--b) 72%,#000);translate:-50% 0;clip-path:polygon(50% 0,100% 100%,0 100%)}
.opt.balloon .art{filter:drop-shadow(0 .2rem .15rem rgba(0,0,0,.18))}
.opt.balloon.right{animation:burst .45s ease-out forwards;background:radial-gradient(circle at 32% 26%,rgba(255,255,255,.95) 0,rgba(255,255,255,.6) 14%,var(--b) 46%,var(--b) 100%);background:radial-gradient(circle at 32% 26%,rgba(255,255,255,.95) 0,rgba(255,255,255,.6) 14%,var(--b) 46%,color-mix(in srgb,var(--b) 72%,#000) 100%);box-shadow:none}
.opt.balloon.wrong{opacity:.4;animation:shake .4s}
.opt.balloon.hint{animation:float 3.2s ease-in-out infinite,glow-b 1s ease-in-out infinite}
@keyframes float{50%{transform:translateY(-1rem) rotate(2deg)}}
@keyframes burst{40%{transform:scale(1.25);opacity:1}100%{transform:scale(1.7);opacity:0}}
@keyframes glow-b{50%{filter:drop-shadow(0 0 .8rem var(--gold))}}

/* lật thẻ */
.memory{display:grid;grid-template-columns:repeat(3,auto);gap:1.1rem;--side:min(calc((100vw - 5rem)/3),calc((var(--vh,1vh)*100 - 20rem)/2),14rem)}
.mcard{width:var(--side);height:var(--side);animation:pop-in .35s backwards;display:grid}
.mcard .in{position:relative;display:block;min-width:0;min-height:0;transition:transform .14s ease-in}
.mcard.turn .in{transform:scaleX(0)}
.mcard .f,.mcard .b{position:absolute;inset:0;border-radius:1.8rem;box-shadow:0 .5rem 0 rgba(120,160,215,.5)}
.mcard .b{background:var(--unit);background:repeating-linear-gradient(45deg,color-mix(in srgb,var(--unit) 88%,#fff) 0 1.1rem,var(--unit) 1.1rem 2.2rem);border:.4rem solid #fff;display:grid;place-items:center}
.mcard .b img{width:46%;height:46%;filter:drop-shadow(0 .2rem .2rem rgba(0,0,0,.2))}
.mcard .f{background:#fff;border:.32rem solid #fff;padding:calc(var(--side)*.09);display:grid;place-items:center;visibility:hidden}
.mcard .f.text{padding:0 .3rem}.mcard .f.text b{font-size:min(3rem,calc(var(--side)/var(--n,4)*1.35));line-height:1;color:var(--ink)}
.mcard.up .f,.mcard.got .f{visibility:visible}.mcard.up .b,.mcard.got .b{visibility:hidden}
.mcard.got .f{border-color:var(--green);background:#eafff0;box-shadow:0 .5rem 0 var(--green-d)}
.mcard.got{animation:yes .5s}

/* xếp chữ, xếp câu */
.slots{display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem;min-height:5.4rem}
.slot{min-width:4.6rem;height:5.2rem;border-radius:1.1rem;background:rgba(255,255,255,.65);border:.22rem dashed #9cc7ef;display:grid;place-items:center;font-size:3.2rem;line-height:1;padding:0 .7rem .15em}
.slot.on{background:#fff;border:.26rem solid var(--green);box-shadow:0 .36rem 0 var(--green-d);animation:pop-in .25s}
.slots.build .slot{font-size:2.3rem;min-width:5.4rem;height:4.6rem}
.tiles{display:flex;flex-wrap:wrap;justify-content:center;gap:.7rem;min-height:5.8rem}
.tile{min-width:5rem;height:5.4rem;border-radius:1.2rem;background:var(--orange);color:#fff;font-size:3.2rem;line-height:1;padding:0 .9rem .15em;box-shadow:0 .42rem 0 var(--orange-d);display:grid;place-items:center;animation:pop-in .3s backwards}
.tile:active:not(:disabled){transform:translateY(.28rem);box-shadow:0 .14rem 0 var(--orange-d)}
.tiles.build .tile{font-size:2.3rem;background:var(--blue);box-shadow:0 .42rem 0 var(--blue-d);height:4.8rem}
.tile.used{visibility:hidden}
.tile.no{animation:shake .4s;background:var(--red);box-shadow:0 .42rem 0 #c93338}
.tile.hint{animation:glow 1s ease-in-out infinite}

/* ---------- kết quả ---------- */
.result{align-items:center;justify-content:center;gap:1rem;text-align:center}
.result h2{margin:0;font-size:3.4rem;line-height:1;color:#fff;-webkit-text-stroke:.12rem #27306b;paint-order:stroke fill;text-shadow:0 .3rem 0 #27306b;font-family:Andika,Baloo,sans-serif}
.result .sub{margin:0;font-size:1.5rem;color:var(--ink);font-weight:700}
.bigstars{display:flex;gap:1rem;align-items:flex-end;height:9rem}
.bigstars img{width:7rem;height:7rem;filter:grayscale(1) brightness(1.4) opacity(.45);transition:filter .2s}
.bigstars img:nth-child(2){width:8.6rem;height:8.6rem}
.bigstars img.on{filter:drop-shadow(0 .5rem .4rem rgba(200,140,0,.4));animation:star-in .55s cubic-bezier(.2,1.7,.4,1)}
@keyframes star-in{from{transform:scale(0) rotate(-140deg)}}
.newstickers{display:flex;flex-wrap:wrap;gap:.6rem;justify-content:center;max-width:44rem}
.newstickers figure{display:grid;place-items:center;margin:0;width:5.4rem;height:5.4rem;border-radius:1.2rem;background:#fff;padding:.5rem;box-shadow:0 .3rem 0 #c8dcf5;animation:pop-in .4s cubic-bezier(.2,1.6,.4,1) backwards}
.result .actions{justify-content:center;margin-top:.4rem}
.result .chipwin{width:8rem;height:8rem;animation:yay 1s cubic-bezier(.3,1.6,.5,1) infinite alternate}

/* ---------- bộ hình dán ---------- */
.album{gap:.8rem}
.album .body{flex:1;min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;padding:.2rem .2rem 2rem;display:flex;flex-direction:column;gap:1rem}
.album .group{background:rgba(255,255,255,.82);border-radius:1.6rem;padding:.8rem 1rem 1rem}
.album .group h3{margin:0 0 .6rem;font-size:1.35rem;display:flex;align-items:center;gap:.5rem}
.album .group h3 img{width:2.2rem;height:2.2rem}
.stickers{display:grid;grid-template-columns:repeat(6,1fr);gap:.7rem}
.sticker{display:grid;place-items:center;aspect-ratio:1;border-radius:1.3rem;background:#fff;padding:.7rem .7rem 1.7rem;position:relative;box-shadow:0 .3rem 0 #c8dcf5;min-width:0}
.sticker:active{transform:scale(.95)}
.sticker span{position:absolute;left:0;right:0;bottom:.3rem;text-align:center;font-family:Andika,Baloo,sans-serif;font-weight:700;font-size:1.05rem;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 .2rem}
.sticker .art.num span{display:none}
.sticker.off{background:rgba(255,255,255,.55);box-shadow:none}
.sticker.off .art{filter:brightness(0) opacity(.13)}.sticker.off span{visibility:hidden}
.sticker.gold{box-shadow:0 .3rem 0 var(--gold-d);background:linear-gradient(180deg,#fff,#fff6d6);outline:.2rem solid var(--gold);outline-offset:-.2rem}

/* ---------- biểu mẫu + bảng ba mẹ ---------- */
.field{display:block;margin-top:.9rem}
.field>span{display:block;font-weight:700;font-size:1.15rem;margin-bottom:.35rem}
.input{width:100%;font:inherit;font-size:1.5rem;font-weight:700;color:var(--ink);padding:.55rem 1rem;border-radius:1rem;border:.2rem solid var(--line);background:#f7faff;outline:none;user-select:text;-webkit-user-select:text}
.input:focus{border-color:var(--blue);background:#fff}
.picks{display:flex;flex-wrap:wrap;gap:.5rem}
.pick{min-width:3.4rem;height:3.4rem;border-radius:1rem;background:#eef3ff;font-weight:700;font-size:1.4rem;padding:0 .8rem;border:.2rem solid transparent}
.pick.on{background:var(--blue);color:#fff;border-color:var(--blue-d)}
.pick.av{width:4.2rem;height:4.2rem;padding:.3rem;border-radius:50%}.pick.av img{width:100%;height:100%}.pick.av.on{background:#fff;border-color:var(--blue)}
.tracks{display:grid;grid-template-columns:1fr 1fr;gap:.7rem}
.track{border-radius:1.3rem;border:.24rem solid var(--line);background:#f7faff;padding:.8rem .9rem;text-align:left;display:flex;gap:.7rem;align-items:center}
.track img{width:3.6rem;height:3.6rem;flex:none}.track b{display:block;font-size:1.25rem;line-height:1.1}.track small{font-size:.98rem;color:var(--ink2);line-height:1.2;display:block;margin-top:.15rem}
.track.on{border-color:var(--green);background:#eafff0}
.err{color:#d0303a;font-weight:700;margin:.6rem 0 0;font-size:1.05rem;min-height:1.3em}
.gate{display:flex;flex-direction:column;align-items:center;gap:.8rem;text-align:center}
.gate .sum{font-size:3rem;font-weight:700;margin:0}
.report{border-radius:1.3rem;background:#f7faff;border:.16rem solid var(--line);padding:.8rem 1rem;margin-top:.8rem}
.report .who2{display:flex;align-items:center;gap:.7rem}.report .who2 img{width:3.4rem;height:3.4rem}.report .who2 b{font-size:1.35rem;line-height:1.1}.report .who2 small{display:block;color:var(--ink2);font-size:1rem}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:.5rem;margin:.7rem 0 .5rem}
.stats div{background:#fff;border-radius:1rem;padding:.45rem .3rem;text-align:center;font-size:.95rem;color:var(--ink2);line-height:1.15}.stats div b{display:block;font-size:1.6rem;color:var(--ink)}
.week{display:flex;gap:.35rem;align-items:center;font-size:.95rem;color:var(--ink2)}.week i{width:1.5rem;height:1.5rem;border-radius:50%;background:#e4ebfa;display:block}.week i.on{background:var(--green)}
.switch{display:flex;align-items:center;gap:.7rem;margin-top:.6rem;font-size:1.08rem;text-align:left}
.switch i{flex:none;width:3.4rem;height:1.9rem;border-radius:1rem;background:#cfd6e6;position:relative;transition:background .15s}.switch i::after{content:"";position:absolute;left:.2rem;top:.2rem;width:1.5rem;height:1.5rem;border-radius:50%;background:#fff;transition:left .15s}
.switch.on i{background:var(--green)}.switch.on i::after{left:1.7rem}

/* ---------- hiệu ứng ---------- */
.confetti{position:fixed;inset:0;z-index:30;pointer-events:none;overflow:hidden}
.confetti i{position:absolute;top:-2rem;width:.9rem;height:1.4rem;border-radius:.2rem;animation:fall linear forwards}
@keyframes fall{to{transform:translateY(110vh) rotate(720deg)}}
.spark{position:fixed;z-index:30;pointer-events:none;width:2.4rem;height:2.4rem;translate:-50% -50%;animation:spark .7s ease-out forwards}
@keyframes spark{to{transform:translate(var(--dx),var(--dy)) scale(.2) rotate(200deg);opacity:0}}
.toast{position:fixed;left:50%;bottom:max(1.2rem,env(safe-area-inset-bottom));translate:-50% 0;z-index:40;background:var(--ink);color:#fff;border-radius:1.2rem;padding:.6rem 1.2rem;font-size:1.1rem;max-width:90vw;text-align:center;animation:pop-in .25s}

/* ---------- iPad dọc + điện thoại ---------- */
@media (orientation:portrait){
  .units{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:none;grid-auto-rows:minmax(11.5rem,1fr);overflow:auto;-webkit-overflow-scrolling:touch;padding:1.5rem .7rem 1rem}
  .unit .pic{height:6rem}
  .options{--cols:2;--rows:2;--side:min(calc((100vw - 3rem - 1.1rem)/2),calc((var(--vh,1vh)*100 - 25rem)/2),16rem)}
  .options[data-n="2"]{--rows:1}.options[data-n="3"]{--cols:3;--rows:1;--side:min(calc((100vw - 3rem - 2.2rem)/3),calc(var(--vh,1vh)*100 - 25rem),15rem)}.options[data-n="4"]{--cols:2}
  .options.pop{--side:min(calc((100vw - 3rem - 2*.9rem)/3),calc((var(--vh,1vh)*100 - 27rem)/2.3),12rem)}
  .memory{--side:min(calc((100vw - 4.2rem)/3),calc((var(--vh,1vh)*100 - 20rem)/2),13rem)}
  .stickers{grid-template-columns:repeat(3,1fr)}
  .tool{width:4rem}.tool span{display:none}.tool{height:3.4rem}
  .topbar{flex-wrap:wrap}
  .tracks{grid-template-columns:1fr}
  .part{font-size:1.12rem;padding:.8rem .3rem .7rem}.part img.icon{width:3.2rem;height:3.2rem}
  .stats{grid-template-columns:repeat(2,1fr)}
}
@media (max-height:520px) and (orientation:landscape){ /* điện thoại nằm ngang */
  .learn .frame,.learn.listen .frame{width:min(15rem,40vh)}.learn.read .frame{width:min(9rem,26vh)}.spellrow{font-size:2.6rem;margin:.2rem 0 0}.prompt{min-height:4rem}.prompt .pic{width:20vh}
  .options{--side:min(calc((100vw - 3rem - (var(--cols) - 1)*1.1rem)/var(--cols)),calc(var(--vh,1vh)*100 - 15rem),15rem)}
  .lesson-bottom{min-height:4rem}.mascot{width:3.8rem;height:3.8rem}
}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01s!important;animation-iteration-count:1!important;transition-duration:.01s!important}}
