/* =====================================================================
   Thế Giới Toán — một bộ CSS cho mọi trang. Phong cách theo bản mẫu Nos client đã chốt
   (~/nos-business/mau-chot/MO-TA.md, jun 10/11/2026): nền gần đen, thẻ kính tối viền mảnh,
   màu nhấn phát sáng đổi theo thế giới (--glow), Manrope cho tiêu đề/số, Noto Sans cho chữ,
   chuyển động --ease (trượt/mờ) và --spring (nảy). Nút chính chữ tối trên nền sáng (≥ 7:1, có test gác).
   Nhân vật = linh vật SVG (js/linhvat.js). KHÔNG dùng ong.
   ===================================================================== */
@font-face { font-family: "Manrope"; src: url("font/Manrope-vietnamese.woff2") format("woff2"); font-weight: 500 800; font-display: swap; unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Manrope"; src: url("font/Manrope-latin-ext.woff2") format("woff2"); font-weight: 500 800; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; src: url("font/Manrope-latin.woff2") format("woff2"); font-weight: 500 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Noto Sans"; src: url("font/NotoSans-vietnamese.woff2") format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Noto Sans"; src: url("font/NotoSans-latin-ext.woff2") format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Noto Sans"; src: url("font/NotoSans-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* nền + chữ (MO-TA mục 1) */
  --nen: #09090a; --nen-xam: #101012; --the: #141417; --the2: #19191d; --vien: rgba(255,255,255,.08); --vien2: rgba(255,255,255,.16);
  --chu: #f4f4f2; --chu2: #b9b9b4; --chu3: #85857f; --toi: #08130a;
  /* màu nhấn: --glow là bộ ba RGB để dùng rgba(var(--glow), a). Mặc định xanh lá Nos */
  --glow: 123,227,106;
  --vang: #ffc800; --dung: #7be36a; --dung-nhat: rgba(123,227,106,.12); --sai: #ff6e6e; --sai-nhat: rgba(255,110,110,.12); --goi-y: rgba(255,200,0,.1);
  --ease: cubic-bezier(.2,.8,.2,1); --spring: cubic-bezier(.3,1.35,.5,1);
  --bo: 14px; --font: "Noto Sans", system-ui, "Segoe UI", sans-serif; --tieu-de: "Manrope", "Noto Sans", system-ui, sans-serif;
  --cao-nut: 46px;
}
/* ---------- màu nhấn 6 thế giới (đổi --glow là cả trang đổi màu) */
[data-tg="con-trung"] { --glow: 123,227,106; }
[data-tg="khung-long"] { --glow: 255,154,74; }
[data-tg="duoi-bien"] { --glow: 76,201,255; }
[data-tg="vu-tru"] { --glow: 165,148,255; }
[data-tg="bau-troi"] { --glow: 106,184,255; }
[data-tg="sa-mac"] { --glow: 255,196,90; }
/* --tg tính từ --glow PHẢI khai lại ở mọi chỗ đổi --glow — biến tính ở :root rồi không đổi theo con (bẫy trong CLAUDE.md) */
:root, [data-tg], body.pro { --tg: rgb(var(--glow)); --tg-nhat: rgba(var(--glow), .12); }
body.lon { --cao-nut: 44px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--nen); }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--chu); min-height: 100vh; -webkit-font-smoothing: antialiased; }   /* nền nằm ở html: body trong suốt để lớp .nen-hero (fixed, z âm) lộ ra */
body.nho { font-size: 18px; }                       /* lớp 3–5: chữ to (mục 15.1) */
body.chu-to { font-size: 19px; } body.nho.chu-to { font-size: 21px; }
/* quầng màu thế giới phía sau (thay key art làm mờ của app Nos) */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 70% 50% at 50% -10%, rgba(var(--glow), .16), transparent 70%), radial-gradient(ellipse 50% 40% at 100% 100%, rgba(var(--glow), .07), transparent 70%); transition: background 1s; }
/* nền hero: ảnh trạm (vùng) đang học, mờ NHẸ + tối phía sau trang học sinh (jun 13/11: bớt blur) — blur tĩnh, không animate filter */
.nen-hero { position: fixed; inset: -20px; z-index: -2; pointer-events: none; background: center / cover no-repeat; filter: blur(5px) brightness(.42) saturate(1.15);
  opacity: 0; transition: opacity .6s; }
body[data-tg]:not(.pro) .nen-hero { opacity: 1; }
body[data-tg]:not(.pro)::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, rgba(9,9,10,.35), rgba(9,9,10,.75)); }
@media (prefers-reduced-motion: reduce) { .nen-hero { transition: none; } }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--tg); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--tg); outline-offset: 3px; border-radius: 8px; }
.an { display: none !important; }
h1, h2, h3, h4 { font-family: var(--tieu-de); line-height: 1.2; margin: .4em 0 .45em; font-weight: 700; color: var(--chu); letter-spacing: -.01em; }
h1 { font-size: 1.8em; } h2 { font-size: 1.35em; } h3 { font-size: 1.08em; }
.mo { color: var(--chu2); }
.hang { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dan { flex: 1; }
.luoi { display: grid; gap: 14px; }
.l2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.l3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.l4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.nhan-nho { font-size: .72em; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--chu3); }

/* ---------------------------------------------------------- khung trang (MO-TA mục 2 "Khung")
   Thanh trên cao 58: logo trái · tab giữa có gạch chân trượt nảy màu --glow · phải: chỉ số + chuông + hồ sơ.
   Màn tập trung (body.tap-trung): chỉ nút ✕ + chỉ số. */
#app { max-width: 1120px; margin: 0 auto; padding: 22px 20px 90px; }
#ben:empty { display: none; }
.dau { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; height: 58px; padding: 0 14px 0 20px;
  background: linear-gradient(180deg, rgba(9,9,10,.92), rgba(9,9,10,.72)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--vien); }
.logo { display: flex; align-items: center; gap: 10px; color: var(--chu); text-decoration: none !important; white-space: nowrap; justify-self: start; }
.logo b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font: 800 1em var(--tieu-de); color: var(--toi); background: var(--tg); box-shadow: 0 0 14px rgba(var(--glow), .55); transition: background .8s, box-shadow .8s; }
.logo span { font: 700 .82em var(--tieu-de); letter-spacing: .28em; text-transform: uppercase; }
.dau .gian { display: none; }
.dau-phai { display: flex; align-items: center; justify-content: flex-end; gap: 6px; justify-self: end; min-width: 0; }
.tabs { position: relative; display: flex; gap: 6px; height: 58px; align-items: center; justify-self: center; }
.tabs a { position: relative; display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; white-space: nowrap; border-radius: 9px; font-size: .86em; font-weight: 600; color: var(--chu3); text-decoration: none !important; transition: color .2s, background .2s;
  background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px var(--vien); }
.tabs a:hover { color: var(--chu); background: rgba(255,255,255,.06); }
/* ô tab riêng biệt (jun: "các nút trên hotbar dính liền"): mỗi tab một ô có nền + viền mảnh, tab đang mở nhuộm màu thế giới */
.tabs a[aria-current] { background: rgba(var(--glow), .14); box-shadow: inset 0 0 0 1px rgba(var(--glow), .45); }
.tabs a[aria-current] { color: #fff; }
.tabs a i { font-style: normal; font-size: 1.05em; filter: grayscale(.4); }
.tabs a[aria-current] i { filter: none; }
.gach { position: absolute; bottom: -1px; height: 2px; border-radius: 2px; background: var(--tg); box-shadow: 0 0 12px var(--tg); transition: left .45s var(--spring), width .45s var(--spring), background .8s; }
.dau nav.muc-trang { display: flex; gap: 2px; justify-self: center; }
.dau nav.muc-trang a { color: var(--chu3); padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: .86em; }
.dau nav.muc-trang a:hover { color: var(--chu); background: rgba(255,255,255,.05); text-decoration: none; }
.thanh-so { display: flex; align-items: center; gap: 4px; min-width: 0; }
.thanh-so > * { flex: none; }
.thanh-so .so-hs, .thanh-so .chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 9px; font: 700 .84em var(--tieu-de); color: var(--chu2);
  white-space: nowrap; background: rgba(255,255,255,.05); box-shadow: 0 0 0 1px var(--vien); text-decoration: none !important; }
