:root {
  --nen: #0d0d12;
  --nen-2: #17171f;
  --nen-3: #22222d;
  --vien: #2e2e3b;
  --chu: #f4f4f6;
  --chu-phu: #a9a9b8;
  --mau-goi: #f59e0b;
  --trong: #f97316;
  --loop: #8b5cf6;
  --bass: #3b82f6;
  --giai: #ec4899;
  --fx: #eab308;
  --do: #ef4444;
  --nav-cao: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--nen); }
body {
  margin: 0; background: var(--nen); color: var(--chu);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.45;
  overscroll-behavior: none;
}
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.app { max-width: 520px; margin-inline: auto; min-height: 100svh; padding: 0 calc(16px + var(--safe-right)) calc(var(--nav-cao) + var(--safe-bottom) + 16px) calc(16px + var(--safe-left)); }
@media (min-width: 640px) { body { background: #08080b; } .app { background: var(--nen); box-shadow: 0 0 40px rgba(0,0,0,.6); } }

/* ---------- Đầu trang ---------- */
.dau { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(8px + var(--safe-top)) 0 8px; background: var(--nen); }
.logo { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.logo-cham { width: 14px; height: 14px; border-radius: 4px; background: var(--mau-goi); box-shadow: 0 0 12px var(--mau-goi); }
.dau-nut { display: flex; gap: 8px; }
.nut-vuong { min-width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--vien); background: var(--nen-2); font-size: 20px; font-weight: 700; display: grid; place-items: center; }
.nut-vuong:disabled { opacity: .45; cursor: default; }
.nut-vuong:active:not(:disabled) { transform: scale(.94); }
.icon-dung { width: 14px; height: 14px; border-radius: 3px; background: currentColor; }
.nut-ghi { height: 44px; min-width: 84px; padding: 0 14px; border-radius: 22px; border: 1px solid #5a2328; background: #2a1215; font-weight: 700; display: flex; align-items: center; gap: 8px; justify-content: center; font-variant-numeric: tabular-nums; }
.cham-do { width: 12px; height: 12px; border-radius: 50%; background: var(--do); }
body.dang-ghi .nut-ghi { background: var(--do); border-color: var(--do); }
body.dang-ghi .cham-do { background: #fff; border-radius: 2px; }

/* ---------- Gói beat ---------- */
.goi-cuon { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 0; margin: 0 -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
.goi-cuon::-webkit-scrollbar { display: none; }
.chip-goi { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--vien); background: var(--nen-2); font-weight: 600; font-size: 15px; white-space: nowrap; }
.chip-goi.chon { background: var(--mau-goi); border-color: var(--mau-goi); color: #111; }
.mo-ta { margin: 4px 0 8px; color: var(--chu-phu); font-size: 14px; }

.hang-nhip { display: flex; align-items: center; gap: 8px; }
.thanh-nhip { flex: 1; display: flex; align-items: center; min-height: 44px; }
.thanh-nhip input { width: 100%; accent-color: var(--mau-goi); height: 44px; margin: 0; }
.so-nhip { min-width: 56px; text-align: right; line-height: 1.05; }
.so-nhip b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.so-nhip small { color: var(--chu-phu); font-size: 12px; }
.hang-phu { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 10px; }
.nut-gonhip { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--vien); background: var(--nen-2); display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.gn-den { width: 10px; height: 10px; border-radius: 50%; background: #55556a; }
.nut-gonhip[aria-pressed="true"] .gn-den { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.phach { display: flex; gap: 8px; padding-right: 4px; }
.phach i { width: 14px; height: 14px; border-radius: 50%; background: var(--nen-3); border: 1px solid var(--vien); }
.phach i.sang { background: var(--mau-goi); border-color: var(--mau-goi); box-shadow: 0 0 10px var(--mau-goi); }
.phach i:first-child.sang { background: #fff; border-color: #fff; }

/* ---------- Lưới 12 ô ---------- */
.luoi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.o { --m: var(--trong); position: relative; height: clamp(72px, calc((100svh - 390px - var(--safe-top) - var(--nav-cao) - var(--safe-bottom)) / 4), 124px); border-radius: 18px; border: 1px solid color-mix(in srgb, var(--m) 45%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--m) 26%, var(--nen-2)), var(--nen-2));
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 10px 12px; text-align: left;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; overflow: hidden;
  transition: transform .06s ease, box-shadow .12s ease, background-color .12s ease; }
.o-trong { --m: var(--trong); } .o-loop { --m: var(--loop); } .o-bass { --m: var(--bass); } .o-giai { --m: var(--giai); } .o-fx { --m: var(--fx); }
.o-nhan { font-size: 16px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.o-loai { font-size: 12px; color: #d4d4de; margin-top: 2px; }
.o.bam { transform: scale(.95); background: var(--m); box-shadow: 0 0 22px color-mix(in srgb, var(--m) 70%, transparent); }
.o.bam .o-nhan, .o.bam .o-loai { color: #0b0b0f; }
.o-den { position: absolute; top: 10px; right: 10px; width: 12px; height: 12px; border-radius: 50%; background: #3b3b4d; }
.o.dang-bat { background: linear-gradient(160deg, color-mix(in srgb, var(--m) 70%, var(--nen-2)), color-mix(in srgb, var(--m) 35%, var(--nen-2))); border-color: var(--m); }
.o.dang-bat .o-den { background: #4ade80; box-shadow: 0 0 10px #4ade80; }
.o.cho { border-style: dashed; border-color: #fff; }
.o.cho .o-den { background: #fbbf24; }
.o.nhay { animation: nhay .18s ease-out; }
@keyframes nhay { from { box-shadow: 0 0 0 3px color-mix(in srgb, var(--m) 80%, transparent); } to { box-shadow: 0 0 0 0 transparent; } }
.trang-thai { color: var(--chu-phu); font-size: 13px; margin: 10px 0 0; min-height: 1.4em; }

/* ---------- Ghi âm ---------- */
.khoi-ghi { display: flex; flex-direction: column; align-items: center; padding: 16px 0 8px; text-align: center; }
.nut-ghi-lon { width: 168px; height: 168px; border-radius: 50%; border: 0; background: radial-gradient(circle at 50% 40%, #ff5a5a, #b91c1c); color: #fff; font-weight: 800; font-size: 17px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 10px 40px rgba(239,68,68,.35); }
.nut-ghi-lon:active { transform: scale(.97); }
.vong-ghi { width: 34px; height: 34px; border-radius: 50%; background: #fff; transition: border-radius .15s; }
.nut-ghi-lon[aria-pressed="true"] .vong-ghi { border-radius: 6px; width: 28px; height: 28px; }
.nut-ghi-lon[aria-pressed="true"] { animation: tho 1.6s ease-in-out infinite; }
@keyframes tho { 50% { box-shadow: 0 0 0 14px rgba(239,68,68,.18); } }
.dong-ho { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 12px; }
.muc-mic { width: 100%; max-width: 260px; height: 8px; border-radius: 4px; background: var(--nen-3); overflow: hidden; margin: 8px 0 12px; }
.muc-mic span { display: block; height: 100%; background: linear-gradient(90deg, #4ade80, #facc15, #ef4444); transform-origin: left; transform: scaleX(0); }
.goi-y-ghi { margin: 2px 0; font-size: 14px; color: var(--chu-phu); max-width: 340px; }
.goi-y-ghi b { color: var(--chu); }
.tieu-de-ds { display: flex; justify-content: space-between; align-items: baseline; margin-top: 20px; }
.tieu-de-ds h2 { font-size: 18px; margin: 0; }
.tieu-de-ds span { color: var(--chu-phu); font-size: 14px; }
.ds-ban-ghi { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ds-ban-ghi .trong { color: var(--chu-phu); font-size: 14px; padding: 16px; border: 1px dashed var(--vien); border-radius: 14px; text-align: center; }
.ban-ghi { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 14px; background: var(--nen-2); border: 1px solid var(--vien); }
.nut-nghe { flex: 0 0 44px; height: 44px; border-radius: 50%; border: 0; background: var(--mau-goi); color: #111; font-size: 15px; display: grid; place-items: center; }
.bg-chu { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bg-chu strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bg-chu span { font-size: 12px; color: var(--chu-phu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nut-nho { flex: 0 0 auto; min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--vien); background: var(--nen-3); font-size: 13px; font-weight: 600; display: grid; place-items: center; text-decoration: none; }
.nut-xoa { color: #fca5a5; }

/* ---------- Gợi ý vần ---------- */
.the-van { background: var(--nen-2); border: 1px solid var(--vien); border-radius: 16px; padding: 14px 16px; margin-top: 12px; }
.the-van h2 { font-size: 19px; margin: 0 0 6px; }
.the-van h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--chu-phu); margin: 12px 0 4px; }
.cau-moi { margin: 0; padding-left: 22px; font-size: 17px; }
.cau-moi li { margin: 4px 0; }
.van-goi-y, .meo { margin: 0; padding-left: 18px; }
.van-goi-y li, .meo li { margin: 5px 0; font-size: 15px; }
.van-goi-y b { color: var(--mau-goi); }
.the-van p { margin: 4px 0 10px; color: var(--chu-phu); font-size: 15px; }
.nut-chinh { min-height: 48px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--mau-goi); color: #111; font-weight: 700; }

/* ---------- Thanh dưới ---------- */
.nav-duoi { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; display: flex; justify-content: space-around;
  padding: 6px calc(8px + var(--safe-right)) calc(6px + var(--safe-bottom)) calc(8px + var(--safe-left));
  background: rgba(13,13,18,.96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--vien); }
@media (min-width: 640px) { .nav-duoi { max-width: 520px; left: 50%; transform: translateX(-50%); } }
.nav-duoi button { flex: 1; min-height: 52px; border: 0; background: none; color: var(--chu-phu); font-size: 12px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.nav-duoi button.chon { color: var(--chu); }
.nav-duoi button.chon .nav-icon { background: var(--mau-goi); }
.nav-icon { width: 24px; height: 24px; background: var(--chu-phu); -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.icon-luoi { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='2' width='6' height='6' rx='1.5'/%3E%3Crect x='9' y='2' width='6' height='6' rx='1.5'/%3E%3Crect x='16' y='2' width='6' height='6' rx='1.5'/%3E%3Crect x='2' y='9' width='6' height='6' rx='1.5'/%3E%3Crect x='9' y='9' width='6' height='6' rx='1.5'/%3E%3Crect x='16' y='9' width='6' height='6' rx='1.5'/%3E%3Crect x='2' y='16' width='6' height='6' rx='1.5'/%3E%3Crect x='9' y='16' width='6' height='6' rx='1.5'/%3E%3Crect x='16' y='16' width='6' height='6' rx='1.5'/%3E%3C/svg%3E"); }
.icon-mic { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='8' y='2' width='8' height='13' rx='4'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0h-2a5 5 0 0 1-10 0zM11 18h2v4h-2z'/%3E%3C/svg%3E"); }
.icon-hoc { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20a10 10 0 0 0 0-20zm0 3a7 7 0 1 1 0 14a7 7 0 0 1 0-14zm0 3a4 4 0 1 0 0 8a4 4 0 0 0 0-8zm0 2.5a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3z'/%3E%3C/svg%3E"); }
.icon-van { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h16a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H9l-5 4v-4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm3 5v2h10V8zm0 4v2h7v-2z'/%3E%3C/svg%3E"); }

/* ---------- Hộp hướng dẫn + thông báo ---------- */
dialog { width: min(92vw, 440px); max-height: 85svh; overflow: auto; border: 1px solid var(--vien); border-radius: 18px; background: var(--nen-2); color: var(--chu); padding: 18px 18px 16px; }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2 { font-size: 18px; margin: 4px 0 8px; }
dialog ol { padding-left: 20px; margin: 0 0 12px; }
dialog li { margin: 6px 0; font-size: 15px; }
dialog p { font-size: 15px; color: var(--chu-phu); }
dialog .nut-chinh { width: 100%; margin-top: 6px; }
/* Thông báo nằm trong đầu trang (chiếm chỗ riêng, đẩy nội dung xuống), không bao giờ đè lên chữ */
.thong-bao { display: none; flex-basis: 100%; order: 3; background: #fff; color: #111; padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; line-height: 1.35; }
.thong-bao.hien { display: block; animation: hienBao .18s ease-out; }
@keyframes hienBao { from { opacity: 0; transform: translateY(-4px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Chọn gói + biến thể ---------- */
.nut-chon-goi { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin-top: 4px; border-radius: 14px; border: 1px solid var(--vien); background: var(--nen-2); text-align: left; }
.cg-mau { flex: 0 0 14px; height: 14px; border-radius: 4px; background: var(--mau-goi); box-shadow: 0 0 10px var(--mau-goi); }
.cg-chu { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.cg-chu b { font-size: 17px; }
.cg-chu small { color: var(--chu-phu); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-doi { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; font-weight: 700; font-size: 14px; color: var(--mau-goi); line-height: 1.2; }
.cg-doi small { color: var(--chu-phu); font-weight: 500; font-size: 12px; }
.hang-bien { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 2px; }
.chip-nho { min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--vien); background: var(--nen-2); font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip-nho.chon { background: var(--mau-goi); border-color: var(--mau-goi); color: #111; }
.nut-phu { min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--vien); background: var(--nen-3); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.nut-phu:disabled, .nut-chinh:disabled { opacity: .55; }

.hop-goi { width: min(94vw, 480px); height: min(86svh, 720px); padding: 14px 14px 16px; }
.hg-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hg-dau h2 { margin: 0; }
.o-tim { display: block; margin: 10px 0 4px; }
.o-tim input, .van-nhay textarea { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--vien); background: var(--nen); color: var(--chu); font: inherit; font-size: 16px; }
.nhom-tieu-de { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--chu-phu); margin: 14px 0 6px; }
.luoi-goi-nhom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.o-goi { min-height: 72px; padding: 10px 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--m) 45%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--m) 22%, var(--nen-2)), var(--nen-2)); text-align: left; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.o-goi b { font-size: 15px; }
.o-goi small { font-size: 12px; color: #c9c9d6; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.o-goi.chon { border: 2px solid var(--m); box-shadow: 0 0 14px color-mix(in srgb, var(--m) 45%, transparent); }
.trong { color: var(--chu-phu); font-size: 14px; padding: 16px; border: 1px dashed var(--vien); border-radius: 14px; text-align: center; }

/* ---------- Tài khoản ---------- */
.the-tk { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--nen-2); border: 1px solid var(--vien); }
.the-tk:empty { display: none; }
.the-tk p { margin: 0 0 10px; color: var(--chu-phu); font-size: 14px; }
.the-tk.da-vao { display: flex; align-items: center; gap: 10px; }
.tk-anh { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--nen-3); display: grid; place-items: center; font-weight: 800; object-fit: cover; }
.tk-chu { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.tk-chu b, .tk-chu small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-chu small { color: var(--chu-phu); font-size: 13px; }
.nut-google { width: 100%; min-height: 48px; border-radius: 12px; border: 0; background: #fff; color: #1f1f1f; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.nut-google:disabled { background: #d8d8de; color: #3a3a44; cursor: default; }
.g-logo { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #fff; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); font-size: 13px; }
.ban-ghi.mang { border-color: color-mix(in srgb, var(--mau-goi) 40%, var(--vien)); }
.ban-ghi { flex-wrap: wrap; }
.ban-ghi .nut-len { flex: 1 0 100%; color: var(--mau-goi); }

/* ---------- Bài học ---------- */
.hoc-dau h2 { margin: 8px 0 4px; font-size: 20px; }
.hoc-dau p { margin: 0; color: var(--chu-phu); font-size: 14px; }
.hang-bai { --m: var(--mau-goi); padding: 10px; border-radius: 14px; background: var(--nen-2); border: 1px solid var(--vien); margin-bottom: 8px; }
.hb-ten { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.hb-ten b { font-size: 16px; }
.hb-ten small { color: var(--chu-phu); font-size: 13px; }
.cham-mau { width: 10px; height: 10px; border-radius: 3px; background: var(--m); align-self: center; }
.hb-nut { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.nut-bai { min-height: 64px; border-radius: 12px; border: 1px solid var(--vien); background: var(--nen-3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.2; }
.nut-bai b { font-size: 14px; }
.nut-bai .sao { color: #fbbf24; font-size: 14px; letter-spacing: 1px; }
.nut-bai small { font-size: 12px; color: var(--chu-phu); }
.nut-bai.da-choi { border-color: color-mix(in srgb, var(--m) 60%, var(--vien)); }
.choi-dau { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.choi-ten { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.choi-ten b { font-size: 18px; }
.choi-ten small { color: var(--chu-phu); font-size: 13px; }
.choi-trang { display: flex; align-items: center; gap: 12px; margin: 8px 0; min-height: 64px; }
.dem { flex: 0 0 88px; height: 64px; border-radius: 14px; background: var(--nen-2); border: 1px solid var(--vien); display: grid; place-items: center; font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; text-align: center; line-height: 1.1; }
.choi-phai { flex: 1; min-width: 0; }
.phan-hoi { font-size: 15px; font-weight: 700; min-height: 1.4em; }
.phan-hoi.kq-chuan { color: #4ade80; font-size: 20px; }
.phan-hoi.kq-som { color: #60a5fa; font-size: 20px; }
.phan-hoi.kq-tre { color: #fbbf24; font-size: 20px; }
.phan-hoi.kq-truot { color: #f87171; font-size: 20px; }
.dem-so { color: var(--chu-phu); font-size: 13px; font-variant-numeric: tabular-nums; }
.tien-do { height: 6px; border-radius: 3px; background: var(--nen-3); overflow: hidden; margin-bottom: 10px; }
.tien-do span { display: block; height: 100%; background: var(--mau-goi); transform-origin: left; transform: scaleX(0); }
.luoi-hoc .o { height: clamp(68px, calc((100svh - 400px - var(--safe-top) - var(--nav-cao) - var(--safe-bottom)) / 4), 110px); }
.luoi-hoc .o.mo { opacity: .38; }
.luoi-hoc .o .vong { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--p, 0) * 100%); background: color-mix(in srgb, var(--m) 55%, transparent); pointer-events: none; }
.luoi-hoc .o.sap { border: 2px solid #fff; }
.luoi-hoc .o.dung-luc { background: #fff; box-shadow: 0 0 26px #fff; }
.luoi-hoc .o.dung-luc .o-nhan, .luoi-hoc .o.dung-luc .o-loai { color: #0b0b0f; }
.luoi-hoc .o-nhan, .luoi-hoc .o-loai { position: relative; }
.o-kq { position: absolute; top: 8px; right: 10px; font-size: 13px; font-weight: 800; padding: 1px 6px; border-radius: 6px; }
.o-kq:empty { display: none; }
.o-kq.kq-chuan { background: #4ade80; color: #052e16; } .o-kq.kq-som { background: #60a5fa; color: #0b1e3f; }
.o-kq.kq-tre { background: #fbbf24; color: #3b2300; } .o-kq.kq-truot { background: #f87171; color: #3f0b0b; }
.choi-nut, .kq-nut { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.ket-qua { text-align: center; padding: 16px 4px; }
.kq-ten { color: var(--chu-phu); margin: 4px 0; }
.kq-diem { font-size: 64px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.kq-sao { color: #fbbf24; font-size: 40px; letter-spacing: 6px; margin: 4px 0; }
.kq-loi { font-size: 17px; font-weight: 700; margin: 6px 0 12px; }
.kq-so { list-style: none; padding: 0; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-width: 360px; }
.kq-so li { background: var(--nen-2); border: 1px solid var(--vien); border-radius: 12px; padding: 8px 4px; font-size: 13px; color: var(--chu-phu); display: flex; flex-direction: column; }
.kq-so b { color: var(--chu); font-size: 22px; }
.kq-ky-luc { font-weight: 700; margin: 12px 0 2px; }
.kq-luu { color: var(--chu-phu); font-size: 14px; margin: 0; }

/* ---------- Vần nhảy nhịp ---------- */
.vn-dau { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.vn-dau span { color: var(--chu-phu); font-size: 14px; white-space: nowrap; }
.van-nhay textarea { min-height: 96px; margin-top: 8px; resize: vertical; line-height: 1.4; }
.vn-san { position: relative; margin-top: 10px; padding: 40px 12px 14px; min-height: 150px; border-radius: 14px; background: var(--nen); border: 1px solid var(--vien); overflow: hidden; }
.vn-bong { position: absolute; left: 0; top: 0; width: 18px; height: 18px; transition-property: transform; transition-timing-function: linear; z-index: 2; }
.vn-bong i { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--mau-goi); box-shadow: 0 0 12px var(--mau-goi); }
.vn-bong i.nhay { animation: bongNhay .4s ease-in-out; }
@keyframes bongNhay { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-22px); } }
.vn-dong { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.9; }
.vn-chu { display: inline-block; color: #8d8d9e; transition: color .1s; }
.vn-chu.van { color: color-mix(in srgb, var(--mau-goi) 70%, #fff); text-decoration: underline 3px color-mix(in srgb, var(--mau-goi) 60%, transparent); text-underline-offset: 6px; }
.vn-chu.qua { color: #cfcfda; }
.vn-chu.dang { color: #fff; }
.vn-chu.van.dang, .vn-chu.van.qua { color: var(--mau-goi); }
.vn-chu.nay { animation: chuNay .26s ease-out; }
.vn-chu.manh.nay, .vn-chu.van.nay { animation: chuNayManh .32s ease-out; }
@keyframes chuNay { 40% { transform: translateY(-8px) scale(1.08); } }
@keyframes chuNayManh { 40% { transform: translateY(-16px) scale(1.25); } }
.vn-dong-sau { margin: 6px 0 0; color: #7c7c8c; font-size: 15px; min-height: 1.4em; }
.vn-cho { color: var(--chu-phu); font-size: 17px; font-weight: 600; }
.vn-nut { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.vn-meo { font-size: 14px !important; margin: 10px 0 0 !important; }
.mau-van { color: var(--mau-goi); }
