/* ================= Học cùng Mây ================= */
.overlay.learn { background: linear-gradient(180deg, #FFF7E6, #EAF4FF); justify-content: flex-start; -webkit-backdrop-filter: none; backdrop-filter: none; z-index: 70; }
.l-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 560px; margin: 0 auto;
  padding: calc(18px + var(--safe-t)) 16px calc(12px + var(--safe-b)); }

.l-dots { display: flex; gap: 6px; min-height: 12px; padding-right: 56px; align-self: flex-start; padding-top: 18px; }
.l-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); opacity: .15; }
.l-dots i.past { background: var(--mint-deep); opacity: .8; }
.l-dots i.on { width: 24px; border-radius: 5px; background: var(--pink); opacity: 1; }

.l-stage { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.l-bubble { min-height: 2.6em; font-size: 21px; line-height: 1.3; font-weight: 700; text-align: center; padding: 0 6px; }
.l-bottom { display: flex; align-items: flex-end; gap: 10px; width: 100%; }
.l-bottom .mascot { width: 116px; height: 124px; min-height: 0; flex: 0 0 auto; }
.l-ctrl { flex: 1; display: flex; gap: 12px; justify-content: flex-end; align-items: center; padding-bottom: 10px; }
.l-next { background: linear-gradient(180deg, #FFE580, var(--yellow) 45%, var(--orange)); box-shadow: 0 6px 0 #E0922E; color: #6B3B0F; font-size: 34px; }

/* Chọn bài */
.l-hub { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.l-card { position: relative; height: 128px; border-radius: 28px; background: #fff; box-shadow: 0 6px 0 #EADBD2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: transform .1s; }
.l-card .e { font-size: 48px; line-height: 1.1; }
.l-card b { font-size: 21px; }
.l-card small { font-size: 14px; color: var(--ink-soft); font-weight: 700; }
.l-card.done::after { content: '✓'; position: absolute; top: 10px; right: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--mint-deep); color: #fff; font-weight: 800; display: grid; place-items: center; }
.l-card:active, .l-opt:active, .l-obj:active { transform: translateY(4px); box-shadow: none; }
.l-title { font-size: 34px; font-weight: 800; display: flex; flex-direction: column; align-items: center; }
.l-title span { font-size: 90px; line-height: 1.1; }
.l-prize span { font-size: 120px; display: block; animation: pop .5s; }

/* Chữ cái & hình lớn */
.l-letterbox { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.l-letter { width: min(56vw, 220px); height: min(56vw, 220px); border-radius: 44px; background: #fff; box-shadow: 0 8px 0 #EADBD2;
  font-size: min(40vw, 160px); font-weight: 800; line-height: 1; display: grid; place-items: center; color: #E0628F; padding-bottom: .12em; }
.l-word { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 6px 22px 6px 12px; border-radius: 30px; background: #fff; font-size: 24px; font-weight: 800; box-shadow: 0 4px 0 #EADBD2; }
.l-word span { font-size: 40px; }
.l-show { font-size: 130px; line-height: 1; }

/* Lựa chọn */
.l-opts { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.l-opt { width: 96px; height: 96px; border-radius: 28px; background: #fff; box-shadow: 0 6px 0 #EADBD2; display: grid; place-items: center; transition: transform .1s, opacity .3s; }
.l-opt-letter { font-size: 62px; font-weight: 800; line-height: 1; color: #5B48B8; padding-bottom: .1em; }
.l-opt-num { align-content: center; gap: 2px; }
.l-opt-num b { font-size: 46px; line-height: 1; color: #2F7D5C; }
.l-opt-num span { font-size: 10px; letter-spacing: 1px; color: var(--ink-soft); max-width: 80px; line-height: 1.1; word-break: break-all; }
.l-opts.small .l-opt { width: 84px; height: 84px; }
.l-opt.dim { opacity: .35; }                                       /* chọn chưa đúng: chỉ mờ đi, không đỏ */
.l-opt.yes { box-shadow: 0 0 0 5px var(--mint), 0 6px 0 #BFE8D5; }
.l-opt.hint { box-shadow: 0 0 0 5px var(--yellow), 0 6px 0 #E0922E; animation: breathe 1s ease-in-out 3; }

/* Màu */
.l-blob { background: var(--c); border: 4px solid rgba(0,0,0,.08); border-radius: 50%; }
.l-blob span { font-size: 34px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }
.l-blob.big { width: min(52vw, 200px); height: min(52vw, 200px); display: grid; place-items: center; box-shadow: 0 8px 0 rgba(0,0,0,.08); }
.l-blob.big span { font-size: 80px; }

/* Đếm */
.l-objs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 420px; }
.l-obj { position: relative; width: 68px; height: 68px; border-radius: 22px; background: rgba(255,255,255,.85); font-size: 44px; display: grid; place-items: center; box-shadow: 0 4px 0 #EADBD2; transition: transform .1s; }
.l-obj.counted { background: #E2F7EE; box-shadow: 0 4px 0 #BFE8D5; }
.l-obj.counted::after { content: attr(data-n); position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; background: var(--mint-deep); color: #fff; font-size: 17px; font-weight: 800; display: grid; place-items: center; }
.l-obj.fly-in { animation: flyIn .7s cubic-bezier(.2,.9,.3,1.2) both; }
.l-obj:nth-last-child(2).fly-in { animation-delay: .15s; }
.l-obj:nth-last-child(3).fly-in { animation-delay: .3s; }
.l-obj.fly-out { animation: flyOut .7s ease-in forwards; pointer-events: none; }
.l-obj.gone { display: none; }
@keyframes flyIn { from { transform: translate(140px, -160px) scale(.3) rotate(-30deg); opacity: 0; } }
@keyframes flyOut { to { transform: translate(-160px, 220px) scale(.2) rotate(40deg); opacity: 0; } }

/* Nút học trên màn hình bé */
.learn-btn { margin-left: auto; position: relative; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.85); font-size: 22px; box-shadow: 0 2px 8px rgba(90,71,67,.12); }
.learn-btn::before { content: ''; position: absolute; inset: -8px; }   /* vùng chạm 60px */
.learn-btn[hidden] { display: none; }
.learn-btn:not([hidden]) ~ .story-btn, .learn-btn:not([hidden]) ~ .pill.star { margin-left: 0; }

@media (max-height: 640px) {
  .l-letter { width: 170px; height: 170px; font-size: 124px; }
  .l-bottom .mascot { width: 90px; height: 96px; }
  .l-opt { width: 84px; height: 84px; }
}

/* ================= 🎵 Dấu thanh (giống bảng trên lớp) ================= */
.t-board { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.t-row { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px; }
.t-row.top > span { visibility: hidden; }
.t-sign, .t-syl { min-height: 64px; border-radius: 12px; border: 3px solid #2B2B2B; display: grid; place-items: center; position: relative; transition: transform .15s; }
.t-sign { background: var(--tb); }
.t-sign span { font-size: 38px; font-weight: 900; color: var(--tc); line-height: 1; }
.t-sign .t-huyen, .t-sign .t-sac { display: inline-block; position: relative; width: .9em; height: .9em; }
.t-sign .bar { position: absolute; left: 50%; top: 50%; width: .2em; height: 1em; margin: -.5em 0 0 -.1em; border-radius: .04em; background: var(--tc); }
.t-huyen .bar { transform: rotate(-45deg); }   /* \ nghiêng 45° */
.t-sac .bar { transform: rotate(45deg); }      /* / nghiêng 45° */
.t-syl { background: #FFF8E8; color: var(--tc); font-size: clamp(24px, 7.5vw, 40px); font-weight: 800; line-height: 1.05; padding: 4px 2px; }
.t-syl.base { background: #DCE8F7; }
.t-syl i { position: absolute; right: 2px; bottom: 0; font-style: normal; font-size: 18px; }
.t-syl.hidden-syl { color: transparent; background: #F3EEE6; }
.t-syl.hidden-syl i { visibility: hidden; }
.t-syl.pop-in { animation: pop .5s; }
.t-syl.reading { transform: scale(1.12); box-shadow: 0 0 0 5px var(--yellow); z-index: 2; animation: breathe 1.2s ease-in-out infinite; }
.t-syl.good { box-shadow: 0 0 0 5px var(--mint); }
.t-sign.fly { animation: signFly .7s ease-in forwards; }
@keyframes signFly { to { transform: translateY(70px) scale(.6); opacity: 0; } }
.t-sign:active, .t-syl:active { transform: translateY(3px); }
.l-opts .t-syl.l-opt { width: 96px; height: 96px; font-size: 40px; }

/* Thẻ dấu lớn khi giới thiệu + cử chỉ */
.t-intro { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.t-sign.big { width: min(52vw, 200px); height: min(52vw, 200px); border-radius: 30px; border-width: 5px; }
.t-sign.big span { font-size: min(30vw, 120px); }
.t-name { font-size: 34px; font-weight: 900; }
.move-down span { animation: mvDown 1.4s ease-in-out infinite; }
.move-up span { animation: mvUp 1.4s ease-in-out infinite; }
.move-drop span { animation: mvDrop 1.2s cubic-bezier(.5,0,1,.5) infinite; }
.move-tilt span { animation: mvTilt 1.4s ease-in-out infinite alternate; }
.move-wave span { animation: mvWave 1.2s ease-in-out infinite alternate; }
@keyframes mvDown { 0% { transform: translate(-14px,-14px); } 60%,100% { transform: translate(14px,14px); } }
@keyframes mvUp { 0% { transform: translate(-14px,14px); } 60%,100% { transform: translate(14px,-14px); } }
@keyframes mvDrop { 0% { transform: translateY(-30px); } 80% { transform: translateY(10px); } 100% { transform: translateY(0); } }
@keyframes mvTilt { from { transform: rotate(-15deg); } to { transform: rotate(15deg); } }
@keyframes mvWave { from { transform: translateX(-10px) skewX(-10deg); } to { transform: translateX(10px) skewX(10deg); } }

/* Quầy nước đã uống */
.juice-shelf { align-self: flex-end; display: flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 16px; background: rgba(255,255,255,.85); font-size: 20px; min-height: 36px; }
.juice-shelf b { font-size: 15px; margin-left: 4px; }

/* Ly nước thưởng */
.juices { display: flex; gap: 14px; justify-content: center; align-items: flex-end; }
.glass { position: relative; width: 96px; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .3s, opacity .3s; }
.glass .cup { position: relative; width: 74px; height: 104px; border: 4px solid #9BB7C9; border-top: 0; border-radius: 0 0 22px 22px; background: rgba(255,255,255,.7); overflow: hidden; }
.glass .liquid { position: absolute; left: 0; right: 0; bottom: 0; height: 85%; background: var(--jc); transition: height 2.6s ease-in; }
.glass .straw { position: absolute; top: -26px; left: 52px; width: 8px; height: 70px; border-radius: 4px; background: repeating-linear-gradient(180deg, #FF6F9F 0 10px, #fff 10px 20px); transform: rotate(14deg); z-index: 1; }
.glass .fruit { position: absolute; top: -18px; left: 2px; font-size: 32px; z-index: 2; }
.glass small { font-size: 14px; font-weight: 800; color: var(--ink); }
.glass:active { transform: translateY(3px); }
.juices:has(.chosen) .glass:not(.chosen) { opacity: .25; transform: scale(.85); }
.glass.chosen { transform: scale(1.25); }
.glass.drink .liquid { height: 0; }

/* Nút chấm của ba mẹ */
.p-judge { flex: 1; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.p-judge small { font-size: 12px; font-weight: 800; color: var(--ink-soft); text-align: right; }
.p-judge > div { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 6px; }
.p-judge button { min-height: 52px; border-radius: 16px; font-weight: 800; font-size: 15px; background: #fff; box-shadow: 0 3px 0 #EADBD2; }
.p-judge button[data-a="ok"] { background: #E2F7EE; color: #2F7D5C; box-shadow: 0 3px 0 #BFE8D5; }
.p-judge button:active { transform: translateY(3px); box-shadow: none; }

/* ⏮ ⏭ chuyển trang (bài dấu thanh) */
.l-nav { position: absolute; top: calc(12px + var(--safe-t)); right: 70px; display: flex; gap: 8px; z-index: 3; }
.l-nav[hidden] { display: none; }
.l-nav button { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.9); font-size: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.l-nav button:active { transform: translateY(2px); }

/* Trang ôn 5 dấu */
.t-signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(100%, 360px); }
.t-sign.mid { min-height: 96px; border-radius: 20px; }
.t-sign.mid span { font-size: 56px; }
