/* ============================================================
   HỌC CÙNG NHÍ — style theo wiki/style_bible.md (ĐÃ KHÓA)
   Vàng nghệ #F5B841 · Teal #2E9E8F · Đỏ gạch #D84B3F
   Mint #A8DCD9 · Lá non #8FC63F · Font tròn đậm (Baloo 2)
   Tông: toy-like, golden-hour, nút "đồ chơi" bấm lún xuống
   ============================================================ */

:root {
  --nghe: #F5B841;
  --nghe-dark: #d99a1b;
  --teal: #2E9E8F;
  --teal-dark: #1f7568;
  --gach: #D84B3F;
  --gach-dark: #b03225;
  --mint: #A8DCD9;
  --mint-light: #cdeeec;
  --la: #8FC63F;
  --la-dark: #6ea32b;
  --cream: #FFF8EA;
  --ink: #3d3a34;
  --ink-soft: #7a746a;
  --white: #ffffff;
  --radius-lg: 28px;
  --radius-md: 20px;
  --font-display: "Baloo 2", "Quicksand", ui-rounded, system-ui, sans-serif;
  --font-body: "Quicksand", "Baloo 2", ui-rounded, system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--mint-light) 0%, var(--mint) 55%, #bfe6c9 100%);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ---------- Cảnh nền Làng Cỏ Xanh ---------- */
.scenery { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.sun {
  position: absolute; top: 6%; right: 8%;
  width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe9ad, var(--nghe));
  box-shadow: 0 0 60px 22px rgba(245, 184, 65, .45);
  animation: sun-breathe 6s ease-in-out infinite;
}
@keyframes sun-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.cloud { position: absolute; font-size: 52px; opacity: .9; filter: drop-shadow(0 4px 6px rgba(46,158,143,.15)); }
.cloud-1 { top: 10%; left: -60px; animation: drift 38s linear infinite; }
.cloud-2 { top: 22%; left: -120px; font-size: 38px; animation: drift 55s linear infinite 8s; }
@keyframes drift { to { transform: translateX(120vw); } }

.hill { position: absolute; border-radius: 50% 50% 0 0; }
.hill-back {
  bottom: -14vh; left: -20vw; width: 90vw; height: 34vh;
  background: linear-gradient(180deg, #a7d55e, var(--la));
  opacity: .75;
}
.hill-front {
  bottom: -18vh; right: -25vw; width: 105vw; height: 36vh;
  background: linear-gradient(180deg, var(--la), var(--la-dark));
}
.lotus {
  position: absolute; bottom: 4vh; left: 6vw; font-size: 44px;
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-4deg);} 50% { transform: translateY(-8px) rotate(4deg);} }

/* ---------- Khung app ---------- */
#app {
  position: relative; z-index: 1;
  max-width: 540px; margin: 0 auto;
  min-height: 100dvh;
  /* chừa lề "tai thỏ"/gờ cong máy (safe-area) ở trái/phải/dưới */
  padding: 18px calc(16px + env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  display: flex; flex-direction: column;
}

