*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font-family:'Be Vietnam Pro',system-ui,sans-serif;color:#17181C;background:#F6F5F1;-webkit-tap-highlight-color:transparent}
[hidden]{display:none!important}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none;padding:0}
a{color:#1F4FD1}
.an{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
h1{margin:0;font-size:26px;font-weight:700;letter-spacing:-.02em}
.phu{margin:4px 0 0;font-size:15px;color:#55575F;line-height:1.5}
button:active,a:active{transform:scale(.98)}

/* Màn sáng (đầu, nhập mã, chờ) */
.man.sang{min-height:100%;max-width:480px;margin:0 auto;padding:56px 24px 28px;display:flex;flex-direction:column;gap:24px}
.dau-trang{display:flex;align-items:center;gap:12px}
.logo{width:48px;height:48px;border-radius:14px;background:#17181C;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.logo.nho{width:44px;height:44px;border-radius:12px}
.hai-nut{display:flex;flex-direction:column;gap:14px;margin-top:8px}
.the-lon{display:flex;align-items:center;gap:18px;padding:22px;border-radius:20px;background:#fff;border:1.5px solid #DAD8D0;color:#17181C;text-decoration:none}
.the-lon.toi{background:#17181C;border-color:#17181C;color:#fff}
.the-lon b{display:block;font-size:20px}
.the-lon small{display:block;margin-top:4px;font-size:14px;color:#55575F}
.the-lon.toi small{color:#C9CAD0}
.o-bt{width:56px;height:56px;border-radius:16px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.o-bt.vang{background:#F5B400}.o-bt.xam{background:#ECEBE5}
.meo{margin:0;background:#FFF4D1;border-radius:16px;padding:16px 18px;font-size:14px;line-height:1.5;color:#4A3700}
.meo.vien{border-radius:999px;padding:10px 20px;align-self:center;text-align:center}
.chan{margin:auto 0 0;text-align:center;font-size:13px;color:#55575F}
.quay-lai{font-size:16px;text-decoration:none;font-weight:600;min-height:44px;display:inline-flex;align-items:center}
.nhap-ma{display:flex;flex-direction:column;gap:16px}
.nhap-ma input{font:inherit;font-size:44px;font-weight:700;letter-spacing:.4em;text-align:center;padding:16px;border-radius:16px;border:1.5px solid #DAD8D0;background:#fff;width:100%}
.nut-chinh{background:#17181C;color:#fff;font-size:18px;font-weight:700;border-radius:14px;min-height:56px}

/* Màn tối (soi bài) */
.toi-man{height:100%;background:#0E0F12;color:#fff;display:flex;flex-direction:column;overflow:hidden}
.thanh-tren{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:calc(12px + env(safe-area-inset-top)) 16px 12px}
.vien-tt{display:flex;align-items:center;gap:8px;background:rgba(255,255,255,.1);border-radius:999px;padding:8px 14px;font-size:14px;font-weight:600;min-width:0}
.vien-tt.sang-tt{background:#ECEBE5;color:#33353C;font-weight:500}
.cham{width:9px;height:9px;border-radius:50%;background:#8A8D96;flex-shrink:0}
.cham.xanh{background:#3DD68C}.cham.vang{background:#F5B400}.cham.do{background:#FF4D4F}
.ma-nho{display:flex;flex-direction:column;align-items:flex-end}
.ma-nho small{font-size:12px;color:#A9ABB3}.ma-nho b{font-size:20px;letter-spacing:.12em}
.phu-toi{font-size:13px;color:#A9ABB3}
.san{flex:1;position:relative;overflow:hidden;margin:0 12px;border-radius:18px;background:#1B1C20;min-height:0}
.khung{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);transition:transform .25s ease}
.khung video,.khung canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.khung video{object-fit:fill;background:#000}
.lop-ve{pointer-events:none;touch-action:none}
.dang-ve .lop-ve{pointer-events:auto;cursor:crosshair}
.nhan-dung{position:absolute;top:12px;left:12px;background:#F5B400;color:#17181C;font-size:13px;font-weight:700;border-radius:999px;padding:6px 12px}
.loi-giua{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:32px;font-size:16px;line-height:1.6;background:rgba(14,15,18,.85)}
.cot-but{position:absolute;right:10px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:10px;background:rgba(14,15,18,.72);border-radius:999px;padding:8px}
.cham-mau{width:30px;height:30px;border-radius:50%}
.cham-mau.chon{box-shadow:0 0 0 3px #0E0F12,0 0 0 5px #fff}
.nut-tron{width:30px;height:30px;display:flex;align-items:center;justify-content:center;color:#fff;border-radius:50%}
.nut-tron.bat{background:#F5B400;color:#17181C}
.nut-tron:disabled{opacity:.3}
.nut-thoat{width:44px;height:44px;border-radius:50%;background:rgba(255,255,255,.1);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.thanh-tren .vien-tt{margin-right:auto}
.nut-luu{position:absolute;bottom:12px;left:12px;display:flex;align-items:center;gap:6px;background:rgba(14,15,18,.72);color:#fff;border-radius:999px;padding:0 14px;min-height:44px;font-size:14px;font-weight:600}
.vien-zoom{position:absolute;bottom:12px;right:12px;display:flex;gap:4px;background:rgba(14,15,18,.72);border-radius:999px;padding:4px}
.vien-zoom button{font-size:14px;font-weight:600;padding:8px 16px;border-radius:999px;min-height:36px}
.vien-zoom button.chon{background:#fff;color:#0E0F12;font-weight:700}
.thanh-duoi{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:end;padding:16px 8px calc(20px + env(safe-area-inset-bottom))}
.nut-cong-cu{display:flex;flex-direction:column;align-items:center;gap:6px;font-size:12px;color:#fff}
.nut-cong-cu .o{width:48px;height:48px;border-radius:14px;background:rgba(255,255,255,.1);display:flex;align-items:center;justify-content:center}
.nut-cong-cu.do .o{background:rgba(255,77,79,.2);color:#FF6B6D}
.nut-cong-cu.bat{color:#F5B400;font-weight:600}
.nut-cong-cu.bat .o{background:rgba(245,180,0,.22);color:#F5B400;box-shadow:inset 0 0 0 2px #F5B400}
.nut-cong-cu:disabled{opacity:.35;cursor:default}
.nut-chup{width:66px;height:66px;border-radius:50%;border:4px solid #fff;display:flex;align-items:center;justify-content:center}
.nut-chup span{width:50px;height:50px;border-radius:50%;background:#fff}

/* Laptop */
.man.sang.rong{max-width:none;padding:40px 64px;height:100%}
.ngang{justify-content:space-between}
.ten{font-size:24px}
.cho-giua{flex:1;display:flex;align-items:center;justify-content:center;gap:72px;flex-wrap:wrap}
.o-qr{background:#fff;border-radius:28px;padding:28px;width:356px;height:356px}
.o-qr svg{width:100%;height:100%;display:block}
.cho-chu{display:flex;flex-direction:column;gap:22px;max-width:520px}
.cho-chu h1{font-size:44px;line-height:1.15}
.o-so{display:flex;gap:12px}
.o-so span{width:72px;height:88px;border-radius:16px;background:#17181C;color:#fff;font-size:52px;font-weight:700;display:flex;align-items:center;justify-content:center}
.buoc{margin:0;padding-left:22px;display:flex;flex-direction:column;gap:8px;font-size:16px;color:#33353C}
.toi-man.rong{flex-direction:row}
.xem-trai{flex:1;display:flex;flex-direction:column;min-width:0;padding-bottom:16px}
.xem-trai .san{margin:0 0 0 16px}
.dai-anh{display:flex;align-items:center;gap:12px;padding:14px 0 0 16px;min-height:84px}
.cac-anh{display:flex;gap:10px;overflow-x:auto;flex:1;min-width:0}
.cac-anh button{width:112px;height:70px;border-radius:10px;overflow:hidden;flex-shrink:0;background:#222}
.cac-anh button.chon{box-shadow:0 0 0 3px #F5B400}
.cac-anh img{width:100%;height:100%;object-fit:cover;display:block}
.nut-vien{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600;border:1.5px solid rgba(255,255,255,.25);border-radius:999px;padding:10px 16px;min-height:44px;white-space:nowrap}
.nut-vien:disabled{opacity:.4;cursor:default}
.cot-phai{width:96px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;overflow-y:auto}
.lop-anh{position:fixed;inset:0;background:#0E0F12;display:flex;align-items:center;justify-content:center;padding:24px;z-index:5}
.anh-lon{display:flex;gap:16px;width:100%;height:100%;align-items:center;justify-content:center}
.anh-lon img{flex:1;min-width:0;max-height:100%;object-fit:contain}
.nut-anh-lon{position:absolute;top:16px;right:16px;display:flex;gap:10px;z-index:1}
.nut-anh-lon .nut-vien{background:rgba(14,15,18,.8)}
.lop-anh{flex-direction:column}
.nut-usb{display:flex;align-items:center;justify-content:center;gap:10px;min-height:52px;padding:0 20px;border-radius:14px;background:#fff;border:1.5px solid #DAD8D0;font-size:16px;font-weight:600;color:#17181C}
.hang-nut{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}
.chan a{font-weight:600}
.lop-hd{position:fixed;inset:0;background:rgba(14,15,18,.55);display:flex;align-items:center;justify-content:center;padding:16px;z-index:8}
.hop-hd{background:#fff;color:#17181C;border-radius:20px;padding:24px;max-width:820px;width:100%;max-height:100%;overflow-y:auto;display:flex;flex-direction:column;gap:14px}
.hop-hd h2{margin:0;font-size:22px}
.hop-hd h3{margin:0 0 8px;font-size:17px}
.hop-hd ol{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:8px;font-size:15px;line-height:1.5}
.hai-cot{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px}
.hai-cot section{background:#F6F5F1;border-radius:14px;padding:16px}
.chon-cam{font:inherit;font-size:14px;background:#1B1C20;color:#fff;border:1px solid rgba(255,255,255,.25);border-radius:10px;padding:8px 10px;max-width:280px}
.thong-bao{position:fixed;left:50%;top:calc(76px + env(safe-area-inset-top));transform:translateX(-50%);max-width:calc(100% - 32px);text-align:center;background:#17181C;color:#fff;padding:12px 20px;border-radius:999px;font-size:15px;box-shadow:0 6px 20px rgba(0,0,0,.3);z-index:9}
@media (max-width:760px){.man.sang.rong{padding:28px 20px}.cho-giua{gap:28px}.cho-chu h1{font-size:30px}.o-qr{width:260px;height:260px}}
@media (prefers-reduced-motion:reduce){.khung{transition:none}}
