:root {
    --primary-color: #0b6e4f;
    --bg-color: #f5f5f5;
    --text-color: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #e0e0e0; /* Nền xám cho máy tính */
    display: flex;
    justify-content: center;
}

/* Khung giả lập giao diện mobile trên desktop */
.app-container {
    width: 100%;
    max-width: 480px; /* Giới hạn độ rộng như một chiếc điện thoại */
    background-color: #fff;
    min-height: 100vh;
    position: relative;
    padding-bottom: 60px; /* Chừa chỗ cho bottom nav */
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

/* Thiết lập Header với hình nền */
.header {
    /* --- 3 DÒNG NÀY GIÚP GHIM HEADER TRÊN CÙNG --- */
    position: sticky;
    top: 0;
    z-index: 999; 
    /* --------------------------------------------- */

    /* Đặt ảnh nền biển xanh có cá mập và bạch tuộc */
    background-image: url('images/backgroud-header.webp');
    background-size: cover;      /* Giúp ảnh nền phủ kín toàn bộ khung */
    background-position: center; /* Căn giữa ảnh nền */
    background-repeat: no-repeat;
    
    display: flex;
    justify-content: space-between; /* Đẩy 2 icon ra 2 sát mép trái/phải */
    align-items: center; /* Căn giữa theo chiều dọc */
    
    padding: 10px 15px;
    height: 55px; /* Bạn có thể tăng giảm chiều cao cho phù hợp */
}

/* Định dạng chung cho 2 icon trái/phải */
.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon img {
    height: 45px; /* Chiều cao của icon, có thể chỉnh to/nhỏ tùy ý */
    width: auto;
    object-fit: contain;
}

/* Do ảnh icon-right.jpg có đuôi jpg (không hỗ trợ nền trong suốt), bo góc để ảnh trông gọn hơn */
.menu-icon img {
    border-radius: 8px; 
}

/* Định dạng cho Logo ở giữa */
.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1; /* Chiếm toàn bộ khoảng trống ở giữa để ép 2 icon ra rìa */
}

.header-logo img {
    height: 35px; /* Chiều cao của logo */
    width: auto;
    object-fit: contain;
}

.banner-slider {
    width: 100%;
    overflow: hidden; /* Giấu các ảnh nằm ngoài khung hình */
    position: relative;
    background-color: #e0e0e0;
}

.banner-track {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease-in-out; /* Thời gian và kiểu hiệu ứng trượt */
}

.banner-track img {
    width: 100%;
    flex-shrink: 0; /* Giữ nguyên kích thước gốc của 100% width, không bị ép nhỏ */
    display: block;
    object-fit: cover;
}

/* Container chính của thanh thông báo */
.announcement {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
    height: 40px; /* Cố định chiều cao để dễ căn chỉnh */
}

/* Icon cái loa bên trái */
.loa-icon {
    height: 30px; /* Chỉnh lại kích thước cho vừa vặn */
    width: auto;
    flex-shrink: 0; /* Ngăn không cho icon bị bóp méo */
}

/* Phần chữ chạy (marquee) */
.marquee-text {
    margin-left: 10px;
    margin-right: 10px; /* Thêm khoảng cách với nút Thông Báo */
    font-size: 14px;
    color: #666; /* Màu xám cho chữ thường */
    font-family: Arial, sans-serif;
}

/* Màu xanh đậm cho chữ AD88 */
.marquee-text .ad88-text {
    color: #0d8365;
    font-weight: bold;
}

/* Màu xanh ngọc cho chữ số 1 */
.marquee-text .number-text {
    color: #10a881;
    font-weight: bold;
}

/* Nút "Thông Báo" có nền ảnh "HOT" */
.notification-btn {
    /* Đặt ảnh image_15d7b5.png làm hình nền */
    background-image: url('images/img_dt_pmd_xx.webp'); 
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    
    /* Căn chỉnh nội dung chữ "Thông Báo" */
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Đẩy chữ về bên phải ảnh */
    padding-right: 10px;       /* Khoảng cách chữ so với lề phải */
    
    /* Kích thước của nút (bạn có thể tinh chỉnh theo kích thước thật của ảnh) */
    width: 110px; 
    height: 26px;
    flex-shrink: 0;
    
    font-size: 13px;
    color: #0d8365;
    position: relative; /* Dùng để định vị dấu chấm đỏ */
    cursor: pointer;
}

