/* ================= CÀI ĐẶT CHUNG (COMMON) ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background-color: #f4f6f8;
    color: #333;
}

ul { list-style: none; }
a { text-decoration: none; color: inherit; }
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
}
/* --- Slider Banner --- */
.hero-banner {
    width: 100%;
    position: relative;
    overflow: hidden; /* Giấu phần ảnh bị tràn ra ngoài */
    background-color: #e5f6f8; /* Màu nền chờ khi ảnh chưa load */
}

.slider-container {
    position: relative;
    width: 100%;
    max-width: 1400px; /* Bằng với max-width của header/nav trên desktop */
    margin: 0 auto;
}

.slider-wrapper {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease-in-out; /* Hiệu ứng trượt ngang mượt mà */
}

.slide {
    min-width: 100%; /* Mỗi ảnh chiếm 100% chiều rộng container */
    box-sizing: border-box;
}

.banner-img {
    width: 100%;
    display: block;
    object-fit: cover;
    /* Có thể set max-height để banner không quá to trên màn hình rộng */
    /* max-height: 400px; */ 
}

/* Nút điều hướng Trái/Phải */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    transition: background 0.3s;
    z-index: 10;
}
.slider-btn:hover { background: rgba(0, 0, 0, 0.6); }
.prev-btn { left: 10px; }
.next-btn { right: 10px; }

/* Các chấm tròn (Dots) */
.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.dot.active {
    background-color: white;
    transform: scale(1.2); /* Chấm đang chọn sẽ to hơn một chút */
}

/* --- Tùy chỉnh nhỏ cho Mobile --- */
@media (max-width: 768px) {
    .slider-btn {
        width: 30px; height: 30px; font-size: 14px; /* Thu nhỏ nút trên điện thoại */
    }
    .slider-dots { bottom: 10px; }
    .dot { width: 8px; height: 8px; }
}

/* Thông báo chạy ngang chung */
.announcement {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 5px 10px;
    font-size: 14px;
    color: #00a2b8;
    border-bottom: 1px solid #ddd;
}
.announcement i { margin-right: 10px; }

/* Các Helper Classes ẩn hiện */
.desktop-only { display: none; }
.mobile-only { display: none; }

/* ================= CSS CHUNG CHO MODAL ĐĂNG NHẬP / ĐĂNG KÝ ================= */
.auth-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65);
    display: none; /* Mặc định ẩn, bật bằng JS */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 15px;
}
.auth-modal-overlay.active {
    display: flex;
}

/* Thanh chuyển đổi Tab Đăng ký / Đăng nhập */
.auth-tabs {
    display: flex;
    border: 1px solid #009eb3;
    border-radius: 30px;
    overflow: hidden;
    margin-bottom: 18px;
    background: #fff;
}
.auth-tab-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    color: #009eb3;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    border-radius: 30px;
    transition: 0.25s;
}
.auth-tab-btn.active {
    background: #009eb3;
    color: #fff;
}

/* Ô nhập liệu Form */
.auth-form .input-group {
    position: relative;
    margin-bottom: 12px;
}
.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="tel"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #b8d8e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #fff;
}
.auth-form input:focus {
    border-color: #009eb3;
}
.pass-group .toggle-pass {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    cursor: pointer;
}