.thanh-so .so-hs img { width: 20px; height: 20px; object-fit: contain; }
.thanh-so .lua { color: #ffb15c; } .thanh-so .xu { color: #ffd36b; }
.thanh-so .hang-chip { color: var(--tg); min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.chan-ben { text-align: center; font-size: .8em; color: var(--chu3); margin: 0; }
.chan-ben a { color: var(--chu3); }

/* màn tập trung */
.dau.tap { grid-template-columns: auto 1fr auto; background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; max-width: 800px; margin: 0 auto; padding: 0 16px; }
.thoat { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--chu3); font-size: 1.3em; text-decoration: none !important; }
.thoat:hover { background: rgba(255,255,255,.07); color: var(--chu); }
.dau.tap .thanh-so .so-hs:not(.lua), .dau.tap .chuong { display: none; }
body.tap-trung #app { max-width: 800px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 8px; min-height: 30px;
  background: rgba(255,255,255,.06); box-shadow: 0 0 0 1px var(--vien); font-weight: 600; font-size: .84em; white-space: nowrap; color: var(--chu); text-decoration: none; }
.chip img { width: 20px; height: 20px; object-fit: contain; }
.chuong { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; text-decoration: none !important; font-size: 1.05em; color: var(--chu3); }
.chuong:hover { background: rgba(255,255,255,.07); }
.chuong b { position: absolute; top: 1px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--sai);
  color: #1a0505; font: 800 10.5px/17px var(--tieu-de); text-align: center; }
.chuong.rung { animation: lac .8s 2; }
@keyframes lac { 20%, 60% { transform: rotate(-14deg); } 40%, 80% { transform: rotate(14deg); } }

/* ---------------------------------------------------------- nút (MO-TA: .btn / .btn.pri / nút CHƠI khối pixel) */
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--cao-nut); padding: 0 20px; border: 0; border-radius: 10px;
  color: var(--toi); font: 700 .92em var(--tieu-de); text-decoration: none !important; background: var(--tg);
  box-shadow: 0 0 18px rgba(var(--glow), .35); transition: background .8s, box-shadow .3s, transform .3s var(--spring), filter .15s; }
.nut:hover { filter: brightness(1.08); box-shadow: 0 0 26px rgba(var(--glow), .5); }
.nut:active:not([disabled]) { transform: translateY(2px) scale(.98); }
.nut.phu { background: rgba(255,255,255,.06); color: var(--chu); box-shadow: 0 0 0 1px var(--vien2); }
.nut.phu:hover { background: rgba(255,255,255,.11); filter: none; }
.nut.vang { background: var(--vang); box-shadow: 0 0 18px rgba(255,200,0,.3); }
.nut.do { background: var(--sai); color: #1a0505; box-shadow: 0 0 18px rgba(255,110,110,.3); }
.nut.xanh { background: #4cc9ff; box-shadow: 0 0 18px rgba(76,201,255,.3); }
.nut.nho { min-height: 34px; padding: 0 13px; font-size: .8em; border-radius: 8px; }
.nut.to { min-height: 54px; padding: 0 30px; font-size: 1em; font-family: var(--tieu-de); letter-spacing: .12em; text-transform: uppercase;
  clip-path: polygon(0 6px,3px 6px,3px 3px,6px 3px,6px 0,calc(100% - 6px) 0,calc(100% - 6px) 3px,calc(100% - 3px) 3px,calc(100% - 3px) 6px,100% 6px,100% calc(100% - 6px),calc(100% - 3px) calc(100% - 6px),calc(100% - 3px) calc(100% - 3px),calc(100% - 6px) calc(100% - 3px),calc(100% - 6px) 100%,6px 100%,6px calc(100% - 3px),3px calc(100% - 3px),3px calc(100% - 6px),0 calc(100% - 6px));
  border-radius: 0; background: linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,0) 55%), var(--tg); box-shadow: inset 0 -5px 0 rgba(0,0,0,.2), inset 0 2px 0 rgba(255,255,255,.4); position: relative; overflow: hidden; }
.nut.to.phu { background: rgba(255,255,255,.08); color: var(--chu); box-shadow: inset 0 0 0 1px var(--vien2); }
.nut.to:not(.phu)::after { content: ""; position: absolute; top: 0; bottom: 0; width: 46px; left: -60px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); transform: skewX(-20deg); animation: luot 4s ease-in-out infinite; }
@keyframes luot { 0%, 62% { left: -60px; } 100% { left: 110%; } }
.nut[disabled] { background: rgba(255,255,255,.06); color: var(--chu3); box-shadow: none; cursor: not-allowed; filter: none; }
.nut-ma { display: inline-grid; place-items: center; background: none; border: 0; color: var(--chu3); padding: 6px; border-radius: 9px; min-width: 40px; min-height: 40px; text-decoration: none !important; font-size: 1.05em; }
.nut-ma:hover { background: rgba(255,255,255,.07); color: var(--chu); }

/* thẻ kính tối (MO-TA: .card / .perk / .plan) */
.the { background: var(--the); border-radius: var(--bo); box-shadow: 0 0 0 1px var(--vien); padding: 18px 20px; }
.the.mau { box-shadow: 0 0 0 1.5px rgba(var(--glow), .7), 0 0 26px rgba(var(--glow), .18); }
.so-lon { font: 700 2em/1.05 var(--tieu-de); font-variant-numeric: tabular-nums; }
.cap-do { display: inline-block; font-size: .7em; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 2px 8px; border-radius: 5px; background: var(--tg-nhat); color: var(--tg); }
.thanh { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.thanh i { display: block; height: 100%; min-width: 0; border-radius: 99px; background: var(--tg); box-shadow: 0 0 10px rgba(var(--glow), .6); }
/* thanh XP kiểu pixel (ô vuông rời) — dùng cho tiến độ bài */
.xp { display: grid; grid-template-columns: repeat(var(--n, 20), 1fr); gap: 3px; }
.xp i { height: 10px; border-radius: 2px; background: rgba(255,255,255,.07); }
.xp i.co { background: var(--tg); box-shadow: 0 0 8px rgba(var(--glow), .5); }
.vao { animation: vao .5s var(--ease) both; }
@keyframes vao { from { opacity: 0; transform: translateY(12px); } }
@keyframes rung { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes phong { from { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.04); } }
@keyframes nhay { 40% { transform: translateY(-14px); } }
@keyframes quay { to { --goc: 360deg; } }
@property --goc { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
/* viền sáng chạy quanh (thẻ đang chọn) */
.vien-chay { position: relative; }
.vien-chay::before { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--goc), transparent 0deg, rgba(255,255,255,.9) 40deg, transparent 90deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: quay 4s linear infinite; }

/* ---------------------------------------------------------- thông báo nổi trên trang Học */
.tb-moi { display: flex; gap: 12px; align-items: center; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: .9em; text-decoration: none !important;
  background: rgba(255,200,0,.08); box-shadow: 0 0 0 1px rgba(255,200,0,.3); color: #ffe9a8; }
.tb-moi .bieu { font-size: 1.2em; }
.tb-moi .xem { font: 800 .74em var(--tieu-de); letter-spacing: .12em; text-transform: uppercase; color: var(--vang); }

/* ---------------------------------------------------------- thẻ hạng: khiên SVG tiến hoá theo bậc (TG.huyHieu) + 2 thanh tiến độ + huy hiệu kế tiếp + dải 5 bậc
   --kim = màu kim loại của bậc hiện tại (đồng/bạc/vàng/lục bảo/kim cương), nhuộm viền + quầng sáng của thẻ */
.the-hang { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 16px; padding: 20px;
  background: radial-gradient(120% 70% at 0% 0%, color-mix(in srgb, var(--kim) 22%, transparent), transparent 60%), linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0) 120px), rgba(20,20,23,.92);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--kim) 35%, transparent), 0 0 0 1px color-mix(in srgb, var(--kim) 28%, transparent), var(--noi); }
