/* Bé Học Vui — tối ưu cho điện thoại và máy tính bảng, cả dọc lẫn ngang. */
:root {
  --bg: #FFF8E7;
  --ink: #3B2F2F;
  --muted: #7A6A5F;
  --card: #FFFFFF;
  --line: #F0E2C8;
  --good: #43A047;
  --bad: #E53935;
  --accent: #FF7043;
  --c: #FFB74D;
  --r: 22px;
  --shadow: 0 4px 0 rgba(59, 47, 47, .12), 0 8px 18px rgba(59, 47, 47, .08);
  --gut: max(12px, env(safe-area-inset-left));
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.4 var(--font);
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; touch-action: manipulation; }
button:focus-visible { outline: 4px solid #42A5F5; outline-offset: 3px; }
button:disabled { opacity: .35; cursor: default; }
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.loading { margin: auto; color: var(--muted); }

/* ---------- Thanh trên ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) var(--gut) 8px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
}
.tb-title { margin: 0; font-size: clamp(20px, 5vw, 28px); font-weight: 800; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 52px; height: 52px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
  font-size: 26px; display: grid; place-items: center;
}
.icon-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(59,47,47,.12); }
.star-total { font-weight: 800; font-size: 17px; white-space: nowrap; }
.tb-space { width: 52px; }

.screen { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 8px var(--gut) calc(16px + env(safe-area-inset-bottom)); }

/* ---------- Trang chủ ---------- */
.topics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 600px) { .topics { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 900px) { .topics { grid-template-columns: repeat(4, 1fr); } }
@media (orientation: landscape) and (min-width: 560px) {
  .topics { grid-template-columns: repeat(4, 1fr); }
  .topics .topic { aspect-ratio: 1.25; }
  .screen .games { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .topics .topic { aspect-ratio: 1.6; }
  .topics .topic-icon { font-size: 44px; }
  .games .game { min-height: 110px; }
}
.topic {
  position: relative; aspect-ratio: 1 / .92; border-radius: var(--r);
  background: var(--c); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: transform .12s;
}
.topic:active { transform: scale(.96); }
.topic-icon { font-size: clamp(54px, 15vw, 88px); line-height: 1; filter: drop-shadow(0 3px 0 rgba(0,0,0,.12)); }
.topic-name { font-weight: 800; font-size: clamp(18px, 4.6vw, 24px); color: #2B1F1F; }
.topic-stars { position: absolute; top: 8px; right: 10px; font-size: 13px; font-weight: 800; background: rgba(255,255,255,.75); border-radius: 99px; padding: 2px 8px; }
.home-foot { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; text-align: center; }
.link-btn { background: var(--card); border-radius: 99px; padding: 10px 18px; font-weight: 700; box-shadow: var(--shadow); color: var(--ink); }

/* ---------- Trang chủ đề ---------- */
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow); font-weight: 700; font-size: 17px; }
.chip.on { background: var(--c); }
.preview { display: flex; justify-content: center; gap: 6px; margin: 6px 0 14px; flex-wrap: wrap; }
.preview .mini { width: 46px; height: 46px; font-size: 34px; }
.games { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 600px) { .games { grid-template-columns: repeat(3, 1fr); } }
.game {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border-bottom: 6px solid var(--c);
  min-height: 140px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.game:active { transform: scale(.96); }
.game-icon { font-size: 52px; line-height: 1.1; }
.game-name { font-weight: 800; font-size: 19px; text-align: center; }
.game-stars { color: #FFB300; font-size: 20px; letter-spacing: 2px; }

/* ---------- Khung chơi ---------- */
.screen.play { display: flex; flex-direction: column; padding-top: 0; }
.stage { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.dots { display: flex; justify-content: center; gap: 8px; padding: 4px 0 10px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); transition: transform .2s, background .2s; }
.dots i.now { transform: scale(1.4); background: var(--c); }
.dots i.done { background: var(--good); }
.dots i.half { background: #FFB300; }
.qbody { flex: 1; display: grid; grid-template-columns: 1fr; align-content: center; gap: 16px; }

.prompt { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--r); padding: 10px 14px 10px 10px; box-shadow: var(--shadow); }
.speak { flex: none; width: 54px; height: 54px; border-radius: 50%; background: var(--c); font-size: 26px; display: grid; place-items: center; }
.speak:active { transform: scale(.92); }
.prompt-text { font-weight: 800; font-size: clamp(19px, 4.8vw, 28px); line-height: 1.25; }

/* Hình vẽ */
.art { display: inline-grid; place-items: center; line-height: 1; }
.art-emoji { font-size: 64px; }
.art-text { font-size: 56px; font-weight: 900; letter-spacing: 1px; }
.art-svg svg { width: 100%; height: 100%; display: block; }
.art-img img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; display: block; pointer-events: none; }
/* ô lưới cố định đúng khung → ảnh cao (người, nghề nghiệp) co lại, không tràn đè lên chữ */
.art.art-img { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.art-img { width: 1.15em; height: 1.15em; }
.swatch { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(0,0,0,.12); }
.art.shadow { filter: brightness(0) opacity(.75); }

/* Lựa chọn */
.choices { display: grid; gap: 12px; }
.choices.n2 { grid-template-columns: repeat(2, 1fr); }
.choices.n3 { grid-template-columns: repeat(3, 1fr); }
.choices.n4 { grid-template-columns: repeat(2, 1fr); }
.choice {
  container-type: inline-size;
  aspect-ratio: 1; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  display: grid; place-items: center; overflow: hidden; border: 4px solid transparent;
  transition: transform .12s, border-color .2s;
}
.choice:active { transform: scale(.95); }
.choice .art { width: 72%; height: 72%; font-size: 58cqi; }
.choice .art-text { font-size: 42cqi; }
.choice .art.num { font-size: 52cqi; }
.correct { border-color: var(--good) !important; background: #E8F5E9 !important; animation: pop .5s; }
.shake { animation: shake .45s; border-color: var(--bad) !important; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes pop { 50% { transform: scale(1.08); } }

/* Màn ngang: đề bài ở trên, hình bên trái, lựa chọn bên phải */
@media (orientation: landscape) and (min-width: 560px) {
  .qbody { grid-template-columns: 1fr 1fr; align-items: center; }
  .qbody > .prompt { grid-column: 1 / -1; }
  .qbody > .choices:nth-child(2) { grid-column: 1 / -1; max-width: 900px; justify-self: center; width: 100%; }
  .qbody > .choices:nth-child(2).n4 { grid-template-columns: repeat(4, 1fr); }
  .qbody > .choices:nth-child(2).n3 { max-width: 720px; }
  .choice { max-height: 42vh; justify-self: center; width: 100%; max-width: 42vh; }
  .sort-item .art.big, .scene .art.big { width: min(24vw, 46vh, 280px); height: min(24vw, 46vh, 280px); font-size: min(19vw, 36vh, 220px); }
}
@media (orientation: portrait) {
  .qbody { align-content: space-evenly; }
  .choices.n3 { grid-template-columns: repeat(2, 1fr); }
  .choices.n3 > :last-child { grid-column: 1 / -1; justify-self: center; width: calc(50% - 6px); }
  .choice { max-height: 28vh; justify-self: center; width: 100%; max-width: 28vh; }
  .choices.n3 > .choice:last-child { width: min(calc(50% - 6px), 28vh); }
}

/* ---------- Thẻ khám phá ---------- */
.explore { flex: 1; display: flex; flex-direction: column; gap: 14px; justify-content: center; align-items: center; }
.xcard {
  width: min(100%, 520px, 62vh); aspect-ratio: 4 / 5; background: var(--card); border-radius: 30px; box-shadow: var(--shadow);
  border-bottom: 8px solid var(--c); padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  container-type: inline-size; touch-action: pan-y;
}
.xcard .art.big { width: 70cqi; height: 52cqi; font-size: 46cqi; }
.xcard .art-text.big { font-size: 34cqi; }
.xtext { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.xsubart { font-size: 11cqi; text-align: center; word-break: break-word; }
.xname { font-size: clamp(24px, 9cqi, 44px); font-weight: 900; text-align: center; }
.xen { font-size: clamp(18px, 6cqi, 28px); color: #8E24AA; font-weight: 700; }
.xinfo { font-size: clamp(15px, 4.6cqi, 20px); color: var(--muted); text-align: center; }
.xcard.pop { animation: cardin .35s ease-out; }
@keyframes cardin { from { transform: translateY(14px) scale(.96); opacity: .4; } }
.xnav { display: flex; align-items: center; gap: 22px; }
.nav { width: 76px; height: 76px; border-radius: 50%; background: var(--c); box-shadow: var(--shadow); font-size: 32px; display: grid; place-items: center; }
.nav:active { transform: scale(.92); }
.xcount { font-weight: 800; color: var(--muted); min-width: 64px; text-align: center; }
@media (orientation: landscape) and (max-height: 560px) {
  .explore { flex-direction: row; }
  .xcard { flex-direction: row; aspect-ratio: auto; height: calc(100dvh - 96px); width: min(76vw, 720px); gap: 18px; }
  .xcard .art.big { width: 40cqi; height: 40cqi; font-size: 32cqi; flex: none; }
  .xcard .art-text.big { font-size: 20cqi; }
  .xtext { flex: 1; }
  .xname { font-size: clamp(22px, 6cqi, 40px); }
  .xsubart { font-size: 6cqi; }
  .xnav { flex-direction: column; }
  .nav { width: 64px; height: 64px; }
}

/* ---------- Lật hình ---------- */
.memory { flex: 1; display: grid; gap: 10px; align-content: center; justify-content: center; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; max-width: 760px; margin: 0 auto; }
.memory.m12 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (orientation: landscape) { .memory.m12 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 900px; } .memory.m6 { max-width: 640px; } }
.mcard { position: relative; aspect-ratio: 1; perspective: 600px; container-type: inline-size; max-height: 24vh; }
@media (orientation: portrait) { .memory.m12 .mcard { max-height: 18vh; } }
.mcard > span { position: absolute; inset: 0; border-radius: 18px; display: grid; place-items: center; backface-visibility: hidden; transition: transform .35s; box-shadow: var(--shadow); }
.mback { background: var(--c); font-size: 40cqi; }
.mface { background: var(--card); transform: rotateY(180deg); }
.mface .art { width: 74%; height: 74%; font-size: 56cqi; }
.mface .art-text { font-size: 30cqi; }
.mcard.up .mback { transform: rotateY(180deg); }
.mcard.up .mface { transform: rotateY(360deg); }
.mcard.matched .mface { background: #E8F5E9; box-shadow: 0 0 0 4px var(--good); }

/* ---------- Phân loại ---------- */
.sort-item, .scene { display: grid; place-items: center; container-type: inline-size; }
.sort-item .art.big, .scene .art.big { width: min(46vw, 30vh, 260px); height: min(46vw, 30vh, 260px); font-size: min(36vw, 24vh, 200px); }
/* ---------- Nối A–B ---------- */
.qbody > .noi { grid-column: 1 / -1; }
.noi { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(44px, .55fr) minmax(0, 1fr); width: 100%; max-width: 820px; margin: 0 auto; height: min(calc(100dvh - 235px), 640px); min-height: 280px; }
.noi-col { display: grid; grid-template-rows: repeat(5, minmax(0, 1fr)); gap: 8px; min-height: 0; }
.noi-col.a { grid-column: 1; } .noi-col.b { grid-column: 3; }
.noi-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 2; }
.ncard { container-type: size; display: flex; align-items: center; gap: 6px; min-height: 0; min-width: 0; padding: 3px 8px 3px 4px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); border: 4px solid transparent; touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .12s, border-color .2s, background .2s; }
.ncard.b { flex-direction: row-reverse; padding: 3px 4px 3px 8px; }
.ncard .art { flex: none; width: 88cqh; height: 88cqh; font-size: 66cqh; }
.ncap { flex: 1; min-width: 0; font-weight: 800; font-size: clamp(12px, min(3.4vw, 26cqh), 19px); line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.ncard.bong { justify-content: center; }
.ncard.a .ncap { text-align: left; } .ncard.b .ncap { text-align: right; }
.ncard.sel { border-color: var(--c, #FFB74D); transform: scale(1.05); box-shadow: 0 0 0 4px rgba(255,183,77,.35), var(--shadow); }
.ncard.done { border-color: var(--m); background: color-mix(in srgb, var(--m) 18%, var(--card)); }
/* màn ngang thấp (điện thoại xoay ngang): ẩn đề bài chữ để thẻ đủ to */
@media (orientation: landscape) and (max-height: 560px) { .qbody:has(> .noi) > .prompt { display: none; } .noi { height: calc(100dvh - 122px); min-height: 200px; max-width: 640px; } }
@media (max-width: 420px) { .ncap { font-size: 12px; } .noi { grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); } }
.bins { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 10px; }
.bin { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 4px solid transparent; min-height: 120px; justify-content: center; }
.bin .art { width: 64px; height: 64px; font-size: 52px; }
.bin-name { font-weight: 800; font-size: 17px; text-align: center; line-height: 1.2; }

/* ---------- Đúng / Sai ---------- */
.yn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.yn { border-radius: var(--r); padding: 14px; font-size: 54px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: var(--shadow); border: 4px solid transparent; }
.yn span { font-size: 22px; font-weight: 800; }
.yn.yes { background: #C8E6C9; }
.yn.no { background: #FFCDD2; }

/* ---------- Quy luật ---------- */
.seq { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.seq-i { font-size: clamp(28px, min(10vw, 11vh), 60px); line-height: 1.1; width: 1.25em; text-align: center; }
.seq-i .art, .cnt .art, .side-items .art { font-size: 1em; }
.seq-i.q { color: var(--accent); font-weight: 900; border: 3px dashed var(--accent); border-radius: 14px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.1); } }

/* ---------- Đếm ---------- */
.count-field { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.cnt { position: relative; font-size: clamp(30px, min(11vw, 8.5vh), 64px); line-height: 1.1; border-radius: 14px; padding: 2px 4px; }
.cnt.on { background: #FFF3C4; }
.cnt.on::after { content: attr(data-n); position: absolute; top: -6px; right: -6px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 900; border-radius: 99px; min-width: 24px; height: 24px; display: grid; place-items: center; }
.choices .art.num { font-weight: 900; }

/* ---------- Nhiều / ít ---------- */
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.side { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); min-height: min(200px, 40vh); padding: 12px; border: 4px solid transparent; display: grid; place-items: center; }
.side-items { font-size: clamp(30px, 8vw, 52px); line-height: 1.2; word-break: break-all; text-align: center; }
.qbody > .sides { grid-column: 1 / -1; }

/* ---------- Đèn giao thông ---------- */
.tlight { justify-self: center; background: #263238; border-radius: 30px; padding: 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.lamp { width: min(22vw, 11vh, 96px); aspect-ratio: 1; border-radius: 50%; opacity: .18; }
.lamp.red { background: #FF1744; } .lamp.yellow { background: #FFEA00; } .lamp.green { background: #00E676; }
.lamp.on { opacity: 1; box-shadow: 0 0 28px currentColor; animation: pulse 1.4s infinite; }
.lamp.red.on { color: #FF1744; } .lamp.yellow.on { color: #FFEA00; } .lamp.green.on { color: #00E676; }
.acts { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 12px; }
.act { border-radius: var(--r); padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: var(--shadow); border: 4px solid transparent; font-size: 50px; }
.act-name { font-size: 18px; font-weight: 800; }
.act-stop { background: #FFCDD2; } .act-slow { background: #FFF59D; } .act-go { background: #C8E6C9; }
@media (orientation: landscape) and (min-width: 560px) { .tlight { flex-direction: row; } .lamp { width: min(12vw, 20vh, 110px); } }

/* ---------- Hộp thoại & kết quả ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(40, 30, 20, .45); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal-card { background: var(--card); border-radius: 28px; padding: 22px; width: min(100%, 440px); text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-card h2 { margin: 6px 0 10px; font-size: 26px; }
.gate-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.btn { background: var(--c); border-radius: 16px; padding: 12px 18px; font-weight: 800; box-shadow: var(--shadow); }
.btn:active { transform: translateY(2px); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn.danger { background: #FFCDD2; }
.result-stars { display: flex; justify-content: center; gap: 6px; font-size: 72px; line-height: 1; }
.result-stars span { color: var(--line); }
.result-stars span.on { color: #FFB300; animation: starin .5s both; text-shadow: 0 4px 0 #E69100; }
@keyframes starin { from { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.25); } }
.result-btns { display: flex; justify-content: center; gap: 14px; margin-top: 10px; }
.big-btn { width: 84px; height: 84px; border-radius: 24px; background: var(--c); font-size: 40px; box-shadow: var(--shadow); }
.big-btn:active { transform: scale(.94); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { top: 110%; transform: rotate(720deg) translateX(40px); } }

/* ---------- Góc bố mẹ ---------- */
.parent { display: grid; gap: 14px; max-width: 720px; -webkit-user-select: text; user-select: text; }
.card { background: var(--card); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 10px; font-size: 21px; }
.card p, .card li { font-size: 16px; }
.card ul { padding-left: 20px; margin: 0; }
.field { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.field-label { font-weight: 700; }
.seg { display: flex; background: var(--bg); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 16px; }
.seg button.on { background: var(--c); box-shadow: 0 2px 0 rgba(0,0,0,.1); }
.muted { color: var(--muted); font-size: 14px !important; }
.donate { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.donate img { width: 220px; height: auto; border-radius: 14px; background: #fff; }
.donate-info { display: grid; gap: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Điện thoại xoay ngang (thấp): lựa chọn xếp một hàng */
@media (orientation: landscape) and (max-height: 500px) {
  .qbody { gap: 10px; }
  .qbody > .choices:nth-child(3).n4 { grid-template-columns: repeat(4, 1fr); }
  .qbody > .choices:nth-child(3) .choice { max-height: 30vh; max-width: 30vh; }
  .dots { padding: 0 0 6px; }
  .topbar { padding-top: calc(env(safe-area-inset-top) + 4px); padding-bottom: 4px; }
}

/* Lời khen thoáng qua */
.toast {
  position: fixed; left: 50%; top: 42%; z-index: 40; transform: translate(-50%, -50%);
  font: 800 clamp(26px, 7vw, 44px)/1.1 var(--font-display); color: #fff;
  background: linear-gradient(180deg, #5FD38B, var(--good)); padding: 14px 26px; border-radius: 999px;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.5), inset 0 -6px 0 rgba(0,0,0,.15), var(--clay-out);
  pointer-events: none; animation: toast 1.4s ease-out forwards;
}
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } 25% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* Gợi ý: đáp án đúng nhún nhảy sau 2 lần chọn sai */
.hint { animation: hint 1s ease-in-out infinite; }
@keyframes hint { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-8px) rotate(-3deg); } 75% { transform: translateY(-4px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .hint { animation: none; outline: 4px dashed var(--good); outline-offset: 4px; } }

/* Hình gợi ý trong đề (trò "Ai dùng cái này?") */
.pick-show { display: flex; justify-content: center; margin: 4px 0 10px; }
.pick-show .art.big { width: min(34vw, 150px); height: min(34vw, 150px); font-size: min(26vw, 110px); }

/* Biểu tượng ảnh đất sét trên thanh tiêu đề và nút chọn bộ (thay emoji) */
.tb-title { display: flex; align-items: center; justify-content: center; gap: 8px; }
.tb-icon .art { width: 1.6em; height: 1.6em; font-size: 1em; }
.chip-icon { display: inline-flex; }
.chip-icon .art { width: 1.7em; height: 1.7em; font-size: 1em; }
img.emo { height: 1.25em; width: 1.25em; object-fit: contain; vertical-align: -0.28em; display: inline-block; }

/* Nút cài app trên màn hình chính + hướng dẫn */
.cai-hang { display: flex; justify-content: center; margin: 2px 0 12px; }
.cai-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 99px; font-weight: 800; font-size: 17px;
  background: var(--accent, #CFA969); color: #fff; box-shadow: var(--shadow); }
.cai-btn[hidden] { display: none; }
.cai-card { text-align: left; }
.cai-card h2 { text-align: center; }
.cai-logo { width: 64px; height: 64px; border-radius: 16px; display: block; margin: 0 auto 4px; }
.cai-list { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; gap: 12px; font-size: 17px; line-height: 1.45; }
.cai-buoc { display: flex; gap: 10px; align-items: flex-start; }
.cai-so { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent, #CFA969); color: #fff; display: grid; place-items: center; font-weight: 800; }
.cai-ic { display: inline-flex; vertical-align: middle; }
.cai-card .btn { display: block; margin: 0 auto; }

/* Ủng hộ */
.donate-card { background: linear-gradient(180deg, #FFF6E6, var(--card)); }
.dn-head { display: flex; gap: 14px; align-items: center; }
.dn-head h2 { margin: 0 0 4px; }
.dn-mascot { width: 84px; height: 84px; border-radius: 22px; flex: none; animation: dn-bob 2.6s ease-in-out infinite; }
@keyframes dn-bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
.dn-dung { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dn-dung li { background: #fff; border-radius: 99px; padding: 6px 12px; font-size: 14px; font-weight: 700; box-shadow: var(--shadow); }
.dn-muc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 14px; }
.dn-chip { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); border: 2px solid transparent; }
.dn-chip.on { border-color: var(--accent, #CFA969); background: #FFF3DC; transform: translateY(-2px); }
.dn-chip .dn-e { font-size: 26px; }
.dn-chip small { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; }
.dn-stk { font-size: 24px; font-weight: 900; letter-spacing: 1px; }
.dn-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.dn-thanks { margin-top: 10px; padding: 12px; border-radius: 16px; background: var(--good-bg, #DCE6D5); font-weight: 800; text-align: center; }
.dn-thanks[hidden] { display: none; }
.dn-free { text-align: center; }
@media (max-width: 420px) { .dn-muc { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .dn-mascot { animation: none; } }

/* Nhiều bộ (Tiếng Anh 30+ bộ): xuống dòng thay vì kéo ngang bị khuất bên phải */
.chips { flex-wrap: wrap; justify-content: center; overflow: visible; }
.chip { padding: 8px 12px; font-size: 15px; }
#donate { scroll-margin-top: 84px; }

/* Ảnh đất sét cắt lưới GIỮ NỀN TRẮNG (29/11/2026): bo góc như thẻ ảnh, không đổ bóng theo hình (sẽ ra bóng vuông) */
.art-img img { border-radius: 14%; }
.art.art-img { filter: none !important; }
