:root { --nen: #070b18; --kinh: rgba(10, 16, 36, .78); --vien: rgba(255, 255, 255, .12); --chu: #eef2ff; --phu: #9aa7c4; --xanh: #2453ff; --ngoc: #22d3ee; --do: #e5484d; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--nen); color: var(--chu); font: 14px/1.45 "Be Vietnam Pro", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
#c3d { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
.nut { border: 1px solid var(--vien); background: rgba(255, 255, 255, .08); color: var(--chu); border-radius: 12px; padding: 8px 14px; font-weight: 600; backdrop-filter: blur(10px); transition: background .15s, transform .15s; }
.nut:hover { background: rgba(255, 255, 255, .16); }
.nut:active { transform: scale(.97); }
.nut.on { background: var(--xanh); border-color: var(--xanh); }
.nut--chinh { background: var(--xanh); border-color: var(--xanh); }
.nut--chinh:hover { background: #1739c9; }
.nut--do { background: rgba(229, 72, 77, .18); border-color: rgba(229, 72, 77, .5); }

/* màn vào lớp */
.vao { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; z-index: 20;
  background: radial-gradient(60% 70% at 85% 10%, rgba(36, 83, 255, .45), transparent 60%), radial-gradient(45% 60% at 10% 100%, rgba(34, 211, 238, .25), transparent 60%), rgba(7, 11, 24, .82); backdrop-filter: blur(4px); }
.vao__the { width: min(460px, 100%); background: rgba(10, 16, 36, .9); border: 1px solid var(--vien); border-radius: 24px; padding: 28px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); }
.vao__nhan { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #cfe0ff; }
.vao__nhan i { width: 8px; height: 8px; border-radius: 50%; background: var(--ngoc); box-shadow: 0 0 0 4px rgba(34, 211, 238, .2); }
.vao h1 { font-size: 26px; margin: 12px 0 6px; letter-spacing: -.02em; }
.vao p { color: var(--phu); margin: 0 0 18px; }
.vao label { display: block; font-size: 12px; font-weight: 600; color: var(--phu); margin-bottom: 12px; }
.vao select, .vao input[type=password], .vao input:not([type]) { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--vien); background: rgba(255, 255, 255, .06); color: var(--chu); font: inherit; outline: none; }
.vao select option { color: #111; }
.vao__mau { display: flex; gap: 8px; margin: 4px 0 14px; }
.vao__mau button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; }
.vao__mau button.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.vao__vai { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-bottom: 18px; }
.vao__vai label { display: inline-flex; gap: 6px; margin: 0; color: var(--chu); font-size: 14px; }
.vao__vai input[type=password] { flex: 1 1 100%; margin-top: 4px; }
#v-ok { width: 100%; padding: 13px; font-size: 15px; }
.vao__phu { font-size: 12px; margin: 14px 0 0 !important; }

/* HUD */
.hud { position: fixed; left: 12px; right: 12px; top: 12px; display: flex; justify-content: space-between; gap: 10px; z-index: 5; pointer-events: none; }
.hud > div { display: flex; gap: 8px; align-items: center; pointer-events: auto; flex-wrap: wrap; }
.hud__trai { background: var(--kinh); border: 1px solid var(--vien); border-radius: 14px; padding: 8px 14px; backdrop-filter: blur(12px); }
.hud__trai span { color: var(--phu); font-size: 12px; }
.kn { color: #fbbf24 !important; } .kn.ok { color: #34d399 !important; }

/* bảng bên */
.ben { position: fixed; right: 12px; top: 64px; bottom: 84px; width: min(340px, calc(100% - 24px)); z-index: 6; display: flex; flex-direction: column; background: var(--kinh); border: 1px solid var(--vien); border-radius: 18px; backdrop-filter: blur(14px); overflow: hidden; }
.ben__tab { display: flex; border-bottom: 1px solid var(--vien); }
.ben__tab button { flex: 1; background: none; border: 0; color: var(--phu); padding: 11px 6px; font-weight: 600; font-size: 13px; }
.ben__tab button.on { color: #fff; box-shadow: inset 0 -2px 0 var(--ngoc); }
.ben__tab i { font-style: normal; background: rgba(255, 255, 255, .12); border-radius: 99px; padding: 0 7px; margin-left: 4px; font-size: 11px; }
.ben__than { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#ds-nguoi { list-style: none; margin: 0; padding: 8px; overflow: auto; }
#ds-nguoi li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; }
#ds-nguoi li:hover { background: rgba(255, 255, 255, .06); }
#ds-nguoi .cham { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
#ds-nguoi small { display: block; color: var(--phu); font-size: 11px; }
#ds-nguoi .the { margin-left: auto; font-size: 11px; color: var(--phu); }
.ds-tin { flex: 1; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.tin { margin: 0; padding: 8px 11px; border-radius: 12px; background: rgba(255, 255, 255, .06); font-size: 13px; overflow-wrap: anywhere; }
.tin b { display: block; font-size: 11px; color: var(--ngoc); margin-bottom: 2px; }
.tin--toi { background: rgba(36, 83, 255, .28); align-self: flex-end; max-width: 88%; }
.tin--rieng { border: 1px dashed rgba(251, 191, 36, .6); }
.tin--ai { background: linear-gradient(135deg, rgba(36, 83, 255, .28), rgba(34, 211, 238, .14)); }
.tin--hoi { background: rgba(255, 255, 255, .04); font-style: italic; }
.tin--he { background: none; color: var(--phu); font-size: 12px; text-align: center; padding: 2px; }
.nhap { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--vien); flex-wrap: wrap; }
.nhap input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--vien); background: rgba(255, 255, 255, .06); color: var(--chu); font: inherit; outline: none; }
#chat-den { flex: 1 1 100%; font-size: 12px; color: #fbbf24; cursor: pointer; }

/* điều khiển trang + bình chọn */
.dk-slide { position: fixed; left: 50%; transform: translateX(-50%); top: 64px; z-index: 5; display: flex; gap: 8px; align-items: center; background: var(--kinh); border: 1px solid var(--vien); border-radius: 14px; padding: 6px 8px; backdrop-filter: blur(12px); }
.dk-slide small { color: var(--phu); font-size: 11px; max-width: 160px; }
.bc { position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 5; width: min(560px, calc(100% - 24px)); background: var(--kinh); border: 1px solid var(--vien); border-radius: 18px; padding: 14px; backdrop-filter: blur(14px); }
.bc b { display: block; margin-bottom: 10px; }
#bc-pa { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#bc-pa button { text-align: left; border: 1px solid var(--vien); background: rgba(255, 255, 255, .06); color: var(--chu); border-radius: 12px; padding: 10px 12px; position: relative; overflow: hidden; }
#bc-pa button i { position: absolute; inset: 0 auto 0 0; background: rgba(34, 211, 238, .2); transition: width .3s; }
#bc-pa button span { position: relative; }
#bc-pa button.chon { border-color: var(--ngoc); }
#bc-pa button.dung { border-color: #34d399; background: rgba(52, 211, 153, .15); }

/* thanh hành động */
.hanh { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 5; display: flex; gap: 8px; align-items: center; background: var(--kinh); border: 1px solid var(--vien); border-radius: 18px; padding: 8px; backdrop-filter: blur(14px); }
.hanh__cx { display: flex; gap: 2px; padding-left: 6px; border-left: 1px solid var(--vien); }
.hanh__cx button { background: none; border: 0; font-size: 20px; padding: 4px 6px; border-radius: 10px; transition: transform .15s; }
.hanh__cx button:hover { transform: scale(1.25); }

.dpad { position: fixed; left: calc(18px + env(safe-area-inset-left)); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 5; width: 124px; height: 124px; border-radius: 50%; border: 1px solid var(--vien); background: radial-gradient(circle, rgba(255,255,255,.10), rgba(15,23,42,.35) 70%); backdrop-filter: blur(8px); touch-action: none; display: grid; place-items: center; user-select: none; -webkit-user-select: none; transition: opacity .2s; opacity: .78; }
.dpad.giu { opacity: 1; } .dpad.chay { box-shadow: 0 0 0 3px rgba(251,191,36,.55); }
.joy__nut { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(160deg, #f8fafc, #94a3b8); box-shadow: 0 4px 14px rgba(0,0,0,.45); pointer-events: none; transition: transform .06s; }
.dpad.giu .joy__nut { transition: none; }
.joy__g { position: absolute; bottom: -20px; white-space: nowrap; font-size: 10.5px; color: var(--phu); text-shadow: 0 1px 2px #000; pointer-events: none; }
body.dt input, body.dt textarea, body.dt select { font-size: 16px !important; }   /* iOS không tự phóng to khi gõ */
body.dt .hud { padding-top: env(safe-area-inset-top); }

.pop { position: fixed; z-index: 15; background: rgba(10, 16, 36, .95); border: 1px solid var(--vien); border-radius: 14px; padding: 10px; min-width: 190px; box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .7); }
.pop b { display: block; margin: 2px 4px 8px; }
.pop button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--chu); padding: 8px; border-radius: 10px; }
.pop button:hover { background: rgba(255, 255, 255, .08); }
.toast { position: fixed; left: 50%; top: 110px; transform: translateX(-50%); z-index: 30; background: rgba(10, 16, 36, .92); border: 1px solid var(--vien); border-radius: 12px; padding: 10px 16px; max-width: calc(100% - 32px); text-align: center; }

@media (max-width: 720px) {
  .ben { top: auto; height: 52vh; bottom: 78px; right: 8px; left: 8px; width: auto; }
  .hud__trai span#h-so { display: none; }
  .hanh { bottom: 10px; max-width: calc(100% - 16px); overflow-x: auto; }
  .hanh__cx button { font-size: 18px; padding: 2px 4px; }
  .dk-slide { top: 60px; }
  #b-bang { display: none; }
  .bc { bottom: 76px; } #bc-pa { grid-template-columns: 1fr; }
}

/* ---- khu học tập: bổ sung ---- */
.vao__the { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.vao__kb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 16px; }
.vao__kb div { border: 1px solid var(--vien); border-radius: 12px; padding: 8px 10px; background: rgba(255, 255, 255, .04); font-size: 12px; color: var(--phu); }
.vao__kb b { display: block; color: var(--chu); font-size: 13px; }
.ghi-chu { color: var(--phu); font-size: 12px; margin: 8px 10px 0; }
.ban-do { position: fixed; left: 12px; top: 64px; z-index: 5; width: 220px; height: 220px; border-radius: 16px; background: var(--kinh); border: 1px solid var(--vien); backdrop-filter: blur(12px); cursor: pointer; }
.mini { position: fixed; left: 12px; bottom: 84px; z-index: 5; width: 300px; border-radius: 14px; overflow: hidden; border: 1px solid var(--vien); box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .7); cursor: zoom-in; }
.mini canvas { display: block; width: 100%; height: auto; }
.mini span { position: absolute; right: 8px; top: 6px; font-size: 14px; }
.phong-lon { position: fixed; inset: 0; z-index: 25; background: rgba(4, 7, 16, .9); display: grid; place-items: center; padding: 20px; }
.phong-lon canvas { width: min(96vw, 160vh); height: auto; border-radius: 16px; box-shadow: 0 30px 80px -20px #000; }
.phong-lon button { position: absolute; top: 16px; right: 16px; }
.dv { position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 6; width: min(680px, calc(100% - 24px)); background: var(--kinh); border: 1px solid var(--vien); border-radius: 18px; padding: 14px; backdrop-filter: blur(14px); }
.dv__dau { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dv__dau span { font-size: 22px; font-weight: 700; color: #facc15; min-width: 48px; text-align: right; }
.dv__pa { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dv__pa button { border: 0; border-radius: 14px; padding: 14px; color: #fff; font-weight: 700; text-align: left; font-size: 15px; }
.dv__pa button:disabled { opacity: .55; } .dv__pa button.chon { outline: 3px solid #fff; opacity: 1; } .dv__pa button.dung { outline: 3px solid #34d399; opacity: 1; }
.o-nho { flex: 1 1 100%; font-size: 12px; color: var(--phu); display: flex; gap: 6px; align-items: center; }
#chat-kenh { border-radius: 10px; border: 1px solid var(--vien); background: rgba(255, 255, 255, .06); color: var(--chu); font: inherit; padding: 0 6px; }
#chat-kenh option { color: #111; }
.the-ghi { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .06); border-left: 4px solid var(--c, #22d3ee); font-size: 13px; }
.the-ghi b { display: block; font-size: 11px; color: var(--phu); }
.the-ghi button { margin-left: auto; background: none; border: 0; color: var(--phu); }
.nhom-ds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nhom-ds button { text-align: left; border: 1px solid var(--vien); background: rgba(255, 255, 255, .05); color: var(--chu); border-radius: 12px; padding: 10px; }
.dh-nhom { display: flex; flex-wrap: wrap; gap: 6px; }
.dh h4 { margin: 8px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--phu); }
.menu-uong { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.menu-uong button { font-size: 26px; background: rgba(255, 255, 255, .06); border: 1px solid var(--vien); border-radius: 12px; padding: 8px 0; color: #fff; }
.menu-uong small { display: block; font-size: 10px; color: var(--phu); }
@media (max-width: 720px) { .ban-do { width: 130px; height: 130px; top: 58px; } .mini { width: 170px; bottom: 76px; } .dv__pa { grid-template-columns: 1fr; } .dpad { bottom: calc(150px + env(safe-area-inset-bottom)); } }
#ds-nguoi li.nhom-dau { cursor: default; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--phu); padding: 10px 8px 4px; }
#ds-nguoi li.nhom-dau:hover { background: none; }
.dh-nhom select { flex: 1; min-width: 0; border-radius: 10px; border: 1px solid var(--vien); background: rgba(255,255,255,.06); color: var(--chu); font: inherit; padding: 8px; }
.dh-nhom select option, .dh-nhom select optgroup { color: #111; }
.dh-nhom input { border-radius: 10px; border: 1px solid var(--vien); background: rgba(255,255,255,.06); color: var(--chu); font: inherit; padding: 8px 10px; }
#h-hen { color: #facc15 !important; font-weight: 700; }

.vao__khu { display: flex; gap: 6px; margin: 12px 0 0; }
.vao__khu a { flex: 1; text-align: center; padding: 9px; border-radius: 12px; border: 1px solid var(--vien); color: var(--phu); text-decoration: none; font-weight: 600; font-size: 13px; }
.vao__khu a.on { background: var(--xanh); border-color: var(--xanh); color: #fff; }
.vao__tuoi { display: flex !important; gap: 8px; align-items: flex-start; color: #fbbf24 !important; font-size: 12.5px !important; }
.pop input, .pop select { display: block; width: 100%; margin: 0 0 8px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--vien); background: rgba(255,255,255,.06); color: var(--chu); font: inherit; }
.pop select option { color: #111; }

.dong-mon { display: flex; gap: 6px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--vien); }
.dong-mon span { flex: 1; font-size: 13px; } .dong-mon small { color: var(--phu); }
.dong-mon button { width: auto !important; display: inline-block !important; background: rgba(255,255,255,.08) !important; border: 1px solid var(--vien) !important; border-radius: 10px; padding: 6px 10px !important; font-size: 12px; }
.pop { max-height: 70vh; overflow: auto; max-width: min(380px, calc(100vw - 16px)); }
.dong-tin { display: block; padding: 8px; border-radius: 10px; color: var(--chu); text-decoration: none; font-size: 13px; border-bottom: 1px solid var(--vien); }
.dong-tin:hover { background: rgba(255,255,255,.06); }
.shorts { position: fixed; inset: 0; z-index: 26; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.shorts video { height: min(86vh, 160vw); aspect-ratio: 9 / 16; object-fit: cover; border-radius: 18px; background: #000; }
.sh-nut { position: absolute; right: max(12px, calc(50% - min(43vh, 80vw) - 70px)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.sh-nut button { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--vien); background: rgba(255,255,255,.12); color: #fff; font-size: 18px; }
.sh-nut span { color: #fff; font-size: 12px; }
.sh-ghi { position: absolute; bottom: 12px; color: var(--phu); font-size: 12px; }
.pop a.nut { display: inline-block; padding: 5px 10px; font-size: 12px; text-decoration: none; margin-left: 4px; }
.pop details input, .pop details select { margin-top: 6px; }

.hd { position: fixed; inset: 0; z-index: 27; background: rgba(4,7,16,.75); display: grid; place-items: center; padding: 16px; }
.hd__the { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: rgba(10,16,36,.96); border: 1px solid var(--vien); border-radius: 22px; padding: 22px; }
.hd__dau { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .hd__dau h2 { margin: 0; font-size: 22px; }
.hd__cach { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 8px; } .hd__cach span { font-size: 12px; background: rgba(255,255,255,.06); border: 1px solid var(--vien); border-radius: 999px; padding: 5px 10px; color: var(--phu); } .hd__cach b { color: #fff; }
.hd__ghi { color: var(--phu); font-size: 12.5px; margin: 6px 0 12px; }
.hd__ds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hd-dong { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--vien); }
.hd-dong > div { flex: 1; min-width: 0; } .hd-dong b { display: block; font-size: 14px; } .hd-dong small { display: block; color: var(--phu); font-size: 11.5px; } .hd-dong .hd-duong { color: #fbbf24; }
.hd-ic { font-size: 26px; } .hd-dong .nut { padding: 6px 10px; font-size: 12px; }
@media (max-width: 640px) { .hd__ds { grid-template-columns: 1fr; } }

/* ---- UAT: tối ưu điện thoại ---- */
@media (max-width: 720px) {
  .hud { left: 8px; right: 8px; top: 8px; }
  .hud__phai { flex-wrap: nowrap; gap: 4px; }
  .hud__phai .nut { padding: 7px 9px; }
  .hud__phai .chu, #h-lop, #h-kn { display: none; }
  .hud__trai { padding: 6px 10px; max-width: 46vw; overflow: hidden; white-space: nowrap; }
  .ban-do { width: 104px; height: 104px; top: 52px; left: 8px; }
  .mini { width: 132px; bottom: 70px; left: 8px; }
  .dk-slide { top: 52px; left: auto; right: 8px; transform: none; }
  .dk-slide small { display: none; }
  .vao__the { padding: 18px; }
  .vao__kb { grid-template-columns: 1fr 1fr; }
  .vao__kb div { font-size: 11px; padding: 6px 8px; }
  .vao h1 { font-size: 21px; }
  .hd__the { padding: 14px; }
}
@media (max-width: 380px) { .vao__kb div { font-size: 0; } .vao__kb b { font-size: 12px; } }

.que__tab { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.que__tab button { border: 1px solid var(--vien); background: rgba(255,255,255,.05); color: var(--chu); border-radius: 999px; padding: 7px 12px; font-size: 13px; }
.que__tab button.on { background: #7f1d1d; border-color: #b91c1c; }
.que p, .que li { color: #e5ebff; font-size: 14px; } .que h4 { margin: 4px 0 8px; color: #fbbf24; }
.que__form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.que__form input, .que__form select { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--vien); background: rgba(255,255,255,.06); color: var(--chu); font: inherit; } .que__form option { color: #111; }
.que__kq { margin-top: 12px; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(127,29,29,.45), rgba(120,53,15,.35)); border: 1px solid rgba(251,191,36,.35); }
.que__hao { font: 700 20px/1.25 monospace; color: #fde68a; margin: 6px 0; }
.que__bang { width: 100%; border-collapse: collapse; text-align: center; } .que__bang th { color: #fbbf24; font-size: 12px; } .que__bang td { padding: 6px; border: 1px solid var(--vien); }
.que__giap { display: flex; flex-wrap: wrap; gap: 6px; } .que__tho { font-style: italic; font-size: 16px !important; color: #fde68a !important; }
.que__gt { font-size: 12px !important; color: #fca5a5 !important; margin-top: 12px; }

.tarot { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.tarot__la { text-align: center; animation: lat .7s both; } .tarot__la small { color: #fbbf24; font-weight: 700; } .tarot__la p { font-size: 12.5px !important; margin: 6px 0 0; }
.tarot__mat { margin: 6px auto 0; width: 110px; height: 180px; border-radius: 12px; background: linear-gradient(160deg, #3b0764, #1e1b4b); border: 2px solid #c9a96e; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 10px 6px; box-shadow: 0 10px 24px -10px #000; }
.tarot__mat span { color: #c9a96e; font: 700 14px serif; } .tarot__mat b { font-size: 46px; } .tarot__mat em { color: #fde68a; font-size: 11px; font-style: normal; }
.tarot__mat.nguoc { transform: rotate(180deg); }
@keyframes lat { from { transform: rotateY(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.bai-tay { display: flex; gap: 10px; justify-content: center; margin: 8px 0; } .bai-tay__la { width: 70px; height: 100px; border-radius: 10px; background: #fff; color: #111; display: grid; place-items: center; font: 800 26px serif; box-shadow: 0 8px 18px -8px #000; animation: lat .6s both; } .bai-tay__la.do { color: #dc2626; }
.vao__the--gon { width: min(420px, 100%); text-align: center; }
.vao__ten { display: block; width: 100%; margin: 6px 0 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--vien); background: rgba(255,255,255,.08); color: var(--chu); font: 600 17px inherit; font-family: inherit; text-align: center; outline: none; }
.vao__ten:focus { border-color: var(--xanh); box-shadow: 0 0 0 3px rgba(36,83,255,.3); }
.vao__tuoi[hidden], .vao__khu[hidden], .vao__kb[hidden], .vao__vai[hidden], .vao__mau[hidden] { display: none !important; }
/* rạp YouTube (lớp CSS 3D nằm sau canvas) + mục lục bài giảng */
#c3d { z-index: 1; background: transparent; }
.yt-dang { display: flex; gap: 10px; align-items: center; margin: 6px 4px 8px; }
.yt-dang img { width: 112px; border-radius: 8px; }
.yt-muc, .ml-trang { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 6px 8px; margin: 2px 0; border-radius: 10px; border: 1px solid transparent; background: rgba(255,255,255,.04); color: inherit; font: inherit; cursor: pointer; }
.yt-muc img { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; }
.yt-muc:hover, .ml-trang:hover { background: rgba(255,255,255,.1); }
.yt-muc.on, .ml-trang.on { border-color: #60a5fa; background: rgba(37,99,235,.25); }
.ml-trang span { flex: none; min-width: 28px; height: 28px; padding: 0 4px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.1); font-weight: 700; font-size: 12px; }
.ml-trang:disabled { opacity: .55; cursor: default; }
#s-tu.on { background: #2563eb; color: #fff; }
.pop[data-che=yt], .pop[data-che=ml] { width: min(380px, calc(100vw - 24px)); box-sizing: border-box; }
.pop button.yt-muc, .pop button.ml-trang { display: flex; flex-direction: row; align-items: center; gap: 10px; width: 100%; } .pop button.ml-trang span { display: grid; }
/* phòng chiếu 360° */
.v360 { position: fixed; inset: 0; z-index: 25; background: #000; display: flex; flex-direction: column; }
.v360[hidden] { display: none; }
.v360__dau { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; background: rgba(10,16,36,.95); border-bottom: 1px solid var(--vien); }
.v360__dau b { font-size: 15px; } .v360__goi { flex: 1; min-width: 140px; color: #9fb0d4; font-size: 12px; }
#v360-ten { color: #fde68a; font-weight: 600; }
.v360__khung { position: relative; flex: 1; min-height: 0; } .v360__khung iframe, #v360-pl { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.v360__trong { position: absolute; inset: 0; display: grid; place-items: center; color: #c8d3ea; padding: 24px; text-align: center; font-size: 16px; }
.v360__trong[hidden] { display: none; }
.v360__ds { position: absolute; top: 56px; right: 12px; width: min(380px, calc(100% - 24px)); max-height: calc(100% - 80px); overflow: auto; background: rgba(10,16,36,.96); border: 1px solid var(--vien); border-radius: 14px; padding: 8px; z-index: 2; }
.v360__ds[hidden] { display: none; }
.v360__muc { display: flex; gap: 10px; align-items: center; width: 100%; padding: 6px; margin: 2px 0; border: 1px solid transparent; border-radius: 10px; background: rgba(255,255,255,.04); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.v360__muc img { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; flex: none; } .v360__muc.on { border-color: #60a5fa; background: rgba(37,99,235,.25); }
.v360__dan { display: flex; gap: 6px; margin-top: 8px; } .v360__dan input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--vien); background: rgba(255,255,255,.06); color: var(--chu); font: inherit; }

/* ===== Bố cục thống nhất: MỌI khung tương tác neo bên phải (máy tính) / nửa dưới (điện thoại dọc) — không che cảnh 3D ===== */
:root { --dock-w: min(460px, 38vw); }
.pop { left: auto !important; right: 16px !important; top: 64px !important; bottom: auto; width: var(--dock-w); max-width: none; max-height: calc(100vh - 150px); border-radius: 18px; background: rgba(9,12,24,.84); backdrop-filter: blur(14px); }
.hd { inset: 64px 16px 76px auto; width: var(--dock-w); background: none; display: block; padding: 0; }
.hd > .hd__the { width: 100%; max-width: none; height: 100%; max-height: none; overflow: auto; border-radius: 18px; background: rgba(9,12,24,.86); backdrop-filter: blur(14px); }
.bdl { inset: 56px 12px 12px 12px !important; border-radius: 18px; padding: 10px 12px; }   /* bản đồ lớn: gần toàn màn hình để dễ nhìn, dễ chọn */
/* khi đang mở một khung bên phải: ẩn cột Người/Trò chuyện cho gọn */
body:has(.ht-dock:not([hidden]), .pop:not([hidden]), .hd:not([hidden]), .bdl:not([hidden]), .td:not([hidden])) .ben { display: none; }
/* phím tắt 1–9 cho các nút trong khung (máy tính) */
@media (pointer: fine) { .ht-dock__day { counter-reset: p; } .ht-dock__day > button:nth-child(-n+9) { counter-increment: p; position: relative; }
  .ht-dock__day > button:nth-child(-n+9)::after { content: counter(p); position: absolute; top: -6px; right: -4px; font-size: 10px; line-height: 15px; min-width: 15px; padding: 0 3px; border-radius: 8px; background: #2453ff; color: #fff; text-align: center; } }
@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px) {
  .bdl { inset: 50px 6px 6px 6px !important; } .bdl .bdl__khung { min-height: 52vh; } .bdl .bdl__ds { max-height: 30vh; }
  .pop, .hd { left: 8px !important; right: 8px !important; width: auto !important; top: auto !important; bottom: 70px !important; max-height: 50vh; }
  .hd { height: 50vh; } }
#hd-ds { grid-template-columns: 1fr !important; }
.hd-nhom { grid-column: 1 / -1; margin: 10px 2px 2px; font-size: 14px; color: #fde68a; }
.que__ai { display: flex; gap: 8px; margin-top: 12px; } .que__ai input { flex: 1; min-width: 0; border-radius: 12px; border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.3); color: #fff; padding: 9px 12px; font: inherit; }
/* —— điện thoại & màn nhỏ (UAT 12/11): không tràn ngang, thanh trên 1 hàng cuộn được, ẩn bảng phụ chiếm chỗ —— */
html, body { overflow-x: hidden; }
@media (max-width: 900px), (max-height: 520px) {
  .hud { gap: 6px; }
  .hud__trai { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap !important; overflow: hidden; }
  .hud__trai > *:not(#h-vung) { display: none; }
  #h-vung { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
  .hud__phai { flex: 0 1 auto; flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; max-width: 58vw; }
  .hud__phai::-webkit-scrollbar { display: none; }
  .hud__phai .nut { padding: 7px 9px; flex: none; }
  .hud__phai .chu { display: none; }
  .mini { display: none !important; }   /* màn hình phòng thu nhỏ: chỉ dùng trên máy tính */
  .hanh { max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .hanh::-webkit-scrollbar { display: none; }
  .hanh > * { flex: none; }
  .ban-do { top: 54px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .ben:not([hidden]) { top: 50px; bottom: 60px; width: min(320px, 42vw); }
  .ban-do { width: 96px; height: 96px; }
  .hanh { bottom: 6px; padding: 4px 6px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .ht-dock { top: 6px !important; bottom: 6px !important; height: auto !important; max-height: none !important; left: auto !important; right: 6px !important; width: min(420px, 50vw) !important; }
  .ht-dock__dau { padding: 6px 10px !important; } .ht-dock__day { padding: 6px 10px !important; } .cp-o { padding: 6px 10px !important; }
  .cp-chao { bottom: auto; top: 50px; width: min(320px, 44vw); }
}
@media (max-height: 520px) and (orientation: landscape) { .dpad { bottom: calc(58px + env(safe-area-inset-bottom)); width: 112px; height: 112px; } .joy__g { display: none; } }
/* điện thoại dọc: tên phòng 1 hàng, các nút 1 hàng chia đều — không phải vuốt mới thấy nút */
@media (max-width: 560px) and (orientation: portrait) {
  .hud { flex-wrap: wrap; top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px; gap: 6px; }
  .hud__trai { flex: 1 1 100% !important; max-width: none !important; }
  #h-vung { max-width: none; }
  .hud__phai { flex: 1 1 100% !important; max-width: none !important; justify-content: space-between; overflow: visible; gap: 2px !important; }
  .hud__phai .nut { padding: 7px 0 !important; flex: 1 1 0 !important; min-width: 0; text-align: center; }
  .ban-do { top: 104px !important; width: 104px !important; height: 104px !important; }
}
/* điện thoại dọc: khi đang mở khung/bản đồ thì ẩn cần điều khiển (khung chiếm nửa dưới) */
@media (orientation: portrait) { body:has(.ht-dock:not([hidden]), .pop:not([hidden]), .hd:not([hidden]), .bdl:not([hidden]), .td:not([hidden]), .hdm:not([hidden])) .dpad { display: none; } }
/* cảm ứng: nút trong khung đủ lớn để chạm (≥ 36 px) */
body.dt .ht-dock button, body.dt .cp-chao button, body.dt .pop button { min-height: 36px; }
body.dt .ht-dock__day > button::after { display: none !important; }   /* số phím tắt chỉ cho máy tính */
/* màn nhỏ: nút trải nghiệm chính của phòng lên đầu thanh dưới (trước đây bị đẩy khuất bên phải), rồi tới Ra ngoài */
@media (max-width: 900px), (max-height: 520px) { .hanh .nut--chinh { order: -2; } .hanh #b-ra { order: -1; } }
@media (max-width: 900px), (max-height: 520px) { .hanh #b-chup { order: -1; } }
