/* =====================================================================
   NHÀ SAM SÓC – GIAO DIỆN TUẦN 1
   Màu theo từng người: Sam tím hồng · Sóc xanh lá/xanh dương · Bố mẹ nền sáng tông xanh.
   Vì sao dùng biến màu (--nen, --nut...): đổi màu cả màn hình chỉ bằng 1 lớp (class).
   ===================================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Nunito', system-ui, sans-serif; background: var(--nen); color: var(--chu); -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 4px solid #7FD6FF; outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) { button { transition: transform .12s ease; } }
button:active { transform: translateY(4px); }

/* ---- Bộ màu ---- */
body, .giao-dien-bo-me { --nen:#F1F6F4; --the:#FFFFFF; --chu:#12302A; --phu:#4A635C; --nut:#1F7A55; --chu-nut:#FFFFFF; --bong:#155C40; --vien:#DCE6E2; }
.giao-dien-sam { --nen:#2A1E4A; --the:#3A2A62; --the2:#4A3679; --chu:#FBF7FF; --phu:#D9CCF0; --nut:#FF8DB8; --chu-nut:#2A1E4A; --bong:#C2457A; --vien:#6E57A8; }
.giao-dien-soc { --nen:#123A4A; --the:#1A4D60; --the2:#23617A; --chu:#F2FBF7; --phu:#BFE3D9; --nut:#7BE08A; --chu-nut:#0F2E1A; --bong:#3E9A50; --vien:#3B86A3; }
.giao-dien-may-con { --nen:#1B2440; --the:#26325A; --chu:#F4F7FC; --phu:#C3D3EC; --nut:#FFC93C; --chu-nut:#1B2440; --bong:#C98F12; --vien:#3E4F80; }
/* Bảo vệ mắt buổi tối (tự bật 19h–6h): phủ một lớp màu hổ phách nhẹ để giảm ánh sáng xanh.
   Vì sao phủ lớp thay vì đổi hết màu: con vẫn nhận ra "màu của mình" (Sam tím, Sóc xanh). */
body.bao-ve-mat::after { content: ''; position: fixed; inset: 0; background: rgba(255,150,40,.13); mix-blend-mode: multiply; pointer-events: none; z-index: 50; }
/* Nền sáng của bố mẹ: buổi tối chuyển sang kem dịu, không trắng tinh */
body.giao-dien-bo-me.bao-ve-mat, .giao-dien-bo-me.bao-ve-mat { --nen:#E8E2D4; --the:#F4EFE4; --vien:#D3CBBA; }

#app { min-height: 100%; background: var(--nen); color: var(--chu); display: flex; flex-direction: column; }
.dang-tai { margin: auto; font-size: 20px; font-weight: 700; color: var(--phu); }
.khung { width: 100%; max-width: 980px; margin: 0 auto; padding: 24px 20px 40px; display: flex; flex-direction: column; gap: 18px; }
.khung-hep { max-width: 440px; }
h1 { font-family: 'Baloo 2', 'Be Vietnam Pro', sans-serif; font-weight: 800; font-size: 32px; line-height: 1.15; margin: 0; }
h2 { font-family: 'Baloo 2', 'Be Vietnam Pro', sans-serif; font-weight: 700; font-size: 22px; margin: 0; }
.giao-dien-bo-me h1, .giao-dien-bo-me h2 { font-family: 'Be Vietnam Pro', sans-serif; }
.phu { color: var(--phu); font-size: 16px; line-height: 1.5; margin: 0; }
.the { background: var(--the); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }

/* ---- Nút: to, có bóng như phím thật ---- */
.nut { min-height: 60px; border: none; border-radius: 20px; background: var(--nut); color: var(--chu-nut); box-shadow: 0 6px 0 var(--bong); font-weight: 800; font-size: 20px; padding: 0 24px; }
.nut:disabled { opacity: .55; cursor: default; }
.nut-phu { min-height: 52px; border: 2px solid var(--vien); border-radius: 16px; background: transparent; color: var(--chu); font-weight: 700; font-size: 17px; padding: 0 18px; }
.nut-chu { background: none; border: none; color: var(--phu); font-weight: 700; font-size: 16px; text-decoration: underline; padding: 8px; min-height: 44px; }
.hang { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---- Ô nhập ---- */
label { font-weight: 700; font-size: 16px; display: flex; flex-direction: column; gap: 6px; }
input { font-family: inherit; font-size: 18px; min-height: 52px; border-radius: 14px; border: 2px solid var(--vien); background: var(--the); color: var(--chu); padding: 0 14px; }
.ghi-chu { font-weight: 600; font-size: 14px; color: var(--phu); }
.thong-bao { border-radius: 14px; padding: 12px 14px; font-weight: 700; font-size: 16px; }
.thong-bao.loi { background: #FDE8E4; color: #8A2412; }
.thong-bao.tot { background: #E6F4EC; color: #155C40; }

/* ---- Chọn người (ảnh tròn to) ---- */
.luoi-nguoi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }
.the-nguoi { border: none; border-radius: 28px; background: var(--the); color: var(--chu); padding: 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: 0 8px 0 rgba(0,0,0,.25); min-height: 200px; }
/* Ảnh đại diện tròn – dùng ở mọi màn hình */
.anh { flex-shrink: 0; width: 128px; height: 128px; border-radius: 50%; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.the-nguoi .ten { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 28px; }
.anh-sam { background: #4A3679; } .anh-soc { background: #23617A; } .anh-bo-me { background: #DCE6E2; }

/* ---- Bàn phím PIN: nút thật to cho tay trẻ ---- */
.o-pin { display: flex; gap: 16px; justify-content: center; }
.o-pin span { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--phu); }
.o-pin span.da { background: var(--nut); border-color: var(--nut); }
.ban-phim { display: grid; grid-template-columns: repeat(3, 96px); gap: 16px; justify-content: center; }
.ban-phim button { height: 96px; border: none; border-radius: 26px; background: var(--the2, var(--the)); color: var(--chu); font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 40px; box-shadow: 0 6px 0 rgba(0,0,0,.3); }

/* ---- Màn hình chính tạm ---- */
.dau-trang { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dau-trang .gian { flex: 1; min-width: 200px; }
.vien-tron { background: var(--the); border-radius: 999px; padding: 10px 18px; font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.danh-sach-may { display: flex; flex-direction: column; gap: 10px; }
.dong-may { display: flex; align-items: center; gap: 12px; background: var(--nen); border-radius: 14px; padding: 10px 12px; }
.dong-may .gian { flex: 1; }
