/* ban-do.css — màn Học: dải 4 vùng + đường bài học (TG.duongVung, TG.ganDuong), phong cách app Nos. Nạp SAU app.css. */

/* ---- 4 vùng: thẻ ảnh key art kiểu thẻ phiên bản của app Nos; vùng đang xem viền sáng chạy quanh */
nav.vung { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 22px; }
nav.vung .o-vung { position: relative; display: flex; flex-direction: row; align-items: flex-end; min-width: 0; height: 84px; padding: 0; border-radius: 12px; overflow: hidden; text-decoration: none !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,.09); opacity: .85; transition: opacity .3s, transform .35s var(--spring), box-shadow .3s; }
nav.vung .o-vung:hover { opacity: 1; transform: translateY(-3px); }
nav.vung .anh-dao { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
nav.vung .o-vung:hover .anh-dao { transform: scale(1.07); }
nav.vung .o-vung::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.88), rgba(0,0,0,.1) 70%); }
nav.vung .tt { position: relative; z-index: 1; padding: 0 10px 8px; min-width: 0; width: 100%; display: flex; flex-direction: column; line-height: 1.15; color: #fff; }
nav.vung .tt small { font: 700 .62em var(--tieu-de); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.7); }
nav.vung .tt b { font: 700 .8em var(--tieu-de); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
nav.vung .trang-thai { display: none; }
nav.vung .thanh { height: 3px; margin-top: 5px; background: rgba(255,255,255,.18); }
nav.vung .o-vung.chon { opacity: 1; transform: translateY(-3px); box-shadow: 0 0 0 1.5px var(--tg), 0 0 22px rgba(var(--glow), .35); }
nav.vung .o-vung.chon::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,.95) 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; }
nav.vung .o-vung.khoa { filter: grayscale(.85) brightness(.7); }