.hh-chinh { display: flex; align-items: center; gap: 14px; }
.huy-hieu { position: relative; flex: none; width: 92px; height: 80px; filter: drop-shadow(0 8px 16px color-mix(in srgb, var(--kim, #fc6) 45%, transparent)); }
.hh-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hh-svg.khoa { filter: grayscale(1) brightness(.55); opacity: .7; }
.hh-loe { animation: hh-loe 5s ease-in-out infinite; }
@keyframes hh-loe { 0%, 70% { transform: translateX(0) skewX(-18deg); } 100% { transform: translateX(150px) skewX(-18deg); } }
.hh-svg.khoa .hh-loe { display: none; }
.tt-hang { min-width: 0; }
.tt-hang .nhan-nho { color: var(--kim); }
.tt-hang h3 { margin: 2px 0 0; font-size: 1.3em; line-height: 1.15; }
.chi-so { display: grid; gap: 10px; }
.hh-dong { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 6px 10px; font-size: .8em; }
.hh-dong span { color: var(--chu2); font-weight: 600; }
.hh-dong b { font: 800 1.05em var(--tieu-de); font-variant-numeric: tabular-nums; color: var(--chu); } .hh-dong b small { color: var(--chu3); font-weight: 700; }
.hh-thanh { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: rgba(255,255,255,.07); box-shadow: inset 0 1px 1px rgba(0,0,0,.4); overflow: hidden; }
.hh-thanh i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f5c542, #ffe07a); box-shadow: 0 0 10px rgba(255,200,0,.45); transition: width .8s var(--ease); }
.hh-dong.lo .hh-thanh i { background: linear-gradient(90deg, rgba(var(--glow), .75), rgb(var(--glow))); box-shadow: 0 0 10px rgba(var(--glow), .5); }
.con-lai { display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 12px; border-radius: 12px; font-size: .84em; line-height: 1.35; color: var(--chu);
  background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--vien); }
.con-lai small { display: block; font-size: .92em; margin-top: 1px; }
.hh-ke { flex: none; width: 40px; height: 35px; } .hh-ke .hh-svg { width: 100%; height: 100%; }
.the-hang .nac { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding-top: 2px; }
.the-hang .nac::before { content: ""; position: absolute; top: 15px; left: 10%; right: 10%; height: 2px; border-radius: 2px; background: rgba(255,255,255,.07); }
.the-hang .nac span { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.the-hang .nac .hh-svg { width: 36px; height: 32px; }
.the-hang .nac em { font-style: normal; font-size: .62em; line-height: 1.2; color: var(--chu3); }
.the-hang .nac span.dat em { color: var(--chu2); }
.the-hang .nac span.dang em { color: var(--chu); font-weight: 700; }
.the-hang .nac span.dang .hh-svg { transform: scale(1.18); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--kim) 70%, transparent)); }
.bang-nv h3 { margin: 0; font-size: 1.08em; }
.dem-nv { font: 800 .9em var(--tieu-de); color: var(--chu3); font-variant-numeric: tabular-nums; }
.nv-muc { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--vien); }
.nv-muc:last-of-type { border-bottom: 0; }
.nv-muc .dan { min-width: 0; line-height: 1.35; } .nv-muc small { display: block; font-size: .8em; }
.nv-muc .thanh { height: 6px; margin-top: 7px; }
.o-tick { flex: none; position: relative; width: 36px; height: 36px; border-radius: 10px; background: rgba(255,200,0,.12); color: var(--vang); display: grid; place-items: center; }
.o-tick::before { content: "⚡"; font-size: 1em; }
.nv-muc + .nv-muc .o-tick { background: rgba(var(--glow), .12); } .nv-muc + .nv-muc .o-tick::before { content: "📘"; }
.nv-muc.xong .o-tick { background: var(--tg); box-shadow: 0 0 14px rgba(var(--glow), .5); } .nv-muc.xong .o-tick::before { content: "✓"; color: var(--toi); font-weight: 800; }
.nv-muc.xong b { color: var(--tg); }
.nv-them { display: block; margin-top: 10px; font-size: .86em; }