.screen { animation: screen-in .35s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Chữ ---------- */
h1, h2, h3, .btn { font-family: var(--font-display); }

.app-title {
  text-align: center; font-size: clamp(28px, 8vw, 40px); font-weight: 800;
  color: var(--teal-dark);
  text-shadow: 0 2px 0 var(--white);
  letter-spacing: .5px;
}
.app-sub { text-align: center; color: var(--ink-soft); font-weight: 600; margin-top: 2px; }

.screen-title {
  font-size: clamp(22px, 6vw, 28px); font-weight: 800; color: var(--teal-dark);
  text-align: center;
}
.screen-sub { text-align: center; color: var(--ink-soft); font-weight: 600; font-size: 14px; }

/* ---------- Nút đồ chơi (bấm = lún) ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: none; cursor: pointer;
  border-radius: var(--radius-md);
  font-weight: 700; font-size: 18px; color: var(--white);
  padding: 16px 20px; min-height: 64px; width: 100%;
  background: var(--teal);
  box-shadow: 0 6px 0 var(--teal-dark), 0 10px 18px rgba(31,117,104,.25);
  transition: transform .08s ease, box-shadow .08s ease;
  touch-action: manipulation;
}
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--teal-dark); }
.btn-nghe { background: var(--nghe); color: #5b4300; box-shadow: 0 6px 0 var(--nghe-dark), 0 10px 18px rgba(217,154,27,.3); }
.btn-nghe:active { box-shadow: 0 1px 0 var(--nghe-dark); }
.btn-gach { background: var(--gach); box-shadow: 0 6px 0 var(--gach-dark), 0 10px 18px rgba(176,50,37,.3); }
.btn-gach:active { box-shadow: 0 1px 0 var(--gach-dark); }
.btn-la { background: var(--la); color: #2c4406; box-shadow: 0 6px 0 var(--la-dark), 0 10px 18px rgba(110,163,43,.3); }
.btn-la:active { box-shadow: 0 1px 0 var(--la-dark); }

.btn-back {
  width: auto; min-height: 48px; padding: 8px 18px; font-size: 15px;
  background: var(--white); color: var(--teal-dark);
  box-shadow: 0 4px 0 #d8d2c4;
  align-self: flex-start;
}
.btn-back:active { box-shadow: 0 1px 0 #d8d2c4; }

/* ---------- Header các màn ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 8px; padding-top: env(safe-area-inset-top); }
.star-count {
  font-family: var(--font-display); font-weight: 800; font-size: 18px;
  background: var(--white); color: var(--nghe-dark);
  border-radius: 999px; padding: 8px 16px;
  box-shadow: 0 4px 0 #e8dfc8;
}

/* ---------- HOME: mascot + danh sách tập ---------- */
.mascot { text-align: center; font-size: clamp(64px, 20vw, 96px); line-height: 1; margin: 8px 0 2px; animation: bob 3.5s ease-in-out infinite; }

.ep-list { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.ep-card {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--white); color: var(--ink);
  border: none; cursor: pointer;
  border-radius: var(--radius-lg); padding: 16px;
  box-shadow: 0 6px 0 #e3dccb, 0 12px 22px rgba(61,58,52,.08);
  transition: transform .08s ease, box-shadow .08s ease;
}
.ep-card:active { transform: translateY(5px); box-shadow: 0 1px 0 #e3dccb; }
.ep-scene {
  flex: 0 0 64px; height: 64px; border-radius: 18px;
  display: grid; place-items: center; font-size: 36px;
  background: linear-gradient(160deg, var(--mint-light), var(--mint));
}
.ep-info { flex: 1; min-width: 0; }
.ep-num { font-size: 12px; font-weight: 700; color: var(--gach); text-transform: uppercase; letter-spacing: 1px; }
.ep-name { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--teal-dark); }
.ep-words { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.ep-stars { font-size: 14px; font-weight: 700; color: var(--nghe-dark); white-space: nowrap; }

/* ---------- Thẻ Học tiếp (Home) ---------- */
.continue-card {
  display: flex; align-items: center; gap: 12px;
  width: 100%; margin: 10px 0 14px; padding: 14px 16px;
  border: none; border-radius: var(--radius-lg); cursor: pointer;
  background: linear-gradient(135deg, var(--nghe) 0%, #ffd97a 100%);
  box-shadow: 0 6px 0 var(--nghe-dark), 0 12px 20px rgba(217, 154, 27, .3);
  font-family: var(--font-display); text-align: left;
  transition: transform .12s ease;
}
.continue-card:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--nghe-dark); }
.cont-scene { font-size: 40px; }
.cont-info { flex: 1; display: flex; flex-direction: column; }
.cont-label { font-size: 13px; font-weight: 800; color: var(--gach); text-transform: uppercase; letter-spacing: .5px; }
.cont-name { font-size: 17px; font-weight: 800; color: var(--ink); }
.cont-go {
  font-size: 20px; color: var(--white); background: var(--teal);
  border-radius: 50%; width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 var(--teal-dark);
}

/* ---------- Chặng phiêu lưu (accordion) ---------- */
.stage-list { display: flex; flex-direction: column; gap: 10px; }
.stage {
  background: rgba(255, 255, 255, .55);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stage-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; cursor: pointer; list-style: none;
  font-family: var(--font-display); user-select: none;
}
.stage-head::-webkit-details-marker { display: none; }
.stage-icon { font-size: 30px; }
.stage-titles { flex: 1; display: flex; flex-direction: column; }
.stage-name { font-size: 16px; font-weight: 800; color: var(--teal-dark); }
.stage-tag { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.stage-prog {
  font-size: 13px; font-weight: 800; color: var(--ink-soft);
  background: var(--cream); border-radius: 999px; padding: 4px 10px;
}
.stage-prog.all { color: var(--white); background: var(--la); }
.stage[open] .stage-head { border-bottom: 2px dashed var(--mint); }
.stage .ep-list { padding: 10px 10px 12px; }

/* ---------- MENU HOẠT ĐỘNG ---------- */
.act-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.act-card {
  border: none; cursor: pointer;
  border-radius: var(--radius-lg);
  padding: 18px 10px 16px; min-height: 128px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--white);
  transition: transform .08s ease, box-shadow .08s ease;
}
.act-card .act-icon { font-size: 42px; line-height: 1; }
.act-flash { background: var(--teal); box-shadow: 0 6px 0 var(--teal-dark); }
.act-listen { background: var(--nghe); color: #5b4300; box-shadow: 0 6px 0 var(--nghe-dark); }
.act-phonics { background: var(--gach); box-shadow: 0 6px 0 var(--gach-dark); }
.act-video { background: var(--la); color: #2c4406; box-shadow: 0 6px 0 var(--la-dark); }
.act-card:active { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }

/* ---------- FLASHCARD ---------- */
.flash-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 16px; }
/* viewport bọc thẻ: cố định bề rộng + touch-action pan-y để swipe ngang KHÔNG phá
   cuộn dọc / pull-to-refresh. Thẻ bên trong rộng 100% viewport. */
.flash-viewport { width: min(86vw, 380px); touch-action: pan-y; }
.flash-card {
  width: 100%; aspect-ratio: 4 / 4.6;
  background: var(--white);
  border-radius: 32px;
  border: none; cursor: pointer;
  box-shadow: 0 10px 0 #e3dccb, 0 18px 30px rgba(61,58,52,.12);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  transition: transform .1s ease;
  position: relative; overflow: hidden;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; will-change: transform;
}
.flash-card:active { transform: scale(.97); }
/* thẻ mới trượt vào theo hướng (v3.0) */
.slide-in-right { animation: card-in-right .3s cubic-bezier(.2,1.2,.4,1); }
.slide-in-left  { animation: card-in-left  .3s cubic-bezier(.2,1.2,.4,1); }
@keyframes card-in-right { from { transform: translateX(60vw) rotate(8deg); opacity: .4; } }
@keyframes card-in-left  { from { transform: translateX(-60vw) rotate(-8deg); opacity: .4; } }
.flash-card::after {
  content: "🔊 Chạm để nghe";
  position: absolute; bottom: 14px;
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
  background: var(--cream); border-radius: 999px; padding: 6px 14px;
}
.flash-emoji { font-size: clamp(90px, 30vw, 140px); line-height: 1.15; }
.flash-en { font-family: var(--font-display); font-size: clamp(34px, 9vw, 46px); font-weight: 800; color: var(--gach); }
.flash-vi { font-size: 17px; font-weight: 600; color: var(--ink-soft); }
.flash-card.pop .flash-emoji { animation: pop .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.22) rotate(-4deg); } }