/* ---- Unit: thẻ tiêu đề kính tối có vạch màu thế giới bên trái (dính đầu màn khi cuộn) + đường nút */
.unit { margin: 0 0 30px; }
.dau-unit { position: sticky; top: 66px; z-index: 9; display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; border-radius: 14px;
  background: rgba(20,20,23,.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 3px 0 0 var(--tg), 0 0 0 1px var(--vien), 0 0 30px rgba(var(--glow), .08); }
.dau-unit > div { flex: 1; min-width: 0; }
.dau-unit small { font: 700 .7em var(--tieu-de); letter-spacing: .14em; text-transform: uppercase; color: var(--tg); }
.dau-unit h2 { margin: 3px 0 0; font-size: 1.22em; }
.dau-unit .ly { display: inline-block; margin-top: 5px; font-size: .8em; color: var(--chu3); }
.nut-tt { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; background: rgba(255,255,255,.05); box-shadow: 0 0 0 1px var(--vien2); font-size: 1.1em; text-decoration: none !important; }
.nut-tt:hover { background: rgba(255,255,255,.1); }
.unit.khoa .dau-unit { box-shadow: inset 3px 0 0 var(--chu3), 0 0 0 1px var(--vien); }
.unit.khoa .dau-unit small { color: var(--chu3); }

/* ---- nút bài: khối pixel phát sáng (như nút CHƠI của app Nos) uốn lượn */
.duong { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 30px 0 10px; }
.tram { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; transform: translateX(calc(var(--x, 0) * 1px)); }
.khoi { display: block; line-height: 0; }
.nut-bai { --m: var(--glow); position: relative; display: grid; place-items: center; width: 66px; height: 62px; border: 0; padding: 0; color: var(--toi); text-decoration: none !important; cursor: pointer;
  background: linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,0) 55%), rgb(var(--m));
  clip-path: polygon(0 8px,4px 8px,4px 4px,8px 4px,8px 0,calc(100% - 8px) 0,calc(100% - 8px) 4px,calc(100% - 4px) 4px,calc(100% - 4px) 8px,100% 8px,100% calc(100% - 8px),calc(100% - 4px) calc(100% - 8px),calc(100% - 4px) calc(100% - 4px),calc(100% - 8px) calc(100% - 4px),calc(100% - 8px) 100%,8px 100%,8px calc(100% - 4px),4px calc(100% - 4px),4px calc(100% - 8px),0 calc(100% - 8px));
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.22), inset 0 2px 0 rgba(255,255,255,.45); transition: transform .3s var(--spring), filter .2s; }
.khoi:has(> .nut-bai:not(.khoa)) { filter: drop-shadow(0 0 12px rgba(var(--glow), .55)) drop-shadow(0 0 34px rgba(var(--glow), .2)); }
.nut-bai:hover { transform: translateY(-3px) scale(1.04); }
.nut-bai:active { transform: translateY(2px) scale(.97); }
.nut-bai .bieu { font: 800 1.45em/1 var(--tieu-de); }
/* đã xong → xám (vẫn bấm được để học lại); dấu ✓ + sao giữ để biết đã làm */
.nut-bai.xong { --m: 128,128,136; color: #e9e9ee; }
.khoi:has(> .nut-bai.xong) { filter: none; }
.nut-bai.xong:hover { --m: 160,160,168; }
.nut-bai.khoa { background: #1c1c20; color: var(--chu3); box-shadow: inset 0 -6px 0 rgba(0,0,0,.3); } .nut-bai.khoa .bieu { font-size: 1.1em; filter: grayscale(1); opacity: .6; }
/* bài đang học: vòng sáng nhịp quanh nút + nhãn BẮT ĐẦU nảy */
.tram:has(.dang) { margin-top: 50px; }
.nut-bai.dang::after { content: ""; position: absolute; top: 0; bottom: 0; width: 26px; left: -40px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); transform: skewX(-20deg); animation: luot 3s ease-in-out infinite; }
.tram:has(.dang)::before { content: ""; position: absolute; top: -11px; width: 88px; height: 84px; border-radius: 18px; box-shadow: 0 0 0 2px rgba(var(--glow), .5); animation: nhip-vong 2s ease-out infinite; }
@keyframes nhip-vong { from { transform: scale(.92); opacity: 1; } to { transform: scale(1.22); opacity: 0; } }
.bat-dau { position: absolute; bottom: calc(100% + 16px); z-index: 2; white-space: nowrap; font: 800 .74em var(--tieu-de); letter-spacing: .14em; color: var(--tg); padding: 7px 13px;
  border-radius: 9px; background: #17171a; box-shadow: 0 0 0 1px rgba(var(--glow), .55), 0 0 16px rgba(var(--glow), .25); animation: nhay-nhe 1.6s ease-in-out infinite; }
.bat-dau::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: #17171a; box-shadow: 1px 1px 0 rgba(var(--glow), .55); transform: translateX(-50%) rotate(45deg); }
@keyframes nhay-nhe { 50% { transform: translateY(-5px); } }
.sao-nho { font-size: .78em; color: #c9c9cf; letter-spacing: 1px; line-height: 1; margin-top: 4px; } .sao-nho .tat { color: rgba(255,255,255,.12); text-shadow: none; }
.lv-ben { position: absolute; top: -40px; width: 130px; pointer-events: none; }
.lv-ben .lv { --co: 130px; }
.lv-ben.phai { left: calc(100% + 40px); } .lv-ben.trai { right: calc(100% + 40px); }
/* tên bài ngay dưới nút: 2 dòng tối đa; chưa làm = sáng, đang học = màu thế giới, xong = xám, khoá = mờ */
.ten-bai { width: 168px; margin-top: 7px; text-align: center; font: 700 .8em/1.25 var(--tieu-de); color: var(--chu);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.ten-bai small { font-size: .9em; color: var(--chu3); margin-right: 2px; }
.ten-bai.dang { color: var(--tg); } .ten-bai.xong { color: #9a9aa2; font-weight: 600; } .ten-bai.khoa { color: var(--chu3); font-weight: 600; }
.tram:has(.the-noi) .ten-bai { visibility: hidden; }
/* mini-boss: nút đỏ có mặt quái; Boss cuối vùng: khối tím lớn */
.nut-bai.mini { width: 84px; height: 78px; --m: 255,110,110; }
.khoi:has(> .nut-bai.mini) { filter: drop-shadow(0 0 14px rgba(255,110,110,.5)); }
.nut-bai.mini .qv { position: relative; z-index: 1; margin-top: -6px; }
.nut-bai.mini.xong { --m: 128,128,136; } .khoi:has(> .nut-bai.mini.xong) { filter: none; } .nut-bai.mini.xong .qv { filter: grayscale(1) opacity(.75); }
.tram.cuoi { margin-top: 10px; text-align: center; gap: 2px; padding-bottom: 20px; }
.nut-bai.boss { width: 128px; height: 116px; --m: 190,150,255; overflow: visible; }
.khoi:has(> .nut-bai.boss:not(.khoa)) { filter: drop-shadow(0 0 18px rgba(190,150,255,.55)) drop-shadow(0 0 50px rgba(190,150,255,.2)); }
.nut-bai.boss .qv { margin-top: -14px; position: relative; z-index: 1; }
.nut-bai.boss.khoa .qv { filter: grayscale(1) opacity(.4); }
.nut-bai.boss.xong { --m: 128,128,136; } .khoi:has(> .nut-bai.boss.xong) { filter: none; } .nut-bai.boss.xong .qv { filter: grayscale(1) opacity(.75); }
.tram.cuoi b { margin-top: 8px; font-family: var(--tieu-de); } .tram.cuoi .mo { font-size: .84em; }
/* thẻ nổi khi bấm nút bài (kiểu bảng nổi .pop của app Nos) */
.tram:has(.the-noi) { z-index: 10; }
.the-noi { position: absolute; top: calc(100% + 14px); z-index: 6; width: 300px; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 13px; text-align: left;
  background: #17171a; color: var(--chu); box-shadow: 0 0 0 1px rgba(var(--glow), .45), 0 0 26px rgba(var(--glow), .15), 0 24px 60px rgba(0,0,0,.6); animation: phong .25s var(--spring) both; filter: none; }
.the-noi::before { content: ""; position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; background: #17171a; box-shadow: -1px -1px 0 rgba(var(--glow), .45); transform: translateX(-50%) rotate(45deg); }
.the-noi b { font: 700 1.05em/1.3 var(--tieu-de); } .the-noi small { color: var(--chu2); }
.the-noi .nut { width: 100%; margin-top: 6px; }
.the-noi.khoa { box-shadow: 0 0 0 1px var(--vien2), 0 24px 60px rgba(0,0,0,.6); } .the-noi.khoa::before { box-shadow: -1px -1px 0 var(--vien2); }
.the-noi .ly { color: var(--chu3); font-size: .9em; }

@media (max-width: 760px) {
  nav.vung { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dau-unit { top: 62px; }
  .tram { transform: translateX(calc(var(--x, 0) * .7px)); }
  .lv-ben { width: 96px; top: -24px; } .lv-ben .lv { --co: 96px; } .lv-ben.phai { left: calc(100% + 18px); } .lv-ben.trai { right: calc(100% + 18px); }
  .the-noi { width: min(300px, 86vw); }
  .ten-bai { width: 132px; font-size: .74em; }
}
/* kiểu ải của mỗi bài (TG.kieuAi): huy hiệu tròn góc phải nút bài + dòng luật trong thẻ nổi — cho em biết bài này chơi kiểu gì */
.kieu-ai { position: absolute; top: -8px; left: calc(50% + 22px); z-index: 2; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 14px; line-height: 1;
  background: #17171a; box-shadow: 0 0 0 1.5px rgba(var(--glow), .55), 0 2px 6px rgba(0,0,0,.5); pointer-events: none; }
.tram:has(.nut-bai.khoa) .kieu-ai { filter: grayscale(1); opacity: .5; }
.kieu-noi { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; margin-top: 4px; border-radius: 10px; background: rgba(var(--glow), .08); box-shadow: inset 0 0 0 1px rgba(var(--glow), .25); }
.kieu-noi > span { font-size: 1.4em; line-height: 1; } .kieu-noi b { font-size: .92em; } .kieu-noi small { display: block; font-size: .8em; line-height: 1.35; color: var(--chu2); }