/* ---------------------------------------------------------- bài học: thanh XP, câu hỏi, dải đáy */
.thanh-bai { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; }
.thanh-bai .thanh { flex: 1; height: 10px; }
.buoc { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.buoc span { flex: none; font-size: .74em; font-weight: 600; color: var(--chu3); padding: 3px 9px; border-radius: 7px; white-space: nowrap; display: inline-flex; gap: 5px; align-items: center; background: rgba(255,255,255,.04); }
.buoc span i { font-style: normal; font-family: var(--tieu-de); font-weight: 800; }
.buoc span.xong { color: var(--chu2); } .buoc span.xong i::after { content: " ✓"; color: var(--tg); }
.buoc span.dang { color: var(--toi); background: var(--tg); box-shadow: 0 0 14px rgba(var(--glow), .4); }
.tieu-bai { margin: .1em 0 0; font-size: 1.6em; }
.ma-bai { font-size: .8em; margin-bottom: 14px; color: var(--chu3); }
.loi-nv { display: flex; gap: 10px; align-items: flex-end; margin: 6px 0 16px; }
.loi-nv > .lv, .loi-nv > img { flex: none; width: 110px; }
.loi-nv .bong-noi { position: relative; flex: 1; background: var(--the); box-shadow: 0 0 0 1px var(--vien2); border-radius: 14px; padding: 12px 16px; margin-bottom: 30px; }
.loi-nv .bong-noi::before { content: ""; position: absolute; left: -7px; bottom: 18px; width: 12px; height: 12px; background: var(--the); box-shadow: -1px 1px 0 var(--vien2); transform: rotate(45deg); }
.loi-nv .an-nv { float: right; margin: -8px -10px 0 4px; min-height: 30px; min-width: 30px; font-size: .85em; }
body.an-nv .loi-nv > .lv, body.an-nv .loi-nv > img { display: none; }
body.an-nv .loi-nv .bong-noi { margin-bottom: 0; } body.an-nv .loi-nv .bong-noi::before { display: none; }
.loi-nv .loi { display: block; }
#vung-cau.the { box-shadow: none; padding: 0; background: none; }
.cau { font-size: 1.05em; }
.dau-cau { margin-bottom: 4px; }
.cau .de { font: 600 1.28em/1.45 var(--font); margin: 8px 0 20px; }
body.lon .cau .de { font-size: 1.16em; }
.cau .nc { background: rgba(255,255,255,.04); box-shadow: 0 0 0 1px var(--vien); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-size: .95em; }
.pa { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.pa button { position: relative; display: flex; gap: 12px; align-items: center; text-align: left; min-height: 60px; padding: 12px 16px; border: 0; border-radius: 13px;
  background: var(--the); box-shadow: 0 0 0 1px var(--vien); color: var(--chu); transition: background .15s, box-shadow .2s, transform .3s var(--spring); }
.pa button b { flex: none; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; background: rgba(255,255,255,.06); color: var(--chu3); font: 800 .82em var(--tieu-de); }
.pa button:hover:not([disabled]) { background: var(--the2); box-shadow: 0 0 0 1px var(--vien2); transform: translateY(-2px); }
.pa button:active:not([disabled]) { transform: scale(.98); }
.pa button[aria-pressed="true"] { box-shadow: 0 0 0 1.5px var(--tg), 0 0 20px rgba(var(--glow), .22); background: rgba(var(--glow), .07); }
.pa button[aria-pressed="true"] b { background: var(--tg); color: var(--toi); }
.pa button.dung { box-shadow: 0 0 0 1.5px var(--dung), 0 0 22px rgba(123,227,106,.3); background: var(--dung-nhat); animation: bat .4s; }
.pa button.dung b { background: var(--dung); color: var(--toi); font-size: 0; } .pa button.dung b::before { content: "✓"; font-size: .95rem; }
.pa button.sai { box-shadow: 0 0 0 1.5px var(--sai), 0 0 22px rgba(255,110,110,.25); background: var(--sai-nhat); }
.pa button.sai b { background: var(--sai); color: #1a0505; font-size: 0; } .pa button.sai b::before { content: "✕"; font-size: .95rem; }
.pa button.mo { opacity: .35; }
.pa button[disabled]:not(.dung):not(.sai) { cursor: default; }
@keyframes bat { 40% { transform: scale(1.03); } }
.nhap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nhap input { width: min(100%, 260px); font: 700 1.35em var(--tieu-de); padding: 12px 16px; border-radius: 12px; border: 0; text-align: center; background: var(--the); box-shadow: 0 0 0 1px var(--vien2); }
.nhap input:focus { box-shadow: 0 0 0 1.5px var(--tg), 0 0 20px rgba(var(--glow), .2); outline: 0; }
.nhap input.dung { box-shadow: 0 0 0 1.5px var(--dung); background: var(--dung-nhat); } .nhap input.sai { box-shadow: 0 0 0 1.5px var(--sai); background: var(--sai-nhat); }
.goi-y-nhap { font-size: .8em; }
/* dải đáy: dính đáy màn, đổi màu theo kết quả */
.chan-cau { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 16px max(16px, calc(50% - 384px)) 20px; background: rgba(9,9,10,.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--vien); transition: background .3s; }
body.tap-trung #app { padding-bottom: 170px; }
.chan-cau .nut { min-width: 160px; }
.chan-cau .goi-y-nut { gap: 8px; flex-wrap: nowrap; } .chan-cau .goi-y-nut .nut { min-width: 0; } .chan-cau .goi-y-nut .mo { font-size: .85em; }
.chan-cau.dung { background: rgba(14,32,12,.94); border-top-color: rgba(123,227,106,.35); }
.chan-cau.sai { background: rgba(38,12,12,.94); border-top-color: rgba(255,110,110,.35); }
.chan-cau .phan-hoi, .chan-cau .phan-hoi.dung, .chan-cau .phan-hoi.sai { margin: 0; padding: 0; box-shadow: none; background: none; flex: 1; min-width: min(100%, 280px); display: flex; gap: 14px; align-items: flex-start; animation: vao .3s var(--ease) both; }
.dau-ph { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; font: 800 1.4em/1 var(--tieu-de); }
.chan-cau.dung .dau-ph { background: var(--dung); color: var(--toi); box-shadow: 0 0 20px rgba(123,227,106,.5); } .chan-cau.sai .dau-ph { background: var(--sai); color: #1a0505; box-shadow: 0 0 20px rgba(255,110,110,.45); }
.chan-cau.dung .tieu-ph { color: var(--dung); } .chan-cau.sai .tieu-ph { color: var(--sai); }
.tieu-ph { display: block; font: 700 1.25em var(--tieu-de); margin-bottom: 2px; }
.phan-hoi { margin-top: 14px; border-radius: 12px; padding: 12px 16px; }
.phan-hoi.dung { background: var(--dung-nhat); box-shadow: 0 0 0 1px rgba(123,227,106,.4); }
.phan-hoi.sai { background: var(--sai-nhat); box-shadow: 0 0 0 1px rgba(255,110,110,.4); }
.phan-hoi.goi-y { background: var(--goi-y); box-shadow: 0 0 0 1px rgba(255,200,0,.35); }
.phan-hoi .ma-loi { display: inline-block; font: 800 .74em var(--tieu-de); background: var(--sai); color: #1a0505; border-radius: 5px; padding: 1px 7px; margin-right: 6px; }
.tien-trinh { display: flex; gap: 4px; margin-bottom: 12px; }
.tien-trinh i { flex: 1; height: 8px; border-radius: 2px; background: rgba(255,255,255,.07); }
.tien-trinh i.d { background: var(--dung); box-shadow: 0 0 8px rgba(123,227,106,.5); } .tien-trinh i.s { background: var(--sai); } .tien-trinh i.h { background: var(--tg); }
.combo { display: inline-block; font: 800 .8em var(--tieu-de); color: #1a0d00; padding: 2px 9px; border-radius: 6px; margin-left: 8px; background: #ffb15c; box-shadow: 0 0 14px rgba(255,177,92,.5); animation: phong .4s var(--spring) both; }
.tu-tin { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.tu-tin button { font-size: 1.5em; width: 60px; height: 60px; border-radius: 13px; border: 0; background: var(--the2); box-shadow: 0 0 0 1px var(--vien); transition: transform .3s var(--spring), box-shadow .2s; }
.tu-tin button:hover { transform: translateY(-3px); }
.tu-tin button[aria-pressed="true"] { box-shadow: 0 0 0 1.5px var(--tg), 0 0 18px rgba(var(--glow), .3); }

/* kết thúc bài / lượt */
.ket { text-align: center; }
.ket > .lv { --co: 170px; filter: drop-shadow(0 0 30px rgba(var(--glow), .25)); }
.ket h2 { font-size: 2.1em; margin: 6px 0; background: linear-gradient(90deg, #9ff58f, #5fd3ff, #c79bff, #ff9ec4, #ffd36b, #9ff58f); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: chay-mau 8s linear infinite; }
@keyframes chay-mau { to { background-position: 300% 0; } }
.sao3 { display: inline-flex; gap: 6px; align-items: flex-end; font-size: 3em; line-height: 1; margin: 2px 0 10px; }
.sao3 b { display: inline-block; color: rgba(255,255,255,.1); transform-origin: 50% 100%; }
.sao3 b:nth-child(2) { font-size: 1.3em; margin-bottom: 6px; }
.sao3 b.on { color: var(--vang); text-shadow: 0 0 22px rgba(255,200,0,.7); animation: sao-roi .7s calc(.25s + var(--i) * .35s) var(--spring) both; }
@keyframes sao-roi { 0% { transform: scale(0) rotate(-90deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.o-so { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.o-so .o { --m: 255,200,0; width: 150px; padding: 12px 10px; border-radius: 13px; background: var(--the); box-shadow: 0 0 0 1.5px rgba(var(--m), .55), 0 0 22px rgba(var(--m), .15); animation: phong .45s calc(.6s + var(--j, 0) * .12s) var(--spring) both; }
.o-so .o:nth-child(2) { --m: 76,201,255; --j: 1; } .o-so .o:nth-child(3) { --m: 255,154,74; --j: 2; }
.o-so small { display: block; font: 700 .68em var(--tieu-de); letter-spacing: .14em; text-transform: uppercase; color: rgb(var(--m)); }
.o-so b { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 4px; color: var(--chu); font: 800 1.45em var(--tieu-de); font-variant-numeric: tabular-nums; }
.o-so b img { width: 24px; height: 24px; }
.ket-hang, #tu-kiem { max-width: 520px; margin: 12px auto; text-align: left; }
#tu-kiem h3 { margin-top: 0; }
.ket-hang .thanh { margin-top: 8px; }
.nut-ket { justify-content: center; margin-top: 14px; }
.thuong { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.thuong span { background: var(--the); box-shadow: 0 0 0 1px var(--vien2); border-radius: 10px; padding: 6px 14px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.thuong img { width: 24px; height: 24px; object-fit: contain; }

/* nội dung bóc từ phiếu */
.nd-phieu { overflow-x: auto; }
.nd-phieu img { vertical-align: middle; margin: 6px 0; }
.nd-phieu img { background: #fff; border-radius: 8px; padding: 4px; }
/* hình vẽ sống (TG.hinhSong): SVG nhúng thay <img class="hv"> — cùng nền trắng, co theo bề ngang như ảnh */
.hv-song { display: inline-block; max-width: 100%; margin: 6px 0; padding: 8px 10px; border-radius: 12px; background: #fff; vertical-align: middle; cursor: pointer; }
/* màn hình: hình đổi màu theo nền tối (toiHoa trong app.js) — hộp cùng màu NEN_HV (#18181c) để mảng "trắng" của TikZ che đúng như gốc. In giữ màu gốc. */
@media screen { .hv-song { background: #18181c; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), inset 0 1px 0 rgba(255,255,255,.04); }
  .hv-song .tf { fill: var(--f); } .hv-song .ts { stroke: var(--s); } }
.hv-song svg { display: block; max-width: 100%; height: auto; }
.hv-song svg > :is(path, g):not([transform]) { transform-box: fill-box; transform-origin: center; }
.nd-phieu .c { text-align: center; margin: 6px 0; }
.nd-phieu .o { display: inline-block; min-width: 4.5em; border-bottom: 2px dotted var(--chu3); margin: 0 4px; }
.nd-phieu .o.l { display: block; min-width: 0; height: 1.4em; }
.nd-phieu .bl { display: inline-block; width: 1.6em; height: 1.2em; border: 1.5px solid currentColor; vertical-align: middle; margin: 0 2px; }
.nd-phieu .cn { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 50%; background: var(--tg); color: var(--toi); font-size: .8em; font-weight: 700; }
.nd-phieu .hop { border: 1.5px solid var(--chu3); border-radius: 4px; padding: 0 4px; }
.nd-phieu ul.ds { list-style: none; padding-left: 4px; margin: 6px 0; }
.nd-phieu ul.ds li { margin: 3px 0; }
.nd-phieu .nh { font-weight: 700; margin-right: 4px; }
.tu-vung { width: 100%; border-collapse: collapse; }
.tu-vung td { border-bottom: 1px solid var(--vien); padding: 7px 8px; vertical-align: top; }
.tu-vung td:first-child { width: 34%; font-weight: 800; }
.muc-kt { box-shadow: 0 0 0 1px var(--vien); border-radius: 13px; padding: 14px 16px; margin: 12px 0; background: var(--the); }
.muc-kt h4 { margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.luu-y { background: var(--goi-y); box-shadow: 0 0 0 1px rgba(255,200,0,.25); border-radius: 13px; padding: 10px 14px 10px 32px; }
.bay-loi { box-shadow: 0 0 0 1px rgba(255,110,110,.35); background: var(--sai-nhat); border-radius: 13px; padding: 10px 14px; margin: 10px 0; }

/* ---------- hạt + chuyển động (hieuung.js) */
.hat-cv { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 80; }
.bay-chu { position: fixed; z-index: 81; pointer-events: none; font: 800 1.2em var(--tieu-de); color: var(--toi); padding: 2px 12px; border-radius: 8px; background: var(--vang); box-shadow: 0 0 20px rgba(255,200,0,.6); white-space: nowrap; }
.lan { animation: vao .55s var(--ease) calc(var(--i, 0) * 60ms) both; }
.thanh i { animation: day .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes day { from { width: 0; } }
@keyframes rung { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.luoi-td { display: inline-grid; gap: 3px; background: #0003; padding: 3px; border-radius: 12px; }
.luoi-td button { width: 40px; height: 40px; border: 0; border-radius: 8px; background: rgba(255,255,255,.88); color: #111; font-size: 18px; }
.luoi-td button.trung { background: #ffd66b; }
.luoi-td button.truot { background: #ccc; }
.truc-so { position: relative; height: 90px; margin: 26px 16px 10px; }
.truc-so .duong { position: absolute; left: 0; right: 0; top: 44px; height: 4px; background: #234; border-radius: 3px; }
.truc-so .vach { position: absolute; top: 34px; width: 2px; height: 24px; background: #234; }
.truc-so .nhan { position: absolute; top: 62px; transform: translateX(-50%); font-weight: 700; color: #123; }
.truc-so .ban { position: absolute; top: 0; transform: translateX(-50%); font-size: 26px; }
.truc-so button.bam { position: absolute; inset: 0; background: none; border: 0; cursor: crosshair; }


/* ---------- đấu trường (mini-boss, Boss) */
.dau-truong { position: relative; border-radius: 16px; padding: 12px 14px 0; background: #070708; box-shadow: 0 0 0 1px var(--vien2); overflow: hidden; margin-bottom: 14px; }
.dt-tren { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tim-ds, .dot-ds { display: flex; gap: 6px; padding: 5px 10px; border-radius: 9px; background: rgba(9,9,10,.6); backdrop-filter: blur(6px); }
.tim-i svg { width: 24px; height: 22px; fill: var(--sai); display: block; filter: drop-shadow(0 0 5px rgba(255,110,110,.6)); }
.tim-i.mat svg { fill: #6b6f80; opacity: .55; }
.dot-ds i { width: 12px; height: 12px; border-radius: 3px; background: rgba(255,255,255,.2); }
.dot-ds i.dang { background: var(--vang); box-shadow: 0 0 8px var(--vang); } .dot-ds i.ha { background: var(--tg); }
.dt-ta #anh-ta { display: inline-block; transform-origin: 50% 100%; }
.dt-ta .lv { --co: 150px; }
.dt-quai { position: relative; text-align: center; width: 230px; }
.ten-quai { display: inline-block; font: 700 .95em var(--tieu-de); color: #fff; padding: 3px 12px; border-radius: 8px; background: rgba(9,9,10,.8); margin-bottom: 6px; }
.dt-quai .hp { position: relative; margin: 0 auto 6px; max-width: 210px; }
.dt-quai .hp b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: #fff; text-shadow: 0 1px 2px #000; }
.dau-truong.rung { animation: rung .4s; }
.vien-dan { position: fixed; z-index: 81; pointer-events: none; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle, #fff 20%, var(--tg) 55%, #0000 72%); box-shadow: 0 0 22px var(--tg); }
.hp { height: 14px; border-radius: 4px; background: rgba(9,9,10,.7); overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.3); }
.hp i { display: block; height: 100%; background: linear-gradient(90deg, #ff4d6d, #ff9a4a); box-shadow: 0 0 12px rgba(255,110,110,.6); transition: width .4s var(--ease); }

/* ---------- cây kỹ năng */
.cay { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.nhanh h4 { margin: 0 0 8px; }
.nut-lo { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 4px 0; font-size: .9em; }
.nut-lo i { flex: none; width: 18px; height: 18px; border-radius: 50%; }
.m0 { background: rgba(255,255,255,.12); } .m1 { background: #7a9bb8; } .m2 { background: #4cc9ff; box-shadow: 0 0 6px #4cc9ff; } .m3 { background: #7be36a; box-shadow: 0 0 8px #7be36a; } .m4 { background: #ffc800; box-shadow: 0 0 10px #ffc800; }

/* ---------- bộ sưu tập + hồ sơ */
.suu-tap { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; }
.suu-tap .o { background: var(--the); box-shadow: 0 0 0 1px var(--vien); border-radius: 13px; padding: 10px; text-align: center; font-size: .82em; }
.suu-tap .o img { width: 82px; height: 82px; object-fit: contain; }
.suu-tap .o.chua img { filter: brightness(0) opacity(.15); }
.avatar { display: inline-grid; place-items: center; width: 112px; height: 112px; border-radius: 22px; overflow: hidden; background: radial-gradient(circle at 50% 60%, rgba(var(--glow), .25), transparent 70%), var(--the2); box-shadow: 0 0 0 2px var(--khung, var(--vien2)), 0 0 22px color-mix(in srgb, var(--khung, transparent) 40%, transparent); flex: none; }
.avatar .lv { --co: 92%; margin-top: 14%; }
.the-ho-so { display: flex; gap: 20px; align-items: center; margin: 0 0 18px; }
.the-ho-so h1 { margin: 0; }
@media (max-width: 700px) { .the-ho-so { flex-direction: column; text-align: center; } .the-ho-so .hang { justify-content: center; } }
.avatar.nho { width: 58px; height: 58px; border-radius: 13px; }
.khung-1 { --khung: #85857f; } .khung-2 { --khung: #4cc9ff; } .khung-3 { --khung: #7be36a; } .khung-4 { --khung: #be96ff; } .khung-5 { --khung: #ffc800; }
[aria-pressed="true"] > .avatar { box-shadow: 0 0 0 2px var(--khung), 0 0 0 4px var(--nen), 0 0 0 5.5px var(--tg); }

/* ---------- thông báo */
.ds-tb { list-style: none; padding: 0; margin: 0; }
.ds-tb li + li { border-top: 1px solid var(--vien); }
.ds-tb li a { display: flex; gap: 12px; align-items: center; padding: 12px 8px; border-radius: 10px; text-decoration: none !important; color: var(--chu); font-weight: 500; }
.ds-tb li a:hover { background: rgba(255,255,255,.04); }
.ds-tb .bieu { font-size: 1.3em; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--tg-nhat); flex: none; }
.ds-tb .chua-doc { width: 9px; height: 9px; border-radius: 50%; background: var(--tg); box-shadow: 0 0 8px var(--tg); flex: none; }
.ds-tb .tg { font-size: .78em; color: var(--chu3); }
.le-hang { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(5,5,6,.7); backdrop-filter: blur(6px); animation: mo-dan 2.8s both; }
.le-hang .the { text-align: center; padding: 28px 38px; animation: phong .5s var(--spring) both; box-shadow: 0 0 0 1.5px rgba(var(--glow), .7), 0 0 40px rgba(var(--glow), .3); }
.le-hang .huy-hieu { margin: 0 auto 10px; width: 150px; height: 130px; }
@keyframes mo-dan { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------------------------------------------------- phụ huynh / giáo viên: cùng nền tối, màu nhấn xanh dương trung tính (mục 15.7) */
body.pro { --glow: 110,200,255; font-size: 15.5px; }
body.pro h1 { font-size: 1.5em; }
.bang { width: 100%; border-collapse: collapse; font-size: .92em; }
.bang th, .bang td { padding: 9px 8px; border-bottom: 1px solid var(--vien); text-align: left; vertical-align: top; }
.bang tr.la-em td { background: rgba(var(--glow), .1); font-weight: 700; }
label.hang { flex-wrap: nowrap; align-items: flex-start; margin: 6px 0; } label.hang input { margin-top: .35em; flex: none; width: 17px; height: 17px; accent-color: var(--tg); }
.bang th { font: 700 .72em var(--tieu-de); text-transform: uppercase; letter-spacing: .12em; color: var(--chu3); }
.bay-ngay { display: flex; gap: 6px; }
.bay-ngay i { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.06); display: grid; place-items: center; font-style: normal; font-size: .7em; font-weight: 700; color: var(--chu3); }
.bay-ngay i.co { background: var(--dung); color: var(--toi); box-shadow: 0 0 10px rgba(123,227,106,.5); }
.canh-bao { border-left: 3px solid var(--vang); background: rgba(255,200,0,.07); border-radius: 10px; padding: 10px 14px; margin: 8px 0; color: var(--chu); }
.canh-bao.vui { border-color: var(--dung); background: var(--dung-nhat); }
.canh-bao.kho, .canh-bao.ngung { border-color: var(--sai); background: var(--sai-nhat); }
.nhiet { border-collapse: collapse; font-size: .78em; }
.nhiet th, .nhiet td { border: 1px solid var(--nen); padding: 4px 6px; text-align: center; min-width: 38px; }
.nhiet th.xoay { writing-mode: vertical-rl; transform: rotate(180deg); height: 120px; text-align: left; font-weight: 600; }
.tab { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 16px; }
.tab button { border: 0; background: rgba(255,255,255,.05); color: var(--chu3); border-radius: 8px; padding: 7px 13px; font-weight: 600; min-height: 36px; }
.tab button.chon { background: var(--chu); color: #0a0a0a; }
.qr-in { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.qr-in .o { border: 1px dashed #aaa; border-radius: 12px; padding: 10px; text-align: center; background: #fff; color: #1f2a44; font-size: .8em; break-inside: avoid; }
.qr-in .o svg, .qr-in .o img { width: 120px; height: 120px; }
.qr-in .o b { display: block; font-size: 1.25em; letter-spacing: 2px; }
input.o-nhap, select.o-nhap, textarea.o-nhap { width: 100%; padding: 11px 14px; border-radius: 10px; border: 0; background: rgba(255,255,255,.05); box-shadow: 0 0 0 1px var(--vien2); min-height: 46px; color: var(--chu); }
select.o-nhap option { background: var(--the); }
input.o-nhap:focus, select.o-nhap:focus, textarea.o-nhap:focus { box-shadow: 0 0 0 1.5px var(--tg), 0 0 18px rgba(var(--glow), .18); outline: 0; }
input.o-nhap::placeholder, textarea.o-nhap::placeholder { color: var(--chu3); }
label.nhan { display: block; font: 700 .74em var(--tieu-de); letter-spacing: .12em; text-transform: uppercase; color: var(--chu3); margin: 14px 0 6px; }

/* ---------- hộp thoại, toast (MO-TA: .pop / pop-up QR) */
.phu-man { position: fixed; inset: 0; z-index: 50; background: rgba(5,5,6,.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; padding: 16px; animation: vao .2s both; }
.phu-man .the { max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; border-radius: 16px; padding: 24px; background: #17171a; box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 24px 60px rgba(0,0,0,.6); animation: phong .3s var(--spring) both; }
.phu-man .the h2 { margin-top: 0; }
.thong-bao { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; background: #17171a; color: var(--chu);
  padding: 12px 20px; border-radius: 12px; font-weight: 600; max-width: 92vw; box-shadow: 0 0 0 1px rgba(var(--glow), .45), 0 0 26px rgba(var(--glow), .18), 0 18px 40px rgba(0,0,0,.5); }
body.tap-trung .thong-bao { bottom: 130px; }

/* ---------------------------------------------------------- lớp "đắt tiền" (jun 15/11: "UI trông đắt tiền hơn")
   Đo bằng extract.js của taste-skill: 18 bán kính khác nhau, glow trên gần mọi nút, emoji màu hệ điều hành ở thanh trên.
   Hướng: bề mặt có lớp (viền sáng trên + bóng đổ mềm) thay glow; glow chỉ còn ở thứ đang chọn/đang tiến triển; icon nét một màu;
   chữ số đều (tabular), tiêu đề khít chữ hơn. Màu nhấn theo thế giới giữ nguyên. */
:root { --bo: 16px; --vien-tren: inset 0 1px 0 rgba(255,255,255,.07);
  --noi: 0 1px 2px rgba(0,0,0,.45), 0 10px 30px -12px rgba(0,0,0,.7); }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.tabs a i { filter: none; display: grid; } .tabs a .ic { width: 19px; height: 19px; }
.tabs a[aria-current] .ic { color: var(--tg); }
.chuong .ic { width: 20px; height: 20px; }
.thanh-so .ic { width: 16px; height: 16px; }
.thanh-so .lua .ic { fill: rgba(255,177,92,.25); }
.dau { border-bottom: 0; box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 8px 24px -16px rgba(0,0,0,.8); }
h1, h2, h3 { letter-spacing: -.02em; }
.so-lon, .thanh-so, .chi-so, .dem-nv { font-variant-numeric: tabular-nums; }
.the { background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0) 120px), rgba(20,20,23,.92);
  box-shadow: var(--vien-tren), 0 0 0 1px var(--vien), var(--noi); }   /* KHÔNG backdrop-filter: biến thẻ thành khối chứa của phần tử fixed → dải đáy câu hỏi kẹt trong thẻ (test chữ-đè-chữ bắt) */
.nut { box-shadow: var(--vien-tren), 0 1px 2px rgba(0,0,0,.4); }
.nut:hover { box-shadow: var(--vien-tren), 0 0 0 1px rgba(var(--glow), .5), 0 6px 18px -6px rgba(var(--glow), .45); }
.nut.vang, .nut.do, .nut.xanh { box-shadow: var(--vien-tren), 0 1px 2px rgba(0,0,0,.4); }
.thanh-so .so-hs, .thanh-so .chip { box-shadow: var(--vien-tren), 0 0 0 1px var(--vien); background: rgba(255,255,255,.04); }
.tabs a { box-shadow: var(--vien-tren), inset 0 0 0 1px var(--vien); }
.tabs a[aria-current] { background: linear-gradient(180deg, rgba(var(--glow), .2), rgba(var(--glow), .08)); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 0 0 1px rgba(var(--glow), .5); }
.gach { opacity: .9; }
.nhan-nho, label.nhan { letter-spacing: .16em; }
/* ô nhiệm vụ: icon nét vẽ bằng mask thay emoji ⚡📘 */
.o-tick::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
  --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M13 2 4 14h7l-1 8 9-12h-7z'/%3E%3C/svg%3E"); }
.nv-muc + .nv-muc .o-tick { color: var(--tg); } .nv-muc + .nv-muc .o-tick::before { content: "";
  --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4h6a4 4 0 0 1 4 4v13a3 3 0 0 0-3-3H2zM22 4h-6a4 4 0 0 0-4 4v13a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E"); }
.nv-muc.xong .o-tick { color: var(--toi); } .nv-muc.xong .o-tick::before { content: "";
  --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E"); }
.o-tick { box-shadow: var(--vien-tren), 0 0 0 1px rgba(255,255,255,.06); }
input[type=checkbox], input[type=radio] { accent-color: var(--tg); width: 18px; height: 18px; }

/* ---------- phím đồ chơi (taste Duolingo, docs/taste/duolingo.com.md: "bấm được thì phải trông như đồ chơi")
   Phương án + nút chính có MÔI DƯỚI đặc 4px màu tối hơn thay bóng mờ; bấm thì lún xuống (mất môi). Chỉ màn câu hỏi + nút chính. */
.pa button { box-shadow: inset 0 0 0 1.5px var(--vien2), 0 4px 0 rgba(255,255,255,.07); transition: transform .08s, box-shadow .08s, background .2s; }
.pa button:hover:not([disabled]) { transform: translateY(-1px); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.22), 0 5px 0 rgba(255,255,255,.09); }
.pa button:active:not([disabled]) { transform: translateY(4px); box-shadow: inset 0 0 0 1.5px var(--vien2), 0 0 0 transparent; }
.pa button[aria-pressed="true"] { background: rgba(var(--glow), .1); box-shadow: inset 0 0 0 2px var(--tg), 0 4px 0 rgba(var(--glow), .45); }
.pa button.dung { box-shadow: inset 0 0 0 2px var(--dung), 0 4px 0 #3e8a33; }
.pa button.sai { box-shadow: inset 0 0 0 2px var(--sai), 0 4px 0 #9b3434; }
.chan-cau .nut:not(.phu):not([disabled]), .ket .nut:not(.phu):not(.to) { box-shadow: inset 0 -4px 0 rgba(0,0,0,.22), 0 1px 0 rgba(255,255,255,.15) inset; }
.chan-cau .nut:not(.phu):not([disabled]):active, .ket .nut:not(.phu):not(.to):active { transform: translateY(3px); box-shadow: inset 0 -1px 0 rgba(0,0,0,.22); }

/* ---------------------------------------------------------- màn hẹp */
/* học sinh: cột phải (#ben) nằm dưới nội dung khi màn không đủ rộng */
body.co-nav #app { max-width: 1240px; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1180px) {
  /* thanh trên trải HẾT bề ngang màn hình (jun 14/11: "thanh này bị ngắn"); nội dung + cột phải vẫn là khối 1280 px ở giữa:
     hai cột lề 1fr hai bên, cột nội dung ≤ 896 px, cột phải 360 px */
  body.co-nav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 896px) 360px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 24px; }
  body.co-nav #dau { grid-column: 1 / -1; }
  body.co-nav #app { grid-column: 2; } body.co-nav #ben { grid-column: 3; }
  body.co-nav:has(#ben:empty) #app { grid-column: 2 / 4; padding-right: 20px; }   /* trang không có cột phải → nội dung dùng cả bề ngang khối giữa */
  body.co-nav #app { margin: 0; max-width: none; padding-right: 0; }
  #ben { position: sticky; top: 70px; align-self: start; display: flex; flex-direction: column; gap: 14px; padding: 22px 20px 30px 0; max-height: calc(100vh - 70px); overflow-y: auto; scrollbar-width: none; }
}
@media (max-width: 1179px) { #ben { display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin: 0 auto; padding: 0 20px 100px; } }
/* MO-TA: cửa sổ hẹp thì tab chỉ còn icon, giữ chữ của tab đang mở. 10 tab có chữ + logo + chỉ số cần ~1860 px từ khi tab thành ô rời (đo 15/11: 1700 px tràn) */
@media (max-width: 1859px) { .tabs a span { display: none; } .tabs a { padding: 0; min-width: 40px; justify-content: center; } .tabs a[aria-current] { padding: 0 12px; } .tabs a i { font-size: 1.2em; } .tabs a[aria-current] span { display: inline; } }
@media (max-width: 1279px) { .dau-phai .thanh-so .hang-chip { display: none; } }   /* hạng đã có ở thẻ hạng (#ben) — chip đè lên tab khi hẹp */
@media (max-width: 1000px) { .tabs a[aria-current] span { display: none; } .tabs { gap: 3px; } .tabs a, .tabs a[aria-current] { min-width: 36px; padding: 0; } }
@media (max-width: 760px) {
  body { font-size: 15px; } body.nho { font-size: 16.5px; }
  /* backdrop-filter biến .dau thành khối chứa của phần tử fixed → thanh tab đáy bị kẹt trong thanh trên. Điện thoại dùng nền đặc. */
  .dau { grid-template-columns: auto 1fr; padding: 0 10px; gap: 6px; background: #09090a; backdrop-filter: none; -webkit-backdrop-filter: none; } .dau nav.muc-trang { display: none; } .logo span { display: none; }
  .dau-phai .thanh-so .xu, .dau-phai .thanh-so .hang-chip { display: none; }
  /* điện thoại: tab thành thanh đáy */
  /* .dau là sticky trong grid → fixed của .tabs vẫn theo khung nhìn, nhưng phải thoát khỏi cột lưới: đặt width 100vw */
  .tabs { position: fixed; z-index: 25; left: 0; bottom: 0; width: 100vw; height: 62px; justify-content: space-around; background: #09090a; border-top: 1px solid var(--vien); }
  .tabs a { background: none; box-shadow: none; } .tabs a.phu-dd { display: none; } .gach { top: -1px; bottom: auto; }
  #app { padding: 14px 14px 100px; }
  #ben { padding-bottom: 90px; }
  /* dải đáy câu hỏi nằm ngay sau câu hỏi (cố định thì che mất phương án cuối) */
  .chan-cau { position: static; margin: 20px -14px 0; padding: 14px; }
  body.tap-trung #app { padding-bottom: 40px; }
  .chan-cau .nut { width: 100%; }
  .pa { grid-template-columns: 1fr; }
}
/* giảm chuyển động: theo hệ điều hành HOẶC công tắc trong Hồ sơ (body.giam) — mục 15.9 */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
body.giam *, body.giam *::before, body.giam *::after { animation: none !important; transition: none !important; }
@media print {
  .dau, .tabs, #ben, .khong-in, .chan-cau { display: none !important; }
  body { background: #fff !important; color: #000; display: block !important; } body::before { display: none; }
  .the { box-shadow: 0 0 0 1px #ccc; background: #fff; color: #000; } h1, h2, h3, .mo { color: #000; }
}
/* icon nét trong khối có .bieu (thẻ chọn ôn, kiểu đấu) + nút bài khoá + nút tóm tắt Unit */
.o-on .bieu .ic, .o-kieu .bieu .ic { width: 30px; height: 30px; color: var(--tg); }
.nut-bai .bieu .ic { width: 22px; height: 22px; } .nut-tt .ic { width: 20px; height: 20px; color: var(--chu2); }
.chip .ic { width: 15px; height: 15px; }
/* trang soi hình #/thu-hinh (demo.js) */
.soi { display: grid; gap: 12px; margin-top: 12px; }
.soi-bai h3 { margin: 0 0 8px; } .soi-bai h3 small { color: var(--tg); margin-right: 4px; }
.soi-nhom { margin-top: 8px; } .soi-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; margin-top: 6px; }
.soi-o { margin: 0; padding: 8px; border-radius: 12px; background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px var(--vien); display: grid; gap: 6px; justify-items: center; }
.soi-o .hv-song, .soi-o img { max-width: 100%; } .soi-o .hv-song svg { width: 100%; height: auto; max-height: 220px; }
.soi-o figcaption { font: 600 .74em var(--tieu-de); color: var(--chu3); text-align: center; word-break: break-word; }
.soi-o.dat { box-shadow: inset 0 0 0 1.5px rgba(123,227,106,.55); } .soi-o.dat figcaption { color: var(--dung); }
.soi-o.loi { box-shadow: inset 0 0 0 2px var(--sai); } .soi-o.loi figcaption { color: var(--sai); }
.soi.chi-loi .soi-o:not(.loi), .soi.chi-loi .soi-bai:not(:has(.soi-o.loi)) { display: none; }
.soi-kq { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.04); font-size: .9em; } .soi-kq .tot { color: var(--dung); } .soi-kq .xau { color: var(--sai); }
.soi-kq ul { margin: 6px 0 0; padding-left: 18px; }
/* chẩn đoán lỗi sai (hoc.js): tên lỗi + cách sửa + nút "Sửa ngay" */
.chan-doan { display: grid; gap: 4px; padding: 10px 12px; margin: 0 0 8px; border-radius: 10px; background: rgba(255,110,110,.08); box-shadow: inset 0 0 0 1px rgba(255,110,110,.3); }
.chan-doan .ma-loi { justify-self: start; } .chan-doan b { font-family: var(--tieu-de); } .chan-doan .nut { justify-self: start; margin-top: 4px; }
/* vòng mục tiêu ngày quanh ngọn lửa chuỗi (TG.vongNgay) */
.vong-ngay { gap: 7px; }
.vn-vong { position: relative; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: conic-gradient(#ffb15c calc(var(--p) * 1%), rgba(255,255,255,.1) 0); }
.vn-vong::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #18181c; }
.vn-vong .ic { position: relative; width: 13px; height: 13px; color: var(--chu3); }
.vong-ngay.xong .vn-vong .ic { color: #ffb15c; fill: rgba(255,177,92,.45); filter: drop-shadow(0 0 4px rgba(255,177,92,.7)); }
.vong-ngay.xong { color: #ffb15c; }
.muc-ngay-chon { gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: .9em; }
/* nút "Tiếp tục" — việc học được chọn sẵn cho hôm nay (TG.nutTiep) */
.tiep-ngay { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; padding: 14px 16px; border-radius: 16px; color: var(--chu); text-decoration: none !important;
  background: linear-gradient(120deg, rgba(var(--glow), .2), rgba(var(--glow), .06) 60%), rgba(20,20,23,.92);
  box-shadow: inset 0 0 0 1.5px rgba(var(--glow), .5), 0 5px 0 rgba(var(--glow), .35), var(--noi); transition: transform .1s, box-shadow .1s; }
.tiep-ngay:hover { transform: translateY(-1px); } .tiep-ngay:active { transform: translateY(4px); box-shadow: inset 0 0 0 1.5px rgba(var(--glow), .5), 0 1px 0 rgba(var(--glow), .35); }
.tn-bieu { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--tg); color: var(--toi); }
.tn-bieu .ic { width: 26px; height: 26px; stroke-width: 2.2; }
.tiep-ngay .dan { display: grid; gap: 1px; min-width: 0; } .tiep-ngay small { font: 800 .7em var(--tieu-de); letter-spacing: .12em; text-transform: uppercase; color: var(--tg); }
.tiep-ngay b { font: 800 1.15em var(--tieu-de); } .tiep-ngay .mo { font-size: .86em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-di { flex: none; font: 800 .82em var(--tieu-de); letter-spacing: .1em; padding: 10px 16px; border-radius: 12px; background: var(--tg); color: var(--toi); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
@media (max-width: 560px) { .tn-di { display: none; } }
/* giấy nháp nổi (TG.giayNhap): máy tính = khung bên phải màn tập trung; điện thoại = nửa dưới màn hình */
.giay-nhap { position: fixed; z-index: 45; right: 16px; top: 70px; bottom: 16px; width: min(420px, 34vw); display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: #18181c; box-shadow: 0 0 0 1px var(--vien2), 0 24px 60px rgba(0,0,0,.6); }
.giay-nhap canvas { flex: 1; width: 100%; touch-action: none; cursor: crosshair;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 24px 24px; }
.gn-dau { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--vien); } .gn-dau b { font-family: var(--tieu-de); }
.gn-dau [aria-pressed="true"] { background: var(--tg-nhat); color: var(--tg); } .gn-dau .ic { width: 18px; height: 18px; }
.nut-nhap .ic { width: 19px; height: 19px; } body.co-nhap .nut-nhap { color: var(--tg); background: var(--tg-nhat); }
@media (min-width: 1100px) { body.co-nhap.tap-trung #app { margin-left: max(16px, calc((100vw - min(420px, 34vw) - 800px) / 2 - 20px)); }
  body.co-nhap .chan-cau { right: calc(min(420px, 34vw) + 32px); } }   /* dải đáy câu hỏi chừa chỗ cho giấy nháp — nút KIỂM TRA không bị che */
@media (max-width: 1099px) { .giay-nhap { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; height: 46vh; } body.co-nhap.tap-trung #app { padding-bottom: 50vh; } }
.buoc span.buoc-ai:not(.dang) { color: var(--tg); box-shadow: inset 0 0 0 1px rgba(var(--glow), .35); }   /* bước 5 = chỗ chơi ải — nổi lên trong thanh bước */
