/* Làng Chữ — giao diện. Thiết kế cho điện thoại trước, máy tính thì canh giữa cột 560px. */
:root {
  --nen: #F4F1EA; --the: #FFFFFF; --chu: #1B2235; --chu2: #3A4358; --mo: #6B7487; --vien: #E3DED3;
  --chinh: #FFC531; --chinh-dam: #E0A800; --tren-chinh: #1B2235;
  --xanh: #2FB67C; --do: #E8505B; --tim: #7C5CFF; --troi: #14213D; --troi2: #2B4C7E;
  --bo: 18px; --bong: 0 3px 0 rgba(27, 34, 53, .08), 0 8px 24px rgba(27, 34, 53, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --nen: #0F1628; --the: #182239; --chu: #EEF2FA; --chu2: #CBD3E4; --mo: #9AA6BE; --vien: #27324D; --bong: 0 3px 0 rgba(0,0,0,.3); color-scheme: dark; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--nen); color: var(--chu); font: 600 16px/1.45 Nunito, "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
body.dang-hoc { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { margin: .2em 0 .4em; font-weight: 900; line-height: 1.2; }
h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h3 small, h2 small { font-weight: 700; color: var(--mo); font-size: .8em; margin-left: auto; }
.mo { color: var(--mo); } .nho { font-size: .85em; }
[hidden] { display: none !important; }

.man { max-width: 560px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 14px 20px; }
.khoi, .the-on, .the-tuan, .lang-dau { background: var(--the); border-radius: var(--bo); padding: 14px; margin: 12px 0; box-shadow: var(--bong); }
.trong, .dang-tai { text-align: center; padding: 60px 20px; color: var(--mo); }
.vong { width: 40px; height: 40px; border: 4px solid var(--vien); border-top-color: var(--chinh); border-radius: 50%; animation: quay 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes quay { to { transform: rotate(360deg); } }

/* ---------- nút ---------- */
.nut-chinh, .nut-phu { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 14px; padding: 12px 18px; font-weight: 900; text-decoration: none; transition: transform .08s; }
.nut-chinh { background: var(--chinh); color: var(--tren-chinh); box-shadow: 0 4px 0 var(--chinh-dam); }
.nut-chinh:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--chinh-dam); }
.nut-chinh:disabled { opacity: .45; box-shadow: none; }
.nut-phu { background: transparent; border: 2px solid var(--vien); color: var(--chu2); }
.nut-phu.do { color: var(--do); border-color: var(--do); }
.nut-chinh.nho, .nut-phu.nho { padding: 6px 12px; font-size: .88rem; border-radius: 10px; }
.nut-chinh.to, .nut-phu.to { width: 100%; padding: 15px; font-size: 1.08rem; margin: 6px 0; }
.nut-icon { background: none; border: 0; font-size: 1.1rem; padding: 6px 8px; border-radius: 10px; color: var(--mo); text-decoration: none; }
.hang-nut { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.hang-nut > * { flex: 1 1 140px; }
.hang-nut.doc > * { flex: 1 1 45%; }
.chip { background: var(--the); border-radius: 999px; padding: 4px 10px; font-weight: 900; box-shadow: var(--bong); white-space: nowrap; }
.cham { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--do); color: #fff; font: 900 11px/1 Nunito, sans-serif; font-style: normal; padding: 0 4px; }

/* ---------- thanh ---------- */
.thanh { height: 12px; background: var(--vien); border-radius: 999px; overflow: hidden; flex: 1; }
.thanh i { display: block; height: 100%; background: linear-gradient(90deg, #FFC531, #FF9F43); border-radius: 999px; transition: width .35s; }
.thanh.mong { height: 6px; }

/* ---------- đầu trang ---------- */
.dau { display: flex; align-items: center; gap: 10px; }
.dau-nv svg { display: block; }
.dau-giua { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dau-giua b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dau-giua span { font-size: .78rem; color: var(--mo); }
.vong-muc-tieu { --p: 0; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--xanh) calc(var(--p) * 1%), var(--vien) 0); flex: none; }
.vong-muc-tieu span { width: 34px; height: 34px; border-radius: 50%; background: var(--nen); display: grid; place-items: center; font-size: .72rem; font-weight: 900; }

/* ---------- màn Học ---------- */
.the-on { display: flex; gap: 12px; align-items: center; }
.the-on div { flex: 1; } .the-on p { margin: 4px 0 0; color: var(--mo); font-size: .9rem; }
.the-on.co { background: linear-gradient(135deg, #FFF3C4, #FFE0A3); color: #3A2C00; }
.the-on.co p { color: #6B5310; }
@media (prefers-color-scheme: dark) { .the-on.co { background: linear-gradient(135deg, #4A3A10, #5A3E12); color: #FFE9A8; } .the-on.co p { color: #E8D190; } }
.the-tuan { text-align: center; } .the-tuan.len { background: #DFF7EA; } .the-tuan.xuong { background: #FDE3E3; }
@media (prefers-color-scheme: dark) { .the-tuan.len { background: #173A2B; } .the-tuan.xuong { background: #3F1C22; } }
.cap.khoa h3 { opacity: .6; }
.duong-cd, .luoi-cd { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.the-cd { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: 16px; border: 2px solid var(--vien);
  background: var(--the); text-align: left; position: relative; min-height: 112px; }
.the-cd.xong { border-color: var(--xanh); }
.the-cd.khoa { opacity: .5; filter: grayscale(.7); }
.cd-icon { font-size: 1.7rem; } .cd-ten { font-weight: 900; font-size: .92rem; line-height: 1.2; flex: 1; }
.cd-sao { color: #F4A100; font-size: .85rem; letter-spacing: 1px; }
.the-cd .thanh { width: 100%; flex: none; }

/* ---------- hộp ---------- */
.hop-nen { position: fixed; inset: 0; background: rgba(10, 16, 32, .55); display: grid; place-items: end center; z-index: 50; animation: hien .15s; }
@keyframes hien { from { opacity: 0; } }
.hop { background: var(--the); width: min(560px, 100%); border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; position: relative; animation: len .2s; }
@keyframes len { from { transform: translateY(40px); } }
@media (min-width: 620px) { .hop-nen { place-items: center; } .hop { border-radius: 22px; } }
.hop-x { position: absolute; right: 10px; top: 10px; background: var(--nen); border: 0; width: 34px; height: 34px; border-radius: 50%; font-weight: 900; color: var(--mo); }
.hop > p { margin: 0 0 8px; }
.cd-dau { text-align: center; font-size: 2.2rem; } .cd-dau h2 { margin-bottom: 0; } .cd-dau small { font-size: .9rem; color: var(--mo); }
.hang-bai { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; padding: 12px 14px; margin: 8px 0; border-radius: 14px;
  border: 2px solid var(--vien); background: var(--the); }
.hang-bai span { font-weight: 900; } .hang-bai small { grid-column: 1; color: var(--mo); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hang-bai b { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: #F4A100; }
.hang-bai.khoa { opacity: .5; }
.hang-bai.boss { border-color: #F4A100; background: linear-gradient(135deg, rgba(255,197,49,.15), rgba(255,159,67,.12)); }
.so-tu { display: flex; flex-direction: column; gap: 8px; }
.dong-tu { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--vien); }
.nhan { font-style: normal; font-size: .72rem; background: var(--vien); padding: 1px 7px; border-radius: 99px; }
.nhan.thuoc { background: var(--xanh); color: #fff; }

/* ---------- màn bài học ---------- */
.bai { position: fixed; inset: 0; background: var(--nen); z-index: 40; display: flex; flex-direction: column; padding: max(10px, env(safe-area-inset-top)) 16px 0; max-width: 560px; margin: 0 auto; overflow: auto; }
.bai-dau { display: flex; align-items: center; gap: 10px; }
.bai-x { background: none; border: 0; font-size: 1.3rem; color: var(--mo); width: 32px; }
.tim, .combo { font-weight: 900; white-space: nowrap; }
.gio { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--troi); color: #fff; font-weight: 900; }
.gio.gap { background: var(--do); animation: nhay .5s infinite alternate; }
@keyframes nhay { to { transform: scale(1.12); } }
.boss-thanh { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-weight: 900; }
.boss-thanh .mau { flex: 1; height: 14px; background: var(--vien); border-radius: 99px; overflow: hidden; }
.boss-thanh .mau i { display: block; height: 100%; background: linear-gradient(90deg, #E8505B, #FF8A5B); transition: width .3s; }
.doi-thu { display: flex; align-items: center; gap: 8px; margin-top: 8px; background: var(--the); padding: 6px 10px; border-radius: 12px; font-size: .9rem; }
.doi-thu .thanh { max-width: 120px; }
.bai-than { flex: 1; padding: 18px 0; display: flex; flex-direction: column; }
.de { font-weight: 900; color: var(--mo); margin: 0 0 14px; }
.hoi-w { font-size: 2rem; font-weight: 900; text-align: center; margin: 18px 0 6px; }
.hoi-vi { font-size: 1.5rem; font-weight: 900; text-align: center; margin: 14px 0; }
.goi-y { text-align: center; color: var(--mo); letter-spacing: 3px; margin-bottom: 10px; }
.goi-y-vi { text-align: center; color: var(--mo); margin: 8px 0 14px; font-style: italic; }
.lua { display: grid; gap: 10px; margin-top: auto; padding-bottom: 8px; }
.nut-lua { display: flex; align-items: center; gap: 10px; text-align: left; padding: 14px; border-radius: 14px; border: 2px solid var(--vien); background: var(--the); font-weight: 800; box-shadow: 0 3px 0 var(--vien); }
.nut-lua b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--vien); font-size: .75rem; color: var(--mo); flex: none; }
.nut-lua.chon { border-color: #5B8DEF; }
.nut-lua.dung { border-color: var(--xanh); background: rgba(47, 182, 124, .14); box-shadow: 0 3px 0 var(--xanh); }
.nut-lua.sai { border-color: var(--do); background: rgba(232, 80, 91, .12); animation: lac .3s; }
@keyframes lac { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.nut-loa { background: var(--the); border: 2px solid var(--vien); border-radius: 12px; padding: 4px 10px; font-size: 1.1rem; }
.nut-loa.nho { font-size: .9rem; padding: 2px 7px; }
.nut-loa.to { font-size: 2.6rem; width: 110px; height: 110px; border-radius: 30px; background: #5B8DEF; border: 0; box-shadow: 0 5px 0 #3E6FD0; }
.nghe-to { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 16px 0; }
.the-tu { background: var(--the); border-radius: 20px; padding: 20px; text-align: center; box-shadow: var(--bong); }
.the-emoji { font-size: 3rem; } .the-w { font-size: 1.9rem; font-weight: 900; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.the-ipa { color: var(--mo); margin: 4px 0 8px; text-align: center; } .the-vi { font-size: 1.25rem; font-weight: 900; color: #E07A00; margin-bottom: 12px; }
.the-ex { text-align: left; background: var(--nen); border-radius: 12px; padding: 10px 12px; } .the-exvi { color: var(--mo); font-size: .9rem; margin-top: 4px; }
.cau-dien { font-size: 1.2rem; font-weight: 800; background: var(--the); padding: 16px; border-radius: 16px; line-height: 1.6; }
.o-trong { display: inline-block; min-width: 70px; border-bottom: 3px solid var(--chinh); color: transparent; }
.xep-dich { min-height: 58px; border-bottom: 2px dashed var(--vien); display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; margin-bottom: 12px; align-items: center; }
.xep-manh { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.manh { min-width: 44px; height: 46px; border-radius: 12px; border: 2px solid var(--vien); background: var(--the); font-weight: 900; font-size: 1.15rem; box-shadow: 0 3px 0 var(--vien); padding: 0 10px; }
.manh:disabled { opacity: .25; } .manh.dat { border-color: #5B8DEF; }
.o-go { width: 100%; padding: 13px 14px; border-radius: 14px; border: 2px solid var(--vien); background: var(--the); font-size: 1.1rem; font-weight: 800; outline: none; }
.o-go:focus { border-color: #5B8DEF; }
.nut-mic { margin: 14px auto 8px; display: block; padding: 18px 26px; border-radius: 999px; border: 0; background: var(--do); color: #fff; font-weight: 900; font-size: 1.1rem; box-shadow: 0 5px 0 #B93541; }
.nut-mic.dang { animation: nhay .6s infinite alternate; }
.ket-noi { text-align: center; } .diem-noi { font-size: 2.4rem; font-weight: 900; color: var(--do); } .diem-noi.dat { color: var(--xanh); }
.ket-noi .ok { color: var(--xanh); font-weight: 900; } .ket-noi .hut { color: var(--do); text-decoration: underline wavy; }
.ghep { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ghep .cot { display: flex; flex-direction: column; gap: 10px; }
.o-ghep { padding: 14px 8px; border-radius: 14px; border: 2px solid var(--vien); background: var(--the); font-weight: 800; box-shadow: 0 3px 0 var(--vien); min-height: 58px; }
.o-ghep.chon { border-color: #5B8DEF; } .o-ghep.dung { border-color: var(--xanh); opacity: .4; } .o-ghep.sai { border-color: var(--do); animation: lac .3s; }
.bai-chan { position: sticky; bottom: 0; padding: 12px 0 calc(14px + env(safe-area-inset-bottom)); background: var(--nen); }
.bai-chan .nut-chinh { width: 100%; padding: 15px; font-size: 1.08rem; }
.phan-hoi { border-radius: 16px; padding: 12px 14px; }
.phan-hoi.ok { background: rgba(47, 182, 124, .16); } .phan-hoi.ko { background: rgba(232, 80, 91, .14); }
.ph-tieu { font-weight: 900; font-size: 1.1rem; } .dap-an { margin: 4px 0 10px; }
.nut-phu#bo-noi { display: block; margin: 8px auto; border: 0; color: var(--mo); text-decoration: underline; }

/* ---------- kết quả ---------- */
.ket-qua { text-align: center; }
.so-lon { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.so-lon div, .luoi-so div { background: var(--nen); border-radius: 14px; padding: 10px 4px; display: flex; flex-direction: column; }
.so-lon b, .luoi-so b { font-size: 1.4rem; font-weight: 900; } .so-lon span, .luoi-so span { font-size: .78rem; color: var(--mo); }
.luoi-so { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.sao-to { font-size: 2.2rem; color: #F4A100; letter-spacing: 4px; }
.thuong { background: linear-gradient(135deg, rgba(255,197,49,.25), rgba(124,92,255,.12)); border-radius: 12px; padding: 9px; margin: 6px 0; font-weight: 800; }

/* ---------- nhiệm vụ & huy hiệu ---------- */
/* băng đầu xanh đêm: tiêu đề, đồng hồ làm mới, vòng mục tiêu ngày, đường rương 3 nấc */
.nv-bang { background: linear-gradient(150deg, var(--troi), var(--troi2)); color: #fff; border-radius: 22px; padding: 16px 16px 12px; margin: 12px 0;
  box-shadow: 0 5px 0 #0B1428; position: relative; overflow: hidden; }
.nv-bang::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 0%, rgba(255,197,49,.25), transparent 55%); pointer-events: none; }
.nv-bang-dau { display: flex; align-items: center; gap: 10px; position: relative; }
.nv-bang-dau > div:first-child { flex: 1; min-width: 0; }
.nv-bang h2 { margin: 0; font-size: 1.25rem; }
.nv-bang p { margin: 4px 0 0; color: #BFD3F2; font-size: .88rem; font-weight: 700; } .nv-bang p b { color: #FFC531; }
.nv-muc-tieu { --p: 0; width: 66px; height: 66px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(#2FB67C calc(var(--p) * 1%), rgba(255,255,255,.18) 0); }
.nv-muc-tieu span { width: 54px; height: 54px; border-radius: 50%; background: var(--troi); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.nv-muc-tieu b { font-size: 1.05rem; } .nv-muc-tieu small { font-size: .58rem; color: #9FB3D1; font-weight: 800; }
.nv-duong { position: relative; height: 62px; margin: 14px 4px 0; }
.nv-ray { position: absolute; left: 0; right: 30px; top: 50%; height: 10px; transform: translateY(-50%); background: rgba(255,255,255,.16); border-radius: 99px; overflow: hidden; }
.nv-ray i { display: block; height: 100%; background: linear-gradient(90deg, #FFC531, #FF9F1C); border-radius: 99px; transition: width .5s; }
.nac { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font: 900 .85rem Nunito, sans-serif; font-style: normal; background: #2A3D63; color: #9FB3D1; border: 3px solid rgba(255,255,255,.2); }
.nac.dat { background: #FFC531; color: #3A2C00; border-color: #FFE7A1; }
.nv-ruong { position: absolute; right: -4px; top: 50%; transform: translateY(-50%); width: 62px; height: 62px; border-radius: 18px; border: 0;
  font-size: 2.1rem; display: grid; place-items: center; background: #2A3D63; box-shadow: 0 5px 0 #0B1428; filter: grayscale(.7); }
.nv-ruong.san-sang { filter: none; background: linear-gradient(160deg, #FFE7A1, #FFC531); box-shadow: 0 5px 0 #E0A800, 0 0 0 8px rgba(255,197,49,.25); animation: lac-ruong 1.6s ease-in-out infinite; }
.nv-ruong.da-mo { filter: none; background: #2FB67C; box-shadow: 0 5px 0 #1F8A5B; }
@keyframes lac-ruong { 0%, 70%, 100% { transform: translateY(-50%) rotate(0); } 76% { transform: translateY(-55%) rotate(-9deg); } 84% { transform: translateY(-55%) rotate(9deg); } 92% { transform: translateY(-52%) rotate(-5deg); } }
.nv-bang .nv-ruong-chu { text-align: center; margin: 6px 0 0; color: #DCE6F7; }

/* thẻ nhiệm vụ: dải màu độ khó bên trái */
.nv-ds { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.nhiem-vu { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 10px; background: var(--the); border-radius: 18px;
  box-shadow: 0 4px 0 var(--vien); border: 2px solid var(--vien); border-left: 6px solid var(--mau); }
.nhiem-vu.dang { cursor: pointer; } .nhiem-vu.dang:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--vien); }
.nhiem-vu.du { border-color: #FFC531; border-left-color: var(--mau); box-shadow: 0 4px 0 #E0A800; background: linear-gradient(120deg, var(--the) 55%, rgba(255,197,49,.18)); }
.nhiem-vu.da { opacity: .6; box-shadow: none; }
.nv-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.7rem; flex: none;
  background: color-mix(in srgb, var(--mau) 16%, transparent); }
.nv-giua { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nv-giua b { font-size: .98rem; line-height: 1.25; }
.nv-kho { font-style: normal; font-size: .66rem; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; color: var(--mau); }
.nv-thanh { position: relative; height: 18px; background: var(--vien); border-radius: 99px; overflow: hidden; margin-top: 2px; }
.nv-thanh i { display: block; height: 100%; background: linear-gradient(90deg, #FFC531, #FF9F1C); border-radius: 99px; transition: width .5s; }
.nhiem-vu.da .nv-thanh i { background: var(--xanh); }
.nv-thanh span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .72rem; font-weight: 900; color: var(--chu); }
.nv-goi { font-size: .74rem; color: var(--mau); font-weight: 800; }
.nv-thuong { font-weight: 900; color: var(--mo); white-space: nowrap; font-size: .9rem; }
.nv-da { font-weight: 900; color: var(--xanh); white-space: nowrap; font-size: .85rem; }
.nut-nhan { border: 0; border-radius: 14px; padding: 8px 12px; background: var(--chinh); color: var(--tren-chinh); font: 900 .95rem Nunito, sans-serif;
  box-shadow: 0 4px 0 var(--chinh-dam); display: flex; flex-direction: column; align-items: center; line-height: 1.1; animation: nhip-nhan 1.1s ease-in-out infinite; flex: none; }
.nut-nhan small { font-size: .72rem; }
.nut-nhan:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--chinh-dam); animation: none; }
@keyframes nhip-nhan { 50% { transform: scale(1.07); } }
.xu-bay { position: fixed; z-index: 90; font-style: normal; font-size: 1.4rem; pointer-events: none; transform: translate(-50%, -50%); animation: xu-bay .9s cubic-bezier(.5, -0.4, .7, 1) forwards; }
@keyframes xu-bay { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.5); opacity: .2; } }

/* mở rương */
.mo-ruong { text-align: center; padding: 6px 0 4px; }
.ruong-to { font-size: 5rem; line-height: 1.1; display: inline-block; }
.ruong-to.rung { animation: rung .18s linear infinite; }
.ruong-to.bat { animation: bat .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes rung { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes bat { from { transform: scale(.4); } to { transform: scale(1); } }
.so-xu { font-size: 2.4rem; font-weight: 900; color: #E0A800; margin: 4px 0 14px; }
.mo-ruong .nut-chinh { min-width: 160px; }

/* huy hiệu: chưa có thì xám + thanh tiến độ */
.luoi-huy-hieu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.huy-hieu { text-align: center; padding: 10px 6px; border-radius: 14px; background: var(--nen); display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; font: inherit; color: inherit; }
.huy-hieu > span:first-child { font-size: 1.8rem; filter: grayscale(1); opacity: .5; }
.huy-hieu b { font-size: .8rem; color: var(--mo); } .huy-hieu small { font-size: .68rem; color: var(--mo); }
.huy-hieu.co { background: linear-gradient(160deg, rgba(255,197,49,.3), rgba(255,255,255,0)); box-shadow: inset 0 0 0 2px rgba(255,197,49,.5); }
.huy-hieu.co > span:first-child { filter: none; opacity: 1; } .huy-hieu.co b { color: var(--chu); }
.hh-thanh { width: 80%; height: 6px; background: var(--vien); border-radius: 99px; overflow: hidden; margin-top: 2px; }
.hh-thanh i { display: block; height: 100%; background: #8B5CF6; border-radius: 99px; }

/* ---------- Tôi ---------- */
.toi-dau { text-align: center; padding: 8px 0; }
.nv-lac { animation: lu 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes lu { 50% { transform: translateY(-4px) rotate(-1.5deg); } }
.luoi-muc-tieu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.o-muc { display: flex; flex-direction: column; align-items: center; padding: 10px; border-radius: 14px; border: 2px solid var(--vien); background: var(--the); }
.o-muc.chon, .o-con.chon, .o-do.chon { border-color: var(--chinh); background: rgba(255, 197, 49, .14); }
.o-muc small { color: var(--mo); font-size: .78rem; }
.hang-cai { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--vien); }
.doi { display: inline-flex; background: var(--nen); border-radius: 12px; padding: 3px; }
.doi button { border: 0; background: none; padding: 6px 12px; border-radius: 9px; font-weight: 900; color: var(--mo); }
.doi button.chon { background: var(--the); color: var(--chu); box-shadow: var(--bong); }
.luoi-con { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.o-con { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 14px; border: 2px solid var(--vien); background: var(--the); font-size: .78rem; }
.tu-do-xem { text-align: center; }
.mau-nen { display: flex; gap: 8px; justify-content: center; margin: 6px 0 10px; }
.mau-nen button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; }
.mau-nen button.chon { border-color: var(--chu); }
.luoi-do { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.o-do { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 14px; border: 2px solid var(--vien); background: var(--the); font-size: .72rem; min-height: 96px; justify-content: center; }
.o-do i { font-style: normal; color: var(--mo); font-size: .7rem; } .o-do.co i { color: var(--xanh); }

/* ---------- làm quen ---------- */
.lam-quen { text-align: center; padding-top: 10px; }
.lam-quen h1 { font-size: 1.7rem; } .lam-quen h1 span { color: #E0A800; }
.lam-quen .o-go { margin: 14px 0 8px; text-align: center; }
.luoi-con.nho { grid-template-columns: repeat(4, 1fr); }
.doi.nn { margin-top: 18px; }

/* ---------- Làng ---------- */
.lang-dau { display: flex; justify-content: space-between; align-items: center; }
.online { color: var(--xanh); font-weight: 800; font-size: .9rem; }
.lang { position: relative; aspect-ratio: 3 / 4; border-radius: 24px; overflow: hidden; box-shadow: var(--bong);
  background: radial-gradient(circle at 50% 44%, #BFE8A6 0 18%, transparent 19%), radial-gradient(circle at 18% 70%, #8FCF76 0 6%, transparent 7%),
    radial-gradient(circle at 85% 40%, #8FCF76 0 7%, transparent 8%), linear-gradient(#A8DB8E, #92CF79); cursor: pointer; }
.duong-lang { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent 46%, #F1DDB0 46% 54%, transparent 54%), linear-gradient(transparent 46%, #F1DDB0 46% 52%, transparent 52%); opacity: .9; }
.lang::after { content: "🌳"; position: absolute; left: 5%; top: 40%; font-size: 2.2rem; pointer-events: none; filter: drop-shadow(0 4px 2px rgba(0,0,0,.15)); }
.lang::before { content: "🌲🌳"; position: absolute; right: 4%; top: 50%; font-size: 2rem; pointer-events: none; }
.nha { position: absolute; transform: translate(-50%, -50%); border: 0; background: rgba(255, 255, 255, .85); border-radius: 18px; padding: 6px 10px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 4px 0 rgba(0,0,0,.12); z-index: 5; color: #1B2235; }
.nha span { font-size: 2rem; } .nha b { font-size: .7rem; white-space: nowrap; }
.dan { position: absolute; transform: translate(-50%, -90%); display: flex; flex-direction: column; align-items: center; transition: left 1.2s ease, top 1.2s ease; cursor: pointer; }
.dan b { font-size: .7rem; background: rgba(20, 33, 61, .78); color: #fff; padding: 1px 7px; border-radius: 99px; white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.dan.toi b { background: var(--chinh); color: var(--tren-chinh); }
.dan .tt { position: absolute; top: -6px; right: -8px; font-style: normal; font-size: 1rem; }
.bong { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, 6px) scale(.6); background: #fff; color: #1B2235; padding: 4px 10px; border-radius: 12px; font-size: .78rem; font-weight: 800; white-space: nowrap; opacity: 0; transition: .2s; pointer-events: none; box-shadow: 0 3px 8px rgba(0,0,0,.15); }
.bong.hien { opacity: 1; transform: translate(-50%, 0) scale(1); }
.cau-nhanh { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px; scrollbar-width: none; }
.cau-nhanh button { flex: none; border: 2px solid var(--vien); background: var(--the); border-radius: 999px; padding: 7px 12px; font-weight: 800; font-size: .85rem; }
.the-nguoi { text-align: center; }

/* ---------- Đấu ---------- */
.nhan-chon { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-weight: 800; }
.nhan-chon select { flex: 1; padding: 10px; border-radius: 12px; border: 2px solid var(--vien); background: var(--the); }
.bang-xh { list-style: none; padding: 0; margin: 0; }
.bang-xh li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 12px; }
.bang-xh li b { flex: 1; } .bang-xh li.toi { background: rgba(255, 197, 49, .2); }
.bang-xh li.len .thu { color: var(--xanh); } .bang-xh li.xuong .thu { color: var(--do); }
.bang-xh .thu { width: 22px; font-weight: 900; text-align: center; }
.dong-ban { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--vien); text-decoration: none; }
.dong-ban > div { flex: 1; display: flex; flex-direction: column; } .dong-ban small { color: var(--mo); font-size: .78rem; }
.dang-tim { text-align: center; padding: 10px; }
.loi-moi { position: fixed; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top)); z-index: 70; background: var(--troi); color: #fff;
  border-radius: 18px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; width: min(520px, calc(100% - 20px)); box-shadow: 0 10px 30px rgba(0,0,0,.3); animation: len .2s; }
.loi-moi div { flex: 1; display: flex; flex-direction: column; } .loi-moi small { opacity: .8; } .loi-moi .nut-icon { color: #fff; }
.dem-nguoc { position: fixed; inset: 0; z-index: 80; background: radial-gradient(circle, var(--troi2), var(--troi)); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dem-nguoc .vs { display: flex; align-items: center; gap: 18px; } .dem-nguoc .vs b { font-size: 2rem; color: var(--chinh); }
.ten-vs { display: flex; gap: 70px; font-weight: 900; margin-top: 6px; }
.dem-nguoc .so { font-size: 5rem; font-weight: 900; color: var(--chinh); animation: nhay .45s infinite alternate; }
.the-thach { text-align: center; padding-top: 30px; }

/* ---------- bạn bè, chat ---------- */
.ma-to { font-size: 1.6rem; letter-spacing: 4px; font-weight: 900; color: #E07A00; }
.hop .ma-to { text-align: center; font-size: 2.4rem; }
.hang-nhap { display: flex; gap: 8px; margin: 8px 0; } .hang-nhap .o-go { flex: 1; }
.chat-dau { display: flex; align-items: center; gap: 10px; padding: 6px 0; } .chat-dau b { flex: 1; }
.chat { height: calc(100vh - 260px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 2px; }
.tin { max-width: 80%; align-self: flex-start; } .tin p { margin: 0; background: var(--the); padding: 9px 13px; border-radius: 18px 18px 18px 4px; box-shadow: var(--bong); }
.tin.toi { align-self: flex-end; text-align: right; } .tin.toi p { background: var(--chinh); color: var(--tren-chinh); border-radius: 18px 18px 4px 18px; }
.tin small { color: var(--mo); font-size: .7rem; }
.mau-tin { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0; } .mau-tin button { flex: none; border: 2px solid var(--vien); background: var(--the); border-radius: 99px; padding: 5px 10px; font-size: .8rem; font-weight: 800; }
.chat-go { display: flex; gap: 8px; } .chat-go .o-go { flex: 1; }

/* ---------- lớp học ---------- */
.bang-cuon { overflow-x: auto; }
.bang-hs { width: 100%; border-collapse: collapse; font-size: .85rem; }
.bang-hs th { text-align: left; color: var(--mo); font-weight: 800; padding: 6px; white-space: nowrap; border-bottom: 2px solid var(--vien); }
.bang-hs td { padding: 6px; border-bottom: 1px solid var(--vien); white-space: nowrap; } .bang-hs td svg { vertical-align: middle; }
.bang-hs tr[data-hs] { cursor: pointer; } .bang-hs .xanh { color: var(--xanh); font-weight: 900; }
.chon-cd details { border: 2px solid var(--vien); border-radius: 12px; padding: 6px 10px; margin: 6px 0; }
.chon-cd summary { font-weight: 900; cursor: pointer; } .chon-cd label { display: block; padding: 4px 0; }
.bieu-do { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding: 6px 0; }
.bieu-do div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bieu-do i { width: 100%; background: linear-gradient(#FFC531, #FF9F43); border-radius: 4px 4px 0 0; min-height: 2px; }
.bieu-do small { font-size: .6rem; color: var(--mo); }

/* ---------- thanh tab + toast ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; background: var(--the);
  border-top: 1px solid var(--vien); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; max-width: 112px; display: flex; flex-direction: column; align-items: center; gap: 1px; text-decoration: none; color: var(--mo); font-size: .72rem; font-weight: 900; position: relative; padding: 2px 0; border-radius: 12px; }
.tabbar a span { font-size: 1.4rem; filter: grayscale(.7); }
.tabbar a.dang { color: var(--chu); } .tabbar a.dang span { filter: none; transform: scale(1.1); }
.tabbar a .cham { position: absolute; top: 0; right: 18%; }
.dang-hoc .tabbar { display: none; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--troi); color: #fff; padding: 10px 16px;
  border-radius: 14px; font-weight: 800; z-index: 90; max-width: calc(100% - 30px); text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.ok { background: #1F8A5B; } .toast.loi { background: #B93541; }

/* ---------- đường học kiểu bản đồ (thay lưới chủ đề) ---------- */
.tab-cap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 4px; }
.tab-cap button { border: 2px solid var(--vien); background: var(--the); border-radius: 14px; padding: 9px 0; font-weight: 900; color: var(--mo); box-shadow: 0 3px 0 var(--vien); }
.tab-cap button.chon { border-color: #8B5CF6; color: #6D28D9; box-shadow: 0 3px 0 #8B5CF6; background: #F5F0FF; }
.tab-cap button.khoa { opacity: .55; }
.ten-cap { text-align: center; color: var(--mo); font-weight: 800; margin: 6px 0 12px; }
.canh-giua { text-align: center; }
.duong-hoc { display: flex; flex-direction: column; align-items: stretch; padding-bottom: 20px; }
.bang-cd { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 18px; padding: 12px 14px; text-align: left;
  background: var(--mau); color: #fff; box-shadow: 0 5px 0 color-mix(in srgb, var(--mau) 70%, #000); margin-top: 18px; }
.bang-cd .bang-icon { width: 52px; height: 52px; border-radius: 14px; background: #fff; display: grid; place-items: center; font-size: 1.8rem; flex: none; }
.bang-cd .bang-chu { display: flex; flex-direction: column; min-width: 0; }
.bang-cd b { font-size: 1.08rem; } .bang-cd small { opacity: .9; font-weight: 700; }
.bang-cd.khoa { background: #CDD5E3; color: #5B6577; box-shadow: 0 5px 0 #B3BDCF; }
@media (prefers-color-scheme: dark) { .bang-cd.khoa { background: #2A3550; color: #9AA6BE; box-shadow: 0 5px 0 #1E2740; } }
.chang-ds { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 26px 0 6px; }
.chang { position: relative; width: 72px; height: 68px; border-radius: 50%; border: 0; transform: translateX(var(--lech));
  display: grid; place-items: center; font: 900 1.6rem Nunito, sans-serif; transition: transform .1s; }
.chang .mat { line-height: 1; }
.chang.khoa { background: #D5DBE6; color: #7A8496; box-shadow: 0 6px 0 #B9C1D0; font-size: 1.3rem; }
@media (prefers-color-scheme: dark) { .chang.khoa { background: #2A3550; box-shadow: 0 6px 0 #1E2740; } }
.chang.mo { background: var(--the); color: var(--mau); border: 4px solid var(--mau); box-shadow: 0 6px 0 color-mix(in srgb, var(--mau) 55%, #000); }
.chang.da { background: #FFC531; color: #fff; box-shadow: 0 6px 0 #E0A800; }
.chang.hien-tai { background: var(--mau); color: #fff; width: 82px; height: 78px; box-shadow: 0 7px 0 color-mix(in srgb, var(--mau) 65%, #000), 0 0 0 10px color-mix(in srgb, var(--mau) 22%, transparent); margin-top: 40px; }
.chang.boss { width: 86px; height: 80px; font-size: 2rem; }
.chang:active { transform: translateX(var(--lech)) translateY(4px); }
.bong-bat-dau { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); background: var(--the); color: var(--mau);
  border: 2px solid var(--vien); border-radius: 12px; padding: 4px 10px; font-size: .78rem; font-weight: 900; white-space: nowrap; animation: nhun 1.2s ease-in-out infinite; }
.bong-bat-dau::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 7px solid transparent; border-top-color: var(--vien); }
@keyframes nhun { 50% { transform: translate(-50%, -4px); } }
.sao-chang { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: .72rem; color: #E0A800; white-space: nowrap; letter-spacing: 1px; }

/* máy tính: cột app trên nền xanh đêm như app điện thoại */
@media (min-width: 620px) {
  html, body { background: var(--troi); }
  #app { background: var(--nen); min-height: 100vh; }
  .tabbar { max-width: 560px; margin: 0 auto; border-radius: 0; }
}

/* ---------- hàng ô riêng: Nội tâm E-WIT · Phát âm ABC·IPA ---------- */
.tab-rieng { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 4px; }
.tab-rieng button { border: 2px solid var(--vien); background: var(--the); border-radius: 14px; padding: 9px 6px; font-weight: 900; color: var(--chu2);
  box-shadow: 0 3px 0 var(--vien); font-size: .86rem; line-height: 1.2; }
.tab-rieng button.chon { border-color: #0EA5A4; color: #0B7F7E; background: #E6FAF8; box-shadow: 0 3px 0 #0EA5A4; }
@media (prefers-color-scheme: dark) { .tab-rieng button.chon { background: #12393A; color: #7FE3DD; } .tab-cap button.chon { background: #2B2150; color: #CDB8FF; } }

/* ---------- thẻ Luyện nói ở màn Học ---------- */
.the-noi { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #FFE3E6, #FFF1D6); border-radius: var(--bo); padding: 12px 14px; margin: 12px 0; box-shadow: var(--bong); color: #3A1E22; }
.the-noi div { flex: 1; } .the-noi p { margin: 2px 0 0; font-size: .86rem; color: #7A4A50; }
.noi-mic { width: 46px; height: 46px; border-radius: 50%; background: var(--do); display: grid; place-items: center; font-size: 1.4rem; flex: none; box-shadow: 0 4px 0 #B93541; }
@media (prefers-color-scheme: dark) { .the-noi { background: linear-gradient(135deg, #3E1E25, #3C3018); color: #FFE0E3; } .the-noi p { color: #E8BFC4; } }

/* ---------- hình minh hoạ cho từ ---------- */
.hinh-tu { display: flex; justify-content: center; margin: 0 auto 10px; }
.hinh-tu img { width: 100%; max-width: 260px; aspect-ratio: 1; object-fit: cover; border-radius: 18px; background: var(--nen); box-shadow: 0 4px 0 var(--vien); }
.hinh-tu.vua img { max-width: 150px; border-radius: 14px; }
.the-dn { text-align: left; font-size: .88rem; color: var(--chu2); background: var(--nen); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; font-style: italic; }
.anh-nho { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.emoji-nho { font-size: 1.6rem; width: 44px; text-align: center; flex: none; }

/* ---------- khối mic dùng chung ---------- */
.o-noi { text-align: center; margin-top: 8px; }
.mic-to { width: 92px; height: 92px; border-radius: 50%; border: 0; background: var(--do); color: #fff; font-size: 2.4rem; box-shadow: 0 6px 0 #B93541; position: relative; margin: 6px auto 4px; display: grid; place-items: center; }
.mic-to:active { transform: translateY(4px); box-shadow: 0 2px 0 #B93541; }
.mic-to.dang::before, .mic-to.dang::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 4px solid var(--do); animation: song 1.4s ease-out infinite; }
.mic-to.dang::after { animation-delay: .7s; }
@keyframes song { from { transform: scale(1); opacity: .7; } to { transform: scale(1.7); opacity: 0; } }
.noi-goi { color: var(--mo); font-weight: 800; font-size: .88rem; margin: 6px 0; }
.noi-kq { min-height: 20px; }
.noi-nghe { font-size: .9rem; margin: 6px 0; }
.diem-vong { --p: 0; width: 96px; height: 96px; border-radius: 50%; margin: 8px auto 4px; display: flex; align-items: baseline; justify-content: center; padding-top: 30px; box-sizing: border-box; position: relative;
  background: conic-gradient(var(--do) calc(var(--p) * 1%), var(--vien) 0); }
.diem-vong.vua { background: conic-gradient(#F4A100 calc(var(--p) * 1%), var(--vien) 0); }
.diem-vong.dat { background: conic-gradient(var(--xanh) calc(var(--p) * 1%), var(--vien) 0); }
.diem-vong::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--the); }
.diem-vong b, .diem-vong small { position: relative; } .diem-vong b { font-size: 1.9rem; font-weight: 900; line-height: 1; } .diem-vong small { font-weight: 900; color: var(--mo); margin-left: 1px; }
.noi-nhan { font-weight: 900; font-size: 1.05rem; }
.noi-sao { color: #F4A100; font-size: 1.5rem; letter-spacing: 3px; }
.noi-tu { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin: 8px 0; }
.noi-tu span { padding: 3px 9px; border-radius: 10px; font-weight: 800; }
.noi-tu .ok { background: rgba(47, 182, 124, .16); color: #178A57; } .noi-tu .hut { background: rgba(232, 80, 91, .14); color: #C42F3B; text-decoration: underline wavy; }
.tu-cham { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.tu-cham button { border: 2px solid var(--vien); background: var(--the); border-radius: 12px; padding: 8px 10px; font-weight: 800; color: var(--chu); }
.tu-cham button.chon { border-color: var(--xanh); background: rgba(47, 182, 124, .14); }
.cau-noi { font-size: 1.3rem; font-weight: 900; text-align: center; line-height: 1.4; background: var(--the); border-radius: 16px; padding: 14px; }
.the-canh { background: #FFF4D6; color: #6B4E00; border-radius: 12px; padding: 8px 10px; font-size: .85rem; }
.chon-nguon { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.chon-nguon select { padding: 9px; border-radius: 10px; border: 2px solid var(--vien); background: var(--the); color: var(--chu); font: 700 .9rem Nunito, sans-serif; }
.chon-nguon.wit { border-color: #0EA5A4; }
.bai-noi .bai-than { text-align: center; }

/* ---------- ô Phát âm ABC · IPA ---------- */
.pa-the { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 6px; }
.pa-the button { border: 2px solid var(--vien); background: var(--the); border-radius: 14px; padding: 8px 4px; font-weight: 900; color: var(--chu2);
  display: flex; flex-direction: column; align-items: center; gap: 1px; box-shadow: 0 3px 0 var(--vien); font-size: .8rem; }
.pa-the button span { font-size: 1.4rem; } .pa-the button small { color: var(--mo); font-size: .7rem; }
.pa-the button.chon { border-color: #F97316; box-shadow: 0 3px 0 #F97316; color: #C2410C; }
.luoi-abc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-bottom: 16px; }
.o-abc { border: 0; border-radius: 16px; background: var(--mau); color: #fff; padding: 8px 2px; display: flex; flex-direction: column; align-items: center;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--mau) 65%, #000); position: relative; }
.o-abc b { font-size: 1.7rem; line-height: 1; } .o-abc b i { font-size: .65em; font-style: normal; opacity: .85; margin-left: 2px; }
.o-abc span { font-size: 1.3rem; } .o-abc small { font-size: .68rem; opacity: .9; font-weight: 800; }
.o-abc.xong::after, .o-ipa.xong::after { content: "✓"; position: absolute; top: 3px; right: 6px; font-weight: 900; font-size: .8rem; }
.o-abc:active, .o-ipa:active { transform: translateY(3px); }
.pa-nhom { margin: 14px 0 6px; font-size: .95rem; }
.luoi-ipa { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.o-ipa { border: 2px solid #8B5CF6; border-radius: 14px; background: var(--the); padding: 8px 2px; display: flex; flex-direction: column; align-items: center; position: relative;
  box-shadow: 0 3px 0 #8B5CF6; color: var(--chu); }
.o-ipa.phu { border-color: #0EA5A4; box-shadow: 0 3px 0 #0EA5A4; }
.o-ipa b { font-size: 1.15rem; font-family: "Segoe UI", "Noto Sans", Nunito, sans-serif; } .o-ipa small { font-size: .7rem; color: var(--mo); }
.o-ipa i { font-style: normal; font-size: .62rem; font-weight: 900; color: var(--xanh); }
.o-ipa.xong { background: rgba(47, 182, 124, .1); }
.pa-dau { text-align: center; }
.chu-to { font-size: 4.4rem; font-weight: 900; line-height: 1; color: #8B5CF6; } .chu-to i { font-style: normal; font-size: .6em; color: var(--mo); margin-left: 6px; }
.ipa-to { font-size: 3.4rem; font-weight: 900; color: #8B5CF6; font-family: "Segoe UI", "Noto Sans", Nunito, sans-serif; }
.pa-vd { display: flex; align-items: center; gap: 12px; background: var(--nen); border-radius: 14px; padding: 8px 12px; margin: 10px 0; }
.pa-vd .the-emoji { font-size: 2.6rem; margin: 0; }
.pa-mota { font-size: .92rem; line-height: 1.5; }
.pa-meo { background: #FFF6DA; color: #5C4300; border-radius: 12px; padding: 8px 10px; font-size: .86rem; margin: 6px 0; }
.pa-loi { background: #FFE9EB; color: #7A1E26; border-radius: 12px; padding: 8px 10px; font-size: .86rem; margin: 6px 0; }
@media (prefers-color-scheme: dark) { .pa-meo { background: #3B3112; color: #F6E3A8; } .pa-loi { background: #3D1C21; color: #F5C2C7; } .the-canh { background: #3B3112; color: #F6E3A8; } }
.video-khung { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; margin: 8px 0; background: #000; }
.video-khung iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pa-tu { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pa-tu-o, .pa-cau { border: 2px solid var(--vien); background: var(--the); border-radius: 12px; padding: 8px; text-align: left; display: flex; flex-direction: column; color: var(--chu); width: 100%; }
.pa-cau { margin-bottom: 6px; } .pa-tu-o small, .pa-cau small { color: var(--mo); font-size: .76rem; }
.pa-tu-o.chon, .pa-cau.chon { border-color: var(--do); }
.pa-dang { grid-column: 1 / -1; background: var(--nen); border-radius: 14px; padding: 10px; margin: 6px 0; text-align: center; }
#dang-luyen { grid-column: 1 / -1; }
.cap-ds { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 8px; }
.cap-ds span { background: var(--nen); border-radius: 99px; padding: 3px 10px; font-weight: 800; font-size: .85rem; }
.cap-chon { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.cap-chon .nut-lua { justify-content: center; text-align: center; }
.cap-chon .nut-lua span { display: flex; flex-direction: column; } .cap-chon .nut-lua small { color: var(--mo); font-weight: 700; font-size: .75rem; }
.nut-lua.mo-di { opacity: .5; }

/* ---------- pháo giấy ---------- */
.phao-giay { position: fixed; inset: 0; z-index: 95; pointer-events: none; }

/* khối "bạn đọc — máy nghe" dưới thẻ từ mới */
.the-luyen { background: var(--the); border-radius: 20px; padding: 12px 14px; margin-top: 12px; box-shadow: var(--bong); }
.the-luyen-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.the-luyen-dau b { font-size: .95rem; }
.the-luyen .doi { display: inline-flex; background: var(--nen); border-radius: 99px; padding: 3px; }
.the-luyen .doi button { border: 0; background: none; border-radius: 99px; padding: 4px 12px; font: 800 .82rem Nunito, sans-serif; color: var(--mo); }
.the-luyen .doi button.chon { background: var(--do); color: #fff; }
.o-noi.gon .mic-to { width: 64px; height: 64px; font-size: 1.7rem; box-shadow: 0 5px 0 #B93541; }
.o-noi.gon .noi-goi { margin: 4px 0; font-size: .8rem; }
.o-noi.gon .diem-vong { width: 76px; height: 76px; padding-top: 22px; } .o-noi.gon .diem-vong b { font-size: 1.5rem; }
