:root {
  --bg1: #fff6e5;
  --bg2: #e6f2ff;
  --ink: #2b2d42;
  --muted: #6b7280;
  --card: #ffffff;
  --line: #e7e3da;
  --primary: #ff7a59;
  --primary-dark: #e8603e;
  --blue: #4f8cff;
  --green: #22b07d;
  --green-soft: #dcfce7;
  --red: #ef4444;
  --red-soft: #fee2e2;
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --kid: #ff7a59;
  --radius: 24px;
  --shadow: 0 6px 0 rgba(43, 45, 66, .08), 0 12px 28px rgba(43, 45, 66, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg1), var(--bg2)) fixed;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
input { font: inherit; }

/* ── Khung chung ── */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.loading { font-size: 72px; animation: bounce 1s infinite; }
.screen { max-width: 960px; margin: 0 auto; padding: 20px 16px 88px; }  /* chừa chỗ cho nút góp ý 💬 */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px;
}

/* Vừa khít 1 màn hình: thanh trên cố định, phần dưới là nội dung (.fit) được app.js thu nhỏ cho vừa.
   Bé chưa biết kéo thanh cuộn nên nút bấm luôn phải nằm trong cửa sổ. */
#app.app-fit { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.app-fit > .topbar { position: relative; flex: none; }
.app-fit > main.screen { flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; padding: 0; overflow-y: auto; }
.app-fit .fit { max-width: 960px; margin: 0 auto; padding: 14px 16px 18px; }
.app-fit .review { max-width: 960px; margin: 8px auto 32px; padding: 0 16px; }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; }

