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

/* Nền cho máy tính (nằm ngoài khung app) */
body {
    background-color: #333; /* Màu tối để làm nổi bật khung app ở giữa */
    display: flex;
    justify-content: center;
}

/* Khung bao bọc tạo hình dáng App Mobile */
.app-wrapper {
    width: 100%;
    max-width: 500px; /* Khóa kích thước tối đa */
    background-color: #f0f2f5;
    min-height: 100vh;
    position: relative;
    padding-bottom: 60px; /* Chừa chỗ cho bottom nav */
    box-shadow: 0 0 15px rgba(0,0,0,0.5); /* Đổ bóng 2 bên trên máy tính */
}

/* -- HEADER -- */
.header {
    background-color: #ffffff; /* Nền trắng giống bản gốc */
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    /* Thêm viền xanh mỏng ở dưới đáy header cho giống ảnh */
    border-bottom: 3px solid #66ccff; 
}

.menu-btn { 
    font-size: 26px; 
    cursor: pointer; 
    color: #2eb2ff; /* Màu xanh dương sáng cho nút 3 gạch */
}

/* Kích thước ảnh Logo */
.logo img {
    height: 35px; /* Bạn có thể tăng giảm số này để logo to/nhỏ theo ý muốn */
    width: auto;
    display: block; /* Xóa khoảng trống thừa dưới ảnh */
}

/* Cụm Icon VIP */
.vip-btn {
    display: flex;
    flex-direction: column; /* Xếp dọc vương miện và chữ VIP */
    align-items: center;
    color: #2eb2ff; /* Màu xanh giống logo */
    cursor: pointer;
}

.vip-btn i {
    font-size: 16px; /* Kích thước vương miện */
    margin-bottom: -3px; /* Kéo chữ VIP nhích lên sát vương miện */
}

/* Phần chữ VIP bọc trong khung */
.vip-text {
    font-size: 9px;
    font-weight: bold;
    border: 1px solid #2eb2ff;
    padding: 0px 3px;
    border-radius: 2px; /* Bo góc nhẹ */
}
/* -- MENU MOBILE -- */
.mobile-menu {
    display: none;
    background-color: #0099cc;
    flex-direction: column;
}
.mobile-menu.active { display: flex; }
.mobile-menu a {
    color: white;
    padding: 10px 15px;
    text-decoration: none;
    border-bottom: 1px solid #007799;
}

/* -- BANNERS -- */
.banner-section { 
    background-color: #ffffff; /* Nền trắng cho liền mạch với header */
    padding: 5px 10px; 
}

/* Khung hiển thị chính (như một chiếc cửa sổ) */
.main-banner {
    width: 100%;
    height: 160px; /* Bạn có thể tăng giảm chiều cao tùy kích thước ảnh */
    border-radius: 8px;
    overflow: hidden; /* Cắt bỏ các ảnh nằm ngoài khung */
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Đường ray chứa 6 ảnh xếp nằm ngang */
.slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out; /* Hiệu ứng trượt mượt mà trong 0.5s */
}

/* Kích thước mỗi ảnh */
.slider-track img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Đảm bảo ảnh không bị méo tỉ lệ */
    flex-shrink: 0; /* Ép mỗi ảnh luôn chiếm 100% chiều rộng của khung main-banner */
}

.marquee-container {
    background-color: #e6f7ff;
    color: #007bff;
    padding: 5px 10px;
    margin-top: 5px;
    font-size: 12px;
    border-radius: 15px; 
    border: 1px solid #b3e6ff;
    display: flex;
    align-items: center;
}

