/* Reset CSS cơ bản */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: Arial, sans-serif; }

/* Tạo nền xám trên máy tính và căn giữa ứng dụng */
body { 
    background-color: #d1d5db; 
    display: flex; 
    justify-content: center; 
}

/* Khung chính của ứng dụng - Giới hạn kích thước như điện thoại */
.app-container {
    width: 100%;
    max-width: 480px; /* Chiều rộng tối đa của điện thoại */
    background-color: #ffffff;
    min-height: 100vh;
    position: relative;
    padding-bottom: 70px; /* Chừa không gian cho menu dưới cùng */
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

.icon-blue { color: #0284c7; }
/* Header */
.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 15px; 
    background-color: #ffffff;
    /* Tạo hiệu ứng bo tròn góc dưới và bóng mờ cho header */
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    
    /* 3 DÒNG DƯỚI ĐÂY DÙNG ĐỂ GHIM HEADER CỐ ĐỊNH TRÊN CÙNG */
    position: sticky; 
    top: 0; 
    z-index: 999; /* Đảm bảo Header luôn nằm trên các ảnh và banner khi cuộn */
}

.header .menu-icon { 
    font-size: 24px; 
    color: #0ea5e9; /* Chỉnh màu xanh khớp với nút */
    cursor: pointer; 
}

/* Chỉnh kích thước khung logo ảnh */
.header .logo { 
    display: flex; 
    align-items: center; 
    height: 28px; /* Giới hạn chiều cao để logo không bị quá to */
}

.header .logo img { 
    height: 100%; 
    width: auto;
    object-fit: contain; /* Đảm bảo hình ảnh giữ đúng tỷ lệ */
}

/* Tạo khối viền bao quanh 2 nút */
.auth-buttons { 
    display: flex; 
    align-items: center; 
    border: 1px solid #0ea5e9; 
    border-radius: 20px; 
    background-color: #ffffff;
}

.auth-buttons button { 
    border: none; 
    font-size: 16px; 
    cursor: pointer; 
}

/* Nút đăng nhập đổ màu xanh và bo tròn dạng viên thuốc */
.btn-login { 
    background-color: #0ea5e9; 
    color: white; 
    padding: 9px 14px; 
    border-radius: 20px; 
    margin: -1px; /* Nới nhẹ để đè lên viền của khối bao ngoài */
}

/* Nút đăng ký nền trong suốt */
.btn-register { 
    background-color: transparent; 
    color: #0ea5e9; 
    padding: 7px 12px;
    border-radius: 0 20px 20px 0;
}

/* Thanh thông báo */
.notice-bar { display: flex; align-items: center; padding: 8px 15px; background: #f8fafc; color: #64748b; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
.notice-bar marquee { flex: 1; margin: 0 10px; }
.msg-box { position: relative; }
.msg-box .fa-envelope { font-size: 20px; }
.badge { position: absolute; top: -5px; right: -8px; background: #ef4444; color: white; border-radius: 50%; padding: 2px 5px; font-size: 9px; font-weight: bold; }

/* Banners Carousel */
.main-banner {
    position: relative;
    width: 100%;
    overflow: hidden; /* Giấu các ảnh nằm ngoài khung */
    display: block;
}

.banner-slides {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease-in-out; /* Hiệu ứng trượt mượt mà 0.5 giây */
}

.banner-slide {
    width: 100%;
    flex-shrink: 0; /* Ngăn không cho ảnh bị ép nhỏ */
    object-fit: cover;
    display: block;
}

/* Kiểu dáng cho cụm dấu chấm (Pagination) ở dưới đáy banner */
.banner-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 2;
}

/* Dấu chấm trạng thái chờ (hình tròn mờ) */
.dot {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Dấu chấm trạng thái đang hoạt động (kéo dài dạng viên thuốc) */
.dot.active {
    width: 20px; 
    background-color: #ffffff;
    border-radius: 4px;
}

/* Thanh tìm kiếm */
.search-bar { padding: 15px; position: relative; }
.search-bar input { width: 100%; padding: 12px 15px; border-radius: 20px; border: 1px solid #e2e8f0; background: #f8fafc; outline: none; font-size: 14px; }
.search-icon { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); color: #0ea5e9; }

/* Nút trượt ngang */
.categories-wrapper { 
    overflow-x: auto; 
    white-space: nowrap; 
    padding: 0 15px 15px; 
    scroll-behavior: smooth; 
    cursor: grab; /* Con trỏ kéo thả */
}
/* Ẩn thanh cuộn (scrollbar) mặc định */
.categories-wrapper::-webkit-scrollbar { display: none; }
.categories { display: flex; gap: 10px; }
.cat-btn { padding: 8px 20px; border-radius: 20px; border: 1px solid #e2e8f0; background: white; color: #0ea5e9; font-weight: bold; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.cat-btn.active { color: #0284c7; border-color: #e0f2fe; background: #e0f2fe; }

/* Tiêu đề & Điều hướng */
.section-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; }
.section-header .title { font-weight: bold; font-size: 16px; }
.section-header .controls { display: flex; align-items: center; gap: 8px; color: #0ea5e9; font-size: 13px; }
.section-header .controls button { background: white; border: 1px solid #e2e8f0; border-radius: 15px; width: 30px; height: 25px; cursor: pointer; color: #94a3b8; }

/* --- Banner Jackpot --- */
.jackpot-banner { 
    padding: 0 15px; 
    margin-bottom: 15px;
}

.jackpot-wrapper { 
    position: relative; 
    width: 100%; 
    border-radius: 8px; 
    display: flex; 
    justify-content: center;
}

.jackpot-wrapper img { 
    width: 100%; 
    display: block; 
    border-radius: 8px;
}

/* Định dạng số Jackpot nổi trên ảnh */
.jackpot-amount {
    position: absolute;
    bottom: 15%; /* Căn chỉnh vị trí lên/xuống để vừa vặn với khung ảnh */
    left: 50%;
    transform: translateX(-50%);
    color: #ffde00; /* Màu vàng */
    font-size: 22px; /* Kích thước chữ, tự động thu nhỏ trên màn hình bé */
    font-weight: 900;
    font-style: italic;
    font-family: 'Arial Black', Impact, sans-serif;
    /* Tạo viền đỏ và bóng mờ cho chữ */
    text-shadow: 
        -1px -1px 0 #d90000,
         1px -1px 0 #d90000,
        -1px  1px 0 #d90000,
         1px  1px 0 #d90000,
         2px  2px 4px rgba(0,0,0,0.6);
    letter-spacing: 1.5px;
    white-space: nowrap;
}

/* Điều chỉnh lại kích thước chữ Jackpot nếu màn hình quá nhỏ */
@media (max-width: 380px) {
    .jackpot-amount { font-size: 18px; }
}

/* --- Lưới Game --- */
.game-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 12px; 
    padding: 10px 15px 25px; 
}

.game-card { 
    position: relative; 
    border-radius: 12px; /* Bo tròn góc nhiều hơn */
    overflow: hidden; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.15); /* Thêm bóng đổ nhẹ để tạo chiều sâu */
    background-color: #f1f5f9;
}

.game-card img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    aspect-ratio: 3 / 4; /* Ép tỷ lệ hiển thị để các ảnh luôn cao bằng nhau */
    display: block; 
}

/* Icon ngôi sao góc trên bên phải */
.favorite-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background-color: rgba(0, 0, 0, 0.4); /* Nền đen mờ */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #cbd5e1; /* Màu xám nhạt cho ngôi sao */
    font-size: 10px;
    z-index: 2;
    cursor: pointer;
}

/* Hiệu ứng khi bấm vào ngôi sao (đổi sang màu vàng) */
.favorite-icon:hover, .favorite-icon:active {
    color: #fbbf24; 
}

/* Tên game và dải màu gradient ở dưới đáy */
.game-title { 
    position: absolute; 
    bottom: 0; 
    left: 0;
    width: 100%; 
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%); 
    color: #ffffff; 
    text-align: center; 
    padding: 25px 4px 8px; /* Tăng padding trên để dải gradient kéo dài lên trên một chút */
    font-size: 11px; 
    font-weight: bold; 
    margin: 0;
    /* Rút gọn tên game nếu quá dài */
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    z-index: 1;
}
/* --- Icon ngôi sao kiểu mới (Màu xanh dương) cho mục Casino --- */
.favorite-icon-blue {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background-color: #38bdf8; /* Nền màu xanh dương sáng */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff; /* Ngôi sao màu trắng */
    font-size: 10px;
    z-index: 2;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* Đổ bóng nhẹ cho nút */
}

/* Hiệu ứng khi bấm vào hoặc rê chuột (đổi sang màu đậm hơn) */
.favorite-icon-blue:hover, .favorite-icon-blue:active {
    background-color: #0284c7; 
}
/* --- Icon 777 cho mục Nổ Hũ --- */
.icon-777 {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: #38bdf8; /* Màu nền xanh dương */
    color: #ffffff; /* Màu chữ trắng */
    font-size: 10px;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 4px; /* Bo góc nhẹ */
    margin-right: 5px;
    letter-spacing: 1px;
    vertical-align: middle;
}
/* --- Mục Tải App --- */
.app-download-section {
    padding-bottom: 20px;
    background-color: #ffffff;
}

/* Icon mũi tên tải xuống trong khung */
.icon-download-box {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1.5px solid #0ea5e9;
    color: #0ea5e9;
    width: 20px;
    height: 24px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 5px;
    vertical-align: text-bottom;
}

/* Banner chính của phần Tải App */
.app-banner {
    width: 100%;
    padding: 0 15px;
    margin-top: 5px;
}

.app-banner img {
    width: 100%;
    display: block;
    border-radius: 8px;
    object-fit: cover;
}

/* Cụm 2 nút tải xuống */
.download-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 15px;
}