/* Ghi chú & Nút Submit */
.remember-me, .agree-terms {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
    margin: 10px 0;
    cursor: pointer;
}
.security-note {
    text-align: center;
    font-size: 12px;
    color: #222;
    line-height: 1.4;
    margin: 10px 0 14px;
}
.btn-submit-auth {
    width: 100%;
    padding: 12px;
    background: #009eb3;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}
.btn-submit-auth:hover { background: #008296; }

.dns-text {
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    margin: 14px 0 10px;
}
.dns-text b { color: #e63946; }
.dns-text .brand-link { color: #009eb3; }

.forgot-Group {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.forgot-box {
    flex: 1;
    background: #c5f1f9;
    color: #1d5a67;
    text-align: center;
    padding: 10px 5px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.3;
}
.app-banner-img {
    width: 100%;
    max-height: 95px;
    object-fit: contain;
}
/* ================= GIAO DIỆN ĐIỆN THOẠI (MOBILE) ================= */
@media (max-width: 768px) {
    .mobile-only { display: flex; } /* Bật hiển thị các element mobile */
    .desktop-only { display: none !important; }

    /* Header Mobile */
    .header-mobile {
        justify-content: space-between;
        align-items: center;
        background-color: #e6f9fa;
        padding: 10px 15px;
    }
    .header-mobile button { background: none; border: none; font-size: 20px; color: #008296; }
    .logo-mobile { height: 4ch; }

    /* Mobile Auth Buttons */
    .mobile-auth-buttons {
        display: flex;
        width: 100%;
    }
    .mobile-auth-buttons .btn {
        flex: 2;
        border-radius: 0;
        padding: 12px 0;
        color: white;
    }
    .btn-register-mob { background-color: #f1f5f9; color: #006d7e !important; }
    .btn-login-mob { background-color: #00a2b8; }

    /* Category Nav Mobile */
    .category-nav {
        display: flex;
        align-items: center;
        background: linear-gradient(to bottom, #00b4d8, #008296); /* Hiệu ứng gradient nền giống ảnh */
        color: white;
        position: relative;
        padding: 0 15px; /* Chừa chỗ cho 2 mũi tên */
    }

    /* Vùng chứa danh sách cuộn */
    .cat-list {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        scroll-behavior: smooth;
        scrollbar-width: none; /* Ẩn thanh cuộn trên Firefox */
        -ms-overflow-style: none; /* Ẩn thanh cuộn trên IE/Edge */
        width: 100%;
    }
    
    .cat-list::-webkit-scrollbar {
        display: none; /* Ẩn thanh cuộn trên Chrome/Safari */
    }

    /* Các mũi tên 2 bên */
    .scroll-arrow {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        background: rgba(0, 130, 150, 0.8);
        z-index: 5;
    }
    .left-arrow { left: 0; }
    .right-arrow { right: 0; }

    .cat-item {
        padding: 10px 15px;
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 11px; /* Cỡ chữ nhỏ lại một chút */
        font-weight: bold;
        flex: 0 0 auto; /* Ngăn không cho các mục bị bóp nhỏ */
        min-width: 70px; /* Đảm bảo chiều rộng tối thiểu cho mỗi mục */
        text-transform: uppercase;
    }

    .cat-item.active { 
        background: linear-gradient(to bottom, #e0f7fa, #b2ebf2); /* Màu nền sáng cho mục đang chọn */
        color: #008296; /* Chữ màu xanh đậm */
    }
    
    .cat-item i { 
        font-size: 20px; /* Icon to hơn một chút */
        margin-bottom: 5px; 
    }
    /* Lưới Game Mobile */
    .game-section { 
        padding: 15px 10px; 
        margin-bottom: 60px; /* Chừa chỗ cho bottom nav */ 
        background-color: #f2f9fa; /* Màu nền hơi xanh nhạt giống ảnh gốc */
    }
    
    .game-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* Chia thành 3 cột */
        gap: 8px; /* Khoảng cách giữa các ô */
    }
    
    .game-card {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Khung chứa ảnh game bo góc, viền xanh */
    .game-img-box {
        background: linear-gradient(to bottom, #ffffff, #eaf6f8); /* Gradient nhẹ trong khung */
        border: 1px solid #b2ebf2; /* Viền xanh lơ nhạt */
        border-radius: 12px; /* Bo góc tròn nhiều hơn */
        padding: 5px;
        width: 100%;
        box-shadow: 0 2px 5px rgba(0, 162, 184, 0.1);
        display: flex;
        justify-content: center;
        align-items: center;
        aspect-ratio: 1 / 1; /* Cố định tỷ lệ khung vuông */
        overflow: hidden;
    }
    
    .game-img-box img { 
        width: 90%; /* Ảnh nhỏ lại một chút so với khung */
        height: 90%; 
        object-fit: contain; /* Đảm bảo ảnh không bị méo */
    }
    
    .game-card p { 
        padding-top: 6px; 
        font-size: 9px; /* Chữ nhỏ lại để vừa với 3 cột */
        font-weight: bold; 
        color: #0077b6; /* Chữ màu xanh đậm */
        text-transform: uppercase;
        white-space: nowrap; /* Tránh rớt dòng chữ */
        overflow: hidden;
        text-overflow: ellipsis; /* Nếu chữ dài quá sẽ có dấu ... */
        width: 100%;
    }
    /* Bottom Nav Mobile */
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #00a2b8;
        display: flex;
        justify-content: space-around;
        padding: 8px 0;
        z-index: 1000;
    }
    .bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: white;
        font-size: 10px;
    }
    .bottom-nav a i { font-size: 18px; margin-bottom: 4px; }
}
/* ================= CSS FORM TRÊN ĐIỆN THOẠI (MOBILE) ================= */
@media (max-width: 768px) {
    .auth-modal-mobile {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        max-width: 420px;
        max-height: 92vh;
        overflow-y: auto;
        background: linear-gradient(180deg, #ffffff 0%, #d4f4fa 100%);
        border-radius: 14px;
        padding: 20px 15px 0;
        position: relative;
    }
    .auth-close-btn-mob {
        position: absolute;
        top: 12px; right: 14px;
        background: none; border: none;
        font-size: 24px; color: #007791;
        cursor: pointer;
    }
    .auth-mob-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 15px;
    }
    .auth-mob-logo { height: 62px; object-fit: contain; }
    .auth-mob-slogan { height: 14px; margin-top: 5px; object-fit: contain; }

    /* Ô số điện thoại có mã +84 ở Tab Đăng Ký Mobile */
    .phone-prefix-group {
        display: flex;
        align-items: center;
        background: #fff;
        border: 1px solid #b8d8e0;
        border-radius: 8px;
        overflow: hidden;
    }
    .vn-prefix {
        padding: 0 10px;
        font-size: 14px;
        font-weight: bold;
        color: #333;
        border-right: 1px solid #ccc;
        display: flex;
        align-items: center;
        gap: 5px;
        white-space: nowrap;
    }
    .vn-flag {
        background: #da251d;
        color: #ffff00;
        padding: 1px 4px;
        border-radius: 2px;
        font-size: 10px;
    }
    .phone-prefix-group input[type="tel"] {
        border: none !important;
    }

    .warning-red {
        color: #e60000;
        font-size: 12px;
        margin: 6px 0;
    }
    .warning-red i { color: #009eb3; }
    
    .btn-reg-mob-submit {
        background: #5bc0de;
        width: 75%;
        margin: 8px auto;
        display: block;
    }
    .auth-mob-ambassador {
        width: 100%;
        max-height: 210px;
        object-fit: contain;
        display: block;
        margin-top: 10px;
    }
    /* Thanh chuyển đổi Tab Đăng ký / Đăng nhập kiểu viên thuốc */
.auth-tabs {
    display: flex;
    width: 100%;
    height: 42px;
    border: 1px solid #009eb3;
    border-radius: 50px;
    background-color: #ffffff;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
    padding: 0;
}

.auth-tab-btn {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    color: #009eb3;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Trạng thái nút đang được chọn (Nền xanh, chữ trắng, bo tròn 2 đầu) */
.auth-tab-btn.active {
    background-color: #009eb3;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 158, 179, 0.25);
}
}

/* ================= GIAO DIỆN MÁY TÍNH (DESKTOP) ================= */
@media (min-width: 769px) {
    .desktop-only { display: block; } /* Bật hiển thị các element desktop */
    .mobile-only { display: none !important; }

    /* Header Desktop */
    .header-desktop {
        background-color: #e5f6f8; /* Màu nền xanh nhạt giống ảnh */
        padding: 5px 0;
        border-bottom: 1px solid #cce8eb;
    }

    /* Container bao quanh để giới hạn độ rộng và căn giữa */
    .header-container {
        display: flex;
        justify-content: space-between; /* Phân bổ đều khoảng trống giữa 3 khu vực */
        align-items: center; /* Căn giữa theo chiều dọc */
        max-width: 1400px; /* Tùy chỉnh độ rộng tối đa của header */
        margin: 0 auto; /* Căn giữa container trên màn hình lớn */
        padding: 0 20px;
    }

    /* --- TÙY CHỈNH VỊ TRÍ THỦ CÔNG --- */
    /* Để dịch chuyển cả cụm, bạn dùng padding hoặc margin */

    /* Cụm bên trái (Khuyến mãi) */
    .header-left {
        display: flex;
        align-items: center;
        /* margin-left: 20px; // Bỏ comment và thay số để đẩy sang phải */
    }

    /* Cụm ở giữa (Logo + Slogan) */
    .header-center {
        display: flex;
        align-items: center;
        gap: 15px; /* Tạo khoảng cách một chút giữa logo và dòng chữ. Sửa số này nếu muốn sát hơn/xa hơn */
    }

    .logo { 
        height: 35px; /* Tùy chỉnh độ cao logo cho phù hợp header */
        object-fit: contain;
    }

    .slogan-img {
        height: 18px; /* Dòng chữ thường nhỏ hơn logo, tùy chỉnh số này */
        object-fit: contain;
    }

    /* Cụm bên phải (Nút bấm) */
    .header-right {
        display: flex;
        gap: 10px;
        align-items: center;
        /* margin-right: 20px; // Bỏ comment và thay số để đẩy sang trái */
    }

    /* --- Kích thước và định dạng chi tiết --- */
    .logo { 
        height: 45px; /* Chỉnh lại kích thước phù hợp */
        object-fit: contain;
    }
    
    .promo-img { 
        height: 70px; 
        object-fit: contain;
    }

    /* Định dạng nút bấm giống ảnh */
    .btn-login { 
        background: linear-gradient(to right, #00b4d8, #0077b6); /* Hiệu ứng gradient */
        color: white; 
        border: none;
    }
    
    .btn-register, .btn-play { 
        background-color: transparent; 
        color: #0077b6; 
        border: 1px solid #0077b6; 
    }
    
    .btn-support {
        background: linear-gradient(to right, #00b4d8, #0077b6);
        color: white;
        border: none;
        border-radius: 50%; /* Làm tròn nút */
        width: 36px;
        height: 36px;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
    }
    /* Navbar Desktop */
    .navbar-desktop {
        background-color: #009eb3; /* Màu xanh nền chuẩn hơn theo ảnh */
        color: white;
        border-bottom: 2px solid #008296; /* Viền dưới đậm màu hơn một chút */
    }

    .nav-container {
        max-width: 1400px; /* Giới hạn độ rộng tương tự header */
        margin: 0 auto;
    }

    .navbar-desktop ul {
        display: flex;
        justify-content: center; /* Căn giữa toàn bộ danh sách */
        flex-wrap: nowrap; /* Đảm bảo không bị rớt dòng nếu màn hình đủ rộng */
    }

    .navbar-desktop li:last-child {
        border-right: none;
    }

    .navbar-desktop li a {
        display: flex;
        align-items: center; /* Căn giữa icon và chữ theo chiều dọc */
        gap: 6px; /* Khoảng cách giữa icon và chữ */
        padding: 12px 14px; /* Giảm padding ngang để vừa nhiều mục hơn */
        font-size: 13px; /* Cỡ chữ nhỏ lại một chút cho cân đối */
        font-weight: 700; /* In đậm */
        text-transform: uppercase; /* Viết hoa toàn bộ chữ */
        transition: background 0.3s, color 0.3s;
        white-space: nowrap; /* Ngăn chữ bị rớt xuống dòng */
    }

    /* Hiệu ứng khi hover */
    .navbar-desktop li a:hover { 
        background-color: #007d91; 
    }
    
    .navbar-desktop li a i { 
        font-size: 16px; /* Cỡ icon lớn hơn một chút so với chữ */
    }
    /* Sidebar Nổi */
    .floating-sidebar {
        position: fixed;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        flex-direction: column;
        gap: 5px;
        z-index: 1000;
    }
    .floating-sidebar a {
        background: #fff;
        color: #00a2b8;
        width: 45px;
        height: 45px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        font-size: 20px;
        border: 1px solid #c7ecee;
    }

    /* Game grid cho màn hình máy tính rộng hơn */
    .game-section { max-width: 1200px; margin: 20px auto; }
    .game-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 15px;
    }
    .game-card { background: white; border-radius: 8px; text-align: center; overflow: hidden;}
    .game-card img { width: 100%; display: block;}
    .game-card p { padding: 10px; font-weight: bold; color: #333; }

    /* Tính năng vượt trội Desktop */
    .features-desktop {
        text-align: center;
        padding: 40px 20px;
        background: #fff;
    }
    
    .features-desktop h2 { 
        color: #00a2b8; 
        margin-bottom: 40px; 
        font-size: 24px;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 15px;
    }

    .features-desktop h2 .slashes {
        color: #c7ecee; /* Màu xanh nhạt cho các dấu gạch chéo */
        letter-spacing: 2px;
    }

    .feature-list {
        display: flex;
        justify-content: space-between; /* Chia đều khoảng cách cho 4 cột */
        gap: 20px;
        max-width: 1200px; /* Mở rộng max-width để chứa đủ 4 cột */
        margin: 0 auto;
    }
    
    .feature-item { 
        flex: 1; 
        text-align: left; /* Căn trái nội dung theo ảnh gốc */
    }
    
    /* Định dạng ảnh thay cho icon */
    .feature-img { 
        height: 100px; /* Tùy chỉnh độ lớn của ảnh */
        object-fit: contain;
        margin-bottom: 20px;
        display: block;
        margin-left: auto;
        margin-right: auto; /* Căn giữa ảnh */
    }
    
    /* Định dạng thanh tiêu đề màu xanh */
    .feature-item h3 { 
        color: #008296; 
        font-size: 15px; 
        margin-bottom: 15px; 
        background: linear-gradient(to right, #c7ecee, transparent); /* Nền gradient xanh nhạt dần */
        padding: 8px 10px;
        border-radius: 4px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .feature-item h3 i {
        font-size: 12px; /* Kích thước icon nhỏ trên tiêu đề */
    }
    
    .feature-item p { 
        font-size: 14px; 
        color: #555; 
        line-height: 1.5;
        padding: 0 5px;
    }
}
/* ================= CSS FORM TRÊN MÁY TÍNH (DESKTOP) ================= */
@media (min-width: 769px) {
    .auth-modal-desktop {
        display: block !important;
        width: 860px;
        max-width: 95vw;
        background: linear-gradient(180deg, #ffffff 60%, #b5effa 100%);
        border-radius: 24px;
        padding: 30px 35px;
        position: relative;
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    }
    .auth-close-btn {
        position: absolute;
        top: -12px; right: -12px;
        width: 32px; height: 32px;
        border-radius: 50%;
        background: #fff;
        border: 2px solid #333;
        font-size: 16px;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .auth-dt-content {
        display: flex;
        gap: 30px;
        align-items: center;
    }
    .auth-dt-left {
        flex: 1.05;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .auth-dt-logo { height: 50px; object-fit: contain; }
    .auth-dt-slogan { height: 16px; margin: 6px 0 15px; object-fit: contain; }
    .auth-dt-ambassador { width: 100%; max-height: 250px; object-fit: contain; }
    
    .auth-dt-signatures h4 {
        color: #0b6e87;
        font-size: 16px;
        margin: 10px 0 6px;
    }
    .sig-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        font-size: 11px;
        color: #008296;
    }
    .sig-text { display: flex; flex-direction: column; }
    .sig-divider { width: 1px; height: 28px; background: #008296; }
    .sig-img { height: 28px; object-fit: contain; }

    .auth-dt-right {
        flex: 1;
    }
    /* Khung thông báo chuông ở Tab Đăng Ký Desktop */
    .dt-bell-box {
        text-align: center;
        padding: 40px 15px;
    }
    .bell-img {
        width: 110px;
        height: 110px;
        object-fit: contain;
        margin-bottom: 20px;
    }
    .bell-fallback {
        font-size: 85px;
        color: #ffb703;
        margin-bottom: 20px;
    }
    .dt-bell-box p {
        color: #008296;
        font-size: 15px;
        line-height: 1.5;
        font-weight: 500;
    }
}