/* -- ACTION BUTTONS & ICONS -- */
.action-buttons {
    display: flex;
    align-items: center;
    padding: 10px 5px;
    /* Tạo hình nền cắt chéo: 35% bên trái màu xanh nhạt, còn lại màu xanh đậm */
    background: linear-gradient(105deg, #2eb2ff 35%, #0073e6 35%);
}

/* -- Phần Nút Bấm Bên Trái -- */
.left-action {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 35%; /* Chiếm 35% chiều rộng */
    padding-right: 15px; /* Đẩy nội dung ra xa đường cắt chéo */
}

.btn {
    padding: 8px 0;
    border: 1px solid white;
    border-radius: 4px;
    font-weight: bold;
    color: white;
    font-size: 12px;
    cursor: pointer;
    background-color: transparent;
    text-align: center;
    width: 100%;
}

.relative-btn {
    position: relative; /* Để gắn nhãn badge đỏ lên góc */
}

/* -- Phần Icon Bên Phải -- */
.right-action {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    flex: 1; /* Chiếm phần diện tích còn lại */
    padding-left: 5px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    gap: 4px;
}

.action-item img {
    width: 32px; /* Kích thước ảnh icon */
    height: 32px;
    object-fit: contain; /* Giữ nguyên tỉ lệ ảnh */
}

.action-item span {
    color: #ffcc00; /* Màu vàng chữ */
    font-size: 9px;
    font-weight: bold;
    text-align: center;
}

/* -- Thiết kế Nhãn dán đỏ (Badge) -- */
.badge {
    position: absolute;
    background: linear-gradient(to right, #ff0000, #cc0000); /* Màu đỏ gradient */
    color: #ffff00; /* Chữ màu vàng nổi bật */
    font-size: 9px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    border: 1px solid white; /* Viền trắng nhỏ */
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 2;
}

/* Vị trí badge trên nút Đăng Ký */
.badge-btn {
    top: -10px;
    right: -10px;
}

/* Vị trí badge trên các Icon */
.badge-icon {
    top: -8px;
    right: -15px;
}
/* -- THIẾT KẾ PHẦN MENU GAME (TAB HEADER) -- */
.game-section { 
    background-color: #ffffff; 
    padding: 0; 
}

/* Khung bao bọc toàn bộ menu để chứa mũi tên */
.tab-menu-wrapper {
    display: flex;
    align-items: center;
    background-color: #1bc4ff; /* Màu nền xanh sáng giống ảnh gốc */
    position: relative;
}

/* Mũi tên cuộn 2 bên */
.scroll-arrow {
    color: white;
    font-size: 14px;
    padding: 0 5px;
    cursor: pointer;
    z-index: 10;
}

/* Khu vực cuộn chính */
.tab-header-scroll {
    display: flex;
    overflow-x: auto; 
    white-space: nowrap;
    scrollbar-width: none; /* Ẩn thanh cuộn (Firefox) */
    flex: 1; /* Lấp đầy không gian giữa 2 mũi tên */
    scroll-behavior: smooth; /* Cuộn mượt mà */
}

.tab-header-scroll::-webkit-scrollbar {
    display: none; /* Ẩn thanh cuộn (Chrome/Safari) */
}

/* Thiết kế từng mục (Item) */
.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    cursor: pointer;
    min-width: 85px; /* Chiều rộng cố định cho mỗi tab */
    flex: 1; /* Chia đều không gian nếu màn hình rộng */
    color: white;
    gap: 6px; /* Khoảng cách giữa icon và chữ */
}

.tab-item i {
    font-size: 22px; /* Phóng to icon */
}

.tab-item span {
    font-size: 11px;
    font-weight: bold;
}

/* Hiệu ứng mục đang chọn (HOT NHẤT) */
.tab-item.active {
    /* Gradient chéo từ xanh đậm sang xanh nhạt như bản gốc */
    background: linear-gradient(135deg, #0f70d6 0%, #1ba0f7 100%);
    box-shadow: inset 0px -2px 5px rgba(0,0,0,0.1);
}

/* CSS riêng cho icon Nổ Hũ (Kết hợp chữ 777 và sao) */
.icon-text-combo {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}
.icon-text-combo i {
    font-size: 8px; /* Ngôi sao nhỏ xíu trên đầu */
    margin-bottom: 2px;
}
.icon-text-combo .text-777 {
    font-size: 18px;
    font-family: 'Arial Black', sans-serif;
    font-style: italic; /* Chữ 777 in nghiêng giống ảnh */
}
/* =========================================
   LƯỚI TRÒ CHƠI (ÉP CỨNG 4 CỘT)
   ========================================= */
.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Lệnh quan trọng nhất: Chia thành 4 cột bằng nhau */
    gap: 5px; /* Khoảng cách giữa các thẻ game */
    padding: 5px;
    background-color: #ffffff;
}

/* -- THIẾT KẾ BÊN TRONG TỪNG THẺ GAME (CARD) -- */
.game-card {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #00bfff; /* Đường viền màu xanh */
    display: flex;
    flex-direction: column;
}

/* Phần Hình Ảnh */
.game-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Phần Đáy: Tên Trò Chơi */
.card-bottom {
    background-color: #00bfff; /* Nền xanh dương */
    padding: 5px 2px;
    width: 100%;
    margin-top: auto; /* Tự động đẩy khối này xuống sát đáy phòng trường hợp các ảnh cao thấp khác nhau */
}

.card-bottom p {
    font-size: 9px; 
    font-weight: bold;
    color: white; /* Chữ màu trắng */
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Hiện dấu ... nếu tên quá dài */
}
/* =========================================
   BOTTOM NAVIGATION (Thanh điều hướng đáy)
   ========================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 500px; /* Khớp với app-wrapper */
    /* Dùng dải màu gradient giống bản gốc */
    background: linear-gradient(to right, #00bfff, #0073e6);
    display: flex;
    z-index: 100;
    /* Xóa padding ở đây để đẩy padding vào từng item con */
}

.nav-item {
    flex: 1; /* Bắt buộc 5 mục chia đều chính xác 100% chiều rộng */
    color: white;
    text-decoration: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0; /* Chuyển padding vào đây để nền màu phủ kín chiều cao */
    
    /* Đường kẻ viền mờ bên phải để phân cách các nút */
    border-right: 1px solid rgba(255, 255, 255, 0.2); 
}

/* Ẩn đường kẻ viền ở mục cuối cùng (ĐỔI QUÀ) cho đẹp */
.nav-item:last-child {
    border-right: none;
}

/* Tùy chỉnh Icon */
.nav-item i {
    font-size: 20px;
    margin-bottom: 4px; /* Khoảng cách giữa icon và chữ */
}

/* Tùy chỉnh chữ */
.nav-item span {
    font-size: 9px;
    font-weight: bold;
}

/* Hiệu ứng khi mục đó đang được chọn (Active) */
.nav-item.active {
    background-color: #1bc4ff; /* Màu xanh sáng hơn so với gradient nền */
}
/* =========================================
   GIAO DIỆN MODAL (POPUP ĐĂNG NHẬP/ĐĂNG KÝ)
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* Ẩn đi, chỉ hiện khi click bằng JS */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(to bottom, #d9f3ff, #8ae2ff);
    width: 90%;
    max-width: 400px; /* Vừa vặn như trên điện thoại */
    border-radius: 12px;
    padding: 20px 15px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-btn {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 24px; color: #0088cc;
    cursor: pointer;
}

/* Header Modal */
.modal-header { text-align: center; margin-bottom: 15px; }
.modal-logo { height: 40px; }
.slogan { font-size: 11px; font-weight: bold; color: #0088cc; font-style: italic; margin-bottom: 10px; }

.ambassador {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 10px; color: #333;
}
.ambassador-text { text-align: left; line-height: 1.4; }
.signature-img { height: 35px; } /* Thay ảnh chữ ký vào đây */

/* Nút Tab */
.modal-tabs {
    display: flex; background: white; border-radius: 25px;
    overflow: hidden; margin-bottom: 15px;
    border: 2px solid #00bfff;
}
.tab-btn {
    flex: 1; padding: 10px; border: none; background: white;
    color: #00bfff; font-weight: bold; cursor: pointer; transition: 0.3s;
}
.tab-btn.active { background: #00bfff; color: white; }

/* Form */
.auth-form { display: none; }
.auth-form.active { display: block; }

.input-group {
    background: white; border-radius: 8px;
    display: flex; align-items: center; padding: 10px;
    margin-bottom: 10px; border: 1px solid #ccebff;
}
.input-group i { color: #00bfff; margin-right: 10px; }
.input-group .icon-right { margin-right: 0; margin-left: auto; color: #333; cursor: pointer;}
.input-group input { border: none; outline: none; width: 100%; font-size: 13px; color: #555; }

/* Nút Submit */
.submit-btn {
    width: 100%; padding: 12px; border: none; border-radius: 25px;
    background: #00bfff; color: white; font-weight: bold; font-size: 16px;
    cursor: pointer; margin-top: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.submit-register { background: #4dd2ff; }

/* Checkbox & Các text phụ */
.checkbox-group { display: flex; align-items: center; font-size: 11px; color: #333; margin-bottom: 10px; }
.checkbox-group input { margin-right: 5px; }
.justify-center { justify-content: center; }
.security-text { font-size: 10px; color: #007bb5; text-align: center; margin-top: 10px; line-height: 1.5; }

/* Cờ VN giả lập */
.phone-prefix .flag-vn { display: inline-block; width: 16px; height: 11px; background: red; position: relative; margin-right: 5px; border-radius: 2px;}
.phone-prefix .flag-vn::after { content: '★'; color: yellow; font-size: 8px; position: absolute; top: -1px; left: 4px; }
.country-code { font-size: 13px; color: #555; margin-right: 5px; }