.flash-nav { display: flex; align-items: center; gap: 16px; width: min(86vw, 380px); }
.flash-nav .btn { flex: 1; font-size: 26px; min-height: 60px; }
.flash-dots { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: min(86vw, 380px); }
.flash-dots span { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 2px var(--teal); }
.flash-dots span.on { background: var(--teal); }

/* ---------- NGHE-CHỌN & QUIZ ---------- */
.listen-stage { display: flex; flex-direction: column; gap: 18px; margin-top: 14px; align-items: center; }
.round-info { font-family: var(--font-display); font-weight: 800; color: var(--teal-dark); font-size: 17px; }
.big-speaker {
  width: 130px; height: 130px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 58px;
  background: radial-gradient(circle at 32% 30%, #ffe9ad, var(--nghe));
  box-shadow: 0 8px 0 var(--nghe-dark), 0 16px 26px rgba(217,154,27,.35);
  transition: transform .08s ease, box-shadow .08s ease;
  animation: speaker-pulse 2.2s ease-in-out infinite;
}
.big-speaker:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--nghe-dark); }
@keyframes speaker-pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.05);} }

.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; }
.choice {
  border: none; cursor: pointer;
  aspect-ratio: 1; border-radius: var(--radius-md);
  font-size: clamp(44px, 13vw, 64px);
  background: var(--white);
  box-shadow: 0 6px 0 #e3dccb, 0 10px 18px rgba(61,58,52,.08);
  transition: transform .08s ease, box-shadow .08s ease;
}
.choice:active { transform: translateY(5px); box-shadow: 0 1px 0 #e3dccb; }
.choice.correct { background: #eaf7d8; box-shadow: 0 6px 0 var(--la-dark); animation: pop .45s cubic-bezier(.2,1.4,.4,1); }
.choice.wrong { animation: shake .4s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-9px) rotate(-2deg); }
  40% { transform: translateX(9px) rotate(2deg); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.round-stars { display: flex; gap: 6px; font-size: 22px; min-height: 28px; }

/* ---------- PHONICS ---------- */
.phonics-stage { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.phon-block {
  background: var(--white); border-radius: var(--radius-lg); padding: 18px;
  box-shadow: 0 6px 0 #e3dccb, 0 12px 22px rgba(61,58,52,.08);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.phon-letter {
  border: none; cursor: pointer;
  width: 110px; height: 110px; border-radius: 26px;
  font-family: var(--font-display); font-size: 58px; font-weight: 800; color: var(--white);
  background: var(--gach);
  box-shadow: 0 7px 0 var(--gach-dark);
  transition: transform .08s ease, box-shadow .08s ease;
}
.phon-letter:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--gach-dark); }
.phon-sound { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--gach); }
.phon-hint { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); text-align: center; }
.phon-words { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.phon-word {
  border: none; cursor: pointer;
  font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--teal-dark);
  background: var(--mint-light); border-radius: 999px; padding: 12px 20px; min-height: 48px;
  box-shadow: 0 4px 0 var(--mint);
}
.phon-word:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--mint); }