/* Định dạng từng nút tải xuống */
.btn-download {
    flex: 1; /* Chia đều không gian cho 2 nút */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 12px 10px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 30px; /* Bo tròn hoàn toàn tạo dạng viên thuốc */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* Hiệu ứng nổi nhẹ */
    transition: all 0.2s ease;
}

.btn-download:active {
    background-color: #f8fafc;
    transform: scale(0.98);
}

/* Kích thước logo trong nút */
.btn-download img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-right: 12px;
}

/* Chữ trong nút */
.btn-download .btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.btn-download .small-text {
    font-size: 11px;
    color: #475569;
    line-height: 1.2;
}

.btn-download .big-text {
    font-size: 14px;
    font-weight: bold;
    color: #334155;
    line-height: 1.2;
    letter-spacing: 0.5px;
}
/* --- Menu dưới cùng cố định --- */
.bottom-nav { 
    position: fixed; 
    bottom: 0; 
    width: 100%; 
    max-width: 480px; 
    background: #ffffff; 
    display: flex; 
    justify-content: space-between; 
    padding: 8px 15px; 
    border-top: 1px solid #e2e8f0; 
    z-index: 100; 
}

/* Căn chỉnh hình ảnh đường cong phần thừa */
.nav-curve {
    position: absolute;
    top: -13.2px; /* Kéo hình nhô lên khỏi viền trên của thanh menu */
    left: 15px; /* Căn ngang cho khớp với vị trí của nút TOP */
    width: 65px; /* Kích thước chiều ngang của phần cong */
    height: auto;
    z-index: -1; /* Nằm dưới các nút bấm để không che mất icon */
    object-fit: contain;
}