/* Dấu chấm đỏ báo hiệu có thông báo mới */
.red-dot {
    position: absolute;
    top: -2px;
    right: 0;
    width: 8px;
    height: 8px;
    background-color: red;
    border-radius: 50%;
}

/* Container chính chứa 2 phần: nút bấm và icon */
.action-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

/* Cụm nút Đăng Nhập / Đăng Ký */
.auth-buttons {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 12px 16px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.btn-login {
    background-color: #fff;
    color: #0b6e4f; /* Màu xanh lá đậm */
    border: 1px solid #0b6e4f;
}

.btn-register {
    background-color: #0b6e4f;
    color: #fff;
    border: 1px solid #0b6e4f;
}

/* Cụm icon truy cập nhanh */
.quick-links {
    display: flex;
    gap: 25px; /* Khoảng cách giữa các mục */
}

.link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

/* Chữ dưới các icon */
.link-item span:last-child {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Vùng chứa icon để định vị nhãn thông báo */
.icon-container {
    position: relative;
    display: flex;
    justify-content: center;
}

.icon-container img {
    height: 36px; /* Kích thước của icon */
    width: auto;
    object-fit: contain;
}

/* Kiểu dáng chung cho các nhãn (badge) thông báo */
.badge {
    position: absolute;
    top: -14px;
    right: -15px;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 2;
}

/* Nhãn màu xanh cho Sinh Lời */
.badge-green {
    background-color: #00cc00; 
}

/* Nhãn màu đỏ cho Mời Bạn */
.badge-red {
    background-color: #ff0000;
}

.main-content {
    display: flex;
    height: calc(100vh - 250px);
}

/* Khung chứa menu trái */
.sidebar {
    width: 25%;
    background-color: #fff; /* Nền trắng */
    border-right: 1px solid #eee;
    padding: 10px 8px; /* Thêm padding để tạo khoảng cách cho các nút */
    
    /* Thiết lập Flexbox dạng cột để các nút tự động xếp dọc */
    display: flex; 
    flex-direction: column;
    gap: 12px; /* Khoảng cách giữa các nút */
    
    /* Cho phép cuộn nếu danh sách game dài hơn màn hình */
    overflow-y: auto; 
}

/* Định dạng từng nút menu */
.side-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 5px;
    background-color: #f8f9fa; /* Màu xám nhạt cho nút chưa chọn */
    
    border: 1px solid #e0e0e0;
    border-radius: 10px; /* Bo góc nút giống hình 1 */
    box-shadow: 2px 2px 5px rgba(0,0,0,0.06); /* Đổ bóng nhẹ tạo cảm giác 3D */
    
    cursor: pointer;
    color: #444;
    font-size: 13px;
    transition: all 0.2s ease;
}

/* Định dạng icon bên trong nút */
.side-tab img {
    height: 45px; /* Chiều cao icon, bạn có thể chỉnh to nhỏ tùy ý */
    width: auto;
    object-fit: contain;
    margin-bottom: 6px; /* Khoảng cách giữa icon và chữ */
}

/* Trạng thái Active (khi nút được chọn) */
.side-tab.active {
    /* Tạo dải màu xanh mờ gradient từ trên xuống */
    background: linear-gradient(to bottom, #006139, #f0fdf6);
    border: 1px solid #038d54;
    color: #0b6e4f; /* Chữ chuyển màu xanh đậm */
    font-weight: bold;
    box-shadow: none; /* Bỏ bóng đổ để nút nhìn chìm xuống một chút */
}

/* Khu vực chứa game */
.game-area {
    width: 75%;
    padding: 10px 10px 20px 10px;
    overflow-y: auto;
    position: relative; /* Dùng để neo nút TOP */
}

/* Thanh Tabs */
.tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #eee; /* Đường kẻ ngang mờ dưới Tab */
}

.tabs span {
    padding-bottom: 10px;
    cursor: pointer;
    position: relative;
}

/* Trạng thái Tab đang chọn */
.tabs .active {
    color: #0b6e4f;
}

/* Gạch chân màu xanh nét đứt hoặc nét liền cho tab đang chọn */
.tabs .active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background-color: #0b6e4f;
    border-radius: 2px;
}