/* ---------- VIDEO + QUIZ ---------- */
.video-stage { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.video-frame {
  width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius-md); overflow: hidden;
  background: var(--ink); box-shadow: 0 10px 22px rgba(61,58,52,.25);
}
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-note { font-size: 13px; font-weight: 600; color: var(--ink-soft); text-align: center; }
.coming-soon {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 36px 20px; text-align: center;
  box-shadow: 0 6px 0 #e3dccb;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.coming-soon .cs-emoji { font-size: 64px; animation: bob 3s ease-in-out infinite; }
.coming-soon .cs-text { font-family: var(--font-display); font-weight: 800; font-size: 21px; color: var(--teal-dark); }

/* ---------- MÀN KẾT QUẢ ---------- */
.result-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 26px; text-align: center; }
.result-stars { font-size: 46px; letter-spacing: 4px; animation: pop .6s cubic-bezier(.2,1.4,.4,1); }
.result-msg { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--teal-dark); }
.result-sub { color: var(--ink-soft); font-weight: 600; }

/* ---------- CONFETTI ---------- */
#confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti {
  position: absolute; top: -20px;
  width: 12px; height: 12px; border-radius: 3px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: .6; }
}

/* ---------- Nút "Cài app" (FAB nổi) ---------- */
.install-fab {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 30;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--white);
  background: var(--teal);
  padding: 13px 22px;
  border-radius: 999px;
  box-shadow: 0 6px 0 var(--teal-dark), 0 12px 22px rgba(31, 117, 104, .35);
  animation: fab-bob 2.4s ease-in-out infinite;
}
.install-fab:active {
  transform: translateX(-50%) translateY(4px);
  box-shadow: 0 2px 0 var(--teal-dark), 0 6px 12px rgba(31, 117, 104, .3);
}
@keyframes fab-bob {
  0%, 100% { margin-bottom: 0; }
  50% { margin-bottom: 6px; }
}

/* ---------- Toast "có bản mới" ---------- */
.update-toast {
  position: fixed;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 10px 12px 10px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(46, 158, 143, .28);
  border: 2px solid var(--mint);
  animation: toast-drop .4s ease;
}
.update-btn {
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.94rem;
  color: var(--white);
  background: var(--gach);
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--gach-dark);
}
.update-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gach-dark); }
@keyframes toast-drop {
  from { opacity: 0; top: -40px; }
  to { opacity: 1; top: 14px; }
}