.nav-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    color: #94a3b8; /* Màu xám cho các icon chưa chọn */
    text-decoration: none; 
    font-size: 11px; 
    gap: 4px;
    flex: 1; /* Chia đều khoảng cách cho 5 nút */
    position: relative;
}

.nav-item i { font-size: 20px; }

/* Trạng thái Active cho nút TOP */
.nav-item.active { 
    color: #0ea5e9; 
}

/* Vòng tròn xanh nền cho icon TOP */
.top-icon-circle {
    background-color: #0ea5e9;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    margin-bottom: 2px;
}

.nav-recharge { position: relative; }

/* Huy hiệu (Badge) Nạp tiền với góc nhọn đặc biệt */
.nav-badge { 
    position: absolute; 
    top: -10px; 
    right: 5px; 
    background: #cc0000; /* Màu đỏ đậm */
    color: white; 
    font-size: 10px; 
    font-weight: bold;
    padding: 2px 4px; 
    border-radius: 4px 4px 4px 0; /* Bo tròn 3 góc, góc dưới cùng bên trái nhọn */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Tạo phần đuôi nhọn ở dưới huy hiệu nạp tiền */
.nav-badge::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    border-width: 4px 4px 0 0;
    border-style: solid;
    border-color: #cc0000 transparent transparent transparent;
}
/* =========================================
   CSS CHO MODAL ĐĂNG NHẬP / ĐĂNG KÝ
   ========================================= */
