/* ============ Học Cùng Bé ============ */
:root {
  --bg: #fff7ec;
  --ink: #3b2f4a;
  --muted: #8a7f99;
  --card: #ffffff;
  --line: #f0e3d3;
  --pri: #ff8a3d;
  --ok: #2ecc71;
  --bad: #ff5e6c;
  --kid: #ff9f43;
  --sub: #5f9cff;
  --r: 22px;
  --shadow: 0 6px 0 rgba(59, 47, 74, .08), 0 10px 24px rgba(59, 47, 74, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 600 17px/1.45 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg) radial-gradient(circle at 10% 0%, #ffe3c2 0, transparent 40%) fixed,
              radial-gradient(circle at 100% 30%, #e3f0ff 0, transparent 35%) fixed;
}
h1, h2, h3, .quiz-title, .pick-title { font-family: "Baloo 2", "Nunito", sans-serif; line-height: 1.15; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.big-emoji { font-size: 64px; line-height: 1; }

/* ---------- Chọn hồ sơ ---------- */
.pick { max-width: 900px; margin: 0 auto; padding: 32px 16px 60px; text-align: center; }
.pick-title { font-size: clamp(32px, 7vw, 54px); margin: 10px 0 0; color: var(--pri); text-shadow: 0 3px 0 #ffd9b8; }
.pick-sub { font-size: 22px; color: var(--muted); margin: 6px 0 28px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; }
.pick-card {
  border: 0; background: var(--card); border-radius: 28px; padding: 22px 12px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 4px; border-bottom: 6px solid var(--kid);
  transition: transform .15s;
}
.pick-card:hover, .pick-card:focus { transform: translateY(-4px) rotate(-1deg); outline: none; }
.pick-ava { font-size: 72px; line-height: 1; background: color-mix(in srgb, var(--kid) 18%, white); border-radius: 50%; width: 110px; height: 110px; display: grid; place-items: center; }
.pick-name { font: 800 24px "Baloo 2", sans-serif; margin-top: 6px; }
.pick-grade { color: var(--muted); font-size: 15px; }
.pick-today { font-size: 22px; letter-spacing: 4px; }
.parent-link { display: inline-block; margin-top: 40px; color: var(--muted); text-decoration: none; padding: 10px 18px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); }
.empty-card { background: #fff; border-radius: var(--r); padding: 30px; box-shadow: var(--shadow); text-align: center; }

/* ---------- Thanh trên ---------- */
.kid-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 3px solid var(--kid);
}
.kid-me { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.kid-ava { font-size: 34px; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--kid) 20%, white); }
.kid-name { font: 800 20px "Baloo 2", sans-serif; display: flex; flex-direction: column; line-height: 1.05; }
.kid-name small { font: 700 13px "Nunito", sans-serif; color: var(--muted); }
.kid-tabs { display: flex; gap: 6px; }
.kid-tabs a { text-decoration: none; display: flex; flex-direction: column; align-items: center; font-size: 13px; padding: 4px 10px; border-radius: 14px; color: var(--muted); }
.kid-tabs a span { font-size: 24px; line-height: 1.1; }
.kid-tabs a.on { background: color-mix(in srgb, var(--kid) 20%, white); color: var(--ink); }

.wrap { max-width: 960px; margin: 0 auto; padding: 18px 16px 60px; }
.back { display: inline-block; text-decoration: none; color: var(--muted); margin-bottom: 8px; }
.sec-title { font-size: 26px; margin: 26px 0 12px; }

.hello h1 { font-size: clamp(26px, 5vw, 36px); margin: 6px 0 0; }
.hello p { margin: 2px 0 0; color: var(--muted); }

/* ---------- Ô hôm nay ---------- */
.today-box { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.today-item { background: #fff; border-radius: var(--r); padding: 16px; text-align: center; box-shadow: var(--shadow); border: 3px dashed var(--line); }
.today-item.got { border: 3px solid #ffd36b; background: linear-gradient(#fffdf3, #fff6d6); }
.today-emoji { font-size: 58px; line-height: 1.1; }
.today-item:not(.got) .today-emoji { filter: grayscale(1); opacity: .45; }
.today-item.got .today-emoji { animation: wiggle 2.4s ease-in-out infinite; }
.today-label { font: 800 19px "Baloo 2", sans-serif; }
.today-note { font-size: 14px; color: var(--muted); }

.goal { margin-top: 14px; display: block; background: #fff; border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.goal-bar { height: 16px; background: #f3ebe1; border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.goal-bar span { display: block; height: 100%; background: linear-gradient(90deg, #ffd36b, #ff8a3d); border-radius: 99px; }
.goal-num { font-size: 14px; color: var(--muted); }

/* ---------- Môn học ---------- */
.subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.subject {
  text-decoration: none; background: #fff; border-radius: var(--r); padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px; border-top: 8px solid var(--sub); transition: transform .15s;
}
.subject:hover { transform: translateY(-3px); }
.subject-icon { font-size: 46px; line-height: 1; }
.subject-name { font: 800 26px "Baloo 2", sans-serif; }
.subject-desc { font-size: 14px; color: var(--muted); }
.subject-prog { font-size: 13px; color: var(--muted); margin-top: 8px; }
.mini-bar { display: block; height: 10px; background: #f3ebe1; border-radius: 99px; overflow: hidden; margin-bottom: 4px; }
.mini-bar span { display: block; height: 100%; background: var(--sub); border-radius: 99px; }

.subject-hero { display: flex; gap: 14px; align-items: center; background: color-mix(in srgb, var(--sub) 14%, white); border-radius: var(--r); padding: 16px 18px; }
.subject-hero h1 { margin: 0; font-size: 32px; }
.subject-hero p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.subject-hero .subject-icon { font-size: 56px; }

.grade-tabs { display: flex; gap: 8px; margin: 16px 0; overflow-x: auto; padding-bottom: 4px; }
.grade-tabs a { flex: 0 0 auto; text-decoration: none; padding: 8px 16px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font-weight: 800; }
.grade-tabs a.on { background: var(--sub); color: #fff; }

.lessons { display: grid; gap: 12px; }
.lesson {
  display: flex; align-items: center; gap: 12px; text-decoration: none; background: #fff; border-radius: 18px;
  padding: 12px 14px; box-shadow: var(--shadow); border-left: 6px solid transparent;
}
.lesson.done { border-left-color: var(--ok); background: #f4fff8; }
.lesson-no { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: color-mix(in srgb, var(--sub) 18%, white); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.lesson-icon { font-size: 30px; }
.lesson-body { flex: 1; display: flex; flex-direction: column; }
.lesson-body small { color: var(--muted); font-size: 13px; }
.lesson-best { color: #2a9d5b !important; }
.lesson-state { font-size: 24px; }

/* ---------- Làm bài ---------- */
.learn-page { background: color-mix(in srgb, var(--sub, #5f9cff) 8%, #fff7ec); }
.quiz-wrap { max-width: 720px; margin: 0 auto; padding: 10px 14px 40px; min-height: 100vh; }
.quiz-top { display: flex; align-items: center; gap: 10px; padding: 6px 0 10px; }
.quiz-close { text-decoration: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #fff; box-shadow: var(--shadow); font-size: 18px; }
.quiz-title { flex: 1; font-size: 20px; font-weight: 800; text-align: center; }
.quiz-who { font-size: 32px; }
.quiz-progress { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.dot { width: 16px; height: 16px; border-radius: 50%; background: #e7ddd0; transition: .2s; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.cur { transform: scale(1.35); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sub); }

.quiz-card { background: #fff; border-radius: 28px; padding: 20px 18px 24px; box-shadow: var(--shadow); text-align: center; }
.quiz-card.pop { animation: pop .3s ease-out; }
.quiz-card.shake { animation: shake .35s; }
.loading { padding: 50px 0; color: var(--muted); font-size: 20px; }
.q-num { color: var(--muted); font-size: 15px; display: flex; justify-content: center; align-items: center; gap: 10px; }
.q-speak { border: 0; background: color-mix(in srgb, var(--sub) 15%, white); border-radius: 50%; width: 40px; height: 40px; font-size: 20px; }
.q-text { font-size: 22px; font-weight: 800; margin: 10px 0; }
.q-big { font: 800 clamp(30px, 8vw, 48px)/1.25 "Baloo 2", sans-serif; margin: 10px 0 16px; padding: 14px; border-radius: 20px; background: #fbf7f1; word-break: break-word; }
.q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.q-opts.n3 { grid-template-columns: repeat(3, 1fr); }
.q-opts.n2 { grid-template-columns: 1fr 1fr; }
.q-opts.long { grid-template-columns: 1fr; }
.opt {
  border: 3px solid #eadfce; background: #fff; border-radius: 18px; padding: 16px 10px; min-height: 64px;
  font: 800 24px "Baloo 2", "Nunito", sans-serif; color: var(--ink); box-shadow: 0 4px 0 #eadfce; transition: transform .1s;
}
.q-opts.long .opt { font-size: 20px; text-align: left; padding: 14px 16px; }
.opt:hover:not(:disabled) { border-color: var(--sub); transform: translateY(-2px); }
.opt:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.opt.right { background: #e6fbef; border-color: var(--ok); box-shadow: 0 4px 0 var(--ok); }
.opt.wrong { background: #ffeef0; border-color: var(--bad); box-shadow: 0 4px 0 var(--bad); }
.opt:disabled { cursor: default; }

.q-input { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 6px 0 12px; }
.q-input input[type=text] {
  width: min(260px, 70vw); text-align: center; font: 800 36px "Baloo 2", sans-serif; padding: 8px 12px;
  border: 3px solid #eadfce; border-radius: 18px; outline: none; color: var(--ink); background: #fff;
}
.q-input input[type=text]:focus { border-color: var(--sub); }
.q-input input[type=text].right { border-color: var(--ok); background: #e6fbef; }
.q-input input[type=text].wrong { border-color: var(--bad); background: #ffeef0; }
.q-unit { font-size: 22px; font-weight: 800; color: var(--muted); }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 300px; margin: 0 auto 14px; }
.numpad button { border: 0; background: #f6efe6; border-radius: 16px; padding: 12px 0; font: 800 26px "Baloo 2", sans-serif; box-shadow: 0 3px 0 #e6dccd; }
.numpad button:active { transform: translateY(2px); box-shadow: none; }
.numpad button:disabled { opacity: .5; }

.btn-main {
  display: inline-block; border: 0; border-radius: 999px; padding: 14px 28px; margin-top: 8px; text-decoration: none;
  font: 800 20px "Baloo 2", sans-serif; color: #fff; background: var(--pri); box-shadow: 0 5px 0 #d96a22;
}
.btn-main:active { transform: translateY(3px); box-shadow: 0 2px 0 #d96a22; }
.btn-main:disabled { opacity: .5; }
.btn-ghost { display: inline-block; border-radius: 999px; padding: 12px 22px; margin-top: 8px; text-decoration: none; font-weight: 800; background: #fff; border: 3px solid #eadfce; }
.q-feedback { margin-top: 14px; }
.fb { border-radius: 16px; padding: 12px; font-size: 20px; font-weight: 800; }
.fb.ok { background: #e6fbef; color: #1e8a4c; }
.fb.bad { background: #ffeef0; color: #c43c4a; }
.fb small { display: block; font-size: 15px; font-weight: 700; color: var(--muted); margin-top: 4px; }

.result { padding: 10px 0; }
.result-stars { font-size: 46px; letter-spacing: 6px; }
.result-score { font: 800 56px "Baloo 2", sans-serif; color: var(--pri); }
.result h2 { margin: 4px 0 10px; }
.result-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.sticker-get { background: linear-gradient(#fffdf3, #fff1c4); border-radius: 24px; padding: 14px; margin: 10px auto; max-width: 340px; border: 3px solid #ffd36b; }
.sticker-big { font-size: 110px; line-height: 1.1; animation: bounceIn .9s cubic-bezier(.2, 1.6, .4, 1) both; }

.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; line-height: 1; margin: 0 .12em; font-size: .9em; }
.frac span:first-child { border-bottom: .08em solid currentColor; padding: 0 .15em .06em; }
.frac span:last-child { padding: .06em .15em 0; }

#confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
#confetti span { position: absolute; top: -40px; animation: fall 3s linear forwards; }

/* ---------- Lịch sticker ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border-radius: 18px; padding: 12px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font: 800 34px "Baloo 2", sans-serif; color: var(--pri); }
.stat span { font-size: 13px; color: var(--muted); }
.cal { background: #fff; border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 20px; }
.cal-head a { text-decoration: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #f6efe6; }
.cal-head span { width: 40px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-w { text-align: center; font-size: 13px; color: var(--muted); font-weight: 800; }
.cal-d { min-height: 74px; border-radius: 12px; background: #fbf7f1; padding: 3px; display: flex; flex-direction: column; align-items: center; }
.cal-d.empty { background: transparent; }
.cal-d.today { outline: 3px solid var(--pri); background: #fff4e8; }
.cal-d.future { opacity: .45; }
.cal-n { font-size: 11px; color: var(--muted); align-self: flex-start; padding-left: 3px; }
.cal-s, .cal-g { font-size: 22px; line-height: 1.15; min-height: 24px; }
.legend { text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Khu phụ huynh ---------- */
.admin { background: #f6f4f9; font-size: 15px; }
.adm-top { background: #3b2f4a; color: #fff; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.adm-top .brand { font: 800 20px "Baloo 2", sans-serif; text-decoration: none; margin-right: auto; }
.adm-top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.adm-top nav a { color: #e6def0; text-decoration: none; padding: 6px 10px; border-radius: 10px; }
.adm-top nav a.on, .adm-top nav a:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.adm { max-width: 1100px; margin: 0 auto; padding: 18px 14px 60px; }
.adm h1 { font-size: 28px; margin: 4px 0 14px; }
.adm h2 { font-size: 21px; margin: 22px 0 10px; }
.box { background: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 2px 10px rgba(0, 0, 0, .05); margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.kidbox-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.kidbox-head .ava { font-size: 36px; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; }
.kidbox-head b { font-size: 19px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #f1ecf6; font-size: 13px; }
.pill.ok { background: #e6fbef; color: #1e8a4c; }
.pill.warn { background: #fff4dd; color: #a86b00; }
.status-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.status { flex: 1; min-width: 130px; background: #faf8fc; border-radius: 12px; padding: 8px 10px; }
.status .e { font-size: 30px; }
.status small { display: block; color: var(--muted); }
.sticker-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.sticker-pick label { cursor: pointer; }
.sticker-pick input { position: absolute; opacity: 0; pointer-events: none; }
.sticker-pick span { display: grid; place-items: center; width: 44px; height: 44px; font-size: 26px; border-radius: 12px; background: #f6f4f9; border: 2px solid transparent; }
.sticker-pick input:checked + span { border-color: var(--pri); background: #fff4e8; }
label.fl { display: block; font-weight: 800; margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 2px solid #e4dfea; border-radius: 12px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #a78bfa; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 140px; }
.btn { display: inline-block; border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 800; background: #ece7f3; color: var(--ink); text-decoration: none; }
.btn.pri { background: var(--pri); color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.danger { background: #ffe3e6; color: #c43c4a; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #efeaf4; vertical-align: middle; }
.tbl th { font-size: 13px; color: var(--muted); }
.tbl-wrap { overflow-x: auto; }
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-weight: 800; }
.flash-ok { background: #e6fbef; color: #1e8a4c; }
.flash-err { background: #ffeef0; color: #c43c4a; }
.login-box { max-width: 380px; margin: 60px auto; }
.hint { color: var(--muted); font-size: 13px; }
.ava-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.ava-pick label span { display: grid; place-items: center; width: 42px; height: 42px; font-size: 24px; border-radius: 50%; background: #f6f4f9; border: 2px solid transparent; cursor: pointer; }
.ava-pick input { position: absolute; opacity: 0; pointer-events: none; }
.ava-pick input:checked + span { border-color: var(--pri); background: #fff4e8; }
.color-dot { width: 30px; height: 30px; border-radius: 50%; display: inline-block; border: 3px solid transparent; cursor: pointer; }
.ava-pick input:checked + .color-dot { border-color: #3b2f4a; }

/* ---------- Hiệu ứng ---------- */
@keyframes pop { from { transform: scale(.96); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg) scale(1.05); } 75% { transform: rotate(8deg) scale(1.05); } }
@keyframes bounceIn { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1) rotate(0); } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .kid-name { font-size: 17px; }
  .kid-tabs a { padding: 4px 6px; }
  .q-opts.n3 { grid-template-columns: repeat(3, 1fr); }
  .opt { font-size: 21px; padding: 12px 6px; }
  .cal-d { min-height: 60px; }
  .cal-s, .cal-g { font-size: 17px; }
  .today-emoji { font-size: 46px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ================= Bản 1.1 ================= */
/* Nền trang trí cho trang của bé */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.sky i { position: absolute; font-style: normal; font-size: 34px; opacity: .22; animation: floaty 9s ease-in-out infinite; }
.sky i:nth-child(1) { top: 16%; left: 4%; }
.sky i:nth-child(2) { top: 30%; right: 6%; font-size: 56px; animation-delay: -2s; }
.sky i:nth-child(3) { top: 62%; left: 2%; font-size: 50px; animation-delay: -4s; }
.sky i:nth-child(4) { top: 78%; right: 10%; animation-delay: -1s; }
.sky i:nth-child(5) { top: 48%; left: 46%; font-size: 60px; opacity: .12; animation-delay: -6s; }
.sky i:nth-child(6) { top: 88%; left: 30%; animation-delay: -3s; }
.kid .wrap, .kid .kid-top { position: relative; z-index: 1; }
.kid .kid-top { position: sticky; z-index: 10; }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-16px) rotate(5deg); } }

.star-chip { text-decoration: none; background: linear-gradient(#fff6c9, #ffe17a); border: 2px solid #ffc93c; border-radius: 999px; padding: 4px 12px; font: 800 18px "Baloo 2", sans-serif; white-space: nowrap; box-shadow: 0 3px 0 #f0b400; }
.pick-stars { font-size: 14px; font-weight: 800; color: #b07a00; background: #fff3c4; border-radius: 999px; padding: 2px 10px; }

.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.chip { flex: 1; min-width: 150px; text-decoration: none; background: #fff; border-radius: 999px; padding: 8px 14px; box-shadow: var(--shadow); font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.chip span { font-size: 22px; }
.chip b { font: 800 22px "Baloo 2", sans-serif; color: var(--ink); }

a.goal { display: flex; gap: 12px; align-items: center; text-decoration: none; border: 3px solid #ffe1a6; background: linear-gradient(100deg, #fffdf5, #fff4d6); }
.goal-pic { flex: 0 0 76px; width: 76px; height: 76px; border-radius: 18px; overflow: hidden; background: #fff; display: grid; place-items: center; box-shadow: 0 3px 0 rgba(0, 0, 0, .06); }
.goal-pic img, .gift-pic img, .my-gift-pic img, .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.goal-pic .gift-emoji { font-size: 46px; }
.goal-body { flex: 1; display: block; min-width: 0; }
.goal-head, .goal-num { display: block; }
.goal-bar.big { height: 22px; margin: 4px 0 14px; background: #fff; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .08); }

/* Trang quà */
.star-hero { display: flex; align-items: center; gap: 16px; background: linear-gradient(120deg, #ffe680, #ffb347); border-radius: 26px; padding: 18px 20px; box-shadow: var(--shadow); color: #5a3b00; }
.star-hero-num { font: 800 46px "Baloo 2", sans-serif; background: rgba(255, 255, 255, .7); border-radius: 22px; padding: 4px 18px; white-space: nowrap; }
.star-hero h1 { margin: 0; font-size: 26px; }
.star-hero p { margin: 2px 0 0; font-size: 14px; }
.kid .flash { margin-top: 12px; }
.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.gift { background: #fff; border-radius: 24px; padding: 12px 12px 16px; box-shadow: var(--shadow); text-align: center; border: 3px solid transparent; display: flex; flex-direction: column; gap: 6px; }
.gift.can { border-color: #ffc93c; background: linear-gradient(#fffef6, #fff5cf); animation: glow 2.2s ease-in-out infinite; }
.gift-pic { aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: #fbf4e8; display: grid; place-items: center; }
.gift-emoji { font-size: 84px; line-height: 1; }
.gift h3 { margin: 4px 0 0; font-size: 21px; }
.gift-note { margin: 0; font-size: 13px; color: var(--muted); }
.gift-cost { font: 800 22px "Baloo 2", sans-serif; color: #c98a00; }
.gift-need { font-size: 14px; color: var(--muted); font-weight: 800; padding: 10px 0 2px; }
.gift .btn-main { width: 100%; margin-top: 4px; }
.my-gifts { display: grid; gap: 10px; }
.my-gift { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; padding: 10px 12px; box-shadow: var(--shadow); }
.my-gift-pic { flex: 0 0 54px; width: 54px; height: 54px; border-radius: 14px; overflow: hidden; background: #fbf4e8; display: grid; place-items: center; }
.my-gift-pic .gift-emoji { font-size: 34px; }
.my-gift-body { flex: 1; display: flex; flex-direction: column; }
.my-gift-body small { color: var(--muted); font-size: 13px; }
.my-gift-state { font-size: 13px; font-weight: 800; white-space: nowrap; }
.my-gift.pending { border-left: 6px solid #ffc93c; }
.my-gift.done { border-left: 6px solid var(--ok); }
@keyframes glow { 0%, 100% { box-shadow: var(--shadow); } 50% { box-shadow: 0 0 0 5px rgba(255, 201, 60, .35), var(--shadow); } }

/* Bộ sưu tập sticker */
.collection { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.col-item { position: relative; background: #fff; border-radius: 16px; padding: 8px 4px 6px; text-align: center; box-shadow: 0 3px 0 rgba(59, 47, 74, .06); border: 2px dashed var(--line); }
.col-item.got { border: 2px solid #ffd36b; background: linear-gradient(#fffdf3, #fff6d6); }
.col-emoji { display: block; font-size: 36px; line-height: 1.15; }
.col-item:not(.got) .col-emoji { opacity: .3; filter: grayscale(1); }
.col-name { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-count { position: absolute; top: 2px; right: 4px; font-size: 11px; font-weight: 800; background: var(--pri); color: #fff; border-radius: 99px; padding: 0 5px; }

/* Làm bài: ô gõ chữ, nghe lại */
.q-input input.q-word { width: min(420px, 86vw); font-size: 28px; }
.say-again { margin-left: 8px; vertical-align: middle; width: 34px; height: 34px; font-size: 16px; }

/* Môn học đẹp hơn */
.subject { position: relative; overflow: hidden; }
.subject::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: color-mix(in srgb, var(--sub) 16%, transparent); }
.subject-icon { position: relative; z-index: 1; }
.lesson { transition: transform .12s; }
.lesson:hover { transform: translateX(4px); }

/* Phụ huynh */
.thumb { width: 64px; }
.thumb img, td.thumb .gift-emoji, div.thumb .gift-emoji { width: 56px; height: 56px; border-radius: 12px; }
td.thumb .gift-emoji, div.thumb .gift-emoji { display: grid; place-items: center; font-size: 34px; background: #f6f4f9; }
input[type=file] { width: 100%; padding: 8px; border: 2px dashed #d9d2e3; border-radius: 12px; background: #fbfafc; font: inherit; }
.adm code { background: #f1ecf6; padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.flash a { color: inherit; }

@media (max-width: 560px) {
  .kid-top { gap: 6px; padding: 8px 10px; }
  .kid-ava { width: 42px; height: 42px; font-size: 28px; }
  .kid-tabs a { font-size: 11px; padding: 3px 5px; }
  .kid-tabs a span { font-size: 21px; }
  .star-chip { font-size: 15px; padding: 3px 9px; }
  .star-hero { flex-direction: column; text-align: center; }
  .gift-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .gift-emoji { font-size: 60px; }
  .gift h3 { font-size: 17px; }
  .collection { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
}

/* ================= Bản 1.2 ================= */
/* Đồng hồ tính nhanh */
.q-timer { position: relative; height: 22px; background: #f3ebe1; border-radius: 99px; overflow: hidden; margin-bottom: 10px; }
.q-timer span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff5e6c, #ffc93c, #2ecc71); border-radius: 99px; transition: width .1s linear; }
.q-timer b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; }

/* Nghe và chọn */
.q-listen { border: 0; background: color-mix(in srgb, var(--sub) 16%, white); border-radius: 26px; padding: 14px 30px; font-size: 54px; line-height: 1.1; margin: 4px 0 12px; box-shadow: 0 5px 0 color-mix(in srgb, var(--sub) 35%, white); }
.q-listen small { display: block; font: 700 13px "Nunito", sans-serif; color: var(--muted); }
.q-listen:active { transform: translateY(3px); box-shadow: none; }
.q-opts.emoji .opt { font-size: 46px; padding: 8px; }

/* Sắp xếp */
.ord-answer { min-height: 66px; border: 3px dashed #d9cdbb; border-radius: 18px; padding: 8px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 8px 0 12px; background: #fffdf8; }
.ord-answer.right { border: 3px solid var(--ok); background: #e6fbef; }
.ord-answer.wrong { border: 3px solid var(--bad); background: #ffeef0; }
.ord-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 54px; margin-bottom: 12px; }
.ord-hint { color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.tok { border: 3px solid #eadfce; background: #fff; border-radius: 14px; padding: 8px 14px; font: 800 21px "Baloo 2", "Nunito", sans-serif; color: var(--ink); box-shadow: 0 4px 0 #eadfce; }
.ord-answer .tok { border-color: var(--sub); box-shadow: 0 4px 0 color-mix(in srgb, var(--sub) 45%, white); background: color-mix(in srgb, var(--sub) 8%, white); }
.tok:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }

/* Nối cột */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0 6px; border-radius: 18px; padding: 4px; }
.match.right { background: #e6fbef; } .match.wrong { background: #ffeef0; }
.match-col { display: grid; gap: 10px; align-content: start; }
.mt { border: 3px solid #eadfce; background: #fff; border-radius: 16px; padding: 10px 8px; min-height: 58px; font: 800 19px "Baloo 2", "Nunito", sans-serif; color: var(--ink); box-shadow: 0 4px 0 #eadfce; word-break: break-word; }
.mt.sel { border-color: var(--ink); transform: scale(1.04); }
.mt.p0 { background: #ffe3e3; border-color: #ff8a8a; box-shadow: 0 4px 0 #ff8a8a; }
.mt.p1 { background: #dff3ff; border-color: #6bb8f0; box-shadow: 0 4px 0 #6bb8f0; }
.mt.p2 { background: #e3f9e5; border-color: #6ccf7a; box-shadow: 0 4px 0 #6ccf7a; }
.mt.p3 { background: #fff3c9; border-color: #f2c230; box-shadow: 0 4px 0 #f2c230; }
.mt.p4 { background: #f0e4ff; border-color: #b58af0; box-shadow: 0 4px 0 #b58af0; }
.mt.p5 { background: #ffe6d3; border-color: #f5a060; box-shadow: 0 4px 0 #f5a060; }

/* Kết quả: huy hiệu mới, câu sai */
.badge-get { background: linear-gradient(#f6f0ff, #ecdfff); border: 3px solid #c9a8ff; border-radius: 22px; padding: 12px; margin: 12px auto; max-width: 420px; }
.badge-new { display: flex; align-items: center; gap: 10px; text-align: left; margin-top: 8px; }
.badge-new span { font-size: 44px; animation: bounceIn .9s cubic-bezier(.2, 1.6, .4, 1) both; }
.badge-new small { display: block; color: var(--muted); font-size: 13px; }
.wrong-list { text-align: left; background: #fff8f0; border-radius: 18px; padding: 10px 14px; margin: 14px 0 4px; }
.wrong-list summary { font-weight: 800; cursor: pointer; }
.wrong-item { border-top: 2px dashed #f0e0cc; padding: 8px 0; font-size: 15px; }
.wrong-item:first-of-type { margin-top: 8px; }
.wq b { font-family: "Baloo 2", sans-serif; }
.wa { color: #1e8a4c; font-weight: 800; }

/* Trang chủ: bài hôm nay, ôn câu sai */
.lesson.todo { border-left-color: var(--sub); }
.review-card { display: flex; align-items: center; gap: 12px; text-decoration: none; background: linear-gradient(100deg, #f6f0ff, #ead9ff); border: 3px solid #d3b8ff; border-radius: 20px; padding: 12px 14px; margin-top: 14px; box-shadow: var(--shadow); }
.review-card > span:first-child { font-size: 34px; }
.review-card > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.review-card small { color: var(--muted); font-size: 13px; }
.review-card > span:last-child { font-size: 24px; }

/* Mã PIN */
.pin-page { max-width: 380px; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 14px 0 18px; }
.pin-dots i { width: 22px; height: 22px; border-radius: 50%; background: #e7ddd0; }
.pin-dots i.on { background: var(--kid); transform: scale(1.15); }
.pin-pad { max-width: 290px; }
.pin-pad button { background: #fff; padding: 14px 0; }

/* Huy hiệu */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.badge { background: #fff; border-radius: 18px; padding: 10px 8px; text-align: center; border: 2px dashed var(--line); display: flex; flex-direction: column; gap: 2px; }
.badge-icon { font-size: 40px; line-height: 1.15; }
.badge b { font-size: 14px; }
.badge small { font-size: 11px; color: var(--muted); }
.badge:not(.got) { opacity: .55; }
.badge:not(.got) .badge-icon { filter: grayscale(1); }
.badge.got { border: 2px solid #c9a8ff; background: linear-gradient(#fbf8ff, #f1e6ff); }

/* Phụ huynh */
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; }
.check-list label { display: flex; gap: 8px; align-items: flex-start; background: #faf8fc; border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.check-list input { margin-top: 4px; }
.check-list small { display: block; color: var(--muted); font-size: 12px; }
.adjust { border-top: 1px dashed #e4dfea; margin-top: 12px; padding-top: 4px; }
textarea { font-family: inherit; }

@media (max-width: 560px) {
  .mt { font-size: 16px; padding: 8px 4px; }
  .tok { font-size: 18px; padding: 7px 10px; }
  .q-opts.emoji .opt { font-size: 38px; }
  .badges { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}