/* ---------- Thanh chuyển hoạt động (cross-nav, đòn A) ---------- */
.act-nav {
  display: flex; gap: 8px; margin: 0 0 14px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.act-nav-chip {
  flex: 1 1 0; min-width: 72px; min-height: 48px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  color: var(--ink-soft); background: var(--white);
  border-radius: 14px; padding: 8px 6px;
  box-shadow: 0 3px 0 #e3dccb;
  transition: transform .08s ease, box-shadow .08s ease;
}
.act-nav-chip .nav-ic { font-size: 22px; line-height: 1; }
.act-nav-chip:active { transform: translateY(3px); box-shadow: 0 1px 0 #e3dccb; }
/* hoạt động hiện tại: tô nổi theo màu của hoạt động, không bấm được */
.act-nav-chip.on { color: var(--white); cursor: default; }
.act-nav-chip.on.nav-flash { background: var(--teal); box-shadow: 0 3px 0 var(--teal-dark); }
.act-nav-chip.on.nav-listen { background: var(--nghe); color: #5b4300; box-shadow: 0 3px 0 var(--nghe-dark); }
.act-nav-chip.on.nav-phonics { background: var(--gach); box-shadow: 0 3px 0 var(--gach-dark); }
.act-nav-chip.on.nav-video { background: var(--la); color: #2c4406; box-shadow: 0 3px 0 var(--la-dark); }

/* ---------- Dấu hoàn thành (đòn C) ---------- */
.ep-info { display: flex; flex-direction: column; gap: 2px; }
.ep-done {
  align-self: flex-start; margin-top: 3px;
  font-size: 12px; font-weight: 800; color: var(--la-dark);
  background: #eef7dd; border-radius: 999px; padding: 1px 9px;
}
.ep-done.all { color: var(--white); background: var(--la); }
.menu-prog { font-weight: 700; color: var(--la-dark); }
.act-card { position: relative; }
.done-badge {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 900; color: var(--la-dark);
  background: var(--white); box-shadow: 0 2px 0 rgba(0,0,0,.12);
}

/* ---------- Nút "Ba mẹ" + "Thông tin" trên topbar Home ---------- */
.topbar-left { display: flex; gap: 8px; align-items: center; }
.btn-parents {
  width: auto; min-height: 48px; padding: 7px 16px; font-size: 14px;
  background: var(--white); color: var(--teal-dark);
  box-shadow: 0 4px 0 #d8d2c4;
}
.btn-parents:active { box-shadow: 0 1px 0 #d8d2c4; }
.btn-info {
  width: auto; min-height: 48px; padding: 7px 12px; font-size: 16px;
  background: var(--white); box-shadow: 0 4px 0 #d8d2c4;
}
.btn-info:active { box-shadow: 0 1px 0 #d8d2c4; }

/* ---------- Banner "mở bằng app" (đã cài, đang xem bằng tab) ---------- */
.openapp-hint {
  position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  background: var(--teal-dark); color: var(--white);
  border-radius: 14px; padding: 11px 12px 11px 15px;
  box-shadow: 0 6px 20px rgba(30,114,104,.35);
  font-size: 13.5px; font-weight: 600; line-height: 1.45;
  animation: openapp-in .35s ease;
}
.openapp-hint strong { font-weight: 800; }
.openapp-x {
  flex-shrink: 0; width: 30px; height: 30px; border: none; cursor: pointer;
  background: rgba(255,255,255,.18); color: var(--white);
  border-radius: 50%; font-size: 14px; line-height: 1;
}
@keyframes openapp-in { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Số phiên bản dưới chân Home ---------- */
.app-version {
  text-align: center; font-size: 12px; font-weight: 600;
  color: var(--ink-soft); opacity: .7; margin: 18px 0 4px;
}

/* ---------- Màn Thông tin / Về app ---------- */
.about-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 4px; text-align: center; }
.about-name { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--teal-dark); }
.about-ver {
  font-size: 13px; font-weight: 800; color: var(--gach);
  background: #fde9e5; border-radius: 999px; padding: 4px 14px;
}
.about-desc { font-size: 15px; font-weight: 500; color: var(--ink); line-height: 1.6; max-width: 460px; }
.about-facts { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 460px; margin: 4px 0; }
.about-fact {
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  background: var(--white); border-radius: var(--radius-md);
  padding: 11px 14px; text-align: left;
  box-shadow: 0 3px 0 #e3dccb;
}

/* ---------- Màn kết quả: lời khích lệ tập cuối ---------- */
.result-endnote {
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  color: var(--la-dark); background: #eef7dd;
  border-radius: var(--radius-md); padding: 12px 16px; width: 100%; text-align: center;
}

/* ---------- GÓC BA MẸ (đòn D) ---------- */
.parents-stage { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.stat-row { display: flex; gap: 10px; }
.stat {
  flex: 1; background: var(--white); border-radius: var(--radius-md);
  padding: 16px 8px; text-align: center;
  box-shadow: 0 5px 0 #e3dccb, 0 10px 18px rgba(61,58,52,.06);
}
.stat-num { display: block; font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--teal-dark); }
.stat-lbl { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-top: 2px; }
.parents-link { text-decoration: none; }
.parents-note { font-size: 13px; font-weight: 600; color: var(--ink-soft); text-align: center; line-height: 1.5; margin-top: 2px; }

/* ---------- FREEMIUM: khóa · cổng ba mẹ · mở khóa (v3.1) ---------- */
/* Khóa: làm mờ CHỮ thôi, KHÔNG grayscale (emoji cảnh vẫn tươi, đỡ buồn cho bé). */
.ep-card.locked .ep-info { opacity: .5; }
.ep-lock { font-size: 22px; white-space: nowrap; }
/* lắc dùng chung keyframes shake có sẵn (sai cổng / sai mã) */
.shake { animation: shake .4s ease; }

.teaser-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 18px; text-align: center; }
.teaser-lock { font-size: 64px; }
.teaser-msg { font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.55; max-width: 420px; }
.teaser-msg strong { color: var(--nghe-dark); }

.gate-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 20px; text-align: center; }
.gate-q { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--teal-dark); }
.gate-q strong { color: var(--gach); font-size: 26px; }
.gate-input {
  width: min(70vw, 220px); min-height: 48px; font-size: 22px; text-align: center;
  font-family: var(--font-display); font-weight: 800; color: var(--ink);
  border: 3px solid var(--mint); border-radius: var(--radius-md); padding: 10px 14px;
  background: var(--white); outline: none;
}
.gate-input:focus { border-color: var(--teal); }
.gate-note { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }

.unlock-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 10px; text-align: center; }
.unlock-title { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--teal-dark); }
.unlock-sub { font-size: 14px; font-weight: 600; color: var(--ink-soft); max-width: 420px; }
.qr-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; width: 100%; }
.qr-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qr-img { width: min(42vw, 190px); height: auto; border-radius: 12px; background: var(--white); box-shadow: 0 4px 0 #e3dccb; }
.qr-cap { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.unlock-price {
  font-family: var(--font-display); font-weight: 800; font-size: 28px; color: var(--gach);
  background: #fde9e5; border-radius: 999px; padding: 6px 22px;
}
.unlock-steps { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.55; max-width: 420px; }
.code-entry { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; margin-top: 6px; }
.code-input {
  width: 100%; min-height: 48px; font-size: 18px; text-align: center; letter-spacing: 1px;
  font-family: var(--font-display); font-weight: 700; color: var(--ink);
  border: 3px solid var(--mint); border-radius: var(--radius-md); padding: 10px 14px;
  background: var(--white); outline: none; text-transform: uppercase;
}
.code-input:focus { border-color: var(--teal); }
.code-msg { font-size: 14px; font-weight: 700; min-height: 20px; }
.code-msg.err { color: var(--gach); }
.code-msg.ok { color: var(--teal-dark); }
.unlock-done { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--teal-dark); }
.parents-premium {
  font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--la-dark);
  background: #eef7dd; border-radius: var(--radius-md); padding: 14px 16px; text-align: center;
}