.modal-overlay {
    display: none; /* Ẩn form mặc định */
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #f8fafc; /* Nền sáng full màn hình giống app thật */
    z-index: 9999; /* Luôn hiển thị trên cùng */
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex; /* Kích hoạt hiển thị Form */
}

.modal-content {
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    padding: 20px 25px;
    position: relative;
    min-height: 100vh;
}

/* Nút quay lại */
.close-modal {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    font-size: 22px;
    color: #64748b;
    cursor: pointer;
}

/* Header Form */
.modal-header {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 25px;
}

.modal-logo {
    color: #0ea5e9;
    font-size: 45px;
    font-weight: 900;
    margin-bottom: 20px;
}

.modal-partners {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #000;
}

.partner-text { text-align: left; }
.partner-text strong { font-size: 14px; }
.partner-logos strong { font-size: 20px; color: #0ea5e9; }

/* Tabs Chuyển đổi */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    cursor: pointer;
    color: #64748b;
    font-size: 15px;
}

.tab-btn i { margin-right: 5px; }

.tab-btn.active {
    color: #0ea5e9;
    border-bottom: 2px solid #0ea5e9;
    font-weight: bold;
    margin-bottom: -2px; /* Đè viền màu xanh lên trên viền xám */
}

/* Ẩn/Hiện Form */
.auth-form { display: none; }
.auth-form.active { display: block; }

/* Khung Input */
.input-label {
    display: block;
    font-size: 13px;
    color: #334155;
    margin-bottom: 8px;
}

.input-group {
    display: flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    background: #ffffff;
}

.input-group i {
    color: #94a3b8;
    font-size: 16px;
    margin-right: 12px;
}

.input-group input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 14px;
    color: #333;
}

.input-group input::placeholder { color: #94a3b8; }
.toggle-pw { cursor: pointer; color: #cbd5e1 !important; margin-right: 0 !important; }

/* Cờ VN và Mã vùng */
.phone-prefix {
    display: flex;
    align-items: center;
    color: #ef4444;
    font-weight: bold;
    margin-right: 12px;
    padding-right: 12px;
    border-right: 1px solid #cbd5e1;
    font-size: 14px;
}
.flag-vn { margin-right: 5px; font-size: 16px; }

/* Ghi nhớ & Điều khoản */
.remember-me, .terms {
    font-size: 13px;
    color: #334155;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.terms label { color: #0ea5e9; }

/* Độ mạnh mật khẩu */
.pw-strength {
    font-size: 12px;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: -5px;
    margin-bottom: 15px;
}
.strength-bars { display: flex; gap: 5px; }
.strength-bars span {
    width: 35px;
    height: 4px;
    background-color: #e2e8f0;
    border-radius: 2px;
}

/* Nút Submit chính */
.btn-submit {
    width: 100%;
    background-color: #0ea5e9;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
}

/* Menu links phụ */
.auth-links {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}
.auth-links a {
    color: #0ea5e9;
    text-decoration: none;
}