/* Gà Con Học Chữ — một thế giới ban ngày duy nhất: trời, mây, đồi cỏ; mọi thứ bé chạm vào là khối đồ chơi nổi viền trắng. */
@property --sky1 { syntax: '<color>'; inherits: true; initial-value: #49B6FF; }
@property --sky2 { syntax: '<color>'; inherits: true; initial-value: #C9EEFF; }
:root {
  color-scheme: light;
  --navy: #1E2A5E; --soft: #5A6594; --white: #fff;
  --red: #FF5964; --orange: #FF9F1C; --yellow: #FFD23F; --green: #3CCB6B; --teal: #12C4C0; --blue: #3B9CFF; --purple: #9A6BFF; --pink: #FF6DB3;
  --sky1: #49B6FF; --sky2: #C9EEFF;
  --font-ui: "Baloo 2", "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-letter: "Andika", "Segoe UI", Arial, sans-serif;
  --font-emoji: "Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  --outline: .07em 0 0 var(--navy), -.07em 0 0 var(--navy), 0 .07em 0 var(--navy), 0 -.07em 0 var(--navy),
    .05em .05em 0 var(--navy), -.05em .05em 0 var(--navy), .05em -.05em 0 var(--navy), -.05em -.05em 0 var(--navy), 0 .15em 0 var(--navy);
  --lift: 0 9px 0 rgba(30, 42, 94, .2), 0 18px 24px rgba(30, 42, 94, .18);
}
body[data-scene="chu-cai"] { --sky1: #3FC8B4; --sky2: #D5FAEC; }
body[data-scene="so-dem"] { --sky1: #FF9D5C; --sky2: #FFE9C4; }
body[data-scene="bong-bay"] { --sky1: #4B9DFF; --sky2: #D3EEFF; }
body[data-scene="hai-qua"] { --sky1: #58C4F5; --sky2: #E2F8D4; }
body[data-scene="tim-chu"] { --sky1: #FF86B9; --sky2: #FFE2EE; }
body[data-scene="ech-nhay"] { --sky1: #2FBFC4; --sky2: #CFF6EA; }
body[data-scene="lat-hinh"] { --sky1: #8168F5; --sky2: #D6CCFF; }
body[data-scene="tap-to"] { --sky1: #FFB52E; --sky2: #FFF1C2; }

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%; color: var(--navy); background: var(--sky2);
  font-family: var(--font-ui); font-size: 18px; line-height: 1.35; font-weight: 600;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) calc(48px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  transition: --sky1 .6s, --sky2 .6s;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 4px solid var(--navy); outline-offset: 3px; }
h1, h2, p { margin: 0; }
.emo { font-family: var(--font-emoji); font-weight: 400; line-height: 1; }
img.emo { width: 1.12em; height: 1.12em; object-fit: contain; vertical-align: middle; flex: none; }
img { -webkit-user-drag: none; }
.sticker { color: #fff; text-shadow: var(--outline); letter-spacing: .01em; }

/* ---------- khung cảnh ---------- */
.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(var(--sky1), var(--sky2) 72%); }
.sun { position: absolute; top: -70px; right: -70px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, #FFF6B0 0 36%, #FFD23F 37% 50%, transparent 51%), repeating-conic-gradient(rgba(255, 226, 110, .7) 0 9deg, transparent 9deg 18deg);
  animation: spin 50s linear infinite; }
.cloud { position: absolute; left: 0; width: 150px; height: 46px; background: #fff; border-radius: 50px; opacity: .92; animation: drift 80s linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 64px; height: 64px; top: -30px; left: 20px; }
.cloud::after { width: 84px; height: 84px; top: -44px; left: 58px; }
.c1 { top: 13%; animation-delay: -20s; }
.c2 { top: 30%; transform: scale(.7); animation-duration: 110s; animation-delay: -70s; opacity: .75; }
.c3 { top: 5%; animation-duration: 95s; animation-delay: -50s; }
.hills { position: absolute; left: 0; bottom: 0; width: 100%; height: min(32vh, 270px); }
.hills { z-index: 1; }
.deco { position: absolute; z-index: 2; width: clamp(34px, 5vw, 56px); height: auto; }
.rainbow { z-index: 0; right: 12%; bottom: min(7vh, 60px); width: min(40vw, 380px); opacity: .9; }
.house { left: 1.5%; bottom: min(15vh, 128px); width: clamp(54px, 7vw, 100px); }
.dtree.t1 { right: 6%; bottom: min(15.5vh, 132px); width: clamp(70px, 11vw, 150px); }
.dtree.t2 { left: 19%; bottom: min(17vh, 146px); width: clamp(46px, 7vw, 96px); }
.fl.d1 { left: 3%; bottom: 8px; } .fl.d2 { left: 30%; bottom: 30px; width: clamp(26px, 4vw, 44px); } .fl.d3 { right: 24%; bottom: 22px; } .fl.d4 { right: 3%; bottom: 10px; width: clamp(28px, 4vw, 46px); }
.snail { left: 58%; bottom: 6px; width: clamp(28px, 4vw, 48px); animation: crawl 70s linear infinite alternate; }
.fly { left: 12%; bottom: min(24vh, 200px); width: clamp(26px, 3.6vw, 44px); animation: flutter 16s ease-in-out infinite; }
.bird { z-index: 0; top: 27%; left: 0; width: clamp(34px, 4.6vw, 58px); animation: drift 46s linear infinite; animation-delay: -12s; }
.kite { z-index: 0; top: 24%; left: 3%; width: clamp(44px, 6.5vw, 86px); transform-origin: 80% 90%; animation: sway 5s ease-in-out infinite; }
/* màn nhỏ hoặc thấp: bớt đồ trang trí để không rối khu chơi */
@media (max-width: 720px), (max-height: 560px) { .kite, .bird, .fly, .house, .dtree { display: none; } .rainbow { width: min(34vw, 260px); opacity: .5; } }

/* ---------- thanh trên ---------- */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 6; display: flex; align-items: center; gap: 10px; max-width: 1000px; margin: 0 auto; padding: 10px; border-radius: 0 0 30px 30px;
  background: color-mix(in srgb, var(--sky1) 82%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
body { padding-left: max(6px, env(safe-area-inset-left, 0px)); padding-right: max(6px, env(safe-area-inset-right, 0px)); }
main { padding-inline: 10px; }
body[data-scene="home"] .bar { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.brand { flex: 1; min-width: 0; font-weight: 800; font-size: clamp(1.4rem, 5vw, 2rem); line-height: 1.1; }
.round { --c: var(--yellow); width: 58px; height: 58px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--c); border: 4px solid #fff;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 60%, #000), 0 9px 12px rgba(30, 42, 94, .22); transition: transform .08s, box-shadow .08s; }
.round:active { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 60%, #000); }
.round svg { width: 28px; height: 28px; fill: var(--navy); }
.stars { display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 999px; padding: 5px 16px 5px 8px; font-weight: 800; font-size: 1.4rem; font-variant-numeric: tabular-nums; box-shadow: 0 5px 0 rgba(30, 42, 94, .2); }
.stars svg { width: 34px; height: 34px; }
.star { fill: var(--yellow); stroke: var(--navy); stroke-width: 1.6; stroke-linejoin: round; }

main { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; padding-top: 6px; }
.row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; }
.btn { --c: var(--green); min-height: 68px; padding: 6px 30px; border-radius: 999px; background: var(--c); border: 5px solid #fff; font-weight: 800; font-size: 1.6rem; color: #fff; text-shadow: var(--outline);
  box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 60%, #000), 0 12px 16px rgba(30, 42, 94, .25); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(5px); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 60%, #000); }
.plain { background: #fff; border-radius: 999px; padding: 8px 20px; min-height: 52px; font-weight: 800; box-shadow: 0 5px 0 rgba(30, 42, 94, .2); }
.plain:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(30, 42, 94, .2); }

/* khối chữ đồ chơi */
.block { --c: var(--blue); display: grid; place-items: center; aspect-ratio: 1; background: #fff; border: .14em solid var(--c); border-radius: .3em;
  color: color-mix(in srgb, var(--c) 72%, var(--navy)); font: 700 1em/1 var(--font-letter);
  box-shadow: 0 .16em 0 color-mix(in srgb, var(--c) 60%, #000), 0 .3em .34em rgba(30, 42, 94, .25); transition: transform .1s, box-shadow .1s; }
button.block:active { transform: translateY(.1em); box-shadow: 0 .05em 0 color-mix(in srgb, var(--c) 60%, #000); }

/* ---------- trang chủ ---------- */
.hero { display: flex; align-items: center; gap: clamp(10px, 3vw, 26px); }
.chick { flex: none; width: clamp(110px, 26vw, 190px); animation: bob 2.6s ease-in-out infinite; }
.mascot { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 0 rgba(30, 42, 94, .16)); }
.hero-text { min-width: 0; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.logo { font-weight: 800; font-size: clamp(2.3rem, 9vw, 4.6rem); line-height: .95; display: flex; flex-wrap: wrap; gap: 0 .25em; }
.logo span:first-child { color: var(--yellow); }
.bubble { position: relative; background: #fff; border-radius: 24px; padding: 10px 18px; font-weight: 800; font-size: clamp(1.05rem, 3.6vw, 1.35rem); line-height: 1.25; box-shadow: 0 6px 0 rgba(30, 42, 94, .18); }
.bubble::before { content: ""; position: absolute; left: -12px; top: 50%; margin-top: -10px; border: 10px solid transparent; border-right-color: #fff; border-left: 0; }
.sec { font-weight: 800; font-size: clamp(1.6rem, 6vw, 2.2rem); line-height: 1; margin-bottom: -8px; }
.grid { display: grid; gap: 20px 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .grid.games { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { --c: var(--blue); display: flex; flex-direction: column; text-align: center; border: 6px solid #fff; border-radius: 30px; overflow: hidden; background: #fff;
  box-shadow: 0 9px 0 color-mix(in srgb, var(--c) 58%, #000), 0 18px 24px rgba(30, 42, 94, .25); transition: transform .15s, box-shadow .15s; }
.grid .card { animation: popin .45s both; }
.grid .card:nth-child(2) { animation-delay: .06s; } .grid .card:nth-child(3) { animation-delay: .12s; } .grid .card:nth-child(4) { animation-delay: .18s; } .grid .card:nth-child(5) { animation-delay: .24s; } .grid .card:nth-child(6) { animation-delay: .3s; }
.card:hover { transform: translateY(-5px) rotate(-1deg); }
.card:active { transform: translateY(6px); box-shadow: 0 3px 0 color-mix(in srgb, var(--c) 58%, #000); }
.card .art { height: clamp(104px, 24vw, 168px); display: flex; align-items: center; justify-content: center; gap: clamp(6px, 2vw, 14px); font-size: clamp(38px, 10vw, 66px);
  background: radial-gradient(rgba(255, 255, 255, .28) 14%, transparent 15%) 0 0 / 34px 34px, linear-gradient(160deg, color-mix(in srgb, var(--c) 62%, #fff), var(--c)); }
.card .label { padding: 8px 8px 12px; }
.card .name { display: block; font-weight: 800; font-size: clamp(1.25rem, 4.6vw, 1.7rem); line-height: 1.1; }
.card .hint { display: block; color: var(--soft); font-size: clamp(.85rem, 3vw, 1rem); line-height: 1.2; }
.card .block { width: 1.25em; font-size: .8em; }
.card .art > :nth-child(odd) { transform: rotate(-6deg); } .card .art > :nth-child(even) { transform: rotate(5deg) translateY(-6px); }
.mb { --c: var(--red); width: 1.9em; height: 2.3em; border-radius: 50% 50% 50% 50% / 45% 45% 55% 55%; background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .75) 0 9%, transparent 10%), var(--c);
  display: grid; place-items: center; font: 700 .52em/1 var(--font-letter); color: var(--navy); border: 3px solid #fff; }
.mini { display: grid; place-items: center; width: 1.05em; height: 1.3em; font: 700 .72em/1 var(--font-letter); border-radius: 10px; border: 4px solid #fff; background: #fff; color: var(--navy); box-shadow: 0 4px 0 rgba(30, 42, 94, .25); }
.mini.q { background: var(--navy); color: var(--yellow); }
.dash { font: 700 1.15em/1 var(--font-letter); color: transparent; -webkit-text-stroke: 3px #fff; }
.lilymini { width: 1.9em; height: 1.9em; border-radius: 50%; background: conic-gradient(from 30deg, #2FA552 0 320deg, transparent 320deg); display: grid; place-items: center; font: 700 .5em/1 var(--font-letter); color: #fff; text-shadow: var(--outline); }
.shelf, details { background: #fff; border-radius: 28px; padding: 16px 18px; box-shadow: var(--lift); }
.shelf { display: flex; flex-direction: column; gap: 10px; }
.shelf h2 { font-size: 1.4rem; font-weight: 800; }
.shelf p { color: var(--soft); }
.slots { display: flex; flex-wrap: wrap; gap: 10px; }
.slots span { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 34px; background: #EEF4FF; border: 3px dashed #B9C6EA; color: #9AA8D4; font-weight: 800; }
.slots span.got { background: #FFF6CC; border: 3px solid var(--yellow); font-size: 40px; }
summary { font-weight: 800; cursor: pointer; }
details ul { margin: 10px 0 14px; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; max-width: 68ch; }
details .plain { background: #EEF4FF; }

/* ---------- câu hỏi của Gà Con ---------- */
.ask { display: flex; align-items: center; gap: 14px; }
.ask > span { width: clamp(64px, 16vw, 92px); flex: none; }
.ask .bubble { flex: 1; min-width: 0; }

/* ---------- học chữ, học số ---------- */
.stagecard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(6px, 2vw, 14px); }
.show { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; background: #fff; border-radius: 32px; padding: 14px; box-shadow: var(--lift); }
@media (max-width: 620px) { .show { grid-template-columns: minmax(0, 1fr); } }
.glyph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 22px; padding: 4px 8px 10px;
  background: linear-gradient(#CFE4FA 2px, transparent 2px) 0 14px / 100% 25% #F4FAFF; }
.glyph .big { display: flex; align-items: baseline; gap: .26em; font: 700 clamp(76px, 21vw, 150px)/1.3 var(--font-letter); }
.glyph .low { color: var(--red); }
.glyph .how { background: #fff; border-radius: 999px; padding: 2px 16px; color: var(--soft); box-shadow: 0 3px 0 rgba(30, 42, 94, .12); }
.glyph .how b { color: var(--navy); font-family: var(--font-letter); }
.pic { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 22px; padding: 12px 8px; width: 100%;
  background: repeating-conic-gradient(from 0deg at 50% 46%, #FFF3B8 0 12deg, #FFE98A 12deg 24deg); }
.pic .emo { font-size: clamp(72px, 19vw, 128px); filter: drop-shadow(0 6px 0 rgba(30, 42, 94, .18)); }
.pic .w { font: 700 clamp(28px, 7vw, 42px)/1.2 var(--font-letter); background: #fff; border-radius: 16px; padding: 2px 18px; box-shadow: 0 4px 0 rgba(30, 42, 94, .15); }
.pic mark { background: none; color: var(--red); }
.blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 16px 12px; font-size: clamp(28px, 7vw, 36px); }
.blocks .sel { transform: translateY(-8px) scale(1.1); outline: 5px solid var(--yellow); outline-offset: 2px; }
.plate { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 4px 8px; min-height: 150px; border-radius: 22px; padding: 12px; width: 100%;
  background: repeating-conic-gradient(from 0deg at 50% 46%, #FFF3B8 0 12deg, #FFE98A 12deg 24deg); font-size: clamp(46px, 12vw, 66px); }
.plate .none { font: 800 1.2rem var(--font-ui); color: var(--soft); }
.it { width: 1.4em; height: 1.4em; border-radius: 50%; display: grid; place-items: center; transition: transform .15s, background .15s; }
.it.cnt { background: #fff; transform: scale(1.1); box-shadow: 0 4px 0 rgba(30, 42, 94, .18); }

/* ---------- trò chơi: bóng bay ---------- */
.field { position: relative; height: min(58vh, 500px); min-height: 350px; border: 6px solid #fff; border-radius: 32px; overflow: hidden; box-shadow: var(--lift);
  background: radial-gradient(ellipse 70px 22px at 16% 20%, rgba(255, 255, 255, .85) 96%, transparent), radial-gradient(ellipse 46px 26px at 19% 16%, rgba(255, 255, 255, .85) 96%, transparent), radial-gradient(ellipse 84px 24px at 80% 12%, rgba(255, 255, 255, .85) 96%, transparent), radial-gradient(ellipse 50px 30px at 77% 8%, rgba(255, 255, 255, .85) 96%, transparent), linear-gradient(#69BEFF, #DDF3FF); }
.balloon { position: absolute; bottom: -180px; width: clamp(78px, 21%, 124px); animation: rise var(--dur, 9s) linear forwards; }
.balloon .b { position: relative; display: grid; place-items: center; aspect-ratio: 5 / 6; border-radius: 50% 50% 50% 50% / 45% 45% 55% 55%;
  background: radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .8) 0 8%, transparent 9%), radial-gradient(circle at 60% 70%, color-mix(in srgb, var(--c) 80%, #000), var(--c) 60%);
  color: var(--navy); font: 700 clamp(40px, 9vw, 62px)/1 var(--font-letter); animation: sway 3s ease-in-out infinite; }
.balloon .b::before { content: ""; position: absolute; left: 50%; top: 100%; margin: -7px 0 0 -8px; border: 8px solid transparent; border-bottom-color: color-mix(in srgb, var(--c) 80%, #000); }
.balloon .b::after { content: ""; position: absolute; left: 50%; top: calc(100% + 8px); width: 2px; height: 56px; margin-left: -1px; background: rgba(30, 42, 94, .45); }
.balloon .b.no { animation: wobble .45s; }
.balloon .b.pop { animation: pop .3s forwards; }
.fdeco { position: absolute; z-index: 0; pointer-events: none; font-size: clamp(34px, 8vw, 60px); }
.fdeco.f1 { top: 30%; left: 0; animation: driftin 26s linear infinite; }
.fdeco.f2 { top: 6%; right: 5%; transform-origin: 20% 90%; animation: sway 4s ease-in-out infinite; }
.balloon { z-index: 1; }
.plus { position: absolute; z-index: 3; width: 54px; margin: -27px 0 0 -27px; animation: floatup .9s ease-out forwards; pointer-events: none; }
.dots { display: flex; justify-content: center; gap: 10px; }
.dots i { width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .7); border: 3px solid #fff; }
.dots i.on { background: var(--yellow); box-shadow: 0 0 0 3px var(--navy); }

/* ---------- trò chơi: hái quả ---------- */
.orchard { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: end; }
@media (max-width: 620px) { .orchard { grid-template-columns: minmax(0, 1fr); } }
.tree { position: relative; isolation: isolate; aspect-ratio: 4 / 3; width: 100%; max-width: 520px; margin: 0 auto; }
.tree::before { content: ""; position: absolute; z-index: 1; inset: 10% 0 22% 0; border: 6px solid #fff; border-radius: 48% 52% 46% 54% / 56% 54% 46% 44%;
  background: radial-gradient(circle at 24% 26%, rgba(255, 255, 255, .3) 0 12%, transparent 13%), radial-gradient(circle at 30% 30%, #7DE08C, #2FA552); box-shadow: 0 8px 0 rgba(30, 42, 94, .18); }
.tree .lobe { position: absolute; z-index: 0; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #8BE899, #37AE59); border: 6px solid #fff; }
.tree .lobe.in { z-index: 2; border-color: transparent; background-clip: padding-box; }
.tree .l1 { left: 4%; top: 2%; width: 34%; height: 40%; } .tree .l2 { left: 32%; top: -7%; width: 38%; height: 44%; } .tree .l3 { right: 4%; top: 3%; width: 34%; height: 40%; }
.tree::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 13%; height: 27%; transform: translateX(-50%); background: linear-gradient(90deg, #B5743F, #8E5529); border-radius: 8px 8px 14px 14px; z-index: -1; }
.fruit { position: absolute; z-index: 3; width: 1.3em; height: 1.3em; margin: -.65em 0 0 -.65em; display: grid; place-items: center; font-size: clamp(34px, 8.5vw, 54px); transition: transform .12s; }
.fruit:hover { transform: scale(1.12); }
.fruit.drop { animation: drop .45s ease-in forwards; pointer-events: none; }
.side { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.need { display: flex; align-items: center; gap: 10px; font-size: clamp(44px, 11vw, 64px); }
.need .block { width: 1.4em; }
.basket { position: relative; width: 100%; max-width: 300px; min-height: 130px; padding: 14px 10px 12px; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-end; gap: 0 2px;
  border: 6px solid #fff; border-radius: 16px 16px 60px 60px; background: repeating-linear-gradient(45deg, #E0A04A 0 10px, #C98632 10px 20px); box-shadow: var(--lift); font-size: clamp(28px, 7vw, 40px); }
.basket .in { animation: bump .3s; }
.basket .n { position: absolute; top: -22px; right: -12px; width: 52px; height: 52px; border-radius: 50%; background: #fff; display: grid; place-items: center; font: 700 30px/1 var(--font-letter); box-shadow: 0 4px 0 rgba(30, 42, 94, .25); }

/* ---------- trò chơi: tìm chữ đầu ---------- */
.quiz { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.piccard { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #fff; border-radius: 34px; padding: 14px clamp(22px, 8vw, 60px) 18px; box-shadow: var(--lift); }
.piccard .emo { font-size: clamp(88px, 24vw, 140px); }
.piccard .w { display: flex; align-items: center; gap: 6px; font: 700 clamp(36px, 10vw, 54px)/1.1 var(--font-letter); }
.piccard .gap { display: grid; place-items: center; min-width: 1.1em; height: 1.3em; padding: 0 .1em; border-radius: 12px; border: 4px dashed var(--pink); color: var(--pink); }
.piccard .gap.ok { border-style: solid; border-color: var(--green); background: #E7FBEA; color: var(--navy); animation: bump .35s; }
.opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 4vw, 26px); width: 100%; max-width: 480px; font-size: clamp(48px, 13vw, 76px); }
.opts .no { animation: wobble .45s; }

/* ---------- trò chơi: ếch nhảy ---------- */
.pond { position: relative; width: 100%; max-width: 680px; aspect-ratio: 4 / 3; max-height: 62vh; margin: 0 auto; border: 6px solid #fff; border-radius: 34px; overflow: hidden; box-shadow: var(--lift);
  background: radial-gradient(circle at 78% 82%, transparent 0 38px, rgba(255, 255, 255, .35) 39px 42px, transparent 43px), radial-gradient(circle at 20% 12%, transparent 0 26px, rgba(255, 255, 255, .35) 27px 30px, transparent 31px), radial-gradient(circle at 30% 20%, #9BE8F5, #33B3E6); }
.lily { position: absolute; width: clamp(60px, 17%, 100px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(from 25deg, #37B65A 0 325deg, transparent 325deg); filter: drop-shadow(0 6px 0 rgba(20, 80, 60, .35)); color: #fff; text-shadow: var(--outline); font: 700 clamp(30px, 7.5vw, 48px)/1 var(--font-letter); transition: filter .2s; }
.pdeco { position: absolute; z-index: 0; font-size: clamp(30px, 8vw, 54px); transform: translate(-50%, -50%); pointer-events: none; animation: bobs 3.4s ease-in-out infinite; }
.pdeco.p1 { left: 92%; top: 11%; } .pdeco.p2 { left: 6%; top: 56%; font-size: clamp(24px, 6vw, 40px); animation-delay: -1.2s; } .pdeco.p3 { left: 91%; top: 90%; animation-delay: -2s; }
.lily { z-index: 1; }
.lily.done { background: conic-gradient(from 25deg, #F2B824 0 325deg, transparent 325deg); }
.lily.no { animation: wobble2 .45s; }
.frog { position: absolute; z-index: 2; left: 9%; top: 90%; transform: translate(-50%, -78%); font-size: clamp(42px, 10.5vw, 68px); pointer-events: none;
  transition: left .45s cubic-bezier(.3, 1.3, .6, 1), top .45s cubic-bezier(.3, 1.3, .6, 1); filter: drop-shadow(0 5px 0 rgba(20, 80, 60, .3)); }
.frog.hop { animation: hop .45s; }

/* ---------- trò chơi: lật hình ---------- */
.mem { display: grid; gap: clamp(10px, 3vw, 18px); width: 100%; max-width: 620px; margin: 0 auto; }
.mcard { aspect-ratio: 4 / 5; border-radius: 22px; border: 5px solid #fff; display: grid; place-items: center; font: 700 clamp(40px, 12vw, 78px)/1 var(--font-letter);
  background: radial-gradient(rgba(255, 255, 255, .35) 16%, transparent 17%) 0 0 / 26px 26px, var(--purple); box-shadow: 0 7px 0 #5B3DBF, 0 12px 16px rgba(30, 42, 94, .25); }
.mcard::before { content: "?"; color: var(--yellow); text-shadow: var(--outline); font-family: var(--font-ui); font-weight: 800; }
.mcard span { display: none; }
.mcard.open { background: #fff; box-shadow: 0 7px 0 rgba(30, 42, 94, .2); animation: flip .3s; }
.mcard.open::before { content: none; }
.mcard.open span { display: block; }
.mcard.done { background: #E7FBEA; border-color: var(--green); }

/* ---------- trò chơi: tập tô ---------- */
.trace { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.seg { display: flex; background: #fff; border-radius: 999px; padding: 5px; box-shadow: 0 5px 0 rgba(30, 42, 94, .2); }
.seg button { padding: 6px 26px; min-height: 48px; border-radius: 999px; font-weight: 800; font-size: 1.2rem; }
.seg button[aria-pressed="true"] { background: var(--yellow); }
.paperrow { display: grid; grid-template-columns: auto minmax(0, 400px) auto; align-items: center; justify-content: center; gap: clamp(6px, 2vw, 14px); width: 100%; }
.paper { position: relative; aspect-ratio: 1; background: #fff; border: 6px solid #fff; border-radius: 30px; overflow: hidden; box-shadow: var(--lift); }
.paper canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.paper .ink { touch-action: none; opacity: .88; cursor: crosshair; }
.meter { width: min(100%, 400px); height: 22px; border-radius: 999px; background: #fff; border: 4px solid #fff; overflow: hidden; box-shadow: 0 4px 0 rgba(30, 42, 94, .2); }
.meter i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--yellow), var(--green)); transition: width .15s; }
.crayon { width: 52px; height: 52px; border-radius: 50%; background: var(--c); border: 4px solid #fff; box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 60%, #000); }
.crayon[aria-pressed="true"] { outline: 5px solid var(--navy); outline-offset: 2px; transform: scale(1.1); }
.pulse { animation: pulse .9s ease-in-out infinite; }

/* ---------- xong lượt ---------- */
.finish { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; background: #fff; border-radius: 36px; padding: 22px 18px 28px; box-shadow: var(--lift); }
.cheer { display: flex; align-items: flex-end; justify-content: center; gap: 6px; font-size: clamp(48px, 13vw, 76px); }
.cheer > span { width: clamp(120px, 34vw, 180px); animation: jump .7s ease-in-out infinite alternate; }
.cheer > .emo:first-child { transform: rotate(-12deg); }
.finish h2 { font-weight: 800; font-size: clamp(2.6rem, 11vw, 4rem); line-height: 1; color: var(--yellow); text-shadow: var(--outline); }
.finish p { font-size: 1.4rem; font-weight: 800; }
.starrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.starrow svg { width: 60px; height: 60px; animation: starin .5s both; }
#fx { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 20; }
#fx i { position: absolute; top: -24px; width: 13px; height: 20px; border-radius: 4px; animation: fall 2s linear forwards; }
.toast { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 999px; padding: 8px 26px 8px 12px;
  font-weight: 800; font-size: 1.3rem; white-space: nowrap; box-shadow: var(--lift); animation: toast 3s forwards; }
.toast .emo { font-size: 52px; }
.bump { animation: bump .35s; }

/* ================= vừa một màn hình ================= */
/* --over: phần chiều cao mà thanh trên + câu hỏi của Gấu Con chiếm; khu chơi tự co theo phần còn lại. */
:root { --vh: 100vh; --bar: 78px; --over: 236px; }
@supports (height: 100dvh) { :root { --vh: 100dvh; } }
body { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
main { gap: 16px; }
@media (max-height: 700px) {
  :root { --over: 200px; }
  .ask { gap: 10px; } .ask > span { width: 56px; } .ask .bubble { padding: 6px 14px; font-size: 1.05rem; border-radius: 18px; }
}
@media (max-height: 560px) {
  :root { --bar: 56px; --over: 150px; }
  .bar { padding: 4px 10px; gap: 8px; }
  .round { width: 46px; height: 46px; border-width: 3px; } .round svg { width: 22px; height: 22px; }
  .brand { font-size: 1.25rem; }
  .stars { font-size: 1.1rem; padding: 2px 12px 2px 6px; } .stars svg { width: 26px; height: 26px; }
  main { gap: 8px; padding-top: 2px; }
  .ask > span { width: 46px; } .ask .bubble { padding: 4px 14px; font-size: 1rem; }
  .dots i { width: 14px; height: 14px; }
  body[data-scene="chu-cai"] .ask, body[data-scene="so-dem"] .ask { display: none; }
  .finish { gap: 6px; padding: 10px 16px 14px; }
  .cheer { font-size: 44px; } .cheer > span { width: 92px; }
  .finish h2 { font-size: 2rem; } .finish p { font-size: 1.1rem; }
  .starrow svg { width: 38px; height: 38px; }
  .btn { min-height: 52px; font-size: 1.3rem; }
}

/* học chữ, học số: thẻ lớn luôn nằm trong tầm mắt khi bé cuộn chọn chữ */
.learn { display: flex; flex-direction: column; gap: 18px; }
.blocks { padding-top: 10px; }
.stagecard { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--bar)); z-index: 4; }
.show { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.glyph .big { font-size: clamp(50px, min(15vw, 15vh), 150px); }
.pic .emo { font-size: clamp(54px, min(17vw, 16vh), 128px); }
.pic .w { font-size: clamp(20px, min(6vw, 6vh), 42px); }
.plate { min-height: 0; font-size: clamp(34px, min(11vw, 9vh), 66px); }
.plate.many { font-size: clamp(24px, min(7.4vw, 6vh), 46px); }
@media (max-width: 620px) {
  .stagecard { grid-template-columns: minmax(0, 1fr); }
  .stagecard > .round { position: absolute; top: -12px; z-index: 1; width: 44px; height: 44px; }
  .stagecard > .round:first-child { left: -4px; } .stagecard > .round:last-child { right: -4px; }
  .show { padding: 10px; gap: 10px; }
}
@media (max-height: 560px) and (min-aspect-ratio: 5/4) {
  .learn { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; gap: 14px; }
  .blocks { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 12px 8px; font-size: 24px; }
}

/* bóng bay */
.field { height: clamp(200px, calc(var(--vh) - var(--over) - 40px), 520px); min-height: 0; }
.balloon { width: clamp(58px, min(21%, 26vh), 124px); }
.balloon .b { font-size: clamp(30px, min(9vw, 12vh), 62px); }
.balloon .b::after { height: clamp(22px, 8vh, 56px); }

/* hái quả: màn dọc thì cây ở trên, giỏ và nút Xong nằm một hàng bên dưới */
.orchard { grid-template-columns: minmax(0, 1fr); gap: 12px; justify-items: center; align-items: center; }
.tree { container-type: inline-size; width: min(100%, 520px, calc((var(--vh) - var(--over) - 204px) * 4 / 3)); min-width: 190px; margin: 14px 0 0; }
.fruit { font-size: clamp(22px, 10.5cqw, 54px); }
.side { flex-direction: row; width: 100%; max-width: 520px; justify-content: center; gap: 10px; }
.need { flex: none; gap: 4px; font-size: clamp(32px, min(9vw, 8vh), 56px); }
.basket { flex: 1 1 0; min-width: 0; max-width: 260px; min-height: 92px; padding: 10px 8px; font-size: clamp(20px, min(5.6vw, 5vh), 36px); }
.basket .n { width: 44px; height: 44px; font-size: 26px; top: -18px; right: -8px; }
#btnDone { flex: none; min-height: 60px; padding-inline: 18px; font-size: 1.35rem; }
@media (min-aspect-ratio: 1/1) and (min-width: 640px) {
  .orchard { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .tree { width: min(100%, 520px, calc((var(--vh) - var(--over) - 44px) * 4 / 3)); justify-self: end; }
  .side { flex-direction: column; justify-self: start; max-width: 300px; }
  .basket { flex: none; width: 100%; }
}
@media (min-aspect-ratio: 1/1) and (min-width: 640px) and (max-height: 560px) {
  .side { flex-direction: row; flex-wrap: wrap; }
  .basket { flex: 1 1 110px; min-height: 80px; }
  #btnDone { flex: 1 1 100%; min-height: 48px; }
}

/* tìm chữ */
.quiz { gap: 16px; }
.piccard { padding: 10px clamp(18px, 6vw, 48px) 14px; }
.piccard .emo { font-size: clamp(60px, min(24vw, calc((var(--vh) - var(--over)) * .3)), 140px); }
.piccard .w { font-size: clamp(28px, min(10vw, 8vh), 54px); }
.opts { font-size: clamp(36px, min(13vw, 11vh), 76px); }
@media (min-aspect-ratio: 5/4) and (max-height: 760px) {
  .quiz { flex-direction: row; justify-content: center; }
  .piccard .emo { font-size: clamp(60px, calc((var(--vh) - var(--over)) * .46), 140px); }
  .opts { max-width: 46%; }
}

/* ếch nhảy */
.pond { container-type: inline-size; max-height: none; width: min(100%, 680px, calc((var(--vh) - var(--over) - 40px) * 4 / 3)); }
.lily { width: clamp(40px, 17%, 100px); font-size: clamp(20px, 8cqw, 48px); }
.frog { font-size: clamp(28px, 11cqw, 68px); }
.pdeco { font-size: clamp(20px, 8cqw, 54px); } .pdeco.p2 { font-size: clamp(16px, 6cqw, 40px); }

/* lật hình */
.mem { container-type: inline-size; max-width: min(620px, calc((var(--vh) - var(--over) - 24px) * var(--cols, 3) * .4)); }
.mcard { font-size: clamp(24px, calc(38cqw / var(--cols, 3)), 78px); }

/* tập tô */
.trace { gap: 14px; }
.ttop { display: flex; align-items: center; justify-content: center; gap: 14px; }
.paper { width: min(400px, 100%, calc(var(--vh) - var(--over) - 190px)); min-width: 190px; }
.tools { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.crayon { width: 46px; height: 46px; }
@media (min-aspect-ratio: 5/4) and (max-height: 760px) {
  .trace { display: grid; grid-template-columns: auto minmax(0, 320px); grid-template-areas: "paper top" "paper meter" "paper tools"; align-content: center; justify-content: center; align-items: center; column-gap: 24px; row-gap: 14px; }
  .paper { grid-area: paper; width: min(400px, calc(var(--vh) - var(--over) - 12px)); }
  .ttop { grid-area: top; } .meter { grid-area: meter; width: 100%; } .tools { grid-area: tools; }
}

/* sửa theo kết quả dò lỗi */
.field { touch-action: none; }                     /* vuốt trên bóng không cuộn trang, không tính nhầm là chạm */
.balloon.gone { transition: opacity .3s, scale .3s; opacity: 0; scale: .6; pointer-events: none; }
.basket button.in { animation: bump .3s; display: inline-grid; place-items: center; }
body[data-scene="home"] .bar { position: static; } /* trang chủ: thanh trên cuộn theo trang, không đè lên thẻ */
.piccard .emo { margin-bottom: 6px; }
.toast { top: auto; bottom: 14%; }
@media (max-width: 420px) {
  .finish { gap: 8px; padding: 14px 12px 20px; }
  .cheer { font-size: 44px; } .cheer > span { width: 108px; }
  .finish h2 { font-size: 2.3rem; } .finish p { font-size: 1.15rem; }
  .starrow svg { width: 42px; height: 42px; }
  .finish .btn { padding-inline: 16px; font-size: 1.3rem; min-height: 58px; }
}

/* nhắc nghỉ mắt */
.rest { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(30, 42, 94, .6); }
.restcard { background: #fff; border-radius: 36px; padding: 22px 20px 26px; width: 100%; max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; box-shadow: var(--lift); }
.restcard > span { width: clamp(96px, 30vw, 160px); }
.restcard h2 { font-weight: 800; font-size: clamp(1.6rem, 6vw, 2.2rem); line-height: 1.1; }
.restcard .btn[disabled] { filter: grayscale(.9); opacity: .65; }
@media (max-height: 560px) { .restcard { max-width: 620px; padding: 12px 18px 16px; gap: 6px; } .restcard > span { width: 76px; } }

/* ================= rực rỡ hơn, gợi ý, cổ vũ ================= */
:root { --rainbow: linear-gradient(90deg, var(--red), var(--orange), var(--yellow), var(--green), var(--teal), var(--blue), var(--purple), var(--pink)); }
/* dây cờ nhiều màu dưới thanh trên */
.bar::after { content: ""; position: absolute; left: 14px; right: 14px; top: calc(100% - 4px); height: 18px; pointer-events: none;
  background:
    conic-gradient(from 150deg at 50% 0, var(--red) 60deg, transparent 0) 0 0 / 120px 18px repeat-x,
    conic-gradient(from 150deg at 50% 0, var(--yellow) 60deg, transparent 0) 24px 0 / 120px 18px repeat-x,
    conic-gradient(from 150deg at 50% 0, var(--green) 60deg, transparent 0) 48px 0 / 120px 18px repeat-x,
    conic-gradient(from 150deg at 50% 0, var(--blue) 60deg, transparent 0) 72px 0 / 120px 18px repeat-x,
    conic-gradient(from 150deg at 50% 0, var(--pink) 60deg, transparent 0) 96px 0 / 120px 18px repeat-x; }
body[data-scene="home"] .bar::after { display: none; }
main { padding-top: 14px; }
@media (max-height: 560px) { .bar::after { height: 10px; background-size: 120px 10px; } main { padding-top: 8px; } }
/* chữ tên trang mỗi chữ một màu */
.logo b { color: var(--c); font-weight: inherit; display: inline-block; animation: bob 2.4s ease-in-out infinite; }
.logo b:nth-child(2n) { animation-delay: -.6s; } .logo b:nth-child(3n) { animation-delay: -1.2s; }
.logo span:first-child { color: inherit; }
/* khung trắng thành khung viền cầu vồng */
.show, .piccard, .finish, .shelf, .paper, .restcard, .field, .pond {
  border: 6px solid transparent; background-origin: border-box; }
.show, .piccard, .finish, .shelf, .restcard { background: linear-gradient(#fff, #fff) padding-box, var(--rainbow) border-box; }
.paper { background: linear-gradient(#fff, #fff) padding-box, var(--rainbow) border-box; }
.bubble { border: 4px solid var(--yellow); background: #FFFBE6; }
.bubble::before { border-right-color: var(--yellow); }
.stars { background: linear-gradient(#FFF6C2, #FFE066); border: 3px solid #fff; }
.sec { display: inline-flex; align-items: center; gap: 10px; }
.sec::after { content: ""; flex: none; width: clamp(60px, 22vw, 200px); height: 10px; border-radius: 999px; background: var(--rainbow); box-shadow: 0 3px 0 rgba(30, 42, 94, .25); }
/* thẻ ở trang chủ: nhãn nhuộm theo màu thẻ */
.card { background: color-mix(in srgb, var(--c) 16%, #fff); }
.card .name { color: color-mix(in srgb, var(--c) 62%, var(--navy)); }
.card .art { background: radial-gradient(rgba(255, 255, 255, .34) 14%, transparent 15%) 0 0 / 34px 34px, radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .5) 0 12%, transparent 13%), linear-gradient(160deg, color-mix(in srgb, var(--c) 55%, #fff), var(--c)); }
/* chấm tiến độ mỗi chấm một màu */
.dots i.on:nth-child(6n+1) { background: var(--red); } .dots i.on:nth-child(6n+2) { background: var(--orange); } .dots i.on:nth-child(6n+3) { background: var(--yellow); }
.dots i.on:nth-child(6n+4) { background: var(--green); } .dots i.on:nth-child(6n+5) { background: var(--blue); } .dots i.on:nth-child(6n) { background: var(--purple); }
.dots i.on { animation: bump .4s; }
.plain { background: linear-gradient(#fff, #F1F6FF); border: 3px solid color-mix(in srgb, var(--blue) 40%, #fff); }
.slots span { background: linear-gradient(135deg, #FFF0F7, #EAF6FF); }
/* bóng bay và sao lấp lánh trong khung cảnh */
.fl8 { --c: var(--red); position: absolute; z-index: 0; bottom: -140px; width: clamp(30px, 4.4vw, 54px); aspect-ratio: 5 / 6; border-radius: 50% 50% 50% 50% / 45% 45% 55% 55%;
  background: radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .8) 0 9%, transparent 10%), var(--c); opacity: .9; animation: floatsky 26s linear infinite; }
.fl8::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 40px; background: rgba(30, 42, 94, .3); }
.f-a { left: 4%; } .f-b { --c: var(--yellow); left: 16%; animation-duration: 33s; animation-delay: -9s; } .f-c { --c: var(--green); left: 78%; animation-duration: 29s; animation-delay: -17s; }
.f-d { --c: var(--purple); left: 92%; animation-duration: 36s; animation-delay: -4s; } .f-e { --c: var(--pink); left: 52%; animation-duration: 40s; animation-delay: -24s; }
.tw { position: absolute; z-index: 0; color: #fff; font-size: clamp(14px, 2vw, 26px); text-shadow: 0 0 8px rgba(255, 255, 255, .9); animation: twinkle 2.4s ease-in-out infinite; }
.t-a { left: 9%; top: 12%; } .t-b { left: 30%; top: 6%; animation-delay: -.8s; color: #FFF3A3; } .t-c { left: 55%; top: 16%; animation-delay: -1.5s; }
.t-d { left: 72%; top: 34%; animation-delay: -.4s; color: #FFD9EC; } .t-e { left: 20%; top: 40%; animation-delay: -1.9s; } .t-f { left: 88%; top: 52%; animation-delay: -1.1s; color: #FFF3A3; }
@media (max-width: 720px), (max-height: 560px) { .f-b, .f-e, .t-e { display: none; } }
/* gợi ý: đáp án sáng lên, bàn tay chỉ vào */
.hinted { outline: 6px solid var(--yellow) !important; outline-offset: 4px; box-shadow: 0 0 0 10px rgba(255, 210, 63, .45), 0 0 26px 10px rgba(255, 210, 63, .8) !important; border-radius: 22px; }
.lily.hinted, .balloon.hinted, .fruit.hinted, .it.hinted { border-radius: 50%; }
.hand { position: fixed; z-index: 25; margin: 0 0 0 -22px; font: 400 48px/1 var(--font-emoji); pointer-events: none; filter: drop-shadow(0 4px 0 rgba(30, 42, 94, .3)); animation: poke .7s ease-in-out infinite; }
/* cổ vũ */
.praise { position: absolute; left: 50%; top: calc(var(--bar, 64px) + 6px); font-weight: 800; font-size: clamp(1.3rem, 6vw, 2.6rem); /* nằm sát thanh trên, không che đáp án bé vừa chọn */ white-space: nowrap; color: var(--c); animation: praise 1.25s ease-out forwards; }
.clapper { position: absolute; bottom: -60px; font-family: var(--font-emoji); animation: clapup 2.6s ease-out forwards; }
.claps { display: flex; gap: 10px; font: 400 clamp(34px, 9vw, 54px)/1 var(--font-emoji); }
.claps > * { animation: clapbeat .45s ease-in-out infinite alternate; } .claps > :nth-child(2) { animation-delay: .15s; } .claps > :nth-child(3) { animation-delay: .3s; }
.finish h2 { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 3px 0 var(--navy)); }
@media (max-height: 560px) { .claps { font-size: 26px; } .praise { font-size: 1.5rem; } }
/* màn thấp: màn chúc mừng gọn lại */
@media (max-height: 700px) {
  .finish { gap: 6px; padding-block: 12px 16px; }
  .cheer { font-size: 44px; } .cheer > span { width: 104px; }
  .finish h2 { font-size: 2.3rem; } .claps { font-size: 30px; }
  .starrow svg { width: 42px; height: 42px; }
  .paper { width: min(400px, 100%, calc(var(--vh) - var(--over) - 206px)); }
}
@media (max-height: 560px) { .claps { display: none; } .cheer > span { width: 76px; } .finish h2 { font-size: 1.8rem; } .starrow svg { width: 32px; height: 32px; } .finish .btn { min-height: 46px; } }
@media (max-height: 560px) and (min-aspect-ratio: 5/4) { .paper { width: min(400px, calc(var(--vh) - var(--over) - 16px)); } }
@keyframes floatsky { to { transform: translateY(-130vh) rotate(8deg); } }
@keyframes twinkle { 0%, 100% { opacity: .25; scale: .7; } 50% { opacity: 1; scale: 1.15; } }
@keyframes poke { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes praise { 0% { transform: translate(-50%, 20px) scale(.4) rotate(-6deg); opacity: 0; } 25% { transform: translate(-50%, 0) scale(1.1) rotate(3deg); opacity: 1; } 75% { transform: translate(-50%, -10px) scale(1) rotate(-2deg); opacity: 1; } 100% { transform: translate(-50%, -40px) scale(1); opacity: 0; } }
@keyframes clapup { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-70vh) scale(1.2) rotate(18deg); opacity: 0; } }
@keyframes clapbeat { from { transform: scale(.85) rotate(-8deg); } to { transform: scale(1.15) rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .fl8, .tw, .logo b, .clapper, .claps > *, .hand { animation: none; } .clapper { display: none; } }

/* ================= hình thật to: hình, chữ, số và ô chọn lấp đầy chỗ trống ================= */
/* Không đụng tới các bài có lớp lt- (màu sắc, hình dạng, con vật) và trò gs- (bóng của ai).
   --sl: phần chiều cao còn dư trong --over khi màn đủ rộng để lời của Gấu Con không xuống dòng. */
:root { --sl: 0px; }
@media (min-width: 700px) { :root { --sl: 12px; } }
/* màn rộng: cột nội dung rộng hơn 1000px để hình to được */
@media (min-width: 1040px) and (min-height: 561px) {
  body:is([data-scene="chu-cai"], [data-scene="so-dem"], [data-scene="bong-bay"], [data-scene="hai-qua"], [data-scene="tim-chu"], [data-scene="ech-nhay"],
    [data-scene="dau-thanh"], [data-scene="so-lon"], [data-scene="tu-moi"], [data-scene="nhieu-hon"], [data-scene="hoa-thuong"], [data-scene="so-thieu"], [data-scene="dan-go"]) { --wide: 1280px; }
  body[data-scene] :is(main, .bar) { max-width: var(--wide, 1000px); }
}
.finish { width: 100%; max-width: 980px; margin-inline: auto; }

/* ----- học chữ, học số, dấu thanh, số 11–20, từ quanh bé -----
   Thẻ lớn có chiều cao định sẵn = phần màn hình còn lại sau khi trừ các ô chọn (--lr-under);
   chữ, hình, đồ vật tự lớn theo ô của mình (đơn vị cq). */
.learn:not(.lt-learn) {
  --lr-w: min(100vw - 32px, var(--wide, 1000px) - 20px);
  --lr-cols: 5; --lr-rows: 6; --lr-gx: 12px; --lr-gy: 16px; --lr-max: 76px; --lr-ar: 1; --lr-extra: 0px; --lr-min: 166px;
  --lr-tw: min(var(--lr-max), (var(--lr-w) - (var(--lr-cols) - 1) * var(--lr-gx)) / var(--lr-cols));
  --lr-under: calc(var(--lr-rows) * var(--lr-tw) * var(--lr-ar) + (var(--lr-rows) - 1) * var(--lr-gy) + 28px + var(--lr-extra) - var(--sl));
  --lr-h: clamp(var(--lr-min), var(--vh) - var(--over) - var(--lr-under), 600px);
}
.learn:not(.lt-learn) .show { height: var(--lr-h); grid-template-rows: minmax(0, 1fr); }
.learn:not(.lt-learn) .show > * { min-width: 0; min-height: 0; }
.learn:not(.lt-learn) :is(.glyph, .pic, .plate) { container-type: size; }
/* --hf: cỡ chữ dòng “đọc là …”, --hl: số dòng của nó; chữ lớn lấy hết phần còn lại của ô */
.learn:not(.lt-learn) .glyph > * { --hf: clamp(13px, min(8cqh, 11cqw), 24px); --hl: 1; }
.learn:not(.lt-learn) .glyph .big { font-size: clamp(40px, min(41cqw, (100cqh - var(--hl) * 1.35 * var(--hf) - 8px) / 1.3), 280px); }
.learn:not(.lt-learn) .glyph .how { font-size: var(--hf); padding-inline: clamp(6px, 4cqw, 16px); white-space: nowrap; }
.learn:not(.lt-learn) .pic { padding: 8px; gap: 4px; }
.learn:not(.lt-learn) .pic > * { --pw: clamp(20px, min(12cqh, 17cqw), 64px); }
.learn:not(.lt-learn) .pic .w { font-size: var(--pw); white-space: nowrap; }
.learn:not(.lt-learn) .pic .emo { font-size: clamp(48px, calc(min(96cqw, 100cqh - 1.25 * var(--pw) - 8px) / 1.12), 400px); }
.learn:not(.lt-learn) .blocks { grid-template-columns: repeat(var(--lr-cols), minmax(0, 1fr)); gap: var(--lr-gy) var(--lr-gx); width: 100%; margin-inline: auto;
  max-width: calc(var(--lr-cols) * var(--lr-max) + (var(--lr-cols) - 1) * var(--lr-gx)); font-size: calc(var(--lr-tw) * .5); }
/* học số: chữ số chỉ có nét thẳng, không dấu → dòng thấp hơn, số to hơn */
body[data-scene="so-dem"] .learn .glyph .big, body[data-scene="so-lon"] .learn .glyph .big { line-height: 1.15; font-size: clamp(40px, min(72cqw, (100cqh - var(--hl) * 1.35 * var(--hf) - 8px) / 1.15), 300px); }
body[data-scene="so-dem"] .learn { --lr-rows: 3; --lr-min: 180px; --lr-gy: 12px; --lr-extra: 24px; }   /* --lr-extra: lời dẫn dài, trên điện thoại xuống 3 dòng */
body[data-scene="so-dem"] .learn .show { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
/* đồ vật để đếm: cỡ mỗi hình = cách xếp hàng × cột vừa đĩa nhất với số hình đang có */
.plate .it { font-size: calc((min(var(--ps, 70px), 320px) - 10px) / 1.4); }
.plate .it:first-child:nth-last-child(1) { --ps: min(100cqw, 100cqh); }
.plate .it:first-child:nth-last-child(2), .plate .it:first-child:nth-last-child(2) ~ .it { --ps: max(min(50cqw, 100cqh), min(100cqw, 50cqh)); }
.plate .it:first-child:nth-last-child(3), .plate .it:first-child:nth-last-child(3) ~ .it { --ps: max(min(33.3cqw, 100cqh), min(50cqw, 50cqh), min(100cqw, 33.3cqh)); }
.plate .it:first-child:nth-last-child(4), .plate .it:first-child:nth-last-child(4) ~ .it { --ps: max(min(25cqw, 100cqh), min(50cqw, 50cqh), min(100cqw, 25cqh)); }
.plate .it:first-child:nth-last-child(5), .plate .it:first-child:nth-last-child(5) ~ .it { --ps: max(min(20cqw, 100cqh), min(33.3cqw, 50cqh), min(50cqw, 33.3cqh), min(100cqw, 20cqh)); }
.plate .it:first-child:nth-last-child(6), .plate .it:first-child:nth-last-child(6) ~ .it { --ps: max(min(16.6cqw, 100cqh), min(33.3cqw, 50cqh), min(50cqw, 33.3cqh)); }
.plate .it:first-child:nth-last-child(7), .plate .it:first-child:nth-last-child(7) ~ .it,
.plate .it:first-child:nth-last-child(8), .plate .it:first-child:nth-last-child(8) ~ .it { --ps: max(min(12.5cqw, 100cqh), min(25cqw, 50cqh), min(33.3cqw, 33.3cqh), min(50cqw, 25cqh)); }
.plate .it:first-child:nth-last-child(9), .plate .it:first-child:nth-last-child(9) ~ .it { --ps: max(min(20cqw, 50cqh), min(33.3cqw, 33.3cqh), min(50cqw, 20cqh)); }
.plate .it:first-child:nth-last-child(10), .plate .it:first-child:nth-last-child(10) ~ .it { --ps: max(min(20cqw, 50cqh), min(25cqw, 33.3cqh), min(33.3cqw, 25cqh), min(50cqw, 20cqh)); }
/* máy tính bảng và máy tính: nhiều ô trên một hàng, thẻ lớn lấy hết phần còn lại */
@media (min-width: 621px) {
  .learn:not(.lt-learn) { --lr-cols: 10; --lr-rows: 3; --lr-max: clamp(56px, 10vh, 72px); }
  body[data-scene="so-dem"] .learn { --lr-cols: 6; --lr-rows: 2; --lr-max: clamp(56px, 11vh, 84px); --lr-gy: 16px; --lr-extra: 0px; }
}
@media (min-width: 621px) and (max-aspect-ratio: 1/1) {   /* màn dọc: chữ ở trên, hình ở dưới, mỗi phần rộng hết thẻ */
  body:is([data-scene="chu-cai"], [data-scene="tu-moi"], [data-scene="so-dem"], [data-scene="dau-thanh"]) .learn .show { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1.2fr); }
}
@media (min-width: 1040px) and (min-aspect-ratio: 5/4) {
  .learn:not(.lt-learn) { --lr-cols: 15; --lr-rows: 2; --lr-max: clamp(56px, 11vh, 80px); }
  body:is([data-scene="chu-cai"], [data-scene="tu-moi"]) .learn .show { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }   /* chữ bị giới hạn bởi bề ngang, hình bởi bề cao */
}
/* màn ngang rộng, ít ô chọn (học số): thẻ lớn cao hết màn hình, các ô xếp thành cột bên phải */
@media (min-width: 900px) and (min-height: 600px) and (min-aspect-ratio: 5/4) {
  body[data-scene="so-dem"] .learn { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 20px;
    --lr-cols: 2; --lr-rows: 6; --lr-gy: 10px; --lr-tw: clamp(56px, (var(--vh) - var(--over) + var(--sl) - 5 * var(--lr-gy)) / 6, 88px);
    --lr-h: calc(var(--vh) - var(--over) + var(--sl)); }
  body[data-scene="so-dem"] .learn .blocks { width: calc(2 * var(--lr-tw) + var(--lr-gx)); max-width: none; padding-top: 0; }
}
/* điện thoại nằm ngang: thẻ lớn bên trái cao hết màn hình, nút mũi tên nằm đè lên góc thẻ */
@media (max-height: 560px) and (min-aspect-ratio: 5/4) {
  .learn:not(.lt-learn) { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); --lr-h: calc(var(--vh) - var(--bar) - 28px); }
  .learn:not(.lt-learn) .blocks { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 10px 8px; max-width: none; font-size: 24px; padding-top: 2px; }
  .learn:not(.lt-learn) .stagecard { grid-template-columns: minmax(0, 1fr); }
  .learn:not(.lt-learn) .stagecard > .round { position: absolute; top: -8px; z-index: 1; width: 44px; height: 44px; }
  .learn:not(.lt-learn) .stagecard > .round:first-child { left: -6px; } .learn:not(.lt-learn) .stagecard > .round:last-child { right: -6px; }
  .learn:not(.lt-learn) .show { padding: 8px; gap: 8px; }
  body[data-scene="so-dem"] .learn { grid-template-columns: minmax(0, 1fr) auto; --lr-tw: clamp(48px, (var(--vh) - var(--bar) - 60px) / 4, 72px); }
  body[data-scene="so-dem"] .learn .blocks { grid-template-columns: repeat(3, minmax(0, 1fr)); width: calc(3 * var(--lr-tw) + 16px); font-size: calc(var(--lr-tw) * .5); }
}

/* ----- các trò hỏi – đáp (tìm chữ, hoa – thường, số còn thiếu, chơi thử trong bài học) -----
   --qa: chiều cao dành cho thẻ hình + ô chọn; --qt: cạnh một ô chọn; --qe: cỡ hình; --qw: cỡ chữ của từ */
.quiz:not(.lt-quiz, .gs-quiz) {
  --qa: calc(var(--vh) - var(--over) - 38px + var(--sl));
  --qg: clamp(12px, 4vw, 26px);
  --qt: min(clamp(90px, var(--qa) * .3, 220px), (min(100vw - 32px, var(--wide, 1000px) - 20px) - 2 * var(--qg)) / 3);
  --qw: clamp(28px, min(10vw, 8vh), 72px);
  --qe: min(var(--qa) - var(--qt) - 100px - 1.45 * var(--qw), 70vw, 420px);
}
.quiz:not(.lt-quiz, .gs-quiz) .piccard .emo { font-size: max(60px, calc(var(--qe) / 1.12)); }
.quiz:not(.lt-quiz, .gs-quiz) .piccard .w { font-size: var(--qw); }
.quiz:not(.lt-quiz, .gs-quiz) .opts { container-type: inline-size; gap: var(--qg); max-width: calc(3 * var(--qt) + 2 * var(--qg)); }
.quiz:not(.lt-quiz, .gs-quiz) .opts .block { font-size: 16cqw; }
@media (max-height: 560px) { .quiz:not(.lt-quiz, .gs-quiz) { --qa: calc(var(--vh) - var(--over) - 22px + var(--sl)); } }
/* màn ngang: thẻ hình bên trái cao hết chỗ, ba ô chọn thật to bên phải */
@media (min-aspect-ratio: 5/4) {
  .quiz:not(.lt-quiz, .gs-quiz, .gn-quiz) { flex-direction: row; justify-content: center; align-items: center;
    --qt: clamp(90px, var(--qa) * .7, 230px);
    --qe: min(var(--qa) - 50px - 1.45 * var(--qw), 32vw, 420px); }
  .quiz:not(.lt-quiz, .gs-quiz, .gn-quiz) .piccard { flex: none; }
  .quiz:not(.lt-quiz, .gs-quiz, .gn-quiz) .opts { flex: 1 1 0; min-width: 0; }
}
/* màn rộng: cả cụm nằm giữa khoảng trống thay vì dồn lên trên */
@media (min-width: 700px) { .quiz:not(.lt-quiz, .gs-quiz) { min-height: var(--qa); justify-content: center; } }

/* ----- bóng bay: khung cao hết màn hình, bóng to hơn trên màn lớn ----- */
.field { height: clamp(200px, calc(var(--vh) - var(--over) - 40px + var(--sl)), 900px); }
.balloon { width: clamp(58px, min(21%, 26vh), 176px); }
.balloon .b { font-size: clamp(30px, min(9vw, 12vh), 88px); }

/* ----- hái quả: cây to hết chỗ ----- */
.tree { max-width: none; width: min(100%, 780px, calc((var(--vh) - var(--over) - 204px + var(--sl)) * 4 / 3)); }
.fruit { font-size: clamp(22px, 10.5cqw, 84px); }
@media (min-aspect-ratio: 1/1) and (min-width: 640px) {
  .tree { width: min(100%, 780px, calc((var(--vh) - var(--over) - 44px + var(--sl) / 2) * 4 / 3)); }
}
@media (min-width: 900px) and (min-height: 600px) {
  .side { max-width: 380px; gap: 18px; }
  .need { font-size: clamp(32px, min(9vw, 8vh), 84px); }
  .basket { max-width: 340px; min-height: 124px; font-size: clamp(20px, min(5.6vw, 5vh), 50px); }
  #btnDone { min-height: 72px; padding-inline: 34px; font-size: 1.7rem; }
}

/* ----- ếch nhảy: lá sen to hơn; màn ngang thì ao rộng ra ----- */
.pond { max-width: none; width: min(100%, 1000px, calc((var(--vh) - var(--over) - 40px + var(--sl)) * 4 / 3)); }
.lily { width: clamp(40px, 20%, 140px); font-size: clamp(20px, 9.5cqw, 66px); }
.frog { font-size: clamp(28px, 12.5cqw, 92px); }
@media (min-aspect-ratio: 5/4) {
  .pond { aspect-ratio: 16 / 10; width: min(100%, 1000px, calc((var(--vh) - var(--over) - 40px + var(--sl)) * 1.6)); }
  .lily { width: clamp(40px, 17.5%, 140px); font-size: clamp(20px, 8.2cqw, 66px); }
  .frog { font-size: clamp(28px, 10.5cqw, 92px); }
}
@media (max-aspect-ratio: 3/4) {   /* màn dọc: ao cao lên, lá sen thưa ra nên to được hơn */
  .pond { aspect-ratio: 4 / 5; width: min(100%, 1000px, calc((var(--vh) - var(--over) - 52px + var(--sl)) * .8)); }
  .lily { width: clamp(40px, 23%, 140px); font-size: clamp(20px, 11cqw, 66px); }
  .frog { font-size: clamp(28px, 14cqw, 92px); }
}

/* màu của từng khối: đặt sau cùng để thắng màu mặc định của thành phần */
.c-red { --c: var(--red); } .c-orange { --c: var(--orange); } .c-yellow { --c: var(--yellow); } .c-green { --c: var(--green); }
.c-teal { --c: var(--teal); } .c-blue { --c: var(--blue); } .c-purple { --c: var(--purple); } .c-pink { --c: var(--pink); }

@keyframes popin { from { transform: scale(.82) translateY(14px); opacity: 0; } 70% { transform: scale(1.04); opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes crawl { from { translate: 0 0; } to { translate: 26vw 0; } }
@keyframes flutter { 0%, 100% { translate: 0 0; rotate: -8deg; } 25% { translate: 18vw -9vh; rotate: 10deg; } 50% { translate: 42vw -2vh; rotate: -6deg; } 75% { translate: 24vw -13vh; rotate: 12deg; } }
@keyframes bobs { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes driftin { from { left: -15%; } to { left: 110%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { from { translate: -240px 0; } to { translate: calc(100vw + 240px) 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes rise { from { transform: translate(-50%, 0); } to { transform: translate(-50%, var(--rise, -900px)); } }
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes wobble { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px) rotate(-5deg); } 50% { transform: translateX(10px) rotate(5deg); } 80% { transform: translateX(-6px); } }
@keyframes wobble2 { 0%, 100% { transform: translate(-50%, -50%); } 25% { transform: translate(calc(-50% - 9px), -50%) rotate(-6deg); } 60% { transform: translate(calc(-50% + 9px), -50%) rotate(6deg); } }
@keyframes pop { 50% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes floatup { from { transform: translateY(0) scale(.6); opacity: 1; } to { transform: translateY(-90px) scale(1.2); opacity: 0; } }
@keyframes drop { to { transform: translateY(160px) rotate(40deg) scale(.6); opacity: 0; } }
@keyframes hop { 0%, 100% { translate: 0 0; } 50% { translate: 0 -34px; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.16); } 100% { transform: scale(1); } }
@keyframes flip { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@keyframes jump { from { transform: translateY(0); } to { transform: translateY(-16px); } }
@keyframes starin { from { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.25); } to { transform: scale(1); } }
@keyframes fall { to { transform: translateY(112vh) rotate(560deg); } }
@keyframes toast { 0% { transform: translate(-50%, -30px) scale(.6); opacity: 0; } 10%, 85% { transform: translate(-50%, 0) scale(1); opacity: 1; } 100% { transform: translate(-50%, -20px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .sun, .cloud, .chick, .deco, .pdeco, .fdeco, .balloon .b, .pulse, .cheer > span, .card, .grid .card { animation: none; transition: none; }
  #fx i { display: none; }
}

/* ---------- wave 5: polish ---------- */
/* Chữ cái + Từ quanh bé trên điện thoại dọc: 29 chữ xếp 6 cột × 5 hàng để cả bài vừa một màn hình, không phải cuộn trang
   (trước đây 5 cột × 6 hàng, điện thoại 360×640 phải cuộn thêm 160px). */
@media (max-width: 620px) and (min-height: 561px) {
  body:is([data-scene="chu-cai"], [data-scene="tu-moi"]) .learn { --lr-cols: 6; --lr-rows: 5; --lr-gx: 8px; --lr-gy: 9px; --lr-extra: -12px; --lr-min: 108px; gap: 12px; }
  body:is([data-scene="chu-cai"], [data-scene="tu-moi"]) .learn .blocks { padding-top: 8px; font-size: calc(var(--lr-tw) * .54); }
}
/* máy rất hẹp (320–350px): tên màn không xuống 3 dòng làm thanh trên cao thêm; hai bài chữ cái bỏ nút "nghe lại" để lời dẫn chỉ còn 2 dòng */
@media (max-width: 350px) {
  .brand { font-size: 1.2rem; }
  body:is([data-scene="chu-cai"], [data-scene="tu-moi"]) .ask > .round { display: none; }
}
/* điện thoại cao và hẹp (từ khoảng 9:19): đủ chỗ cho 5 cột ô to như trước, khe hàng hẹp hơn một chút để thẻ lớn cao thêm */
@media (min-width: 370px) and (max-width: 620px) and (min-height: 800px) and (max-aspect-ratio: 47/100) {
  body:is([data-scene="chu-cai"], [data-scene="tu-moi"]) .learn { --lr-cols: 5; --lr-rows: 6; --lr-gx: 12px; --lr-gy: 12px; --lr-extra: -30px; --lr-min: 166px; gap: 16px; }
  body:is([data-scene="chu-cai"], [data-scene="tu-moi"]) .learn .blocks { padding-top: 10px; font-size: calc(var(--lr-tw) * .5); }
}

/* ---------- wave 6: compat (trình duyệt cũ) ---------- */
/* Bản dự phòng của các luật phía trên cho máy cũ (iPhone/iPad từ iOS 15.4, Chrome/WebView từ 100). Trình duyệt mới bỏ qua hết nhờ điều kiện @supports not.
   Mỗi file css có một khối như thế này ở cuối. Sửa một luật gốc có color-mix(), cqw/cqh hay translate/rotate/scale thì sửa luôn dòng tương ứng trong khối. */
/* Chưa có color-mix() (Safari < 16.2, Chrome < 111). Một khai báo vừa có var() vừa có hàm lạ không bị bỏ lúc đọc mà hỏng lúc tính,
   nên không viết "giá trị cũ ở dòng trước" được: phải ghi đè ở đây. Bóng/nền: chồng lớp đen hoặc trắng trong suốt lên màu gốc → ra đúng màu pha. */
@supports not (color: color-mix(in srgb, red, blue)) {
  :root { --k-red: #C04C62; --k-orange: #C07E2E; --k-yellow: #C0A348; --k-green: #349E67; --k-teal: #1599A5; --k-blue: #337CD2; --k-purple: #7759D2; --k-pink: #C05A9B; } /* màu chữ đậm: 72% màu + 28% xanh đậm */
  .bar { background: var(--sky1); }
  .round { --ck: var(--k-yellow); box-shadow: 0 5px 0 rgba(0, 0, 0, .4), 0 5px 0 var(--c), 0 9px 12px rgba(30, 42, 94, .22); }
  .round:active { box-shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 1px 0 var(--c); }
  .btn { --ck: var(--k-green); box-shadow: 0 7px 0 rgba(0, 0, 0, .4), 0 7px 0 var(--c), 0 12px 16px rgba(30, 42, 94, .25); }
  .btn:active { box-shadow: 0 2px 0 rgba(0, 0, 0, .4), 0 2px 0 var(--c); }
  .block { --ck: var(--k-blue); color: var(--ck, var(--navy)); box-shadow: 0 .16em 0 rgba(0, 0, 0, .4), 0 .16em 0 var(--c), 0 .3em .34em rgba(30, 42, 94, .25); }
  button.block:active { box-shadow: 0 .05em 0 rgba(0, 0, 0, .4), 0 .05em 0 var(--c); }
  .card { --ck: var(--k-blue); box-shadow: 0 9px 0 rgba(0, 0, 0, .42), 0 9px 0 var(--c), 0 18px 24px rgba(30, 42, 94, .25); }
  .card:active { box-shadow: 0 3px 0 rgba(0, 0, 0, .42), 0 3px 0 var(--c); }
  .card .art { background: radial-gradient(rgba(255, 255, 255, .28) 14%, transparent 15%) 0 0 / 34px 34px, linear-gradient(160deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, 0)), var(--c); }
  .mb { --ck: var(--k-red); }
  .balloon .b { background: radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .8) 0 8%, transparent 9%), radial-gradient(circle at 60% 70%, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0) 60%), var(--c); }
  .balloon .b::before { border-bottom-color: var(--c); }
  .crayon { box-shadow: 0 5px 0 rgba(0, 0, 0, .4), 0 5px 0 var(--c); }
  .card { background: linear-gradient(rgba(255, 255, 255, .84), rgba(255, 255, 255, .84)) var(--c); }
  .card .name { color: var(--ck, var(--navy)); }
  .card .art { background: radial-gradient(rgba(255, 255, 255, .34) 14%, transparent 15%) 0 0 / 34px 34px, radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .5) 0 12%, transparent 13%), linear-gradient(160deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0)), var(--c); }
  .plain { border: 3px solid #B1D7FF; }
  .fl8 { --ck: var(--k-red); }
  .f-b { --ck: var(--k-yellow); }
  .f-c { --ck: var(--k-green); }
  .f-d { --ck: var(--k-purple); }
  .f-e { --ck: var(--k-pink); }
  .c-red { --ck: var(--k-red); }
  .c-orange { --ck: var(--k-orange); }
  .c-yellow { --ck: var(--k-yellow); }
  .c-green { --ck: var(--k-green); }
  .c-teal { --ck: var(--k-teal); }
  .c-blue { --ck: var(--k-blue); }
  .c-purple { --ck: var(--k-purple); }
  .c-pink { --ck: var(--k-pink); }
  [style*="--c:"] { --ck: var(--c); }
}
/* Chưa có đơn vị cqw/cqh và @container (Safari < 16, Chrome < 105): js/data.js đo các khung có --cq rồi ghi cỡ vào --cq-w/--cq-h;
   con của khung nhận --cqw/--cqh (1% bề rộng/cao của khung). Chưa đo được thì tính theo màn hình (1vw/1vh). */
@supports not (width: 1cqw) {
  :root { --cqw: 1vw; --cqh: 1vh; }
  * { --cq: none; }
  /* data-cq = "0s" | "0w" | "1s" | "1w": ngăn 0/1 (khung lồng nhau xen kẽ) + s (đo cả hai chiều) / w (chỉ bề rộng) */
  [data-cq^="0"] > *, [data-cq^="0"]::before, [data-cq^="0"]::after { --cqw: var(--cq-w0); }
  [data-cq="0s"] > *, [data-cq="0s"]::before, [data-cq="0s"]::after { --cqh: var(--cq-h0); }
  [data-cq^="1"] > *, [data-cq^="1"]::before, [data-cq^="1"]::after { --cqw: var(--cq-w1); }
  [data-cq="1s"] > *, [data-cq="1s"]::before, [data-cq="1s"]::after { --cqh: var(--cq-h1); }
  .tree { --cq: inline-size; }
  .fruit { font-size: clamp(22px, calc(10.5 * var(--cqw)), 54px); }
  .pond { --cq: inline-size; }
  .lily { font-size: clamp(20px, calc(8 * var(--cqw)), 48px); }
  .frog { font-size: clamp(28px, calc(11 * var(--cqw)), 68px); }
  .pdeco { font-size: clamp(20px, calc(8 * var(--cqw)), 54px); }
  .pdeco.p2 { font-size: clamp(16px, calc(6 * var(--cqw)), 40px); }
  .mem { --cq: inline-size; }
  .mcard { font-size: clamp(24px, calc(calc(38 * var(--cqw)) / var(--cols, 3)), 78px); }
  .learn:not(.lt-learn) :is(.glyph, .pic, .plate) { --cq: size; contain: size; }
  .learn:not(.lt-learn) .glyph > * { --hf: clamp(13px, min(calc(8 * var(--cqh)), calc(11 * var(--cqw))), 24px); }
  .learn:not(.lt-learn) .glyph .big { font-size: clamp(40px, min(calc(41 * var(--cqw)), (calc(100 * var(--cqh)) - var(--hl) * 1.35 * var(--hf) - 8px) / 1.3), 280px); }
  .learn:not(.lt-learn) .glyph .how { padding-inline: clamp(6px, calc(4 * var(--cqw)), 16px); }
  .learn:not(.lt-learn) .pic > * { --pw: clamp(20px, min(calc(12 * var(--cqh)), calc(17 * var(--cqw))), 64px); }
  .learn:not(.lt-learn) .pic .emo { font-size: clamp(48px, calc(min(calc(96 * var(--cqw)), calc(100 * var(--cqh)) - 1.25 * var(--pw) - 8px) / 1.12), 400px); }
  body[data-scene="so-dem"] .learn .glyph .big, body[data-scene="so-lon"] .learn .glyph .big { font-size: clamp(40px, min(calc(72 * var(--cqw)), (calc(100 * var(--cqh)) - var(--hl) * 1.35 * var(--hf) - 8px) / 1.15), 300px); }
  .plate .it:first-child:nth-last-child(1) { --ps: min(calc(100 * var(--cqw)), calc(100 * var(--cqh))); }
  .plate .it:first-child:nth-last-child(2), .plate .it:first-child:nth-last-child(2) ~ .it { --ps: max(min(calc(50 * var(--cqw)), calc(100 * var(--cqh))), min(calc(100 * var(--cqw)), calc(50 * var(--cqh)))); }
  .plate .it:first-child:nth-last-child(3), .plate .it:first-child:nth-last-child(3) ~ .it { --ps: max(min(calc(33.3 * var(--cqw)), calc(100 * var(--cqh))), min(calc(50 * var(--cqw)), calc(50 * var(--cqh))), min(calc(100 * var(--cqw)), calc(33.3 * var(--cqh)))); }
  .plate .it:first-child:nth-last-child(4), .plate .it:first-child:nth-last-child(4) ~ .it { --ps: max(min(calc(25 * var(--cqw)), calc(100 * var(--cqh))), min(calc(50 * var(--cqw)), calc(50 * var(--cqh))), min(calc(100 * var(--cqw)), calc(25 * var(--cqh)))); }
  .plate .it:first-child:nth-last-child(5), .plate .it:first-child:nth-last-child(5) ~ .it { --ps: max(min(calc(20 * var(--cqw)), calc(100 * var(--cqh))), min(calc(33.3 * var(--cqw)), calc(50 * var(--cqh))), min(calc(50 * var(--cqw)), calc(33.3 * var(--cqh))), min(calc(100 * var(--cqw)), calc(20 * var(--cqh)))); }
  .plate .it:first-child:nth-last-child(6), .plate .it:first-child:nth-last-child(6) ~ .it { --ps: max(min(calc(16.6 * var(--cqw)), calc(100 * var(--cqh))), min(calc(33.3 * var(--cqw)), calc(50 * var(--cqh))), min(calc(50 * var(--cqw)), calc(33.3 * var(--cqh)))); }
  .plate .it:first-child:nth-last-child(7), .plate .it:first-child:nth-last-child(7) ~ .it, .plate .it:first-child:nth-last-child(8), .plate .it:first-child:nth-last-child(8) ~ .it { --ps: max(min(calc(12.5 * var(--cqw)), calc(100 * var(--cqh))), min(calc(25 * var(--cqw)), calc(50 * var(--cqh))), min(calc(33.3 * var(--cqw)), calc(33.3 * var(--cqh))), min(calc(50 * var(--cqw)), calc(25 * var(--cqh)))); }
  .plate .it:first-child:nth-last-child(9), .plate .it:first-child:nth-last-child(9) ~ .it { --ps: max(min(calc(20 * var(--cqw)), calc(50 * var(--cqh))), min(calc(33.3 * var(--cqw)), calc(33.3 * var(--cqh))), min(calc(50 * var(--cqw)), calc(20 * var(--cqh)))); }
  .plate .it:first-child:nth-last-child(10), .plate .it:first-child:nth-last-child(10) ~ .it { --ps: max(min(calc(20 * var(--cqw)), calc(50 * var(--cqh))), min(calc(25 * var(--cqw)), calc(33.3 * var(--cqh))), min(calc(33.3 * var(--cqw)), calc(25 * var(--cqh))), min(calc(50 * var(--cqw)), calc(20 * var(--cqh)))); }
  .quiz:not(.lt-quiz, .gs-quiz) .opts { --cq: inline-size; }
  .quiz:not(.lt-quiz, .gs-quiz) .opts .block { font-size: calc(16 * var(--cqw)); }
  .fruit { font-size: clamp(22px, calc(10.5 * var(--cqw)), 84px); }
  .lily { font-size: clamp(20px, calc(9.5 * var(--cqw)), 66px); }
  .frog { font-size: clamp(28px, calc(12.5 * var(--cqw)), 92px); }
  @media (min-aspect-ratio: 5/4) { .lily { font-size: clamp(20px, calc(8.2 * var(--cqw)), 66px); } }
  @media (min-aspect-ratio: 5/4) { .frog { font-size: clamp(28px, calc(10.5 * var(--cqw)), 92px); } }
  @media (max-aspect-ratio: 3/4) { .lily { font-size: clamp(20px, calc(11 * var(--cqw)), 66px); } }
  @media (max-aspect-ratio: 3/4) { .frog { font-size: clamp(28px, calc(14 * var(--cqw)), 92px); } }
}
/* Chưa có translate/rotate/scale rời (Chrome < 104): chuyển sang biến --i-* rồi ghép lại trong transform. */
@supports not (translate: 0) {
  *, ::before, ::after { --i-t: translate(var(--i-tx, 0px), var(--i-ty, 0px)) rotate(var(--i-r, 0deg)) scale(var(--i-sx, 1), var(--i-sy, 1)); }
  @property --i-tx { syntax: '<length-percentage>'; inherits: false; initial-value: 0px; }
  @property --i-ty { syntax: '<length-percentage>'; inherits: false; initial-value: 0px; }
  @property --i-r { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
  @property --i-sx { syntax: '<number>'; inherits: false; initial-value: 1; }
  @property --i-sy { syntax: '<number>'; inherits: false; initial-value: 1; }
  :where(.cloud) { transform: var(--i-t); }
  :where(.snail) { transform: var(--i-t); }
  :where(.fly) { transform: var(--i-t); }
  :where(.bird) { transform: var(--i-t); }
  .pdeco { transform: var(--i-t) translate(-50%, -50%); }
  .frog.hop { transform: var(--i-t) translate(-50%, -78%); }
  .balloon.gone { transition: opacity .3s, --i-sx .3s, --i-sy .3s; --i-sx: .6; --i-sy: .6; transform: var(--i-t); }
  :where(.tw) { transform: var(--i-t); }
  @keyframes twinkle { 0%, 100% { opacity: .25; --i-sx: .7; --i-sy: .7; } 50% { opacity: 1; --i-sx: 1.15; --i-sy: 1.15; } }
  @keyframes crawl { from { --i-tx: 0px; --i-ty: 0px; } to { --i-tx: 26vw; --i-ty: 0px; } }
  @keyframes flutter { 0%, 100% { --i-tx: 0px; --i-ty: 0px; --i-r: -8deg; } 25% { --i-tx: 18vw; --i-ty: -9vh; --i-r: 10deg; } 50% { --i-tx: 42vw; --i-ty: -2vh; --i-r: -6deg; } 75% { --i-tx: 24vw; --i-ty: -13vh; --i-r: 12deg; } }
  @keyframes bobs { 0%, 100% { --i-tx: 0px; --i-ty: 0px; } 50% { --i-tx: 0px; --i-ty: -6px; } }
  @keyframes drift { from { --i-tx: -240px; --i-ty: 0px; } to { --i-tx: calc(100vw + 240px); --i-ty: 0px; } }
  @keyframes rise { from { transform: var(--i-t) translate(-50%, 0); } to { transform: var(--i-t) translate(-50%, var(--rise, -900px)); } }
  @keyframes hop { 0%, 100% { --i-tx: 0px; --i-ty: 0px; } 50% { --i-tx: 0px; --i-ty: -34px; } }
  .c2 { transform: var(--i-t) scale(.7); } /* mây thứ hai: vừa trôi vừa giữ cỡ nhỏ */
}
/* iPhone/iPad: chữ không tự phóng to khi xoay ngang; chạm đúp liên tiếp không phóng to trang */
@supports (-webkit-touch-callout: none) {
  html { -webkit-text-size-adjust: 100%; }
  body { touch-action: manipulation; }
}
