@font-face { font-family: "Playpen Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/playpen-sans-600-vietnamese.woff2) format("woff2"); 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: "Playpen Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/playpen-sans-600-latin.woff2) format("woff2"); 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: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/plus-jakarta-sans-normal-vietnamese.woff2) format("woff2"); 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: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/plus-jakarta-sans-normal-latin.woff2) format("woff2"); 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: "Playfair Display"; font-style: normal; font-weight: 400 900; font-display: swap; src: url(fonts/playfair-display-vietnamese.woff2) format("woff2"); 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: "Playfair Display"; font-style: normal; font-weight: 400 900; font-display: swap; src: url(fonts/playfair-display-latin.woff2) format("woff2"); 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 {
    --navy: #1A2230;
    --kem: #FFF8EF;
    --teal: #0E6B66;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0B0C0F; }
/* Trang chủ in sẵn nội dung website (#web-tinh). Có 3D (html.nk-3d): ẩn #web-tinh. Không có 3D: ẩn căn phòng, trang cuộn như website thường (kiểu chữ, màu lấy từ web-3.css). */
.nk-3d #web-tinh { display: none; }
html:not(.nk-3d), html:not(.nk-3d) body { height: auto; overflow: visible; overflow-x: hidden; background: #b4dc74; }
html:not(.nk-3d) :is(#canh, #den, #goi-y, #nhan, #chuyen-canh, #man-hinh, #mo-dau, #sach, #chu-thich, #ngon-ngu, #loi, #tai) { display: none !important; }
body { font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--navy); }
#canh { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#canh.dang-keo { cursor: grabbing; }
#canh.co-diem { cursor: pointer; }

.vien {
    margin: 0;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: rgba(26, 34, 48, .78);
    color: #fff;
    font: 600 14px/1.35 inherit;
    font-family: inherit;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
#goi-y { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 120px); text-align: center; transition: opacity .5s; }
#goi-y.an { opacity: 0; pointer-events: none; }
/* màn tải: chỉ là nền đen; tải xong thì cảnh hiện ra bằng hiệu ứng cháy lan */
#tai { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: #000; color: #F4EAD5; transition: opacity .35s ease; padding: 24px; text-align: center; }
#tai.xong { opacity: 0; pointer-events: none; }
#tai-so { margin: 0; font: 500 15px/1 inherit; font-family: inherit; letter-spacing: .08em; font-variant-numeric: tabular-nums; opacity: .8; }
#nhan { position: fixed; left: 0; top: 0; pointer-events: none; padding: 6px 12px; font-size: 13px; white-space: nowrap; }

.nut-tron {
    position: fixed; top: 16px; left: 16px;
    width: 46px; height: 46px; border-radius: 50%;
    border: 0; display: grid; place-items: center;
    background: rgba(26, 34, 48, .78); color: #fff; cursor: pointer;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transition: transform .2s;
}
.nut-tron:hover { transform: scale(1.08); }
.nut-tron:focus-visible, #quay-lai:focus-visible { outline: 3px solid #5CCDBD; outline-offset: 3px; }
.nut-tron .ic-troi { display: none; }
.nut-tron[aria-pressed="true"] .ic-troi { display: block; }
.nut-tron[aria-pressed="true"] .ic-trang { display: none; }

#chu-thich {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    width: min(560px, calc(100vw - 32px)); text-align: center;
}
#chu-thich-chu {
    margin: 0; padding: 14px 20px; border-radius: 20px;
    background: rgba(255, 248, 239, .94); color: var(--navy);
    font-size: 16px; line-height: 1.5; font-weight: 500;
}
#quay-lai { cursor: pointer; }
#chu-thich.sat #quay-lai { padding: 5px 14px; font-size: 13px; line-height: 1.3; }
#quay-lai:hover { background: var(--teal); }

@media (max-width: 600px) {
    #goi-y { font-size: 12px; padding: 8px 14px; max-width: calc(100vw - 90px); left: calc(50% + 28px); }
}

[hidden] { display: none !important; }

/* bản thử 2: nội dung đầy đủ của thiết bị, đặt đè đúng lên màn hình trong cảnh */
#man-hinh {
    position: fixed; overflow-y: auto; overflow-x: hidden; background: #fff;
    overscroll-behavior: contain; scrollbar-width: thin;
}
/* website thật trong iframe: dựng ở bề rộng của thiết bị rồi thu / phóng cho vừa khung màn hình trong cảnh */
/* nút đổi ngôn ngữ (góc trên phải); ẩn khi đang phóng vào một vật (lúc đó #chu-thich hiện) */
#ngon-ngu { position: fixed; top: 16px; right: 16px; display: flex; gap: 2px; padding: 4px; }
#ngon-ngu a, #ngon-ngu span { display: grid; place-items: center; min-width: 38px; min-height: 38px; border-radius: 999px; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }
#ngon-ngu span { background: #fff; color: var(--navy); }
#ngon-ngu a:hover { background: rgba(255, 255, 255, .18); }
#ngon-ngu a:focus-visible { outline: 3px solid #5CCDBD; outline-offset: 2px; }
#chu-thich:not([hidden]) ~ #ngon-ngu { display: none; }
/* easter egg ổ cắm: thông báo "tự sửa" ở góc trên phải, dưới nút ngôn ngữ */
#loi { position: fixed; top: 72px; right: 16px; width: min(300px, calc(100vw - 32px)); padding: 12px 14px; border: 1px solid #25E06A; background: rgba(0, 0, 0, .86); color: #25E06A; font: 600 13px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace; pointer-events: none; }
#loi p { margin: 0; }
#loi-thanh { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
#loi-khung { flex: 1; height: 8px; border: 1px solid #25E06A; }
#loi-vach { display: block; height: 100%; background: #25E06A; transform: scaleX(0); transform-origin: left center; }
#loi-pt { min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }
#man-hinh.web { overflow: hidden; background: #b4dc74; }
#man-hinh iframe { display: block; border: 0; transform-origin: 0 0; background: #b4dc74; }
#man-hinh.day iframe { width: 100% !important; height: 100% !important; transform: none !important; }
/* điện thoại: màn hình thiết bị mở ra kín màn hình thật của người xem */
#man-hinh.day { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; transition: left .4s ease, top .4s ease, width .4s ease, height .4s ease; }
@media (prefers-reduced-motion: reduce) { #man-hinh.day { transition: none; } }
#chu-thich-chu strong { display: block; font-size: 18px; margin-bottom: 4px; }

/* chuyển cảnh: mũi tên hai bên + tên cảnh ở dưới */
.nut-mui-ten {
    position: fixed; top: 50%; transform: translateY(-50%);
    width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center;
    background: rgba(26, 34, 48, .78); color: #fff; cursor: pointer;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .2s, transform .2s;
}
#canh-truoc { left: 18px; }
#canh-sau { right: 18px; }
.nut-mui-ten:hover { background: var(--teal); transform: translateY(-50%) scale(1.08); }
.nut-mui-ten:focus-visible { outline: 3px solid #5CCDBD; outline-offset: 3px; }
#ten-canh { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); pointer-events: none; }
@media (max-width: 600px) { .nut-mui-ten { width: 44px; height: 44px; } #canh-truoc { left: 10px; } #canh-sau { right: 10px; } }

/* cảnh mở đầu */
#mo-dau { position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%); }
#go-cua { cursor: pointer; font-size: 16px; padding: 14px 26px; }
#go-cua:hover { background: var(--teal); }
#go-cua:focus-visible { outline: 3px solid #5CCDBD; outline-offset: 3px; }

/* thanh lật trang của cuốn sách 3D */
#sach { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; }
#sach button { cursor: pointer; font-size: 20px; line-height: 1; padding: 9px 16px; }
#sach button:hover:not(:disabled) { background: var(--teal); }
#sach button:disabled { opacity: .35; cursor: default; }
#sach button:focus-visible { outline: 3px solid #5CCDBD; outline-offset: 3px; }
#sach-trang { font-size: 13px; padding: 8px 14px; white-space: nowrap; }
.an-mat { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { #tai { transition: none; } }