/* Lưới Game */
.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 10px; /* Khoảng cách dọc 12px, ngang 10px */
}

.game-card {
    text-align: center;
    cursor: pointer;
}

/* Vùng chứa ảnh game để định vị các huy hiệu */
.game-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* Ép khung hình vuông */
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.game-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px; /* Bo góc ảnh giống khung chứa */
    display: block;
}

/* CSS chung cho huy hiệu (badge) */
.badge {
    position: absolute;
    top: 0;
    font-size: 10px;
    z-index: 2;
}

/* Chữ tên game */
.game-card p {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Tạo dấu ... nếu tên quá dài */
}

.btn-top {
    position: absolute; /* Đã sửa từ fixed thành absolute */
    bottom: 70px; 
    right: 15px;
    width: 45px;
    height: 45px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    color: #0b6e4f;
    cursor: pointer;
    z-index: 10;
}

.btn-top i {
    font-size: 16px;
}

.btn-top span {
    font-size: 9px;
    font-weight: bold;
    margin-top: 2px;
}
/* Tiêu đề danh mục (VD: Nổ Hũ) */
.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.category-header img {
    height: 24px;
    width: auto;
}

.category-header h2 {
    font-size: 16px;
    color: #444;
    margin: 0;
}

/* Banner Jackpot */
.jackpot-banner {
    margin-bottom: 15px;
    width: 100%;
}

