:root {
  --ink: #2b2150;
  --ink-soft: #6b6391;
  --pink: #ff5d8f;
  --yellow: #ffb703;
  --teal: #3ec1d3;
  --green: #8ac926;
  --purple: #9b5de5;
  --orange: #ff8c42;
  --card: #ffffff;
  --radius: 28px;
  --shadow: 0 10px 0 rgba(43, 33, 80, .12), 0 18px 30px rgba(43, 33, 80, .12);
  --font: 'Baloo 2', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #7fd3ff 0%, #bfeaff 55%, #e9f9ff 100%);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .6s ease;
  -webkit-tap-highlight-color: transparent;
}
body[data-theme="night"] { background: linear-gradient(180deg, #1b1446 0%, #3a2a7a 60%, #6a4fb3 100%); color: #fff; }
body[data-theme="grown"] { background: #f3f1fb; }
button { font-family: inherit; cursor: pointer; }
img { display: block; }
.ico { flex: none; vertical-align: middle; }
.ico .f { fill: currentColor; stroke: none; }
.art-ico { flex: none; display: inline-block; vertical-align: middle; overflow: visible; }
button, a { -webkit-user-select: none; user-select: none; }
.big-btn, .text-btn, .read-btn, .pcard button, .tip-link, .file-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

/* ---------- Nền trời: mây, bóng bay, sao, đồi ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; transition: opacity .5s; }
body[data-theme="grown"] .sky, body[data-theme="night"] .sky { opacity: 0; }
.cloud {
  position: absolute; width: 180px; height: 56px; background: #fff; border-radius: 60px; opacity: .9;
  animation: drift linear infinite;
}
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 80px; height: 80px; top: -40px; left: 28px; }
.cloud::after { width: 60px; height: 60px; top: -26px; left: 92px; }
.c1 { top: 12%; animation-duration: 55s; }
.c2 { top: 30%; transform: scale(.7); animation-duration: 75s; animation-delay: -30s; }
.c3 { top: 6%; transform: scale(.5); animation-duration: 95s; animation-delay: -60s; }
@keyframes drift { from { left: -220px; } to { left: 110%; } }
.balloon { position: absolute; bottom: -80px; animation: rise 22s ease-in infinite; }
.b1 { left: 8%; }
.b2 { left: 86%; animation-delay: -11s; filter: hue-rotate(160deg); }
@keyframes rise {
  0% { transform: translate(0, 0) rotate(-6deg); }
  50% { transform: translate(24px, -60vh) rotate(6deg); }
  100% { transform: translate(-10px, -120vh) rotate(-6deg); }
}
.float-star { position: absolute; animation: twinkle 3s ease-in-out infinite; }
.s1 { top: 20%; left: 70%; } .s2 { top: 44%; left: 14%; animation-delay: -1s; } .s3 { top: 60%; left: 92%; animation-delay: -2s; }
@keyframes twinkle { 0%, 100% { transform: scale(.7) rotate(0); opacity: .5; } 50% { transform: scale(1.15) rotate(20deg); opacity: 1; } }
.hills { position: absolute; bottom: 0; left: 0; width: 100%; height: 120px; }

/* ---------- Chuyển màn ---------- */
#app { position: relative; z-index: 1; min-height: 100vh; }
.screen { position: relative; }
.screen-enter { animation: screenIn .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.screen-leave { position: absolute; inset: 0; animation: screenOut .28s ease forwards; pointer-events: none; }
@keyframes screenIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes screenOut { to { opacity: 0; transform: scale(1.03); } }

/* ---------- Linh vật ---------- */
.mascot { position: relative; width: 84px; height: 84px; flex: none; }
.mascot.big { width: 150px; height: 150px; }
.mascot svg { width: 100%; height: 100%; overflow: visible; }
.mascot.bob { animation: bob 2.4s ease-in-out infinite; }
.mascot.sway { animation: sway 4s ease-in-out infinite; }
.mascot-eyes { transform-origin: 60px 58px; animation: blink 4.5s infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
@keyframes sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.zzz { position: absolute; right: -6px; top: 4px; font-weight: 800; color: #fff; opacity: 0; animation: zzz 3s ease-out infinite; }
.z1 { font-size: 16px; } .z2 { font-size: 22px; animation-delay: 1s; } .z3 { font-size: 30px; animation-delay: 2s; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 10px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(34px, -50px); } }

/* ---------- Màn chính của bé ---------- */
.home { padding: 20px clamp(16px, 4vw, 40px) 160px; max-width: 1280px; margin: 0 auto; }
.kid-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.hello { display: flex; align-items: center; gap: 14px; }
.hello h1 { margin: 0; font-size: clamp(24px, 4vw, 38px); line-height: 1.1; text-shadow: 0 3px 0 #fff; }
.hello p { margin: 2px 0 0; font-size: 18px; color: var(--ink-soft); font-weight: 600; }
.kid-top-right { display: flex; align-items: center; gap: 12px; }

.time-pill {
  display: flex; align-items: center; gap: 10px; background: #fff; padding: 8px 16px 8px 10px;
  border-radius: 999px; box-shadow: var(--shadow); font-size: 18px; white-space: nowrap;
}
.time-pill .sun { animation: spin 14s linear infinite; }
.time-pill.low .sun { animation: bob 1.5s ease-in-out infinite; }
.time-bar { width: 90px; height: 14px; background: #ffe7a3; border-radius: 99px; overflow: hidden; }
.time-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--orange)); border-radius: 99px; transition: width .8s ease; }
.time-pill.low .time-bar i { background: var(--pink); animation: pulse 1s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; } }

.round-btn {
  position: relative; width: 56px; height: 56px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .85); color: var(--ink);
  display: grid; place-items: center; box-shadow: 0 4px 0 rgba(0, 0, 0, .08); touch-action: none; text-decoration: none; flex: none;
  transition: transform .15s;
}
.round-btn:active { transform: scale(.92); }
.sticker-btn { width: auto; padding: 0 14px 0 8px; border-radius: 99px; display: inline-flex; gap: 4px; font-size: 20px; }
.sticker-btn .art-ico { animation: spin 16s linear infinite; }
.avatar-btn { background: #fff; box-shadow: 0 4px 0 var(--c); }
.round-btn .ring { position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(var(--purple) var(--p, 0%), transparent 0); -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%); }
@property --p { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
.round-btn.holding .ring { animation: fillRing var(--hold-ms, 2000ms) linear forwards; }
.round-btn.holding { transform: scale(.94); }
@keyframes fillRing { to { --p: 100%; } }
.round-btn.corner { position: fixed; top: 16px; right: 16px; z-index: 5; background: rgba(255, 255, 255, .15); color: #fff; }

.chips { display: flex; gap: 12px; overflow-x: auto; padding: 22px 4px 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: flex; align-items: center; gap: 8px; flex: none; border: 4px solid transparent; background: #fff;
  padding: 6px 18px 6px 6px; border-radius: 999px; font-size: 18px; font-weight: 700; color: var(--ink);
  box-shadow: 0 6px 0 rgba(43, 33, 80, .12); animation: popIn .5s cubic-bezier(.2, 1.6, .4, 1) both;
  animation-delay: calc(var(--i) * 60ms); transition: transform .2s;
}
.chip img, .chip-art { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: #fff4d6; flex: none; }
.chip:hover { transform: translateY(-3px); }
.chip:active { transform: scale(.94); }
.chip.active { border-color: var(--purple); background: #f3e9ff; animation: popIn .5s both, jelly .6s .1s; }
@keyframes popIn { from { opacity: 0; transform: scale(.4) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes jelly { 30% { transform: scale(1.12, .9); } 50% { transform: scale(.94, 1.06); } 70% { transform: scale(1.04, .97); } 100% { transform: none; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 26px; margin-top: 8px; }
.vcard {
  border: none; background: var(--card); padding: 10px 10px 16px; border-radius: var(--radius); text-align: left;
  box-shadow: 0 8px 0 var(--c), 0 18px 28px rgba(43, 33, 80, .15); color: var(--ink);
  animation: popIn .55s cubic-bezier(.2, 1.5, .4, 1) both; animation-delay: calc(min(var(--i), 8) * 70ms);
  transition: transform .25s cubic-bezier(.2, 1.6, .4, 1), box-shadow .25s;
}
.vcard:hover { transform: translateY(-8px) rotate(-1.5deg); }
.vcard:nth-child(even):hover { transform: translateY(-8px) rotate(1.5deg); }
.vcard:active { transform: scale(.95); box-shadow: 0 3px 0 var(--c); }
.vcard.launch { animation: launch .4s ease-in forwards; }
@keyframes launch { 40% { transform: scale(1.08); } 100% { transform: scale(.2) translateY(-60px); opacity: 0; } }
.vthumb { position: relative; display: block; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 9; background: #eee; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.vcard:hover .vthumb img { transform: scale(1.08); }
.vplay {
  position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--c); display: grid; place-items: center; padding-left: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25); animation: breathe 2s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.12); } }
.vtitle { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 20px; font-weight: 700; line-height: 1.2; margin: 12px 6px 0; }
.vch { display: block; margin: 4px 6px 0; font-size: 15px; color: var(--ink-soft); font-weight: 600; }

.empty { text-align: center; padding: 60px 16px; display: flex; flex-direction: column; align-items: center; }
.empty h2 { font-size: 34px; margin: 16px 0 0; }
.empty p { font-size: 20px; margin: 6px 0; color: var(--ink-soft); }
.empty .hint { font-size: 15px; }

.big-btn {
  margin-top: 18px; border: none; background: var(--yellow); color: var(--ink); font-size: 22px; font-weight: 800;
  padding: 12px 28px; border-radius: 999px; box-shadow: 0 6px 0 #d18f00; transition: transform .15s;
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #d18f00; }

/* ---------- Màn xem video ---------- */
.watch { padding: 16px clamp(12px, 3vw, 32px) 160px; max-width: 1180px; margin: 0 auto; }
.watch-top { display: flex; align-items: center; gap: 14px; }
.home-btn {
  flex: none; width: 64px; height: 64px; border-radius: 50%; border: none; background: #fff; color: var(--ink); display: grid; place-items: center;
  box-shadow: 0 6px 0 var(--teal); animation: popIn .5s both; transition: transform .15s;
}
.home-btn:hover { transform: rotate(-10deg) scale(1.06); }
.home-btn:active { transform: scale(.9); }
.watch-title { flex: 1; min-width: 0; margin: 0; font-size: clamp(20px, 3vw, 30px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 3px 0 #fff; }
.stage { margin-top: 16px; }
.player-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: 32px; overflow: hidden; background: #1b1446;
  border: 8px solid #fff; box-shadow: 0 10px 0 var(--pink), 0 24px 40px rgba(43, 33, 80, .25);
  animation: popIn .6s cubic-bezier(.2, 1.3, .4, 1) both;
}
.player-frame iframe, #yt-player { position: absolute; inset: 0; width: 100%; height: 100%; }
.player-shield {
  position: absolute; inset: 0; z-index: 2; border: none; padding: 0; background: transparent;
  display: grid; place-items: center; transition: background .25s;
}
.player-shield.paused { background: rgba(27, 20, 70, .72); }
.big-play {
  width: 110px; height: 110px; border-radius: 50%; background: #fff; color: var(--pink); padding-left: 8px;
  display: grid; place-items: center; box-shadow: 0 8px 0 var(--pink); opacity: 0; transform: scale(.5); transition: opacity .25s, transform .35s cubic-bezier(.2, 1.6, .4, 1);
}
.player-shield.paused .big-play { opacity: 1; transform: none; animation: breathe 1.8s ease-in-out infinite; }
.player-frame:fullscreen { border: none; border-radius: 0; }
.controls { display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.ctl {
  flex: none; width: 60px; height: 60px; border: none; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center;
  box-shadow: 0 6px 0 var(--purple); transition: transform .15s;
}
.ctl:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--purple); }
.progress { position: relative; flex: 1; height: 18px; background: #fff; border-radius: 99px; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .1); }
.progress i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--teal)); transition: width .5s linear; }
.progress .knob { position: absolute; left: 0; top: 50%; transform: translate(-50%, -62%); transition: left .5s linear; animation: bob 1.2s ease-in-out infinite; }
.player-loading, .ended-overlay {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; text-align: center; background: radial-gradient(circle at 50% 40%, #5a3fb0, #1b1446); font-size: 20px; padding: 16px;
}
.player-loading[hidden], .ended-overlay[hidden], .eye-break[hidden] { display: none; }
.ended-overlay { animation: screenIn .5s both; }
.ended-overlay h2 { margin: 8px 0 14px; font-size: clamp(22px, 3vw, 34px); }
.ended-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.row-title { margin: 30px 0 10px; font-size: 26px; text-shadow: 0 3px 0 #fff; }
.row-subtitle { margin: 26px 0 10px; font-size: 22px; font-weight: 800; color: var(--ink); text-shadow: 0 2px 0 #fff; display: flex; align-items: center; gap: 8px; }
.next-row { display: flex; gap: 18px; overflow-x: auto; padding: 6px 4px 18px; scrollbar-width: none; }
.ncard {
  flex: none; width: 210px; border: none; background: #fff; border-radius: 22px; padding: 8px 8px 12px; text-align: left; color: var(--ink);
  box-shadow: 0 6px 0 var(--purple); animation: popIn .5s both; animation-delay: calc(var(--i) * 70ms); transition: transform .2s;
}
.ended-row .ncard { width: 170px; }
.ncard:hover { transform: translateY(-6px) rotate(-2deg); }
.ncard:active { transform: scale(.95); }
.ncard img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; }
.ncard span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 700; font-size: 16px; line-height: 1.2; margin: 8px 4px 0; }

/* ---------- Màn khóa ---------- */
.lock { min-height: 100vh; display: grid; place-items: center; padding: 60px 16px; text-align: center; overflow: hidden; }
.night-sky { position: fixed; inset: 0; pointer-events: none; }
.star { position: absolute; width: 6px; height: 6px; background: #fff; border-radius: 50%; box-shadow: 0 0 10px #fff; animation: twinkle 2.4s ease-in-out infinite; }
.moon { position: absolute; top: 8%; right: 12%; animation: bob 6s ease-in-out infinite; filter: drop-shadow(0 0 30px rgba(255, 240, 170, .6)); }
.lock-body { position: relative; display: flex; flex-direction: column; align-items: center; max-width: 560px; }
.lock h1 { font-size: clamp(34px, 6vw, 54px); margin: 18px 0 4px; animation: popIn .6s .2s both; }
.lock p { font-size: 21px; margin: 4px 0; opacity: .9; }
.lock .hours { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .15); padding: 8px 18px; border-radius: 99px; margin-top: 10px; }
.tips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.tips span {
  display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--ink); padding: 6px 16px 6px 8px; border-radius: 99px; font-weight: 700; font-size: 18px;
  animation: popIn .5s both, floaty 3s ease-in-out infinite; animation-delay: calc(.4s + var(--i) * 120ms), calc(var(--i) * .5s);
}
@keyframes floaty { 50% { transform: translateY(-6px); } }

/* ---------- Cổng phụ huynh ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 70px 16px 40px; }
.gate .back { position: fixed; top: 16px; left: 16px; }
.gate-card { background: #fff; border-radius: 32px; padding: 30px 28px; width: min(360px, 100%); text-align: center; box-shadow: 0 20px 50px rgba(43, 33, 80, .15); }
.gate-icon { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: #f1ecff; color: var(--purple); animation: bob 3s ease-in-out infinite; }
.gate-card h1 { margin: 6px 0 0; font-size: 28px; }
.gate-card .sub { margin: 2px 0 16px; color: var(--ink-soft); }
.dots { display: flex; justify-content: center; gap: 16px; margin-bottom: 8px; }
.dots i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--purple); transition: background .15s, transform .15s; }
.dots i.on { background: var(--purple); transform: scale(1.15); }
.gate-msg { min-height: 1.4em; color: #d62c5b; margin: 6px 0 10px; font-weight: 600; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.key { height: 64px; display: grid; place-items: center; border: none; border-radius: 20px; background: #f1ecff; font-size: 26px; font-weight: 700; color: var(--ink); transition: transform .1s, background .1s; }
.key:hover { background: #e5dcff; }
.key:active { transform: scale(.92); background: #d6c7ff; }
.gate-card.shake { animation: shake .45s; }
.gate-card.unlocked { animation: unlock .45s forwards; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
@keyframes unlock { to { transform: scale(1.05); opacity: 0; } }

/* ---------- Cài đặt phụ huynh ---------- */
.parent { padding: 16px clamp(16px, 4vw, 40px) 60px; max-width: 1100px; margin: 0 auto; font-size: 16px; }
.parent-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.parent-top h1 { margin: 0; font-size: 26px; }
.text-btn { min-height: 44px; border: none; background: #fff; color: var(--ink); font-size: 16px; font-weight: 700; padding: 8px 16px; border-radius: 99px; box-shadow: 0 2px 8px rgba(43, 33, 80, .1); }
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.pgrid > * { min-width: 0; } /* thẻ co theo màn hình nhỏ, không đẩy trang cuộn ngang */
.pcard input[type="checkbox"] { width: 24px; height: 24px; flex: none; accent-color: var(--purple); }
@media (max-width: 700px) { .pgrid { grid-template-columns: 1fr; } }
.pcard { background: #fff; border-radius: 22px; padding: 18px 20px; box-shadow: 0 4px 16px rgba(43, 33, 80, .07); animation: popIn .4s both; }
.pcard.wide { grid-column: 1 / -1; }
.pcard h2 { margin: 0 0 10px; font-size: 20px; }
.pcard h3 { margin: 14px 0 4px; font-size: 16px; color: var(--ink-soft); }
.pcard input[type="text"], .pcard input[type="password"], .pcard input[type="number"], .pcard input[type="time"] {
  font: inherit; width: 100%; padding: 9px 12px; margin: 4px 0 10px; border: 2px solid #e2dcf5; border-radius: 12px; background: #fcfbff;
}
.pcard input:focus { outline: none; border-color: var(--purple); }
.pcard .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pcard .row label { flex: 1; min-width: 120px; }
.pcard label { display: block; font-weight: 600; }
.pcard button { min-height: 44px; font-size: 15px; font-weight: 700; border: none; border-radius: 12px; padding: 9px 16px; background: var(--purple); color: #fff; }
.pcard button:hover { filter: brightness(1.08); }
.pcard button.ghost { background: #f1ecff; color: var(--ink); }
.pcard button.ghost.danger { color: #d62c5b; }
.muted { color: var(--ink-soft); margin: 4px 0 10px; }
.status { min-height: 1.3em; margin: 8px 0 0; color: #1f8a4c; font-weight: 600; }
.status.error { color: #d62c5b; }
.item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f0ecfa; }
.item img { width: 80px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; flex: none; }
.item span { flex: 1; min-width: 0; }
.item b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item small { color: var(--ink-soft); }
.bar { height: 12px; border-radius: 99px; background: #f1ecff; overflow: hidden; margin: 6px 0 12px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--purple)); }
.switch { display: flex !important; align-items: center; gap: 8px; margin-top: 14px; }

/* ---------- Trang chủ: lưới các khu ---------- */
.hub { padding: 20px clamp(16px, 4vw, 40px) 60px; max-width: 1100px; margin: 0 auto; }
.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 3vw, 28px); margin-top: clamp(18px, 4vh, 40px); }
.hub-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  min-height: clamp(150px, 28vh, 260px); padding: 20px; border-radius: 32px; background: #fff; color: var(--ink);
  text-decoration: none; box-shadow: 0 10px 0 var(--c), 0 20px 34px rgba(43, 33, 80, .14);
  animation: popIn .5s both; animation-delay: calc(var(--i) * 90ms); transition: transform .2s;
}
.hub-tile:hover { transform: translateY(-6px) rotate(-1.5deg); }
.hub-tile:active { transform: scale(.95); }
.hub-tile.launch { animation: launch .35s ease-in forwards; }
.hub-icon { width: clamp(84px, 14vh, 128px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c); }
.hub-icon .ico { width: 55%; height: 55%; }
.hub-label { font-size: clamp(22px, 3.4vw, 34px); font-weight: 800; }
/* Nút về trang chủ ở đầu mỗi khu (thay cho linh vật) */
.hello .back-home { text-decoration: none; }

/* ---------- Khu hoạt động (tô màu / truyện) ---------- */
.activity { padding: 20px clamp(16px, 4vw, 40px) 160px; max-width: 1280px; margin: 0 auto; }
.activity .grid { margin-top: 20px; }
.pcard-kid, .book, .chibi-card {
  border: none; background: #fff; padding: 12px 12px 16px; border-radius: var(--radius); text-align: left; color: var(--ink);
  box-shadow: 0 8px 0 var(--c), 0 18px 28px rgba(43, 33, 80, .15);
  /* Chỉ ~8 thẻ đầu xuất hiện nối đuôi; thẻ sau hiện ngay (100 tranh không phải chờ 8 giây khi cuộn) */
  animation: popIn .55s cubic-bezier(.2, 1.5, .4, 1) both; animation-delay: calc(min(var(--i), 8) * 80ms);
  transition: transform .25s cubic-bezier(.2, 1.6, .4, 1);
}
.pcard-kid:hover, .book:hover, .chibi-card:hover { transform: translateY(-8px) rotate(-1.5deg); }
.pcard-kid:active, .book:active, .chibi-card:active { transform: scale(.95); }
.pcard-kid.launch, .chibi-card.launch { animation: launch .4s ease-in forwards; }
.pic-thumb { position: relative; display: block; border-radius: 20px; overflow: hidden; background: #fff; }

/* Tab mức & Chip chủ đề thư viện tô màu */
.level-tabs {
  display: flex; gap: 12px; margin: 16px 0 10px; overflow-x: auto; padding: 4px 2px 10px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.level-tabs::-webkit-scrollbar { display: none; }
.level-tab {
  flex: 1; min-width: 130px; min-height: 58px; padding: 10px 16px; border-radius: 22px;
  border: 3px solid rgba(43, 33, 80, .1); background: #fff; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; transition: all .2s cubic-bezier(.2, 1.6, .4, 1); box-shadow: 0 4px 0 rgba(43, 33, 80, .1);
}
.level-tab:hover { transform: translateY(-2px); }
.level-tab:active { transform: scale(.96); }
.level-tab[aria-selected="true"], .level-tab.active {
  background: var(--purple, #7b2cbf); color: #fff; border-color: var(--purple, #7b2cbf);
  box-shadow: 0 6px 0 rgba(43, 33, 80, .25); transform: translateY(-3px);
}
.level-tab .tab-stars { display: flex; gap: 2px; align-items: center; }
.level-tab .tab-label { font-size: 16px; font-weight: 800; line-height: 1.2; }
.level-tab .tab-count { font-size: 13px; font-weight: 700; opacity: .8; }
.level-tab[aria-selected="true"] .tab-count { opacity: .95; }

/* Chủ đề: nhiều thì xuống dòng, không cuộn ngang */
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 18px; padding: 2px 2px 6px; }
.cat-chip {
  min-height: 44px;
  padding: 8px 18px; border-radius: 99px; border: 2px solid rgba(43, 33, 80, .12);
  background: #fff; color: var(--ink); font-size: 15px; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: all .2s; box-shadow: 0 2px 0 rgba(43, 33, 80, .06);
}
.cat-chip:hover { border-color: var(--ink); transform: translateY(-1px); }
.cat-chip:active { transform: scale(.95); }
.cat-chip[aria-pressed="true"], .cat-chip.active {
  background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 4px 0 rgba(43, 33, 80, .2);
}

.empty-level {
  padding: 44px 20px; text-align: center; color: var(--ink-soft); font-size: 18px; font-weight: 700;
  grid-column: 1 / -1; background: #fff; border-radius: var(--radius); box-shadow: 0 6px 0 rgba(43, 33, 80, .1);
}

/* Ảnh tranh / thẻ tranh */
.art { display: block; width: 100%; height: auto; }
/* Nháy nhẹ khi đổ màu (tranh chibi: cả khung; tranh bố mẹ gửi: canvas đã gồm nét) */
@keyframes regionPop { 40% { transform: scale(1.06); } 100% { transform: none; } }

/* Màn tô màu */
.color { padding: 16px clamp(12px, 3vw, 32px) 40px; max-width: 1100px; margin: 0 auto; }
.color .ctl { box-shadow: 0 6px 0 var(--yellow); }
.color-stage { display: flex; gap: 24px; margin-top: 18px; align-items: flex-start; }
.canvas-wrap {
  position: relative; flex: 1; width: 100%; max-width: min(640px, 72vh); margin: 0 auto; background: #fff; border-radius: 32px; padding: 14px;
  box-shadow: 0 10px 0 var(--yellow), 0 24px 40px rgba(43, 33, 80, .2); animation: popIn .6s both;
}
.palette {
  display: grid; grid-template-columns: repeat(3, 56px); gap: 12px; background: #fff; padding: 16px; border-radius: 28px;
  box-shadow: 0 8px 0 rgba(43, 33, 80, .12);
}
.swatch {
  width: 56px; height: 56px; border-radius: 50%; border: 4px solid #fff; background: var(--sw, #fff); color: var(--ink); display: grid; place-items: center; padding: 0;
  box-shadow: 0 0 0 2px rgba(43, 33, 80, .15), 0 4px 0 rgba(43, 33, 80, .2);
  animation: popIn .4s both; animation-delay: calc(var(--i) * 30ms); transition: transform .2s cubic-bezier(.2, 1.6, .4, 1);
}
.swatch:hover { transform: scale(1.1); }
.swatch.active { transform: scale(1.18); box-shadow: 0 0 0 4px var(--ink), 0 6px 0 rgba(43, 33, 80, .25); animation: jelly .6s; }
.swatch.eraser { background: repeating-linear-gradient(45deg, #fff 0 8px, #f1ecff 8px 16px); }

/* Danh sách truyện */
.book.open { animation: bookOpen .45s ease-in forwards; }
@keyframes bookOpen { 50% { transform: perspective(600px) rotateY(-25deg) scale(1.05); } 100% { transform: perspective(600px) rotateY(-80deg) scale(.6); opacity: 0; } }
.book-cover { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden; border-left: 12px solid var(--c); }
.book-emoji { animation: bob 2.6s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .12)); }

/* Màn đọc truyện */
.story { padding: 16px clamp(12px, 3vw, 32px) 40px; max-width: 1000px; margin: 0 auto; }
.reader { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.page-holder { flex: 1; min-width: 0; perspective: 1400px; touch-action: pan-y; }
.turn {
  flex: none; width: 64px; height: 64px; border-radius: 50%; border: none; background: #fff; color: var(--ink); display: grid; place-items: center;
  box-shadow: 0 6px 0 var(--teal); transition: transform .15s, opacity .2s;
}
.turn:hover:not(:disabled) { transform: scale(1.08); }
.turn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--teal); }
.turn:disabled { opacity: .3; cursor: default; }
.page-card { background: #fff; border-radius: 32px; overflow: hidden; box-shadow: 0 10px 0 var(--c), 0 24px 40px rgba(43, 33, 80, .2); transform-origin: left center; }
.page-card.flip-next { animation: flipNext .55s cubic-bezier(.2, .9, .3, 1) both; }
.page-card.flip-prev { animation: flipPrev .55s cubic-bezier(.2, .9, .3, 1) both; transform-origin: right center; }
@keyframes flipNext { from { transform: rotateY(-70deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes flipPrev { from { transform: rotateY(70deg); opacity: 0; } to { transform: none; opacity: 1; } }
.scene { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.actor { position: absolute; transform: translate(-50%, -50%); line-height: 1; cursor: pointer; user-select: none; }
.actor > span { display: inline-block; animation: popIn .6s both; animation-delay: calc(var(--d) + .2s); }
.actor.a-hop > span { animation: popIn .6s both, hop 1.4s ease-in-out infinite; animation-delay: calc(var(--d) + .2s), var(--d); }
.actor.a-float > span { animation: popIn .6s both, floaty 3s ease-in-out infinite; animation-delay: calc(var(--d) + .2s), var(--d); }
.actor.a-sway > span { animation: popIn .6s both, sway 3s ease-in-out infinite; animation-delay: calc(var(--d) + .2s), var(--d); }
.actor.a-spin > span { animation: popIn .6s both, spin 12s linear infinite; animation-delay: calc(var(--d) + .2s), 0s; }
.actor.a-pulse > span { animation: popIn .6s both, breathe 1.6s ease-in-out infinite; animation-delay: calc(var(--d) + .2s), var(--d); }
.actor.a-wobble > span { animation: popIn .6s both, wobble 1.2s ease-in-out infinite; animation-delay: calc(var(--d) + .2s), var(--d); }
.actor.a-walk > span { animation: popIn .6s both, walk 4s ease-in-out infinite alternate; animation-delay: calc(var(--d) + .2s), 0s; }
.actor.a-drop > span { animation: drop 1.6s ease-in infinite; animation-delay: var(--d); }
.actor.a-grow > span { animation: grow 2.4s cubic-bezier(.2, 1.4, .4, 1) both; }
.actor.a-sleep > span { animation: popIn .6s both, sleepy 3.5s ease-in-out infinite; animation-delay: calc(var(--d) + .2s), var(--d); }
.actor.boing > span { animation: boing .6s cubic-bezier(.2, 1.8, .4, 1) !important; }
@keyframes hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 10% { transform: scale(1.1, .9); } 45% { transform: translateY(-28%) scale(.95, 1.05); } 80% { transform: translateY(0) scale(1.05, .95); } }
@keyframes wobble { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes walk { from { transform: translateX(-40px) scaleX(-1); } to { transform: translateX(40px) scaleX(-1); } }
@keyframes drop { 0% { transform: translateY(-40px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(160px); opacity: 0; } }
@keyframes grow { from { transform: scale(.1) translateY(60%); } to { transform: none; } }
@keyframes sleepy { 0%, 100% { transform: scale(1) rotate(-4deg); } 50% { transform: scale(1.05, .95) rotate(4deg); } }
@keyframes boing { 0% { transform: scale(1); } 30% { transform: scale(1.4, .7) translateY(10%); } 60% { transform: scale(.85, 1.25) translateY(-30%) rotate(10deg); } 100% { transform: none; } }
.story-text { margin: 0; padding: 20px 26px 26px; font-size: clamp(20px, 2.6vw, 28px); line-height: 1.5; font-weight: 600; }
.story-text span { border-radius: 8px; padding: 0 2px; transition: background .15s, color .15s; }
.story-text span.spoken { color: var(--ink-soft); }
.story-text span.now { background: var(--yellow); color: var(--ink); box-shadow: 0 3px 0 #d18f00; }
.story-text.reading { animation: none; }
.reader-bottom { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 22px; flex-wrap: wrap; }
.page-dots { display: flex; gap: 8px; }
.page-dots i { width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px var(--teal); transition: transform .2s, background .2s; }
.page-dots i.on { background: var(--teal); transform: scale(1.3); }
.read-btn {
  border: none; background: var(--teal); color: #fff; font-size: 22px; font-weight: 800; padding: 12px 26px; border-radius: 999px;
  box-shadow: 0 6px 0 #238a98; transition: transform .15s;
}
.read-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #238a98; }
.read-btn.on { background: var(--pink); box-shadow: 0 6px 0 #c13a66; animation: breathe 1.6s ease-in-out infinite; }
.end-card { text-align: center; padding: 30px 20px 36px; display: flex; flex-direction: column; align-items: center; }
.end-card h2 { font-size: 36px; margin: 12px 0 0; }
.end-card p { font-size: 20px; color: var(--ink-soft); margin: 4px 0 0; }
.row-center { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.big-btn.alt { background: var(--teal); color: #fff; box-shadow: 0 6px 0 #238a98; }

/* Gợi ý bấm được trên màn khóa */
.tip-link {
  background: var(--yellow); color: var(--ink); padding: 8px 18px; border-radius: 99px; font-weight: 800; font-size: 18px; text-decoration: none;
  box-shadow: 0 5px 0 #d18f00; animation: popIn .5s both, floaty 3s ease-in-out infinite; animation-delay: calc(.4s + var(--i) * 120ms), calc(var(--i) * .5s);
}
.tip-link:active { transform: translateY(3px); }
.tip-hint { font-size: 17px !important; margin-top: 14px !important; opacity: .85; }

/* ---------- Ai đang chơi? ---------- */
.who { min-height: 100vh; padding: 40px 16px 160px; display: flex; flex-direction: column; align-items: center; }
.who-head { display: flex; flex-direction: column; align-items: center; }
.who-head h1 { font-size: clamp(30px, 5vw, 46px); margin: 10px 0 24px; text-shadow: 0 3px 0 #fff; }
.who-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; max-width: 900px; }
.who-card {
  width: 190px; border: none; background: #fff; border-radius: 36px; padding: 18px 12px 16px; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: 0 10px 0 var(--c), 0 20px 30px rgba(43, 33, 80, .15);
  animation: popIn .6s cubic-bezier(.2, 1.5, .4, 1) both; animation-delay: calc(var(--i) * 100ms); transition: transform .25s cubic-bezier(.2, 1.6, .4, 1);
}
.who-card:hover { transform: translateY(-10px) rotate(-2deg); }
.who-card:hover .who-avatar { animation: jelly .8s; }
.who-card.picked { animation: launch .45s ease-in forwards; }
.who-avatar { width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 20%, #fff); }
.who-name { font-size: 26px; font-weight: 800; }

/* ---------- Sổ sticker ---------- */
.book-progress { height: 16px; background: #fff; border-radius: 99px; overflow: hidden; margin: 18px 0 6px; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .1); }
.book-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--pink), var(--yellow), var(--green), var(--teal), var(--purple)); }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px; margin-top: 16px; }
.sticker-slot {
  position: relative; border: 4px dashed #cfe0f2; background: rgba(255, 255, 255, .55); border-radius: 28px; aspect-ratio: 1; padding: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink);
  animation: popIn .5s both; animation-delay: calc(var(--i) * 35ms);
}
.sticker-slot.have { border: 4px solid #fff; background: #fff; box-shadow: 0 6px 0 rgba(43, 33, 80, .12); }
.sticker-slot.have .art-ico { filter: drop-shadow(0 3px 0 rgba(43, 33, 80, .15)); }
.sticker-slot.fresh::after { content: 'Mới!'; position: absolute; top: -8px; right: -6px; background: var(--pink); color: #fff; font-weight: 800; font-size: 14px; padding: 2px 10px; border-radius: 99px; animation: breathe 1.4s ease-in-out infinite; }
.sticker-slot.boing .art-ico { animation: boing .6s cubic-bezier(.2, 1.8, .4, 1); }
.slot-q { font-size: 44px; font-weight: 800; color: #b9cce3; }
.slot-name { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.sticker-slot .count { position: absolute; top: 8px; left: 10px; font-size: 14px; color: var(--purple); }
.hint.center { text-align: center; color: var(--ink-soft); font-weight: 600; margin-top: 22px; }

/* ---------- Popup thưởng / xác nhận ---------- */
.reward { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(27, 20, 70, .55); padding: 16px; animation: fadeIn .25s both; }
.reward.out { animation: fadeOut .25s forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.reward-card {
  position: relative; background: #fff; border-radius: 36px; padding: 28px 24px 26px; width: min(420px, 100%); text-align: center;
  box-shadow: 0 12px 0 var(--yellow), 0 30px 60px rgba(0, 0, 0, .3); animation: popIn .55s cubic-bezier(.2, 1.6, .4, 1) both; overflow: hidden;
}
.reward-card h2 { margin: 6px 0 0; font-size: 28px; }
.reward-card p { margin: 2px 0 0; font-size: 20px; color: var(--ink-soft); font-weight: 700; }
.reward-rays { position: absolute; left: 50%; top: 100px; width: 520px; height: 520px; margin: -260px 0 0 -260px; background: repeating-conic-gradient(#fff4c2 0 12deg, transparent 12deg 24deg); animation: spin 14s linear infinite; }
.reward-sticker { position: relative; display: inline-block; animation: stickerIn 1s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes stickerIn { from { transform: scale(0) rotate(-200deg); } 70% { transform: scale(1.15) rotate(10deg); } to { transform: none; } }
.reward-card h2, .reward-card p, .reward-card .row-center { position: relative; }
.confirm-card { box-shadow: 0 12px 0 var(--pink), 0 30px 60px rgba(0, 0, 0, .3); }
.confirm-card h2 { font-size: 24px; margin: 8px 0 4px; }
.big-btn.danger { background: var(--pink); color: #fff; box-shadow: 0 6px 0 #c13a66; }

/* ---------- Nghỉ mắt ---------- */
.eye-break {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: #fff; text-align: center; background: radial-gradient(circle at 50% 35%, #3ec1d3, #1b6f8a); padding: 12px; animation: screenIn .5s both;
}
.eye-break h2 { margin: 0; font-size: clamp(22px, 3.4vw, 36px); }
.break-step { display: flex; flex-direction: column; align-items: center; }
.break-step p { margin: 4px 0 0; font-size: clamp(18px, 2.6vw, 26px); font-weight: 700; }
.break-art { animation: breathe 2s ease-in-out infinite; display: grid; place-items: center; }
.break-ring { position: relative; width: 84px; height: 84px; }
.break-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.break-ring circle { fill: none; stroke-width: 9; }
.break-ring .track { stroke: rgba(255, 255, 255, .25); }
.break-ring .bar { stroke: #ffd23f; stroke-linecap: round; stroke-dasharray: 276.5; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.break-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; }
.eye-break .big-btn { margin-top: 6px; }

/* ---------- Trò chơi ---------- */
.game-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.game-card {
  position: relative; border: none; background: #fff; border-radius: var(--radius); padding: 14px 14px 18px; text-align: left; color: var(--ink);
  box-shadow: 0 8px 0 var(--c), 0 18px 28px rgba(43, 33, 80, .15); animation: popIn .55s cubic-bezier(.2, 1.5, .4, 1) both;
  animation-delay: calc(var(--i) * 80ms); transition: transform .25s cubic-bezier(.2, 1.6, .4, 1);
}
.game-card:hover { transform: translateY(-8px) rotate(-1.5deg); }
.game-card:hover .game-art .art-ico { animation: jelly .8s; }
.game-card.launch { animation: launch .4s ease-in forwards; }
.game-art { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 20px; background: color-mix(in srgb, var(--c) 18%, #fff); }
.game-badge { position: absolute; top: 18px; right: 18px; display: inline-flex; align-items: center; gap: 2px; background: #fff; border-radius: 99px; padding: 2px 10px 2px 6px; font-weight: 800; box-shadow: 0 3px 0 rgba(43, 33, 80, .12); }
.game { padding: 16px clamp(12px, 3vw, 32px) 60px; max-width: 1000px; margin: 0 auto; position: relative; }
.game .ctl { box-shadow: 0 6px 0 var(--purple); }
.round-stars { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; max-width: 45%; }
.round-stars span { filter: grayscale(1) opacity(.35); transition: filter .3s; }
.round-stars span.on { filter: none; animation: jelly .6s; }
.game-prompt { text-align: center; font-size: clamp(22px, 3.4vw, 34px); font-weight: 800; margin: 18px 0 10px; text-shadow: 0 3px 0 #fff; }
.game-prompt.pop { animation: popIn .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.game-board { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.game-win {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .88); animation: fadeIn .3s both; text-align: center;
}
.game-win[hidden] { display: none; }
.game-win h2 { font-size: clamp(34px, 6vw, 56px); margin: 10px 0 0; animation: popIn .6s .2s both; }
.answer-row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.answer {
  min-width: 96px; height: 96px; padding: 0 20px; border: none; border-radius: 28px; background: #fff; color: var(--ink); font-size: 48px; font-weight: 800;
  box-shadow: 0 8px 0 var(--purple); animation: popIn .45s both; transition: transform .15s;
}
.answer:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--purple); }
.answer.right, .balloon-btn.right { background: #d8f7c3; box-shadow: 0 8px 0 var(--green); animation: jelly .6s; }
.wrong { animation: shake .45s !important; }
.answer.wrong { background: #ffe0e8; }
/* Tìm cặp */
.memory-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 130px)); gap: 14px; width: 100%; justify-content: center; }
.mcard { position: relative; aspect-ratio: 3 / 4; border: none; padding: 0; background: none; perspective: 700px; animation: popIn .45s both; animation-delay: calc(var(--i) * 40ms); }
.mface { position: absolute; inset: 0; border-radius: 22px; display: grid; place-items: center; backface-visibility: hidden; transition: transform .45s cubic-bezier(.2, 1.2, .4, 1); box-shadow: 0 6px 0 rgba(43, 33, 80, .15); }
.mface.back { background: repeating-linear-gradient(45deg, var(--purple) 0 12px, #b18cf0 12px 24px); border: 5px solid #fff; }
.mface.front { background: #fff; transform: rotateY(180deg); }
.mface .art-ico { width: 78%; height: auto; }
.mcard.flipped .back { transform: rotateY(-180deg); }
.mcard.flipped .front { transform: rotateY(0); }
.mcard.matched .front { box-shadow: 0 6px 0 var(--green), 0 0 0 4px #d8f7c3; animation: jelly .6s; }
/* Đếm số */
.count-field { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 620px; padding: 18px; background: rgba(255, 255, 255, .6); border-radius: 32px; }
.count-item { position: relative; border: none; background: none; padding: 0; animation: popIn .5s both; animation-delay: calc(var(--i) * 90ms); }
.count-item.counted { animation: jelly .5s; }
.count-item b { position: absolute; top: -6px; right: -6px; min-width: 30px; height: 30px; border-radius: 99px; background: var(--pink); color: #fff; font-size: 18px; display: none; place-items: center; }
.count-item.counted b { display: grid; }
/* Chữ cái */
.letter-card { background: #fff; border-radius: 36px; padding: 18px 40px 22px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 10px 0 var(--teal); animation: popIn .5s both; }
.letter-art .art-ico { animation: bob 2.6s ease-in-out infinite; }
.letter-word { font-size: 56px; font-weight: 800; letter-spacing: 2px; }
.blank { display: inline-block; min-width: 54px; text-align: center; color: #b9cce3; border-bottom: 6px solid var(--teal); margin-right: 2px; }
.blank.filled { color: var(--pink); animation: jelly .6s; }
.answer.letter { width: 110px; }
/* Màu sắc */
.balloon-row { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; padding-top: 20px; }
.balloon-btn { border: none; background: none; padding: 6px 4px; border-radius: 24px; animation: popIn .5s both, floaty 3s ease-in-out infinite; animation-delay: calc(var(--i) * 90ms), calc(var(--i) * .4s); }
.balloon-btn.fly { animation: flyAway 1.2s ease-in forwards !important; }
@keyframes flyAway { to { transform: translateY(-120vh) rotate(12deg); } }
/* Ghép hình */
.puzzle-wrap { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.puzzle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: min(480px, 88vw); background: #fff; padding: 8px; border-radius: 28px; box-shadow: 0 10px 0 var(--purple); }
.ptile { border: none; padding: 0; background: #fff; aspect-ratio: 1; border-radius: 12px; overflow: hidden; transition: transform .2s; outline: 4px solid transparent; }
.ptile.sel { transform: scale(.92); outline-color: var(--yellow); }
.ptile.ok { outline-color: rgba(138, 201, 38, .45); }
.puzzle-grid.solved { gap: 0; animation: jelly .8s; }
.puzzle-grid.solved .ptile { border-radius: 0; outline: none; }
.puzzle-hint { width: 150px; background: #fff; border-radius: 22px; padding: 8px; text-align: center; font-weight: 700; color: var(--ink-soft); box-shadow: 0 6px 0 rgba(43, 33, 80, .12); }

/* Cấp độ trò chơi */
.level-badge { display: inline-block; vertical-align: middle; font-size: 15px; font-weight: 800; color: #fff; background: var(--purple); border-radius: 99px; padding: 1px 12px; margin-left: 6px; text-shadow: none; }
.level-up { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: clamp(20px, 3vw, 28px); font-weight: 800; color: var(--ink); background: #fff4c2; border-radius: 99px; padding: 6px 20px 6px 10px; box-shadow: 0 5px 0 #ffd23f; animation: popIn .6s .3s cubic-bezier(.2, 1.6, .4, 1) both, breathe 1.6s 1s ease-in-out infinite; }
.level-up[hidden] { display: none; }
.game-level { display: inline-flex; align-items: center; gap: 4px; margin: 6px 6px 0; font-size: 14px; font-weight: 800; color: var(--ink-soft); }
.game-level i { width: 10px; height: 10px; border-radius: 50%; background: #e4def5; }
.game-level i.on { background: var(--c); }
.memory-grid.pairs-8 { grid-template-columns: repeat(4, minmax(0, 110px)); }
.count-field.many { display: grid; grid-template-columns: repeat(5, auto); max-width: 420px; }
.balloon-row.n6 .balloon-btn svg { width: 86px; height: 112px; }
.skills { width: 100%; border-collapse: collapse; font-size: 15px; }
.skills th { text-align: left; font-size: 13px; color: var(--ink-soft); font-weight: 700; padding: 6px 8px; border-bottom: 2px solid #f0ecfa; }
.skills td { padding: 8px; border-bottom: 1px solid #f0ecfa; vertical-align: middle; }
.skills td:first-child { white-space: nowrap; font-weight: 700; }
.pcard .skills select { margin: 0; min-width: 150px; }
.trend { font-weight: 700; color: var(--ink-soft); }
.trend.good { color: #1f8a4c; }
.trend.good::before { content: '▲ '; }
.trend.warn { color: #b25e00; }
.trend.warn::before { content: '▼ '; }

/* ---------- Vẽ & Tô ---------- */
.pic-thumb.blank { display: grid; place-items: center; aspect-ratio: 1; color: var(--pink); background: repeating-linear-gradient(45deg, #fff 0 14px, #fff0f4 14px 28px); }
.custom-thumb, .drawing-card img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; }
.drawing-card { position: relative; padding: 12px; }
.drawing-card img { aspect-ratio: 4 / 3; }
.drawing-open { border: none; background: none; padding: 0; width: 100%; display: block; }
.drawing-del { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%; border: none; background: #fff; color: #d62c5b; display: grid; place-items: center; box-shadow: 0 3px 0 rgba(43, 33, 80, .15); }
.fill-canvas, .draw-canvas { display: block; width: 100%; height: auto; border-radius: 20px; cursor: pointer; touch-action: none; }
.fill-canvas.pop { animation: regionPop .35s; }
/* Tranh chibi: nháy cả khung (lớp màu + lớp nét) cùng lúc để hai lớp luôn trùng khít */
.chibi-stage.pop { animation: regionPop .35s; }
.canvas-wrap .player-loading { position: absolute; border-radius: 20px; }
.draw .canvas-wrap { max-width: min(860px, 100%); }
.draw .save-btn { box-shadow: 0 6px 0 var(--green); color: #1f8a4c; }
.tools { display: flex; flex-direction: column; gap: 14px; }
.tool-row { display: flex; gap: 10px; background: #fff; padding: 12px; border-radius: 24px; box-shadow: 0 8px 0 rgba(43, 33, 80, .12); flex-wrap: wrap; }
.tool { width: 52px; height: 52px; border-radius: 50%; border: 3px solid transparent; background: #f5f2ff; color: var(--ink); display: grid; place-items: center; transition: transform .15s; }
.tool.active { border-color: var(--ink); background: #fff; transform: scale(1.1); }
.tool.size i { display: block; border-radius: 50%; background: var(--ink); }
.stamp-tray { display: grid; grid-template-columns: repeat(3, 60px); gap: 10px; background: #fff; padding: 14px; border-radius: 28px; box-shadow: 0 8px 0 rgba(43, 33, 80, .12); }
.stamp-tray[hidden], .palette[hidden] { display: none; }
.stamp { width: 60px; height: 60px; border-radius: 18px; border: 3px solid transparent; background: #f5f2ff; display: grid; place-items: center; animation: popIn .35s both; animation-delay: calc(var(--i) * 25ms); }
.stamp.active { border-color: var(--purple); background: #fff; animation: jelly .5s; }
.draw .palette { grid-template-columns: repeat(6, 40px); gap: 10px; }
.draw .swatch { width: 40px; height: 40px; }

/* Màn tô màu: bảng màu 1 hàng ngang dưới hình, vuốt ngang để xem thêm màu; hình co theo chiều cao màn hình */
.color:not(.draw) .color-stage { flex-direction: column; align-items: center; gap: 14px; }
.color:not(.draw) .canvas-wrap { flex: none; max-width: min(640px, calc(100vh - 290px)); }
.color:not(.draw) .palette {
  display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 10px;
  box-sizing: border-box; width: fit-content; max-width: 100%; /* vừa thì căn giữa, thiếu chỗ thì cuộn từ màu đầu tiên */
  padding: 14px 16px; overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.color:not(.draw) .swatch { flex: none; width: 52px; height: 52px; }
/* Hàng công cụ dưới hình: nút tô tay bên trái + bảng màu cuộn ngang */
.color-tools { display: flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%; }
.color-tools .mode-btn { flex: none; width: 60px; height: 60px; }
.color-tools .palette { flex: 0 1 auto; min-width: 0; }
.chibi-stage { max-width: min(520px, calc((100vh - 320px) * 2 / 3)); }
@media (max-width: 800px) {
  .color:not(.draw) .palette { width: fit-content; max-width: 100%; gap: 8px; padding: 12px; }
  .color:not(.draw) .swatch { width: 46px; height: 46px; }
  .color-tools { gap: 8px; }
  .color-tools .mode-btn { width: 52px; height: 52px; }
  .color:not(.draw) .canvas-wrap { max-width: min(640px, calc(100vh - 330px)); }
  .chibi-stage { max-width: min(520px, calc((100vh - 360px) * 2 / 3)); }
}

/* ---------- Truyện ---------- */
.book-badge { position: absolute; bottom: 10px; right: 10px; display: inline-flex; align-items: center; gap: 4px; background: #fff; color: var(--pink); font-size: 14px; font-weight: 800; padding: 2px 10px; border-radius: 99px; }
.scene-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.actor .art-ico { width: 100%; height: auto; display: block; }

/* ---------- Phụ huynh: hồ sơ, báo cáo, nội dung ---------- */
.profile-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pchip { display: inline-flex; align-items: center; gap: 8px; border: 3px solid transparent; background: #fff; border-radius: 99px; padding: 4px 16px 4px 6px; font-weight: 700; font-size: 16px; color: var(--ink); box-shadow: 0 2px 8px rgba(43, 33, 80, .08); }
.pchip.active { border-color: var(--c); }
.pchip em { font-style: normal; font-size: 12px; color: #fff; background: var(--c); border-radius: 99px; padding: 0 8px; }
.pchip.add { color: var(--purple); border-style: dashed; border-color: #d6c7ff; }
.label { font-weight: 600; margin: 6px 0 4px; }
.avatar-pick, .color-pick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pcard .apick { width: 56px; height: 56px; border-radius: 50%; padding: 0; display: grid; place-items: center; background: #f5f2ff; border: 3px solid transparent; }
.pcard .apick.active { border-color: var(--purple); background: #fff; }
.pcard .cpick { width: 44px; height: 44px; border-radius: 50%; padding: 0; background: var(--sw); border: 3px solid #fff; box-shadow: 0 0 0 2px #e2dcf5; }
.pcard .cpick.active { box-shadow: 0 0 0 3px var(--ink); }
.pcard select, .pcard textarea { font: inherit; width: 100%; padding: 8px 10px; margin: 4px 0 10px; border: 2px solid #e2dcf5; border-radius: 12px; background: #fcfbff; color: var(--ink); }
.pcard textarea { resize: vertical; }
.pcard code { background: #f1ecff; padding: 1px 6px; border-radius: 6px; }
.pgrid.one { grid-template-columns: 1fr; }
.file-btn { font-weight: 700; font-size: 15px; background: #f1ecff; color: var(--ink); padding: 9px 16px; border-radius: 12px; cursor: pointer; flex: none !important; min-width: 0 !important; }
.item-art { flex: none !important; width: 52px; }
.report { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; }
.report-side h3 { margin: 12px 0 4px; }
.report-side ul { list-style: none; padding: 0; margin: 0; }
.report-side li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid #f0ecfa; }
.report-side li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-side li b { flex: none; font-weight: 700; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stat { flex: 1; min-width: 110px; background: #f7f5fd; border-radius: 16px; padding: 10px 14px; }
.stat b { display: block; font-size: 30px; line-height: 1.1; color: var(--ink); }
.stat span { color: var(--ink-soft); font-size: 14px; }
.chart { --series-1: #2a78d6; --series-2: #eb6834; }
.chart-legend { display: flex; gap: 16px; font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 3px; }
.chart-plot { position: relative; display: flex; align-items: flex-end; gap: 10px; padding: 0 0 26px 30px; box-sizing: content-box; }
.chart-grid { position: absolute; left: 0; right: 0; top: 0; bottom: 26px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid span { font-size: 12px; color: var(--ink-soft); border-top: 1px solid #eeeaf7; line-height: 0; padding-top: 0; text-indent: -2px; }
.chart-grid span:last-child { border-top-color: #cfc8e6; }
.chart-col { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; cursor: default; }
.chart-col:hover .bar-stack, .chart-col:focus .bar-stack { filter: brightness(1.08); }
.bar-stack { width: min(34px, 70%); display: flex; flex-direction: column; justify-content: flex-end; }
.seg { display: block; width: 100%; }
.seg.video { background: var(--series-1); }
.seg.other { background: var(--series-2); margin-bottom: 2px; }
.seg.top { border-radius: 4px 4px 0 0; }
.chart-x { position: absolute; bottom: -24px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.chart-x.today { color: var(--ink); font-weight: 800; }
.chart-tip { position: absolute; top: -6px; width: 180px; background: var(--ink); color: #fff; font-size: 13px; padding: 6px 10px; border-radius: 10px; pointer-events: none; z-index: 2; }
.chart-table { margin-top: 10px; font-size: 14px; }
.chart-table summary { cursor: pointer; color: var(--purple); font-weight: 700; }
.chart-table table { border-collapse: collapse; margin-top: 6px; }
.chart-table td, .chart-table th { padding: 3px 12px 3px 0; text-align: left; }
.page-edit { border: 2px solid #f0ecfa; border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; }
.page-edit-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.page-text { margin: 0 0 8px; line-height: 1.5; }
.page-preview { flex: none !important; width: 64px; height: 56px; display: grid; place-items: center; }
.page-preview img { max-width: 64px; max-height: 56px; border-radius: 8px; }
.rec-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pcard .rec-btn { background: var(--pink); }
.pcard .rec-btn.recording { animation: pulse 1s ease-in-out infinite; }
.rec-state { display: inline-flex; gap: 8px; align-items: center; }

/* ---------- Gói kênh (phụ huynh) ---------- */
.packs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pack-tile { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; border: 2px solid #f0ecfa; border-left: 8px solid var(--c); }
.pack-tile.added { background: color-mix(in srgb, var(--c) 10%, #fff); }
.pack-tile .pack-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pack-tile small { color: var(--ink-soft); }
.pack-art { flex: none; display: grid; place-items: center; }

/* ---------- Tài khoản gia đình ---------- */
.account-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 8px; }
.sub-card { border: 2px solid #f0ecfa; border-radius: 18px; padding: 14px 16px; }
.sub-card h3 { margin: 0 0 8px !important; color: var(--ink) !important; }
.family-code { font-size: 20px; font-weight: 800; letter-spacing: 2px; padding: 2px 10px !important; }
.advanced { margin-top: 14px; }
.advanced summary { cursor: pointer; color: var(--purple); font-weight: 700; }
.advanced[open] { border-top: 1px solid #f0ecfa; padding-top: 10px; }
.pcard input:disabled { opacity: .6; }

/* ---------- Trang quản trị ---------- */
.admin-body { background: #f3f1fb; }
.admin { max-width: 1180px; }
.admin .parent-top h1 { display: inline-flex; align-items: center; gap: 10px; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-tab { display: inline-flex; align-items: center; gap: 8px; border: 2px solid transparent; background: #fff; color: var(--ink); font-size: 16px; font-weight: 700; padding: 8px 16px; border-radius: 99px; box-shadow: 0 2px 8px rgba(43, 33, 80, .08); }
.admin-tab.active { border-color: var(--purple); color: var(--purple); }
.admin-login .gate-card input { font: inherit; width: 100%; padding: 10px 12px; border: 2px solid #e2dcf5; border-radius: 12px; margin-top: 8px; }
.admin .pcard form > input, .admin .pcard form > button { margin-bottom: 8px; }
.admin .pcard input[type="search"] { font: inherit; padding: 8px 12px; border: 2px solid #e2dcf5; border-radius: 12px; flex: 1; max-width: 320px; }
.admin .pcard select { width: auto; }
.pack-card { border-left: 8px solid var(--c); }
.pack-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pack-title { flex: 1; min-width: 200px; }
.pack-title h2 { margin: 0 !important; }
.pack-title p { margin: 2px 0 0; }
.publish { margin-top: 0 !important; }
.pack-items { margin: 10px 0; }
.add-item { margin-top: 6px; }
.add-item input { flex: 1; min-width: 220px; margin: 0 !important; }
.pack-edit { margin-top: 10px; }
.pack-edit summary { cursor: pointer; color: var(--purple); font-weight: 700; }
.families td.actions { white-space: nowrap; }
.families td.actions button { padding: 6px 10px; font-size: 14px; }
.families tr[hidden] { display: none; }

/* ---------- Hiệu ứng chung ---------- */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti-layer i { position: absolute; top: -20px; width: 12px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--drift), 110vh) rotate(var(--spin)); } }
.sparkle { position: fixed; z-index: 60; pointer-events: none; transform: translate(-50%, -50%); animation: burst .8s ease-out forwards; }
@keyframes burst { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.3); opacity: 0; } }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 70; transform: translateX(-50%); background: #fff; color: var(--ink);
  font-weight: 700; font-size: 20px; padding: 10px 24px 10px 12px; border-radius: 99px; box-shadow: 0 8px 0 var(--yellow), 0 16px 30px rgba(0, 0, 0, .2);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .5s cubic-bezier(.2, 1.6, .4, 1) both; max-width: calc(100% - 32px); text-align: center;
}
.toast.out { animation: toastOut .4s forwards; }
@keyframes toastIn { from { transform: translate(-50%, 120px); } }
@keyframes toastOut { to { transform: translate(-50%, 120px); opacity: 0; } }

@media (max-width: 800px) {
  .color-stage { flex-direction: column; }
  .tools { width: 100%; align-items: center; }
  .draw .palette { grid-template-columns: repeat(auto-fill, 44px); }
  .draw .swatch { width: 44px; height: 44px; }
  .stamp-tray { grid-template-columns: repeat(auto-fill, 56px); width: 100%; justify-content: center; }
  .report { grid-template-columns: 1fr; }
  .skills thead { display: none; }
  .families td.actions { white-space: normal; }
  .skills tr { display: grid; grid-template-columns: 1fr 1fr; padding: 8px 0; border-bottom: 1px solid #f0ecfa; }
  .skills td { border: none; padding: 2px 4px; }
  .skills td:first-child, .skills td:last-child { grid-column: 1 / -1; }
  .memory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .puzzle-hint { display: none; }
  .palette { grid-template-columns: repeat(auto-fill, 48px); width: 100%; justify-content: center; }
  .swatch { width: 48px; height: 48px; }
  .canvas-wrap { max-width: 100%; }
  .turn { position: fixed; bottom: 18px; z-index: 5; }
  .turn.prev { left: 16px; }
  .turn.next { right: 16px; }
  .reader-bottom { padding-bottom: 70px; }
}

@media (max-width: 600px) {
  .who-card { width: 150px; }
  .who-avatar { width: 110px; height: 110px; }
  .answer { min-width: 76px; height: 76px; font-size: 38px; }
  .letter-word { font-size: 42px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .vtitle { font-size: 16px; }
  .vch { display: none; }
  .vplay { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
  .vplay .ico { width: 20px; height: 20px; }
  .mascot { width: 64px; height: 64px; }
  .mascot.big { width: 120px; height: 120px; }
  .hello p { font-size: 15px; }
  .time-bar { width: 56px; }
  .watch-top .pill-slot { display: none; }
  .home-btn { width: 52px; height: 52px; }
  .round-btn { width: 48px; height: 48px; }
  .sticker-btn { width: auto; }
  .kid-top-right { gap: 8px; }
  /* Đầu trang màn hoạt động: hàng nút ở trên, tiêu đề xuống dòng dưới (không bị cắt, không tràn ngang) */
  .watch-top { flex-wrap: wrap; gap: 8px; }
  .watch-top .home-btn { margin-right: auto; }
  .watch-top .ctl { width: 48px; height: 48px; }
  .watch-top .watch-title { order: 10; flex-basis: 100%; white-space: normal; font-size: 22px; line-height: 1.2; }
  /* Khu phụ huynh: nút ở hàng trên, tiêu đề dòng dưới (không gãy chữ nút) */
  .parent-top { flex-wrap: wrap; }
  .parent-top .text-btn { white-space: nowrap; }
  .parent-top h1 { order: 10; flex-basis: 100%; font-size: 22px; }
}

@media (max-width: 400px) {
  .time-bar { width: 36px; }
  .kid-top-right { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Tô tay (touch/mouse) cho tranh canvas */
.color .mode-btn { transition: background .2s, color .2s, transform .15s, box-shadow .2s; }
.color .mode-btn.on { background: var(--kid-accent, #4d96ff); color: #fff; box-shadow: 0 6px 0 #2a6bcc; }
.color .fill-canvas.brushing { cursor: crosshair; touch-action: none; }

/* Nhãn phiên bản app ở góc trên trái */
.app-version {
  position: fixed; top: calc(4px + env(safe-area-inset-top)); left: calc(6px + env(safe-area-inset-left)); z-index: 100;
  font-size: 11px; font-weight: 700; line-height: 1; color: var(--ink); opacity: .45; pointer-events: none; user-select: none;
}
body[data-theme="night"] .app-version { color: #fff; opacity: .55; }