/* ---------- Góc ba mẹ: báo cáo sao theo chặng + email (v3.2) ---------- */
.pstage-list {
  background: var(--white); border-radius: var(--radius-md);
  padding: 8px 4px; box-shadow: 0 5px 0 #e3dccb, 0 10px 18px rgba(61,58,52,.06);
}
.pstage-head {
  font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--teal-dark);
  padding: 6px 12px 8px;
}
.pstage-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-top: 1px dashed var(--mint-light);
}
.pstage-ic { font-size: 22px; flex: 0 0 auto; }
.pstage-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: var(--ink); }
.pstage-stars { font-size: 13px; font-weight: 800; color: var(--nghe-dark); white-space: nowrap; }
/* email dùng lại .code-input nhưng KHÔNG viết hoa (email phân biệt hoa/thường) */
.email-field { text-transform: none; letter-spacing: normal; }

/* ---------- Responsive nhỏ ---------- */
@media (max-width: 380px) {
  .act-grid { grid-template-columns: 1fr; }
  .act-card { min-height: 96px; flex-direction: row; }
  .install-fab { font-size: 0.94rem; padding: 12px 18px; }
  .update-toast { font-size: 0.9rem; padding: 9px 10px 9px 15px; }
  .act-nav-chip { font-size: 11px; min-width: 64px; }
}