.jackpot-banner img {
    width: 100%;
    border-radius: 8px;
    display: block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Khung chứa danh sách các sảnh game */
.provider-list {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Khoảng cách giữa các banner sảnh */
    padding-bottom: 20px;
}

/* Thẻ sảnh game (Banner ngang) */
.provider-card {
    display: block;
    width: 100%;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.provider-card:active {
    transform: scale(0.98); /* Hiệu ứng lún xuống một chút khi bấm vào */
}

.provider-card img {
    width: 100%;
    display: block;
    border-radius: 10px; /* Bo góc cho các thẻ ngang giống hình gốc */
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
}
/* --- THANH TÌM KIẾM VÀ LỌC --- */
.search-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-top: 15px; /* Cách lưới game phía trên */
    margin-bottom: 15px; /* Cách phần Nổ Hũ phía dưới */
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.search-icon {
    font-size: 18px;
    color: #0b6e4f; /* Màu xanh kính lúp */
    cursor: pointer;
}

.filter-options {
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 10px;
}

.filter-options button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 12px;
}

.filter-options span {
    font-size: 13px;
    color: #333;
}

/* --- PHẦN NỔ HŨ --- */
.category-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.category-header img {
    height: 18px; /* Thu nhỏ icon lại một chút cho cân đối */
    width: auto;
}

.category-header h2 {
    font-size: 14px; /* Kích thước chữ bằng với bản gốc */
    color: #333;
    margin: 0;
}

/* Kích thước Banner Jackpot */
.jackpot-banner {
    margin-bottom: 10px;
    width: 100%;
}

.jackpot-banner img {
    width: 100%;
    border-radius: 6px; /* Bo góc nhẹ */
    display: block;
}

/* Kích thước và khoảng cách các sảnh game */
.provider-list {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Giảm khoảng cách giữa các banner sảnh cho giống hình */
    padding-bottom: 20px;
}

.provider-card {
    display: block;
    width: 100%;
    text-decoration: none;
    border: 1px solid #f0f0f0; /* Viền siêu mờ tạo cảm giác nổi */
    border-radius: 12px;
}

.provider-card img {
    width: 100%;
    display: block;
    border-radius: 12px; /* Độ bo góc chuẩn 12px */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Đổ bóng rất mờ tạo chiều sâu */
}
/* Thanh điều hướng dưới cùng (Bottom Navigation) */
.bottom-nav {
    /* --- CÁC DÒNG NÀY GIÚP GHIM BOTTOM NAV DƯỚI CÙNG VÀ CĂN GIỮA --- */
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px; /* Phải khai báo max-width bằng với .app-container */
    z-index: 999;
    /* --------------------------------------------------------------- */
    
    /* Chèn Hình 1 làm ảnh nền thay cho màu trắng cơ bản */
    background-image: url('images/d1.avif');
    background-size: cover; /* Ép ảnh nền trải dài vừa vặn khung */
    background-position: bottom center;
    background-repeat: no-repeat;
    
    display: flex;
    justify-content: space-around;
    padding: 10px 0 5px 0; /* Tinh chỉnh khoảng cách trên dưới */
    border-top: 1px solid #ddd;
}

/* Định dạng từng mục menu */
.nav-item {
    text-align: center;
    font-size: 15px;
    color: #888; /* Màu xám cho chữ của các mục chưa chọn */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

/* Định dạng cho các ảnh icon thay thế FontAwesome */
.nav-item img {
    height: 36px; /* Kích thước icon bằng Hình 2 */
    width: auto;
    object-fit: contain;
    margin-bottom: 4px; /* Khoảng cách giữa icon và chữ */
}

/* Trạng thái mục đang được chọn (Active) */
.nav-item.active {
    color: #0d8365; /* Đổi chữ thành màu xanh lá đậm giống hình gốc */
    font-weight: bold; /* Làm đậm chữ lên một chút */
}
/* --- NỀN MODAL BÊN NGOÀI --- */
.modal {
    display: none; /* Ẩn mặc định */
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.5); /* Nền đen mờ */
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

/* Modal sẽ hiển thị dạng Flex khi được kích hoạt bằng JS */
.modal.show { display: flex; }

/* --- KHUNG NỘI DUNG MODAL --- */
.modal-content {
    background-color: #fff;
    width: 100%;
    max-width: 480px; /* Khớp với khung điện thoại của bạn */
    height: 100vh; /* Chiếm trọn màn hình điện thoại */
    overflow-y: auto;
    padding: 20px;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Header Modal */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 20px;
}

.close-modal {
    position: absolute;
    left: 0;
    font-size: 24px;
    color: #555;
    cursor: pointer;
}

.modal-logo { height: 40px; }

.modal-sponsor {
    text-align: center;
    font-size: 11px;
    color: #0b6e4f;
    font-weight: bold;
    margin-bottom: 20px;
}

/* --- TABS (ĐĂNG NHẬP / ĐĂNG KÝ) --- */
.auth-tabs {
    display: flex;
    background-color: #999; /* Nền xám cho tab chưa chọn */
    border-radius: 25px;
    margin-bottom: 20px;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 12px 0;
    border: none;
    background: transparent;
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

/* Tab đang được chọn chuyển sang màu xanh lá */
.tab-btn.active {
    background-color: #0b6e4f;
    border-radius: 25px;
}

/* --- CÁC FORM VÀ Ô NHẬP LIỆU --- */
.auth-form { display: none; }
.auth-form.active { display: block; }

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

.input-icon {
    color: #0b6e4f;
    font-size: 18px;
    margin-right: 10px;
}

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

.toggle-pw { color: #888; cursor: pointer; }

/* Khối nhập số điện thoại đặc biệt */
.phone-group { padding-left: 10px; }
.country-code {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #555;
    font-weight: bold;
    border-right: 1px solid #ccc;
    padding-right: 10px;
    margin-right: 10px;
}

/* --- THÀNH PHẦN PHỤ TRỢ (CHECKBOX, NÚT BẤM, LINKS) --- */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #444;
    margin-bottom: 20px;
}
.checkbox-group.align-top { align-items: flex-start; }
.checkbox-group label a { color: #0b6e4f; text-decoration: none; cursor: pointer;}

.btn-submit {
    width: 100%;
    background-color: #0b6e4f;
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
}

.auth-links {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
}
.auth-links a {
    color: #0b6e4f;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #0b6e4f;
}

/* Nút Đăng nhập nhanh */
.quick-login {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
    margin-bottom: 15px;
}
.quick-login .line { flex: 1; height: 1px; background-color: #ddd; }
.quick-login .text { margin: 0 15px; }

.quick-icons { display: flex; justify-content: center; gap: 20px; }
.q-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid #ddd;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #0b6e4f; cursor: pointer;
}

/* Độ mạnh mật khẩu (Bên tab Đăng Ký) */
.pw-strength { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #666; margin: -5px 0 15px 0;}
.bars { display: flex; gap: 5px; flex: 1; }
.bar { height: 4px; background-color: #ddd; flex: 1; border-radius: 2px; }

/* Chữ cảnh báo */
.warning-text { color: #ff00ff; font-size: 12px; font-weight: bold; margin: -5px 0 15px 0; }