.btn {
  border: 0; border-radius: 18px; padding: 14px 22px; font-weight: 800; font-size: 20px;
  background: #fff; box-shadow: 0 4px 0 var(--line); transition: transform .08s, box-shadow .08s;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 5px 0 var(--primary-dark); }
.btn.primary:active { box-shadow: 0 2px 0 var(--primary-dark); }
.btn.green { background: var(--green); color: #fff; box-shadow: 0 5px 0 #15895f; }
.btn.big { font-size: 24px; padding: 18px 28px; }
.btn.icon { padding: 10px 14px; font-size: 24px; line-height: 1; }
.btn.small { padding: 6px 10px; font-size: 18px; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); font-weight: 700; }

/* ── Đăng nhập ── */
.login { width: 100%; max-width: 420px; text-align: center; }
.logo { font-size: 72px; }
.login form { display: grid; gap: 14px; margin-top: 20px; text-align: left; }
.login label { display: grid; gap: 6px; font-weight: 700; }
.login input {
  border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 18px; outline: none;
}
.login input:focus { border-color: var(--blue); }
.error { color: var(--red); font-weight: 700; min-height: 1.2em; }

/* ── Chọn bé ── */
.kids { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-top: 24px; }
.kid-card {
  border: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 16px;
  display: grid; gap: 8px; justify-items: center; border-top: 10px solid var(--kid);
}
.kid-card .avatar { font-size: 72px; }
.kid-card b { font-size: 28px; }

/* ── Đổi bé (chỉ cần mật khẩu phụ huynh) ── */
.switch-pin { max-width: 360px; margin: 16px auto 0; display: grid; gap: 6px; text-align: left; }
.switch-pin label { display: grid; gap: 6px; font-weight: 700; }
.switch-pin input {
  border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 18px; outline: none;
}
.switch-pin input:focus { border-color: var(--blue); }
.switch .kids { margin-top: 8px; }
.switch .kid-card { padding: 18px 12px; }
.switch .kid-card .avatar { font-size: 60px; }
.kid-card.cur { outline: 4px solid var(--kid); outline-offset: -4px; }
.switch-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ── Thanh trên cùng ── */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; background: rgba(255, 255, 255, .85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .who { display: flex; align-items: center; gap: 10px; }
.topbar .who .avatar {
  font-size: 28px; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; background: color-mix(in srgb, var(--kid) 20%, white); border: 3px solid var(--kid);
}
.topbar .who span:last-child { display: grid; line-height: 1.1; }
.topbar .who small { color: var(--muted); font-weight: 700; }
.topbar .title { flex: 1; text-align: center; font-weight: 900; font-size: 20px; }
.stars-total { font-weight: 900; font-size: 20px; background: var(--amber-soft); padding: 8px 14px; border-radius: 999px; }
button.stars-total { border: 0; box-shadow: 0 3px 0 #f3d58a; }
button.stars-total:active { transform: translateY(2px); box-shadow: 0 1px 0 #f3d58a; }

/* ── Bảng xếp hạng sao ── */
.board h2 { font-size: 30px; }
.board-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.board-list li { display: grid; grid-template-columns: 56px 64px 1fr auto; align-items: center; gap: 14px;
  background: #fff; border-radius: 18px; padding: 8px 18px; box-shadow: 0 4px 0 var(--line); border-left: 8px solid var(--kid); }
.board-list li.me { background: var(--amber-soft); outline: 4px solid var(--amber); }
.board-list .rank { font-size: 34px; font-weight: 900; text-align: center; color: var(--muted); }
.board-list .avatar { font-size: 44px; line-height: 1; text-align: center; }
.board-list .avatar.has-photo { width: 60px; height: 60px; border-width: 3px; }
.board-list .who { display: grid; line-height: 1.2; }
.board-list .who b { font-size: 24px; }
.board-list .who small { color: var(--muted); font-weight: 800; font-size: 16px; }
.board-list .st { font-size: 28px; font-weight: 900; color: #b45309; white-space: nowrap; }

/* ── Hình đại diện (emoji hoặc ảnh bé tải lên) ── */
.topbar .who .avatar { overflow: hidden; }
.ava-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar.has-photo { display: inline-grid; width: 84px; height: 84px; border-radius: 50%; overflow: hidden;
  border: 4px solid var(--kid); background: #fff; flex: none; }
.hello-ava { border: 0; background: none; padding: 0; display: grid; justify-items: center; gap: 2px; }
.hello-ava .avatar { font-size: 64px; line-height: 1.1; }
.hello-ava .ava-edit { font-size: 15px; font-weight: 800; color: var(--blue); background: #fff; border-radius: 99px;
  padding: 2px 10px; box-shadow: 0 2px 0 var(--line); white-space: nowrap; }
.ava-card { display: grid; gap: 16px; }
.ava-now { display: flex; align-items: center; gap: 20px; }
.ava-now .avatar { font-size: 84px; line-height: 1; }
.ava-now .avatar.has-photo { width: 120px; height: 120px; }
.ava-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; }
.ava-opt { border: 0; background: #fff; border-radius: 18px; box-shadow: 0 4px 0 var(--line); font-size: 40px; padding: 8px 0;
  line-height: 1.2; outline: 3px solid transparent; }
.ava-opt.on { outline-color: var(--primary); background: var(--amber-soft); }
.ava-opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }

/* ── Phụ huynh ── */
.parent-link { margin-top: 18px; display: grid; gap: 6px; justify-items: center; }
.parent .card { margin-bottom: 16px; }
.parent h2 { font-size: 24px; }
.row-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 8px; }
.row-form label { display: grid; gap: 6px; font-weight: 700; flex: 1 1 220px; }
.row-form input { border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 18px; outline: none; }
.row-form input:focus { border-color: var(--blue); }
.howto { margin-top: 12px; background: #f8fafc; border-radius: 14px; padding: 10px 16px; }
.howto summary { font-weight: 800; cursor: pointer; color: var(--blue); }
.howto li { margin: 8px 0; line-height: 1.6; }
.howto code { background: #fff; border: 2px dashed var(--line); border-radius: 8px; padding: 2px 8px; font-size: 17px; user-select: all; }
.ok-note { background: var(--green-soft); margin-top: 12px; }
.ptabs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ptab { border: 0; border-radius: 99px; padding: 10px 20px; font-size: 18px; font-weight: 800; background: #f1f5f9;
  color: var(--muted); box-shadow: 0 3px 0 var(--line); }
.ptab.on { background: var(--primary); color: #fff; box-shadow: 0 3px 0 var(--primary-dark); }
.kid-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.kchip { border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 14px; font-size: 17px; font-weight: 700; }
.kchip.on { border-color: var(--blue); background: #e6f0ff; color: #1d4ed8; }
.hday { font-size: 19px; margin: 20px 0 10px; color: var(--muted); }
.hitem { border-left: 8px solid var(--c, var(--primary)); background: #fbfaf7; border-radius: 14px; padding: 12px 16px;
  margin-bottom: 10px; line-height: 1.55; }
.hhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 18px; margin-bottom: 4px; }
.hava { font-size: 26px; line-height: 1; }
.hl { white-space: pre-wrap; overflow-wrap: anywhere; }
.live { background: var(--amber-soft); color: #92400e; border-radius: 99px; padding: 2px 10px; font-size: 14px; font-weight: 800; }
.prog-form { display: grid; gap: 14px; margin-top: 12px; }
.prog-row { display: grid; grid-template-columns: 170px 1fr; gap: 4px 14px; align-items: center; }
.prog-row .pname { font-weight: 800; font-size: 20px; grid-row: span 2; }
.prog-row select { border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 18px; font-family: inherit;
  background: #fff; min-width: 0; width: 100%; }
.prog-row select:focus { border-color: var(--blue); outline: none; }
.prog-form .btn { justify-self: start; }
@media (max-width: 600px) { .prog-row { grid-template-columns: 1fr; } .prog-row .pname { grid-row: auto; } }
.hist-empty { font-size: 18px; color: var(--muted); }
#histMore { margin-top: 10px; }

/* ── Trang chủ ── */
.hello { display: flex; align-items: center; gap: 16px; margin: 4px 0 20px; }
.hello .avatar { font-size: 64px; }
.hello h1 { font-size: 34px; }
.subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.subject {
  border: 0; text-align: left; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; display: grid; gap: 10px; border-left: 12px solid var(--c);
}
.subject .ico { font-size: 54px; }
.subject b { font-size: 28px; }
.subject .bar { height: 12px; border-radius: 99px; background: #f1efe9; overflow: hidden; }
.subject .bar i { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.subject.soon { opacity: .6; }
.subject .tag { font-weight: 800; color: var(--muted); }
.notice {
  margin-top: 24px; background: var(--amber-soft); border-radius: 16px; padding: 14px 18px; font-weight: 700;
}
.footer-actions { margin-top: 24px; text-align: center; }

/* ── Danh sách bài ── */
.lessons { display: grid; gap: 14px; margin-top: 16px; }
.lesson {
  border: 0; text-align: left; background: #fff; border-radius: 20px; box-shadow: var(--shadow);
  padding: 16px 20px; display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 16px;
}
.lesson .num {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  font-size: 28px; background: var(--bg1);
}
.lesson b { font-size: 21px; display: block; }
.lesson small { color: var(--muted); font-weight: 700; }
.lesson .st { font-size: 22px; letter-spacing: 2px; white-space: nowrap; }
.lesson.locked { opacity: .55; }
.lesson.next { outline: 4px solid var(--primary); animation: pulse 1.6s infinite; }
.lesson.done .num { background: var(--green-soft); }

/* ── Trang bài học ── */
.hub-head { display: flex; gap: 18px; align-items: center; margin: 4px 0 20px; }
.hub-head .big-icon { font-size: 72px; }
.hub-head small { color: var(--muted); font-weight: 800; }
.hub-head h2 { font-size: 30px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.step {
  border: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 20px;
  display: grid; gap: 6px; justify-items: center; text-align: center;
}
.step span { font-size: 56px; }
.step b { font-size: 24px; }
.step small { color: var(--muted); font-weight: 700; font-size: 16px; }
.step.suggest { outline: 4px solid var(--primary); }

/* ── Học bài (slides) ── */
.slide-card { position: relative; text-align: center; padding: 26px 24px; }
.slide-count { position: absolute; top: 16px; left: 20px; color: var(--muted); font-weight: 800; }
.slide-card .speak { position: absolute; top: 12px; right: 12px; }
.slide-card h2 { font-size: 32px; margin-bottom: 16px; color: var(--primary-dark); }
.slide-text { font-size: 26px; line-height: 1.5; font-weight: 700; margin-top: 12px; }
.slide-text.table { columns: 2; column-gap: 40px; display: inline-block; text-align: left; font-variant-numeric: tabular-nums; }
.slide-text.passage { text-align: left; font-size: 24px; line-height: 1.7; max-width: 720px; margin-left: auto; margin-right: auto; }
.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }

/* ── Câu hỏi ── */
.progress { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.dot { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--line); }
.dot.cur { border-color: var(--primary); transform: scale(1.2); }
.dot.ok { background: var(--green); border-color: var(--green); }
.dot.ok2 { background: #a3e635; border-color: #a3e635; }
.dot.bad { background: var(--red); border-color: var(--red); }
.dot.retry { background: var(--amber); border-color: var(--amber); }
.dot.done { background: var(--blue); border-color: var(--blue); }
.qcard { position: relative; text-align: center; padding: 20px 20px; }
.qcard .speak { position: absolute; top: 12px; right: 12px; }
.prompt { font-size: 52px; font-weight: 900; padding: 4px 48px; line-height: 1.2; }
.prompt.long { font-size: 28px; line-height: 1.5; font-weight: 800; }
.answer-area { margin-top: 16px; }
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.choices.n3 { grid-template-columns: repeat(3, 1fr); }
.choice {
  border: 0; background: #fff; border-radius: 20px; box-shadow: 0 6px 0 var(--line); padding: 18px 12px;
  font-size: 36px; font-weight: 900; transition: transform .08s;
}
.choice.text { font-size: 24px; }
.choice.long { font-size: 19px; text-align: left; padding: 16px 18px; line-height: 1.4; }
.choice.pic { font-size: 64px; padding: 12px; line-height: 1.15; }
.en { color: var(--blue); font-weight: 900; }
.fb .en, .ex .en { color: #1d4ed8; }
.listen-btn {
  margin-top: 12px; font-size: 28px; background: var(--blue); color: #fff; box-shadow: 0 5px 0 #2f6ad9;
  animation: pulse-blue 1.6s 2;
}
@keyframes pulse-blue { 50% { transform: scale(1.06); } }
.vis-emoji { font-size: 120px; line-height: 1; }
.vis-pics figure { margin: 0; display: grid; justify-items: center; gap: 4px; }
.vis-pics figure span { font-size: 56px; line-height: 1; }
.vis-pics figcaption { font-size: 24px; font-weight: 900; color: var(--blue); }
.choice:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--line); }
.choice.right { background: var(--green); color: #fff; box-shadow: 0 6px 0 #15895f; }
.choice.wrong { background: var(--red-soft); color: var(--red); box-shadow: 0 6px 0 #fca5a5; }
.choice.picked { background: var(--blue); color: #fff; }
.inputbox {
  margin: 0 auto 16px; max-width: 300px; min-height: 84px; border-radius: 20px; background: #fff;
  border: 4px solid var(--blue); font-size: 52px; font-weight: 900; display: grid; place-items: center;
}
.inputbox .placeholder { color: #cbd5e1; }
.inputbox.right { border-color: var(--green); background: var(--green-soft); }
.inputbox.wrong { border-color: var(--red); background: var(--red-soft); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 380px; margin: 0 auto; }
.key {
  border: 0; background: #fff; border-radius: 16px; box-shadow: 0 5px 0 var(--line); padding: 14px 0;
  font-size: 32px; font-weight: 900;
}
.key:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }
.key.ok { background: var(--green); color: #fff; box-shadow: 0 5px 0 #15895f; }
/* Câu bấm số trên màn hình rộng: câu hỏi + lời giải bên trái, bàn phím số bên phải (khỏi phải thu nhỏ) */
@media (min-width: 860px) {
  .qgrid.num {
    display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "q a" "f a";
    grid-template-rows: auto 1fr; column-gap: 24px; align-items: start;
  }
  .qgrid.num .qcard { grid-area: q; }
  .qgrid.num .answer-area { grid-area: a; margin-top: 0; }
  .qgrid.num .feedback { grid-area: f; }
}
.feedback { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; }
.feedback .fb { flex: 1 1 420px; }
.feedback #nextBtn { flex: none; }
/* ── Mẹo tính nhanh (tách số, ghép cho tròn trăm) ── */
.trick-btn {
  margin: 6px auto 0; display: block; font-size: 22px; background: var(--amber-soft); box-shadow: 0 5px 0 #f3d58a;
}
.trick-btn[hidden] { display: none; }
.trick { margin-top: 10px; }
.trick-title { font-size: 20px; font-weight: 900; color: var(--primary-dark); }
.trick-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 18px; }
.trick-svg { width: 330px; max-width: 100%; height: auto; }
.trick-svg .tk-n { font: 900 36px "Nunito", "Segoe UI", sans-serif; fill: var(--ink); }
.trick-svg .tk-n.op { fill: var(--primary); }
.trick-svg .tk-n.sm { font-size: 30px; }
.trick-svg .tk-n.round { fill: #fff; font-size: 28px; }
.trick-svg .tk-br { stroke: #94a3b8; stroke-width: 3; stroke-linecap: round; }
.trick-svg .tk-arrow { fill: none; stroke-width: 4; stroke-linecap: round; }
/* nhóm màu: 0 cam, 1 xanh dương, 2 xanh lá, 3 tím (cùng màu = gom với nhau) */
.trick-svg .tk-pair { stroke-width: 3; }
.trick-svg .tk-pair.g0 { fill: #ffedd5; stroke: #ff7a59; }   .trick-svg .tk-n.pair.g0 { fill: #c2410c; }
.trick-svg .tk-pair.g1 { fill: #dbeafe; stroke: #4f8cff; }   .trick-svg .tk-n.pair.g1 { fill: #1d4ed8; }
.trick-svg .tk-pair.g2 { fill: #dcfce7; stroke: #22b07d; }   .trick-svg .tk-n.pair.g2 { fill: #166534; }
.trick-svg .tk-pair.g3 { fill: #f3e8ff; stroke: #a855f7; }   .trick-svg .tk-n.pair.g3 { fill: #7e22ce; }
.trick-svg .g0.tk-arrow { stroke: #ff7a59; } .trick-svg .g0.tk-round, .trick-svg .g0.tk-head { fill: #ff7a59; }
.trick-svg .g1.tk-arrow { stroke: #4f8cff; } .trick-svg .g1.tk-round, .trick-svg .g1.tk-head { fill: #4f8cff; }
.trick-svg .g2.tk-arrow { stroke: #22b07d; } .trick-svg .g2.tk-round, .trick-svg .g2.tk-head { fill: #22b07d; }
.trick-svg .g3.tk-arrow { stroke: #a855f7; } .trick-svg .g3.tk-round, .trick-svg .g3.tk-head { fill: #a855f7; }
.trick-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; text-align: left; }
.trick-steps li {
  font-size: 24px; font-weight: 800; padding: 4px 14px; border-radius: 12px; background: #f1f5f9;
  white-space: nowrap; animation: pop .4s backwards;
}
.trick-steps li small { font-size: 15px; font-weight: 800; opacity: .8; }
.trick-steps li.g0 { background: #ffedd5; color: #c2410c; }
.trick-steps li.g1 { background: #dbeafe; color: #1d4ed8; }
.trick-steps li.g2 { background: #dcfce7; color: #166534; }
.trick-steps li.g3 { background: #f3e8ff; color: #7e22ce; }
.trick-steps li.last { outline: 2px dashed #94a3b8; outline-offset: -2px; }
.trick-steps .tk-q { color: var(--blue); }
/* nhảy trên tia số: 579 →(+1) 580 →(+20) 600 →(+42) 642 */
.jumps { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 2px 4px; margin: 6px 0; }
.jumps .jp { min-width: 64px; padding: 6px 10px; border-radius: 14px; background: #fff; border: 3px solid #cbd5e1;
  font-size: 26px; font-weight: 900; text-align: center; }
.jumps .hop { display: grid; justify-items: center; line-height: 1; padding-bottom: 8px; }
.jumps .hop small { font-size: 18px; font-weight: 900; }
.jumps .hop i { font-style: normal; font-size: 22px; }
.jumps .g0 { color: #c2410c; } .jumps .jp.g0 { border-color: #ff7a59; background: #fff7ed; }
.jumps .g1 { color: #1d4ed8; } .jumps .jp.g1 { border-color: #4f8cff; background: #eff6ff; }
.jumps .g2 { color: #166534; } .jumps .jp.g2 { border-color: #22b07d; background: #f0fdf4; }
.qgrid.num .trick-svg { width: 280px; }
.qgrid.num .trick-steps li { font-size: 22px; padding: 4px 12px; }

/* ── Hình vẽ Toán ── */
.svgv { max-width: 100%; height: auto; }
.vis-shapes { gap: 12px; }
.svgv.clock { width: 170px; height: 170px; }

/* ── Bài đọc hiểu ── */
.passage-card { margin-bottom: 14px; padding: 18px 22px; background: #fffdf6; }
.ps-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ps-head b { font-size: 22px; color: var(--primary-dark); }
.ps-text { font-size: 22px; line-height: 1.65; font-weight: 700; text-align: left; max-height: 40vh; overflow-y: auto; }
.read-choices { display: block; margin: 0 auto 14px; font-size: 20px; background: var(--amber-soft); box-shadow: 0 5px 0 #f3d58a; }
.choice.reading { outline: 5px solid var(--amber); outline-offset: 2px; transform: scale(1.03); }
.fb { width: 100%; border-radius: 18px; padding: 12px 18px; font-size: 22px; font-weight: 700; line-height: 1.45; text-align: left; }
.fb.ok { background: var(--green-soft); color: #166534; text-align: center; font-size: 30px; font-weight: 900; }
/* Lời khen / nhắc nổi lên giữa khung câu hỏi (app.js đặt vị trí theo khung câu hỏi) */
.float-fb {
  position: fixed; left: 50%; transform: translate(-50%, -50%); z-index: 30; pointer-events: none;
  max-width: calc(100vw - 32px); padding: 16px 40px; border-radius: 26px; text-align: center;
  font-size: 40px; font-weight: 900; line-height: 1.25; box-shadow: 0 10px 0 rgba(43, 45, 66, .12), 0 18px 40px rgba(43, 45, 66, .2);
  animation: pop-float .4s;
}
.float-fb.ok { background: var(--green-soft); color: #166534; border: 5px solid var(--green); }
.float-fb.oops { background: #fff7ed; color: #9a3412; border: 5px solid var(--amber); font-size: 34px; }
.float-fb small { display: block; font-size: 24px; font-weight: 800; color: var(--ink); margin-top: 4px; }
.float-fb small b { color: var(--green); }
.fb.hint { background: var(--amber-soft); }
.fb.explain { background: #e0ecff; }
.shake { animation: shake .4s; }

/* ── Hình minh họa ── */
.vis { margin: 16px auto 0; display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.obj { font-size: 40px; line-height: 1.15; display: inline-block; position: relative; }
.obj.sm { font-size: 28px; }
.obj.crossed { opacity: .35; }
.obj.crossed::after {
  content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--red);
  font-weight: 900; font-size: 34px; opacity: 1;
}
.objs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 280px; }
.objs.grid5 { display: grid; grid-template-columns: repeat(5, auto); }
.vis .op { font-size: 44px; font-weight: 900; color: var(--primary); }
.vis .op.sep { width: 2px; height: 60px; background: var(--line); }
.vis-rows { flex-direction: column; align-items: flex-start; gap: 10px; display: inline-flex; }
.vis-rows .row { display: flex; gap: 10px; }
.vis-groups .grp {
  display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; max-width: 140px; padding: 10px;
  border: 3px dashed #cbd5e1; border-radius: 18px; background: #fffdf7;
}
.vis-groups .grp.extra { border-style: dotted; border-color: var(--red); background: var(--red-soft); }
.vis-column pre {
  margin: 0; font-family: "Consolas", "Courier New", monospace; font-size: 44px; font-weight: 700;
  line-height: 1.2; text-align: right; background: #fffdf7; border-radius: 16px; padding: 12px 24px;
  border: 2px solid var(--line);
}
.vis-tens { align-items: flex-end; gap: 8px; }
.bundle { display: grid; grid-template-rows: repeat(10, 12px); gap: 2px; padding: 4px; background: #e0ecff; border-radius: 8px; }
.bundle i, .ones i { display: block; width: 18px; height: 12px; background: var(--blue); border-radius: 3px; }
.ones { display: grid; grid-template-columns: repeat(2, 18px); gap: 4px; margin-left: 12px; }
.ones i { height: 18px; background: var(--primary); border-radius: 50%; }
.vis-caption { font-weight: 800; color: var(--muted); margin-top: 8px; font-size: 20px; }
.vis-numbers { flex-direction: column; align-items: flex-start; gap: 6px; display: inline-flex; }
.vis-numbers .row { display: flex; align-items: center; gap: 14px; }
.vis-numbers .n { font-size: 36px; font-weight: 900; width: 48px; text-align: right; color: var(--primary-dark); }
.vis-numbers .obj { font-size: 30px; }
.vis-line { gap: 6px; }
.vis-line span {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 12px; background: #fff;
  border: 2px solid var(--line); font-size: 24px; font-weight: 900;
}
.vis-line span.mark { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Kết quả ── */
.result { text-align: center; }
.result { padding: 22px 24px; }
.result .big-emoji { font-size: 80px; line-height: 1.1; animation: pop .6s; }
.result h1 { font-size: 34px; }
.score { font-size: 60px; font-weight: 900; color: var(--primary-dark); margin: 4px 0; line-height: 1.15; }
.star-row { font-size: 56px; letter-spacing: 8px; }
.star-row .off { filter: grayscale(1); opacity: .3; }
.star-row span { display: inline-block; animation: pop .5s backwards; }
.unlock { margin: 12px auto; background: var(--green-soft); border-radius: 16px; padding: 14px 18px; font-weight: 800; font-size: 20px; max-width: 520px; }
.review { text-align: left; margin-top: 24px; display: grid; gap: 12px; }
.review h3 { font-size: 22px; }
.review-item { background: #fff; border-radius: 16px; padding: 14px 18px; border-left: 8px solid var(--red); box-shadow: var(--shadow); }
.review-item .q { font-size: 22px; font-weight: 900; }
.review-item .a { margin: 4px 0; font-weight: 700; }
.review-item .a .bad { color: var(--red); }
.review-item .a .good { color: var(--green); }
.review-item .ex { color: var(--muted); font-weight: 600; white-space: pre-line; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }

/* ── Góp ý / báo lỗi (nút 💬 góc dưới bên phải) ── */
.fb-fab { position: fixed; right: 16px; bottom: 16px; z-index: 45; width: 52px; height: 52px; border-radius: 50%;
  border: 0; background: #fff; box-shadow: 0 4px 0 var(--line), 0 6px 16px rgba(43, 45, 66, .18);
  font-size: 26px; line-height: 1; padding: 0; opacity: .85; }
.fb-fab:hover, .fb-fab:focus-visible { opacity: 1; }
.fb-fab:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.fb-modal { position: fixed; inset: 0; z-index: 100; background: rgba(43, 45, 66, .45); display: grid;
  place-items: center; padding: 16px; }
.fb-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; display: grid; gap: 12px; }
.fb-box h2 { margin: 0; }
.fb-box p { margin: 0; }
.fb-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fb-kind { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 12px 14px; font-size: 18px;
  font-weight: 800; text-align: left; box-shadow: 0 3px 0 var(--line); }
.fb-kind.on { border-color: var(--primary); background: var(--amber-soft); }
#fbMsg { border: 2px solid var(--line); border-radius: 14px; padding: 12px; font: inherit; font-size: 17px;
  min-height: 84px; resize: vertical; outline: none; }
#fbMsg:focus { border-color: var(--blue); }
.fb-where { font-size: 15px; color: var(--muted); }
.fb-actions { display: flex; justify-content: flex-end; gap: 10px; }
.fb-actions .btn:disabled { opacity: .5; }
.pl-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pl-row .btn { padding: 8px 14px; font-size: 16px; }
.vt-info { display: grid; gap: 4px; background: #f6f8fc; border-radius: 14px; padding: 10px 14px; font-size: 15px; }
.vt-info div { display: flex; justify-content: space-between; gap: 12px; }
.vt-info span { color: var(--muted); white-space: nowrap; }
.vt-info b { text-align: right; overflow-wrap: anywhere; }
.vt-status { font-weight: 700; font-size: 17px; min-height: 2.6em; }
.vt-tips { font-size: 15px; color: #374151; display: grid; gap: 4px; background: var(--amber-soft); border-radius: 14px; padding: 10px 14px; }
@media (max-width: 600px) {
  .fb-kinds { grid-template-columns: 1fr; }
  .fb-fab { width: 44px; height: 44px; font-size: 22px; right: 10px; bottom: 10px; }
}

/* ── Hiệu ứng ── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: var(--ink);
  color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 700; transition: transform .25s, opacity .25s;
  z-index: 50; max-width: calc(100% - 32px); opacity: 0; visibility: hidden;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.confetti { position: fixed; top: -60px; font-size: 32px; pointer-events: none; z-index: 40; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes pop-float { 0% { transform: translate(-50%, -50%) scale(0); } 70% { transform: translate(-50%, -50%) scale(1.15); } 100% { transform: translate(-50%, -50%) scale(1); } }
@keyframes bounce { 50% { transform: translateY(-12px); } }
@keyframes pulse { 50% { outline-color: rgba(255, 122, 89, .35); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

@media (max-width: 640px) {
  .prompt { font-size: 40px; padding: 8px 40px; }
  .prompt.long { font-size: 22px; }
  .slide-text { font-size: 21px; }
  .slide-text.table { columns: 1; }
  .slide-text.passage { font-size: 20px; }
  .ps-text { font-size: 19px; }
  .ps-head { flex-wrap: wrap; }
  .topbar .title { display: none; }
  .choice { font-size: 30px; }
}

/* Nhắc mở bằng Edge khi trình duyệt không có giọng đọc tiếng Việt */
.voice-note { line-height: 1.5; }
.voice-note .btn { display: block; width: fit-content; margin-top: 10px; text-decoration: none; font-size: 17px; padding: 8px 16px; }
.login .voice-note { font-size: 15px; text-align: left; margin: 0 0 16px; }

/* ── Ôn thi học kì + Chinh phục lỗi sai ── */
.subject { position: relative; }
.fix-badge { position: absolute; top: 14px; right: 14px; background: var(--red-soft); color: #b91c1c; font-weight: 900;
  border-radius: 99px; padding: 4px 12px; font-size: 18px; }
/* thanh 2 mục trên đầu danh sách bài: dính dưới thanh trên cùng nên cuộn tới bài nào cũng thấy */
.extras { position: sticky; top: 70px; z-index: 4; display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 10px -6px 6px; padding: 8px 6px; background: rgba(255, 246, 229, .94); border-radius: 0 0 18px 18px; }
.extra { border: 0; background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; text-align: left; }
.extra .ico { font-size: 38px; }
.extra b { display: block; font-size: 20px; }
.extra small { color: var(--muted); font-weight: 700; font-size: 15px; }
.extra.exam { border-left: 8px solid var(--blue); }
.extra.fix { border-left: 8px solid var(--green); }
.extra.fix.has { border-left-color: var(--red); }
.extra.fix.has small { color: #b91c1c; }
.sec-title { font-size: 30px; margin: 2px 0 4px; }
.sec-sub { font-weight: 700; margin: 0 0 14px; font-size: 17px; }
.exam-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.exam-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.exam-card h2 { margin: 0 0 6px; font-size: 26px; color: var(--primary-dark); }
.exam-card p { margin: 6px 0; font-weight: 700; font-size: 17px; }
.exam-card .best { color: var(--ink); }
.exam-card .best .st { letter-spacing: 1px; }
.exam-card.off { opacity: .75; }
.exam-card.off h2 { color: var(--muted); }
.steps2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.steps2 .step { background: var(--bg1); padding: 16px 10px; box-shadow: 0 4px 0 var(--line); }
.steps2 .step span { font-size: 44px; }
.steps2 .step b { font-size: 22px; }
.fix-stat { display: inline-block; margin-left: 6px; color: var(--ink); }
.fix-go { display: block; margin: 0 auto 14px; }
.fix-empty { background: var(--green-soft); border-radius: 18px; padding: 22px; font-size: 24px; font-weight: 900; text-align: center; }
.fix-pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 12px; font-size: 18px; }
.fix-pager .btn[disabled] { opacity: .35; }
.mis-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mis-card { border: 0; background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 12px 14px; text-align: left;
  display: grid; gap: 4px; align-content: start; border-top: 6px solid var(--red); min-width: 0; }
.mis-card.half { border-top-color: var(--amber); }
.mis-card small { color: var(--muted); font-weight: 800; }
.mis-card .q { font-size: 20px; font-weight: 900; line-height: 1.25; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.mis-card .st { font-weight: 700; font-size: 15px; color: #b91c1c; }
.mis-card.half .st { color: #92400e; }
.mis-card .see { font-weight: 800; color: var(--blue); font-size: 15px; }
.mis-detail { position: relative; text-align: center; padding: 20px 24px; }
.mis-detail .speak { position: absolute; top: 12px; right: 12px; }
.mis-detail .from { display: block; color: var(--muted); font-weight: 800; padding: 0 48px; }
.mis-detail .prompt { font-size: 40px; }
.mis-detail .a { font-size: 22px; font-weight: 800; margin-top: 10px; }
.mis-detail .a .bad { color: var(--red); }
.mis-detail .a .good { color: var(--green); }
.mis-detail .ex { font-size: 20px; font-weight: 700; color: var(--muted); white-space: pre-line; margin-top: 6px; }
.from-chip { display: inline-block; margin: 0 0 4px; background: var(--bg2); color: #1e40af; border-radius: 99px;
  padding: 2px 12px; font-weight: 800; font-size: 15px; }
.score .point { color: var(--primary-dark); }
.score small { font-size: 22px; color: var(--muted); font-weight: 800; }
.saved-note { margin: 10px auto 0; background: var(--amber-soft); border-radius: 14px; padding: 10px 16px; font-weight: 700;
  max-width: 560px; }
.fix-lines { display: grid; gap: 6px; margin-top: 8px; font-weight: 800; font-size: 19px; }
@media (max-width: 760px) {
  .exam-grid, .extras { grid-template-columns: 1fr; }
  .mis-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .mis-grid { grid-template-columns: 1fr; }
}

/* Phụ huynh → 💪 Lỗi sai */
.kchip .kn { display: inline-block; min-width: 24px; margin-left: 4px; padding: 0 6px; border-radius: 99px;
  background: #fee2e2; color: #b91c1c; font-size: 14px; font-weight: 800; text-align: center; }
.pmis-sub { margin: 18px 0 8px; font-size: 20px; }
.pmis { border: 2px solid var(--line); border-radius: 14px; margin: 8px 0; background: #fff; }
.pmis[open] { border-color: var(--blue); }
.pmis summary { cursor: pointer; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.pmis .pfrom { font-size: 14px; font-weight: 800; color: var(--muted); }
.pmis .pq { font-weight: 800; font-size: 18px; flex: 1 1 260px; }
.pmis .pa { font-size: 16px; }
.pmis .pa .bad { color: var(--red); }
.pmis .pa .good { color: var(--green); }
.pmis .pw { font-size: 14px; color: var(--muted); font-weight: 700; }
.pmis .pbody { padding: 0 14px 12px; display: grid; gap: 8px; font-size: 17px; line-height: 1.5; }
.pmis .pvis { zoom: .6; }

/* ── 🎮 Trò chơi ── */
.hello .game-btn { margin-left: auto; }
.game-btn {
  display: grid; justify-items: center; gap: 2px; border: 0; border-radius: 22px; padding: 10px 18px; min-width: 150px;
  background: linear-gradient(135deg, #ffd34d, #ff9f43); color: #4a2a00; box-shadow: 0 5px 0 #d97a1c, var(--shadow);
  font-family: inherit; cursor: pointer;
}
.game-btn .gb-ico { font-size: 34px; line-height: 1; }
.game-btn b { font-size: 19px; }
.game-btn small { font-size: 13px; font-weight: 800; }
.game-btn.locked { background: linear-gradient(135deg, #eef1f7, #d9dfec); color: #4b5563; box-shadow: 0 5px 0 #b8c0d2, var(--shadow); }
.game-btn.ready { animation: wiggle 1.8s ease-in-out infinite; }
.play-note { font-weight: 800; font-size: 19px; margin-bottom: 14px; }
.play-note.locked { background: #eef1f7; color: #374151; }
.play-note.ready, .play-note.playing { background: var(--green-soft); color: #14532d; }
.play-earn, .play-need { margin: 12px auto 0; border-radius: 16px; padding: 10px 16px; font-weight: 800; font-size: 18px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.play-earn { background: #fff4c2; color: #6b4500; }
.play-need { background: #eef1f7; color: #4b5563; font-size: 16px; }
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.game-card { padding: 18px; }
.gc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.gc-head .gc-ico { font-size: 56px; line-height: 1; }
.gc-head h2 { margin: 0 0 2px; font-size: 26px; }
.gsubs { display: grid; gap: 10px; }
.gsub {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; text-align: left;
  border: 0; border-left: 8px solid var(--c); border-radius: 16px; background: #fff; box-shadow: var(--shadow);
  padding: 10px 14px; font-family: inherit; cursor: pointer;
}
.gsub .gs-ico { font-size: 30px; }
.gsub b { font-size: 21px; }
.gsub small { font-weight: 800; color: var(--muted); font-size: 15px; }
.gsub:not(:disabled):hover { transform: translateY(-2px); }
.gsub:disabled { opacity: .45; cursor: default; }
@media (max-width: 760px) { .game-grid { grid-template-columns: 1fr; } }

/* 🎈 Bắn bóng bay: cả cửa sổ, không cuộn; khung trời chiếm phần còn lại */
.app-fit > main.screen.game-screen { display: flex; flex-direction: column; gap: 8px; overflow: hidden; padding: 8px 16px 12px; }
.game-screen > * { width: 100%; max-width: 1000px; margin-left: auto; margin-right: auto; }
.bb-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; flex: none; }
.bb-chip { background: #fff; border-radius: 99px; padding: 4px 14px; font-weight: 800; font-size: 17px; box-shadow: var(--shadow); }
.bb-chip.score b { color: var(--primary-dark); }
.bb-chip.clock { position: relative; min-width: 100px; text-align: center; font-size: 21px; }
.bb-chip.clock b { font-variant-numeric: tabular-nums; }
.bb-chip.clock.low { color: var(--red); animation: pulse-blue .8s ease-in-out infinite; }
.bb-delta { position: absolute; left: 50%; top: 100%; font-style: normal; font-weight: 900; font-size: 20px;
  white-space: nowrap; opacity: 0; pointer-events: none; z-index: 3; transform: translateX(-50%); }
.bb-delta.up { color: #15803d; animation: bb-delta 1.1s ease-out; }
.bb-delta.down { color: var(--red); animation: bb-delta 1.1s ease-out; }
@keyframes bb-delta {
  0% { opacity: 0; transform: translate(-50%, -6px) scale(.8); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.2); }
  70% { opacity: 1; transform: translate(-50%, 6px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, 16px) scale(1); }
}
.bb-q { position: relative; text-align: center; padding: 10px 56px; flex: none; }
.bb-q .speak { position: absolute; top: 8px; right: 8px; }
.bb-q .prompt { font-size: 38px; padding: 0; }
.bb-q .prompt.long { font-size: 24px; }
.bb-vis { zoom: .62; max-height: 260px; overflow: hidden; }
.sky {
  position: relative; flex: 1 1 auto; min-height: 230px; overflow: hidden; border-radius: var(--radius);
  background: linear-gradient(#bfe3ff, #e8f5ff 70%, #f4fbff); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .7);
}
.sky::before, .sky::after { content: "☁️"; position: absolute; font-size: 64px; opacity: .8; pointer-events: none; }
.sky::before { top: 14%; left: 6%; }
.sky::after { top: 46%; right: 7%; font-size: 48px; }
.balloon {
  --bw: 118px; position: absolute; bottom: -180px; width: var(--bw); height: 176px; border: 0; padding: 0; background: none;
  cursor: pointer; z-index: 1; font-family: inherit; transition: opacity .25s;
}
.balloon.wide { --bw: 156px; }
.bl-body {
  position: relative; display: grid; place-items: center; width: 100%; height: 132px; border-radius: 50% 50% 47% 47% / 56% 56% 44% 44%;
  background: radial-gradient(circle at 30% 26%, rgba(255, 255, 255, .7) 0 9%, transparent 10%), var(--bc);
  box-shadow: inset -10px -14px 0 rgba(0, 0, 0, .12); animation: sway 2.4s ease-in-out infinite alternate;
}
.bl-body::after {
  content: ""; position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent; border-top: 11px solid var(--bc);
}
.bl-string { display: block; width: 2px; height: 40px; margin: 8px auto 0; background: rgba(60, 60, 80, .45); }
.bl-text { color: #fff; font-weight: 900; font-size: 32px; line-height: 1.1; padding: 0 8px; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.balloon.wide .bl-text { font-size: 21px; }
.balloon.pic .bl-text { font-size: 56px; text-shadow: none; }
.balloon:not(:disabled):hover .bl-body { filter: brightness(1.08); }
.balloon.popped .bl-body { animation: bl-pop .35s forwards; }
.balloon.burst .bl-body { animation: bl-burst .4s forwards; }
.balloon.popped .bl-string, .balloon.burst .bl-string { opacity: 0; }
.balloon.popped::after {
  content: attr(data-pts); position: absolute; top: 34px; left: 50%; transform: translateX(-50%);
  font-size: 40px; font-weight: 900; color: #f59e0b; text-shadow: 0 2px 0 #fff; animation: pts-up 1s forwards;
}
.balloon.fade { opacity: .25; }
.balloon.glow .bl-body { animation: none; box-shadow: 0 0 0 6px #fff, 0 0 28px 12px rgba(34, 176, 125, .9); }
.bb-msg {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3; max-width: 92%;
  background: #fff; border-radius: 99px; padding: 8px 22px; font-weight: 900; font-size: 22px; text-align: center;
  box-shadow: var(--shadow); opacity: 0; transition: opacity .2s; pointer-events: none;
}
.bb-msg.show { opacity: 1; }
.bb-msg.ok { color: var(--green); }
.bb-msg.oops { color: var(--red); }
.bb-msg.hint { color: #b45309; }

/* 👾 Đánh quái lỗi sai */
.qcard.monster .prompt { padding-left: 84px; }
.boss { position: absolute; top: 8px; left: 14px; font-size: 64px; line-height: 1; animation: boss-idle 1.6s ease-in-out infinite; }
.boss.boom { animation: boss-boom .8s forwards; }
.boss.laugh { animation: boss-laugh .6s 2; }
.boss.flee { animation: boss-flee .9s forwards; }
.dot.mon { width: auto; height: auto; border: 0; background: none; font-size: 26px; line-height: 1; }
.dot.mon.cur { transform: scale(1.35); }
.dot.mon.ok, .dot.mon.ok2 { background: none; filter: grayscale(1); opacity: .4; }
.dot.mon.bad { background: none; opacity: .25; }
.dot.mon.retry { background: none; }
.mon-gallery { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; font-size: 44px; line-height: 1.1; }
.mon-gallery span { position: relative; }
.mon-gallery .down::after {
  content: "✔"; position: absolute; right: -6px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 14px; font-weight: 900; display: grid; place-items: center;
}
.mon-gallery .away { opacity: .3; }

@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-4deg); } 86% { transform: rotate(4deg); } 94% { transform: rotate(-2deg); } }
@keyframes sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes bl-pop { 0% { transform: scale(1); } 60% { transform: scale(1.35); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes bl-burst { 0% { transform: scale(1); } 40% { transform: scale(1.15, .8); } 100% { transform: scale(.2); opacity: 0; filter: grayscale(1); } }
@keyframes pts-up { 0% { opacity: 0; margin-top: 10px; } 20% { opacity: 1; } 100% { opacity: 0; margin-top: -60px; } }
@keyframes boss-idle { 50% { transform: translateY(-6px) rotate(-3deg); } }
@keyframes boss-boom { 0% { transform: scale(1); } 30% { transform: scale(1.4) rotate(12deg); filter: brightness(2); }
  100% { transform: scale(.2) rotate(-40deg); opacity: 0; } }
@keyframes boss-laugh { 25% { transform: translateY(-14px) rotate(-10deg); } 75% { transform: translateY(-6px) rotate(10deg); } }
@keyframes boss-flee { 30% { transform: translateX(-10px); } 100% { transform: translateX(-160px) scale(.6); opacity: 0; } }

/* ── Ba Mẹ tự tạo tài khoản, thêm bé ── */
.signup-link { margin-top: 18px; display: grid; gap: 6px; justify-items: center; }
.login label small { font-weight: 400; font-size: 14px; }
.notice.setup-steps { margin-top: 14px; font-weight: 400; }
.notice.setup-steps ol { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 4px; }
.kchip.add { border-style: dashed; color: #15803d; }
.kchip.add.on { border-color: #22b07d; background: #e7f8f0; color: #15803d; }
.prog-row input { border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 18px; font-family: inherit;
  min-width: 0; width: 100%; outline: none; }
.prog-row input:focus { border-color: var(--blue); }

/* Bảng xếp hạng: top 10 + bé đang xem. Màn hình rộng: 2 cột (cột trái hạng 1–6) cho vừa một màn hình */
@media (min-width: 900px) {
  .board-list.two { grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(var(--rows), auto);
    column-gap: 18px; }
}
.board-list li.gap { display: block; background: none; box-shadow: none; border: 0; padding: 0; text-align: center;
  font-size: 30px; font-weight: 900; line-height: 1; color: var(--muted); align-self: center; }
