/* Kẹt ở tầng 7 – TOEX English (luyện đọc TOEIC Part 7) */
:root {
  --kem: #FBF6EA; --the: #F6EDDB; --vien: #E2D8C0; --rung: #3A4A32; --olive: #5F6D45;
  --chu: #4A4A3E; --chu-phu: #625E51; --cam: #B25D2A; --cam-dam: #8F4519; --glacier: #86A3BB;
  --giay: #FFFCF4; --xanh-dam: #2F4A62; --do: #A0392A; --xanh-nen: #E6EDDA;
  --font: "Be Vietnam Pro", system-ui, sans-serif; --serif: "Lora", Georgia, serif;
  --bo: 8px; --bong: 0 10px 30px rgba(20, 26, 18, .28);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: #23291F; color: var(--chu); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
button { font-family: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--glacier); outline-offset: 2px; }
[hidden] { display: none !important; }
#app { min-height: 100dvh; }
.man { min-height: 100dvh; width: 100%; }

/* ---------- nút ---------- */
.nut { min-height: 44px; padding: 10px 18px; border-radius: var(--bo); border: 2px solid var(--rung); background: var(--giay); color: var(--rung); font-weight: 700; font-size: 15px; transition: transform .12s, background .15s, box-shadow .15s; }
.nut:active { transform: translateY(1px) scale(.98); }
.nut-chinh { background: var(--cam); border-color: var(--cam-dam); color: #fff; box-shadow: 0 3px 0 var(--cam-dam); }
.nut-chinh:hover { background: #BF6730; }
.nut-phu { border-color: var(--vien); }
.nut-phu:hover { border-color: var(--olive); }
.nut-rong { width: 100%; margin-top: 14px; }
.nut[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.nut-icon { width: 44px; height: 44px; border-radius: var(--bo); border: 1.5px solid rgba(251, 246, 234, .35); background: rgba(251, 246, 234, .08); color: var(--kem); display: grid; place-items: center; }
.nut-icon .am-tat { display: none; } .nut-icon[aria-pressed="true"] .am-tat { display: block; } .nut-icon[aria-pressed="true"] .am-song { display: none; }
.nut-hud { min-height: 44px; padding: 0 14px; border-radius: var(--bo); border: 1.5px solid rgba(251, 246, 234, .45); background: rgba(251, 246, 234, .12); color: var(--kem); font-weight: 700; font-size: 14px; }
.nut-dong { min-height: 44px; padding: 0 14px; border-radius: var(--bo); border: 1.5px solid var(--vien); background: var(--giay); color: var(--rung); font-weight: 600; font-size: 14px; }

/* ---------- màn mở ---------- */
.man-mo { position: relative; display: grid; align-items: center; padding: 24px 16px; padding-top: calc(24px + env(safe-area-inset-top)); }
.mo-nen { position: fixed; inset: 0; background: linear-gradient(90deg, rgba(20, 26, 18, .15), rgba(20, 26, 18, .65)), url("assets/thoat-phong/hanh-lang.webp?v=20261118tp3") center / cover no-repeat; }
.mo-khung { position: relative; width: min(620px, 100%); margin-left: auto; margin-right: clamp(0px, 6vw, 80px); background: var(--kem); border-radius: 14px; padding: 22px 26px 24px; box-shadow: var(--bong); }
.mo-ve { display: inline-flex; align-items: center; min-height: 44px; color: var(--olive); font-weight: 600; text-decoration: none; font-size: 14px; }
.mo-nhan { margin: 2px 0; font-size: 13px; font-weight: 700; color: var(--olive); }
.man-mo h1, .xong-khung h1 { font-family: var(--serif); font-size: clamp(36px, 5vw, 52px); line-height: 1.08; margin: 0 0 10px; color: var(--rung); }
.mo-gt { margin: 0 0 14px; }
.mo-hoc { border-left: 3px solid var(--olive); padding: 2px 0 2px 14px; margin: 0 0 16px; }
.mo-hoc-td { margin: 0 0 2px; font-weight: 700; color: var(--rung); font-size: 15px; }
.mo-hoc ul { margin: 0; padding-left: 18px; font-size: 14.5px; color: var(--chu-phu); }
.mo-phong { display: grid; gap: 6px; margin-bottom: 14px; }
.the-phong { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "so hang" "ten hang" "en hang"; text-align: left; padding: 9px 14px; border-radius: var(--bo); border: 1.5px solid var(--vien); background: var(--giay); transition: border-color .15s, transform .15s; min-height: 44px; }
.the-phong:hover:not([disabled]) { border-color: var(--olive); transform: translateX(3px); }
.the-phong.khoa { background: var(--the); cursor: not-allowed; }
.tp-so { grid-area: so; font-size: 12px; font-weight: 700; color: var(--olive); }
.tp-ten { grid-area: ten; font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--rung); line-height: 1.25; }
.tp-en { grid-area: en; font-size: 13px; color: var(--chu-phu); }
.tp-hang { grid-area: hang; align-self: center; font-size: 13px; font-weight: 700; color: var(--chu-phu); text-align: right; max-width: 150px; }
.the-phong.xong .tp-hang { color: var(--cam-dam); font-size: 15px; }
.mo-nut { display: flex; flex-wrap: wrap; gap: 8px; }
.mo-bimat { margin: 10px 0 0; font-size: 13.5px; color: var(--chu-phu); }
.mo-canh { margin: 12px 0 0; padding: 10px 12px; background: var(--the); border-radius: var(--bo); font-size: 14px; }

/* ---------- trong phòng ---------- */
.man-phong { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); height: 100dvh; }
.hud { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; background: var(--rung); color: var(--kem); padding: 2px 10px; padding-top: calc(2px + env(safe-area-inset-top)); min-height: 50px; position: relative; z-index: 2; }
.hud-trai { display: flex; gap: 12px; align-items: baseline; min-width: 0; }
.hud-ten { font-family: var(--serif); font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-gio { font-variant-numeric: tabular-nums; font-weight: 600; }
.hud-giua { display: flex; gap: 12px; font-size: 13.5px; opacity: .92; }
.hud-phai { display: flex; gap: 6px; }
.tien-do { position: relative; z-index: 2; height: 26px; background: #2C3826; color: var(--kem); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; padding: 0 12px; }
.tien-do-thanh { position: absolute; left: 0; top: 0; bottom: 0; width: var(--tl, 0%); background: var(--olive); transition: width .6s cubic-bezier(.16, 1, .3, 1); }
.tien-do-chu { position: relative; }
.san { position: relative; overflow: auto; }
.phong-nen { position: fixed; inset: 0; background-size: cover; background-position: center; z-index: 0; }
.nen-hop, .nen-ke-toan { background-color: #2B3326; }
.phong-nen[style*="url"] { background-size: cover !important; background-position: center !important; background-repeat: no-repeat !important; }
.nen-nhan-su { background: radial-gradient(ellipse at 20% 15%, rgba(248, 214, 150, .55), transparent 45%), radial-gradient(ellipse at 85% 80%, rgba(134, 163, 187, .35), transparent 55%), linear-gradient(160deg, #6E5A44 0%, #4A3D2F 55%, #2F2A22 100%); }
.nen-kho { background: radial-gradient(ellipse at 50% 0%, rgba(240, 220, 170, .35), transparent 50%), repeating-linear-gradient(90deg, rgba(0, 0, 0, .18) 0 3px, transparent 3px 180px), repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 120px), linear-gradient(180deg, #4C5560 0%, #353C44 60%, #24282D 100%); }
.nen-giam-doc { background: radial-gradient(ellipse at 75% 25%, rgba(134, 163, 187, .45), transparent 50%), radial-gradient(ellipse at 15% 85%, rgba(230, 180, 110, .35), transparent 45%), linear-gradient(150deg, #34452F 0%, #283423 50%, #1C2318 100%); }
.vat-luoi { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(92px, auto); gap: 12px; padding: 18px clamp(12px, 3vw, 36px) calc(24px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; }
.vat { position: relative; text-align: left; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 10px 14px 10px 16px; border-radius: 10px; border: 1.5px solid rgba(226, 216, 192, .9); background: rgba(251, 246, 234, .93); box-shadow: 0 6px 18px rgba(10, 14, 8, .28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .18s, box-shadow .18s, border-color .18s; min-height: 92px; }
.vat::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 3px 3px 0; background: var(--glacier); }
.vat:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(10, 14, 8, .35); border-color: #fff; }
.vat-kieu { font-size: 11.5px; font-weight: 700; color: var(--olive); }
.vat-ten { font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--rung); line-height: 1.25; }
.vat-tt { font-size: 12.5px; color: var(--chu-phu); }
.vat.co-khoa::before, .vat-cua::before { background: var(--cam); }
.vat.co-khoa .vat-tt { color: var(--cam-dam); font-weight: 600; }
.vat.da-mo::before { background: var(--olive); }
.vat.da-mo .vat-tt { color: var(--olive); font-weight: 600; }
.vat-cua { border-color: rgba(178, 93, 42, .55); }
.vat.moi::after { content: ""; position: absolute; top: 10px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--cam); }
.vat.bi-mat { background: rgba(243, 227, 168, .95); }
@media (prefers-reduced-motion: no-preference) {
  .vat.moi::after { animation: nhay 1.6s ease-in-out infinite; }
  .vat.moi { animation: sang 3.2s ease-in-out infinite; }
}
@keyframes nhay { 50% { transform: scale(1.7); opacity: .4; } }
@keyframes sang { 0%, 100% { box-shadow: 0 6px 18px rgba(10, 14, 8, .28); } 50% { box-shadow: 0 6px 18px rgba(10, 14, 8, .28), 0 0 0 3px rgba(251, 246, 234, .45); } }

/* ---------- bảng trượt ---------- */
.man-mo-nen { position: fixed; inset: 0; background: rgba(16, 20, 14, .62); z-index: 20; }
.sheet { position: fixed; inset: auto 0 0 0; z-index: 21; display: flex; justify-content: center; pointer-events: none; }
.sh-khung { pointer-events: auto; width: min(720px, 100%); max-height: 90dvh; display: flex; flex-direction: column; background: var(--kem); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px rgba(10, 14, 8, .4); padding-bottom: env(safe-area-inset-bottom); }
.sh-dau { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px 8px 18px; border-bottom: 1px solid var(--vien); }
.sh-td { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 19px; color: var(--rung); }
.sh-than { overflow: auto; padding: 14px 18px 20px; }
.sh-ghi { margin: 0 0 12px; font-size: 14.5px; color: var(--chu-phu); }

/* ---------- văn bản ---------- */
.vb { background: var(--giay); border: 1px solid var(--vien); border-radius: 6px; padding: 16px 18px; font-size: 16px; line-height: 1.6; color: #36362C; box-shadow: 0 2px 0 rgba(58, 74, 50, .06); }
.vb p { margin: 0 0 8px; }
.vb-td { margin: 0 0 10px; font-family: var(--serif); font-size: 19px; color: var(--rung); line-height: 1.3; }
.vb-dau { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--vien); font-size: 14.5px; }
.vb-dau dt { font-weight: 700; color: var(--chu-phu); }
.vb-dau dd { margin: 0; }
.vb-ky { margin-top: 10px; font-style: italic; color: var(--chu-phu); }
.vb-chu-y { margin-top: 10px; padding: 8px 12px; background: #FFF4D6; border-left: 3px solid #D9A63A; font-size: 15px; }
.vb-bang-cuon { overflow-x: auto; margin: 6px 0; }
.vb-tbl { border-collapse: collapse; width: 100%; font-size: 15px; }
.vb-tbl th, .vb-tbl td { border: 1px solid var(--vien); padding: 6px 8px; text-align: left; vertical-align: top; }
.vb-tbl th { background: var(--the); color: var(--rung); font-size: 14px; }
.vb-tbl.hai-cot td:first-child { font-weight: 700; color: var(--chu-phu); width: 38%; background: var(--the); }
.vb-ghi-chu { background: #FBEFB8; border-color: #E7D58A; font-family: var(--font); transform: rotate(-.4deg); }
.vb.vb-bang { background: #FCFCFA; border: 6px solid #C9CDD2; border-radius: 4px; }
.vb-chieu { background: var(--rung); color: var(--kem); border-color: #2A3524; }
.vb-chieu .vb-td { color: #F3E3A8; font-size: 22px; }
.vb-chieu .tu { color: var(--kem); text-decoration-color: #F3E3A8; }
.vb-tin-nhan { background: #EEF2F5; border-color: #CBD6DE; }
.vb-tin-nhan p { background: #fff; border-radius: 12px 12px 12px 3px; padding: 8px 12px; display: block; width: fit-content; max-width: 92%; box-shadow: 0 1px 0 rgba(47, 74, 98, .1); }
.vb-thu, .vb-bao { font-family: var(--serif); }
.vb-bao .vb-td { font-size: 21px; border-bottom: 2px solid var(--chu); padding-bottom: 6px; }
.vb-thong-bao { border-left: 4px solid var(--xanh-dam); }
.lich { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin-bottom: 8px; }
.lich-thu { font-size: 12px; font-weight: 700; color: var(--olive); text-align: center; }
.lich-o { min-height: 52px; border: 1px solid var(--vien); border-radius: 4px; padding: 2px 4px; font-size: 13px; background: #fff; overflow: hidden; }
.lich-o b { display: block; font-size: 13px; }
.lich-o small { display: block; font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; color: var(--cam-dam); }
.lich-o.co-ghi { background: #FFF4D6; border-color: #E7C979; }
.tu { font: inherit; color: inherit; background: none; border: none; padding: 10px 3px; margin: -10px -3px; text-decoration: underline; text-decoration-style: dotted; text-decoration-color: var(--olive); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: help; }
.tu.da-tra { text-decoration-style: solid; }
.tu:hover { background: rgba(95, 109, 69, .12); }

/* ---------- khoá ---------- */
.mo-vat .vb + .khoa, .mo-vat .vb + .khoa-chua, .mo-vat .vb + .khoa-xong { margin-top: 14px; }
.khoa { border: 1.5px solid var(--vien); border-radius: 10px; background: var(--the); padding: 14px; }
.khoa-hoi { margin: 0 0 10px; font-weight: 700; color: var(--rung); font-size: 16.5px; }
.khoa-hoi small { display: block; font-weight: 500; color: var(--chu-phu); font-size: 14px; margin-top: 2px; }
.khoa-chua, .khoa-xong { padding: 10px 12px; border-radius: var(--bo); background: var(--the); margin: 0; }
.khoa-xong { background: var(--xanh-nen); color: var(--rung); }
.khoa-o { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; justify-content: center; }
.o-ky { width: 40px; height: 48px; border-radius: 6px; border: 2px solid var(--vien); background: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--rung); }
.o-ky.co { border-color: var(--olive); }
.o-ky.dung, .o-thu.dung { background: var(--olive); color: #fff; border-color: var(--olive); }
.khoa-o.thu-tu { flex-direction: column; align-items: stretch; }
.o-thu { min-height: 40px; border: 2px dashed var(--vien); border-radius: 6px; background: #fff; display: flex; align-items: center; gap: 10px; padding: 4px 10px; font-weight: 600; }
.o-thu b { width: 24px; height: 24px; border-radius: 50%; background: var(--vien); color: var(--rung); display: grid; place-items: center; font-size: 13px; flex: none; }
.o-thu.co { border-style: solid; border-color: var(--olive); }
.o-thu.co b { background: var(--olive); color: #fff; }
.ban { display: grid; gap: 6px; margin-bottom: 10px; }
.ban-so { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ban-chu { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.ban-thu-tu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.phim { min-height: 48px; border-radius: 6px; border: 1.5px solid var(--vien); background: #fff; font-size: 20px; font-weight: 700; color: var(--rung); }
.phim:active { background: var(--xanh-nen); }
.phim-chu { font-size: 17px; padding: 0; }
.phim-lc { font-size: 15px; padding: 6px 10px; }
.phim[disabled] { opacity: .35; }
.khoa-nut { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; z-index: 1; background: var(--the); padding: 8px 0 10px; box-shadow: 0 -8px 10px -8px rgba(58,74,50,.25); }
.khoa-nut .nut { min-width: 110px; }
.khoa-tb { margin: 10px 0 0; min-height: 1.5em; font-weight: 600; }
.khoa-tb.sai { color: var(--do); }
.khoa-tb.dung { color: var(--rung); background: var(--xanh-nen); padding: 8px 10px; border-radius: 6px; }
.goi-y { margin-top: 12px; border-top: 1px dashed var(--vien); padding-top: 10px; }
.gy-dong { margin: 0 0 6px; font-size: 15px; padding: 6px 10px; background: #fff; border-radius: 6px; border-left: 3px solid var(--glacier); }
.nut-goi-y { font-size: 14px; }
.nut-so-tay { margin-top: 8px; font-size: 14px; }
.nut-ve-khoa { margin: 0 0 12px; }
.nut-goi-y.nhac { border-color: var(--cam); color: var(--cam-dam); }

/* ---------- sổ tay, sổ từ ---------- */
.so-dong { display: grid; text-align: left; width: 100%; padding: 10px 12px; margin-bottom: 6px; border-radius: var(--bo); border: 1.5px solid var(--vien); background: var(--giay); min-height: 44px; }
.so-dong b { color: var(--rung); }
.so-dong span { font-size: 14px; color: var(--chu-phu); }
.ds-tu { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.ds-tu li { padding: 6px 10px; background: var(--giay); border-radius: 6px; }
.ds-tu small { color: var(--chu-phu); }
.hd-buoc { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 8px; }
.hd-ghi { margin: 0; font-size: 14px; color: var(--chu-phu); }
.tiep p { margin: 0 0 12px; }

/* ---------- xong phòng ---------- */
.man-xong { background: var(--kem); padding: 24px 16px 40px; padding-top: calc(24px + env(safe-area-inset-top)); }
.xong-khung { max-width: 760px; margin: 0 auto; }
.x-dau { display: flex; gap: 18px; align-items: center; margin: 6px 0 4px; }
.x-hang { flex: none; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 46px; font-weight: 700; color: #fff; background: var(--olive); box-shadow: 0 6px 0 rgba(58, 74, 50, .25); }
.x-hang.hang-S { background: var(--cam); }
.x-hang.hang-B { background: var(--xanh-dam); }
.x-hang.hang-C { background: #6B675B; }
.x-so { margin: 0; font-weight: 700; color: var(--rung); font-size: 17px; }
.x-cach { margin: 2px 0 0; font-size: 13.5px; color: var(--chu-phu); }
.x-tb { margin: 10px 0 0; }
.xong-khung h2 { font-family: var(--serif); font-size: 21px; color: var(--rung); margin: 24px 0 6px; }
.x-ghi { margin: 0 0 10px; font-size: 14.5px; color: var(--chu-phu); }
.x-cap { display: grid; gap: 8px; }
.cap-dong { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; padding: 10px 14px; background: var(--giay); border: 1.5px solid var(--vien); border-radius: var(--bo); }
.cap-dong p { margin: 0; }
.cap-dong span { display: block; font-size: 11.5px; font-weight: 700; color: var(--olive); }
.cap-vb { font-style: italic; }
.cap-dl { font-weight: 600; color: var(--rung); }
.cap-vi { grid-column: 1 / -1; font-size: 14px; color: var(--chu-phu); border-top: 1px dashed var(--vien); padding-top: 4px; }
.x-meo { margin-top: 14px; padding: 12px 14px; background: var(--rung); color: var(--kem); border-radius: var(--bo); }
.x-meo p { margin: 0; }
.x-meo-td { font-weight: 700; color: #F3E3A8; margin-bottom: 2px !important; }
.x-tu { margin: 0; padding-left: 20px; columns: 2; }
.x-tu li { margin-bottom: 4px; break-inside: avoid; }
.x-nut { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

/* ---------- thông báo nhỏ ---------- */
.bao { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40; background: var(--rung); color: var(--kem); padding: 10px 16px; border-radius: var(--bo); font-size: 15px; box-shadow: var(--bong); max-width: min(560px, calc(100% - 32px)); }
.bao b { color: #F3E3A8; }
.bao-phu { display: block; font-size: 12.5px; opacity: .85; }

/* ---------- điện thoại ---------- */
@media (max-width: 760px) {
  .mo-khung { margin: 0 auto; padding: 16px 16px 20px; }
  .man-mo { padding: 12px; align-items: end; }
  .hud { grid-template-columns: 1fr auto; }
  .hud-giua { display: none; }
  .hud-trai { flex-direction: column; gap: 0; line-height: 1.15; }
  .hud-ten { font-size: 16px; }
  .vat-luoi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px 10px calc(16px + env(safe-area-inset-bottom)); grid-auto-rows: auto; }
  .vat { grid-column: auto !important; grid-row: auto !important; min-height: 78px; padding: 8px 10px 8px 13px; }
  .vat-ten { font-size: 15px; }
  .sh-than { padding: 12px 12px 18px; }
  .vb { padding: 12px 12px; }
  .ban-chu { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .o-ky { width: 30px; height: 44px; font-size: 19px; }
  .cap-dong { grid-template-columns: 1fr; }
  .x-tu { columns: 1; }
  .x-hang { width: 68px; height: 68px; font-size: 38px; }
}
@media (max-height: 460px) and (orientation: landscape) {
  .vat-luoi { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: auto; gap: 6px; padding: 8px 12px; }
  .vat { grid-column: auto !important; grid-row: auto !important; min-height: 64px; padding: 6px 10px 6px 13px; }
  .sh-khung { max-height: 96dvh; }
  .ban-chu { grid-template-columns: repeat(13, minmax(0, 1fr)); }
  .ban-so { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .phim { min-height: 44px; }
  .hud-giua { display: none; }
  .khoa-o.thu-tu { flex-direction: row; flex-wrap: wrap; }
  .o-thu { flex: 1 1 45%; min-height: 36px; }
  .ban-thu-tu { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .vb-ghi-chu { transform: none; }
}
/* ---------- bổ sung bước kiểm 18/11 ---------- */
.lich-ghi { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 4px; }
.lich-ghi li { padding: 6px 10px; background: #FFF4D6; border-left: 3px solid #E7C979; border-radius: 4px; }
.lich-ghi b { margin-right: 6px; color: var(--rung); }
.khoa-o:not(.thu-tu) { flex-wrap: nowrap; }
.o-ky { flex: 0 1 40px; min-width: 0; }
@media (max-width: 760px) {
  .vb-tbl, .vb-chu-y, .vb-dau, .gy-dong, .khoa-hoi small { font-size: 16px; }
  .vb-tbl th { font-size: 15px; }
  .lich-o { min-height: 40px; }
  .lich-o small { display: none; }
  .o-ky { height: 44px; font-size: 18px; }
}
.tiep .khoa-nut { position: static; background: none; box-shadow: none; padding: 0; }
.bao { width: max-content; }
@media (max-width: 760px) { .hud-trai { overflow: hidden; align-items: flex-start; } .hud-ten { max-width: 100%; } }

/* ---------- điện thoại xoay ngang 20261118dt2: bảng khoá hai cột – ô nhập và câu hỏi bên trái, bàn phím bên phải ---------- */
@media (max-height: 480px) and (orientation: landscape) {
  .sh-khung { width: min(900px, 100%); }
  .sh-than { padding: 8px 12px 10px; }
  .khoa { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); column-gap: 14px; align-items: start; padding: 10px 12px; }
  .khoa > * { grid-column: 1 / -1; }
  .khoa > .khoa-hoi { grid-column: 1; grid-row: 1; margin-bottom: 6px; font-size: 16px; }
  .khoa > .khoa-hoi small { font-size: 14px; }
  .khoa > .khoa-o { grid-column: 1; grid-row: 2; margin-bottom: 6px; }
  .khoa > .khoa-tb { grid-column: 1; grid-row: 3; margin-top: 2px; }
  .khoa > .ban { grid-column: 2; grid-row: 1 / span 2; margin-bottom: 0; }
  .khoa > .khoa-nut { grid-column: 2; grid-row: 3; position: static; box-shadow: none; background: none; padding: 8px 0 0; }
  .ban-chu { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .ban-so { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .ban-thu-tu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .khoa > .khoa-o.thu-tu { flex-direction: column; }
  .khoa .o-thu { flex: none; }
}

/* ux1 – sửa theo đánh giá: điểm bắt đầu rõ, ba trạng thái phân biệt bằng hình + chữ, phản hồi mở khoá */
.mo-chon { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: var(--rung); } .mo-chon b { color: var(--cam-dam); }
.tp-thu { font-style: normal; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--cam); color: #fff; font-size: 12px; }
.mo-phong { margin-bottom: 12px; } .mo-nut { margin-bottom: 14px; }
.mo-gt { font-size: 16px; }
.mo-hoc ul { color: #3F3B30; }
.bat-dau { position: relative; z-index: 2; margin: 0; padding: 8px 14px; background: #F3E3A8; color: #3A2F0C; font-size: 15px; line-height: 1.35; border-bottom: 1px solid #C9B36A; }
.bat-dau b { color: #6B3A10; }
.tien-do { height: 32px; font-size: 14px; }
.tien-do-chu { position: relative; font-size: 14px; font-weight: 700; }
.tien-gio { position: relative; margin-left: auto; display: none; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vat-tt { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: #4A463A; }
.vat-tt .bt { width: 14px; height: 14px; flex: none; }
.bt-cam { display: inline-block; border-radius: 50%; background: var(--cam); box-shadow: 0 0 0 2px rgba(178,93,42,.25); }
.vat.moi::after { display: none; }
.vat.st-chua-xem .vat-tt { color: var(--cam-dam); }
.vat.st-doc .vat-tt, .vat.st-xong .vat-tt { color: var(--olive); }
.vat.st-khoa { border-color: var(--cam); border-width: 2px; } .vat.st-khoa .vat-tt { color: var(--cam-dam); }
.vat.st-chua-dung { background: rgba(214, 208, 190, .9); border-style: dashed; border-color: #8E8873; box-shadow: none; }
.vat.st-chua-dung .vat-ten, .vat.st-chua-dung .vat-kieu { color: #4A463A; } .vat.st-chua-dung .vat-tt { color: #3F3B30; }
.vat.st-chua-dung::before { background: #8E8873; }
.vat-kieu { font-size: 12.5px; color: #4F5A36; }
.vat-bd { align-self: flex-start; margin-bottom: 3px; padding: 1px 8px; border-radius: 999px; background: var(--cam); color: #fff; font-size: 12px; font-weight: 700; }
.vat.bat-dau-o { border-color: var(--cam); border-width: 2.5px; box-shadow: 0 0 0 3px rgba(243,227,168,.7), 0 6px 18px rgba(10,14,8,.28); }
.khoa-tb .tb-nhan { margin-right: 4px; }
.khoa-tb.sai { background: #FBE3DB; border: 1px solid #D89477; border-left: 5px solid var(--do); color: #7A2C18; padding: 8px 10px; border-radius: 6px; }
.khoa-tb.dung { border-left: 5px solid var(--olive); padding: 8px 10px; }
.bao { font-size: 15.5px; }
@media (max-width: 760px) {
  .hud-ten { white-space: normal; overflow: visible; display: block; font-size: 16px; line-height: 1.2; }
  .hud-trai { overflow: visible; } .hud-gio { display: none; }
  .tien-gio { display: inline; }
  .vat-luoi { display: flex; flex-wrap: wrap; } .vat { flex: 1 1 calc(50% - 4px); min-width: 0; order: 0; }
  .vat.st-khoa { order: 1; } .vat.st-chua-dung { order: 2; } .vat.vat-cua { order: 3; }
  .bat-dau { font-size: 15px; }
}
/* k13: lời dẫn mở màn trong dải hướng dẫn (thay thông báo nổi 5 giây che hàng thẻ cuối trên điện thoại) */
.bat-dau .bd-mo { display: block; margin-bottom: 4px; font-size: 14px; font-style: italic; color: #4A3D12; }
/* k13: màn thấp/ngang (lưới tự xếp) cùng thứ tự với điện thoại dọc – tài liệu trước, vật đang khoá, vật chưa dùng được, cửa ra cuối; máy tính giữ vị trí theo tranh */
.vat { order: 0; } .vat.st-khoa { order: 1; } .vat.st-chua-dung { order: 2; } .vat.vat-cua { order: 3; }
/* k13: tương phản đo được – chữ trắng trên nút chính ≥ 4.5:1 cả khi rê/chạm, viền phím và ô nhập ≥ 3:1 */
.nut-chinh:hover { background: #A5521F; }
.phim, .nut-phu, .nut-dong, .o-ky { border-color: #8F8569; }
.o-thu { border-color: #8F8569; }
.o-ky.co, .o-thu.co { border-color: var(--olive); }
.nut-icon { border-color: rgba(251,246,234,.6); }
.khoa-tb .tb-nhan { margin-right: 0; }
/* k13: điện thoại – phòng chưa mở gọn một dòng để nút "Vào phòng" nằm trong màn đầu */
@media (max-width: 640px) {
  .the-phong.khoa { padding: 5px 12px; min-height: 44px; grid-template-areas: "so hang" "ten hang"; }
  .the-phong.khoa .tp-en { display: none; }
  .mo-gt { font-size: 15px; margin-bottom: 10px; }
  .man-mo h1 { margin-bottom: 6px; }
}

/* ux2 – nút vào phòng ngay dưới phần dẫn; danh sách phòng là phần phụ; vật đầu tiên nổi riêng; sai nêu tên văn bản; xác nhận mở khoá */
.mo-nut { margin: 0 0 8px; }
.nut-vao { flex: 1 1 200px; min-height: 48px; font-size: 17px; }
.mo-chon { margin: 0 0 12px; font-size: 14.5px; font-weight: 500; color: #3F3B30; }
.mo-ds-td { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--olive); }
.vat.cho-dau { box-shadow: none; opacity: .88; }
.vat.cho-dau .vat-tt { color: #4A463A; }
.vat.cho-dau .bt-cam { background: #8E8873; box-shadow: none; }
.vat.bat-dau-o { box-shadow: 0 0 0 4px rgba(243,227,168,.85), 0 8px 22px rgba(10,14,8,.32); }
.vat-bd { font-size: 12.5px; padding: 2px 10px; }
.vat.ke-tiep { border-color: var(--cam); border-width: 2px; }
.the-phong:not(.khoa) { border-color: #9A8F72; }
.lq-ds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lq-nut { min-height: 44px; padding: 6px 12px; border-radius: 8px; border: 1.5px solid #8F8569; background: #fff; color: #3A2F0C; font-weight: 600; font-size: 14px; text-align: left; }
.lq-nut::after { content: " ›"; color: var(--cam-dam); font-weight: 700; }
.xac-nhan { padding: 4px 0 2px; }
.xn-td { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 12px 14px; border-radius: 8px; background: var(--xanh-nen); border-left: 5px solid var(--olive); color: var(--rung); font-family: var(--serif); font-weight: 700; font-size: 19px; line-height: 1.25; }
.xn-td .bt { width: 22px; height: 22px; flex: none; }
.xn-xong { margin: 0 0 10px; font-size: 15px; color: #34362D; }
.xn-moi { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; border: 1.5px dashed var(--cam); background: #FFF6DE; color: #5A3A0C; font-size: 15px; }
/* ux3: điện thoại – dải vàng đề bài gọn tối đa 2 dòng (chỉ lời chỉ dẫn); lời dẫn truyện mở khi chạm vào dải */
@media (max-width: 640px) {
  .bat-dau { padding: 7px 12px; font-size: 14.5px; }
  .bat-dau.co-dan { padding-right: 34px; cursor: pointer; }
  .bat-dau.co-dan:not(.mo-rong) .bd-mo { display: none; }
  .bat-dau .bd-chi { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .bat-dau.co-dan::after { content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2.5px solid #6B3A10; border-bottom: 2.5px solid #6B3A10; transform: rotate(45deg); }
  .bat-dau.co-dan.mo-rong::after { transform: rotate(-135deg); margin-top: -2px; }
}
/* ux3: máy tính – bảng (hộp phản hồi, văn bản) nổi cách đáy màn, không áp sát mép dưới */
@media (min-width: 761px) and (min-height: 521px) {
  .sheet { bottom: 24px; }
  .sh-khung { border-radius: 14px; max-height: calc(90dvh - 24px); }
}
@media (max-width: 640px) {
  .mo-khung { padding: 12px 16px 16px; }
  .mo-gt { font-size: 14.5px; margin-bottom: 8px; }
  .man-mo h1 { font-size: 32px; }
  .nut-vao { flex-basis: 100%; }
}

/* ===== ux4 ===== */
/* lúc chưa đọc vật đầu tiên: chỉ vật "Bắt đầu ở đây" có viền cam; khoá đang thử được dùng màu trung tính */
.vat.st-khoa.khoa-cho { border-color: #8F8569; border-width: 1.5px; }
.vat.khoa-cho::before { background: #8E8873; }
.vat.st-khoa.khoa-cho .vat-tt { color: #4A463A; font-weight: 600; }
/* nhập sai: dòng "Chưa đúng" ngay dưới hàng ô mã; ô mã viền đỏ đất (rung nhẹ bằng JS) */
.khoa-sai { margin: -4px 0 10px; padding: 6px 10px; border-radius: 6px; background: #FBE3DB; border: 1px solid #D89477; border-left: 5px solid var(--do); color: #7A2C18; font-weight: 600; text-align: center; }
.khoa-sai[hidden] { display: none; }
.khoa-o.sai .o-ky, .khoa-o.sai .o-thu { border-color: #A8452B; background: #FDF1EC; }
.khoa-tb.sai-lq { color: #3F3B2E; font-weight: 600; background: #F6EFE0; border: 1px solid #D9CFB4; padding: 8px 10px; border-radius: 6px; }
@media (max-height: 480px) and (orientation: landscape) {
  .khoa > .khoa-sai { grid-column: 1; grid-row: 3; margin: 0 0 4px; }
  .khoa > .khoa-tb { grid-row: 4; }
}
/* ux5: nhãn loại ở thẻ bài học cuối phòng ("Văn bản" / "Câu hỏi/đáp án nói") ≥ 12px như nhãn loại đồ vật */
.cap-dong span { font-size: 12.5px; }
