/* Thiết lập chung và Dark Mode */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0d1117; 
    color: #e6edf3; 
    margin: 0;
    padding-bottom: 70px; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Style (tùy chọn) */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1a1f24;
}
::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* 1. HEADER */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #161b22;
    border-bottom: 1px solid #2d3840;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.logo-text {
    color: #FFD700;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: 0.5px;
}
.header-icons i {
    font-size: 1.3rem;
    color: #90ee90;
    cursor: pointer;
    transition: color 0.2s ease;
}
.header-icons i:hover {
    color: #FFD700;
}

/* 2. BANNER */
.banner-section {
    padding: 15px;
}
.banner-placeholder {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}
.banner-image-real {
    width: 100%;
    height: auto;
    display: block;
}

/* 3. KHU VỰC ICON CHỨC NĂNG */
.function-icons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 25px 15px;
    margin-top: 15px;
    border-top: 1px solid #2d3840;
    border-bottom: 1px solid #2d3840;
    background-color: #161b22;
}
.grid-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.grid-item:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}
.grid-item i {
    background: linear-gradient(135deg, #2a0f5b, #4a0d6e);
    color: #e6edf3;
    border: none;
    padding: 15px;
    border-radius: 50%;
    font-size: 1.3rem;
    margin-bottom: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}
.grid-item.important i {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #161b22;
}
.grid-item p {
    margin: 0;
    font-size: 12px;
    color: #b0c2d4;
}

/* 4. DANH SÁCH GAME */
.game-listing {
    padding: 15px;
}
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
}
.game-header h3 {
    margin: 0;
    color: #FFD700;
    font-size: 18px;
    border-left: 3px solid #FFD700;
    padding-left: 10px;
}
.game-header span {
    color: #b0c2d4;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s ease;
}
.game-header span:hover {
    color: #FFD700;
}
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}
.game-card {
    background-color: #161b22;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.game-icon img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.game-card p {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #e6edf3;
}
.game-card .time {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 10px;
    color: #a0a0a0;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 3px 6px;
    border-radius: 5px;
}

/* 5. THANH ĐIỀU HƯỚNG DƯỚI (FOOTER) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: #161b22;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #2d3840;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.4);
    z-index: 999;
}
.nav-item {
    text-align: center;
    color: #8b949e;
    text-decoration: none;
    font-size: 11px;
    padding: 5px 0;
    width: 20%;
    transition: color 0.2s ease;
}
.nav-item i {
    font-size: 20px;
    display: block;
    margin-bottom: 4px;
}
.nav-item.active {
    color: #FFD700;
    font-weight: bold;
}
.nav-item:hover {
    color: #FFD700;
}

/* ********************************************** */
/* KHU VỰC HIỂN THỊ SỐ DƯ (TRANG CHỦ) */
/* ********************************************** */
.user-wallet-info-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #1a1a1a;
    border-bottom: 1px solid #2d3840;
    margin-top: -1px;
}

.user-profile {
    display: flex;
    align-items: center;
}

.home-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid #e6edf3;
}

.name-vip {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

#home-username {
    font-size: 14px;
    font-weight: 600;
    color: #e6edf3;
}

.home-vip-tag {
    font-size: 10px;
    font-weight: bold;
    color: #FFD700;
    background-color: #4a0d6e;
    padding: 1px 4px;
    border-radius: 4px;
    width: fit-content;
}

.wallet-balance {
    display: flex;
    align-items: center;
    background-color: #0d1117;
    padding: 8px 12px;
    border-radius: 6px;
}

.balance-label {
    font-size: 12px;
    color: #b0c2d4;
    margin-right: 5px;
}

.balance-amount {
    font-size: 16px;
    font-weight: 800;
    color: #90ee90;
}

.currency-symbol {
    font-size: 12px;
    color: #90ee90;
    margin-left: 4px;
}

.balance-toggle {
    margin-left: 8px;
    color: #b0c2d4;
    cursor: pointer;
}


/* ********************************************** */
/* THIẾT KẾ TRANG ĐĂNG NHẬP (login.html) */
/* ********************************************** */

.auth-container {
    background-color: #161b22;
    padding: 40px; 
    border-radius: 16px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 
                0 0 0 1px #2d3840; 
    transition: all 0.3s ease;
}

.auth-container:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
}

.logo-header {
    text-align: center;
    margin-bottom: 30px;
    font-size: 32px; 
    font-weight: 900;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#login-form h2, #register-form h2 {
    color: #e6edf3;
    text-align: center;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
}

.auth-container input {
    width: 100%;
    padding: 15px; 
    margin: 12px 0; 
    display: block;
    border: 1px solid #3d495a;
    border-radius: 8px; 
    box-sizing: border-box;
    background-color: #0d1117; 
    color: #e6edf3;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.auth-container input:focus {
    border-color: #FFD700; 
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    outline: none;
}
.auth-container input::placeholder {
    color: #6a737d;
}

.auth-container button {
    background: linear-gradient(90deg, #FFD700, #FFA500);
    color: #161b22;
    padding: 15px 20px;
    margin-top: 25px;
    border: none;
    border-radius: 8px;
    width: 100%;
    font-weight: bold;
    font-size: 17px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.auth-container button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

.auth-container p {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #b0c2d4;
}
.auth-container p a {
    color: #90ee90;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}
.auth-container p a:hover {
    color: #FFD700;
    text-decoration: underline;
}

.error-message {
    color: #ff4d4f;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 500;
}

/* ********************************************** */
/* STYLE RIÊNG CHO INPUT SỐ ĐIỆN THOẠI MỚI */
/* ********************************************** */

.phone-input-group {
    display: flex;
    gap: 10px; 
}

.country-code-select {
    padding: 15px 10px; 
    border: 1px solid #3d495a;
    border-radius: 8px;
    background-color: #0d1117;
    color: #e6edf3;
    font-size: 16px;
    box-sizing: border-box;
    width: 120px; 
    appearance: none; 
    cursor: pointer;
    transition: border-color 0.3s ease;
    margin: 12px 0; 
}
.country-code-select:focus {
    border-color: #FFD700; 
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    outline: none;
}

#register-phone {
    flex-grow: 1; 
    width: auto; 
    margin: 12px 0; 
}

/* Ghi đè CSS cho Liên kết đã truy cập */
a:link, a:visited, .menu-group-1 a.menu-item {
    color: #e6edf3 !important; 
    text-decoration: none !important;
}

/* Ghi đè màu icon và chữ cho mục Tài sản */
.menu-group-1 a.menu-item .menu-title {
    color: #e6edf3 !important; 
}
.menu-group-1 a.menu-item .menu-icon i {
    color: #FFD700 !important; 
}

/* Responsive adjustments */
@media (min-width: 600px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* ********************************************** */
/* STYLE CHO TRANG ADMIN */
/* ********************************************** */
.admin-header {
    background-color: #1a1a1a;
    color: #FFD700;
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid #3d495a;
}
.admin-header h1 {
    margin: 0;
    font-size: 28px;
}
.admin-content {
    padding: 20px;
    overflow-x: auto;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
    min-width: 900px; /* Đảm bảo bảng không bị co lại trên mobile */
}

.user-table th, .user-table td {
    border: 1px solid #2d3840;
    padding: 10px;
    text-align: left;
    white-space: nowrap;
}

.user-table th {
    background-color: #161b22;
    color: #b0c2d4;
    font-weight: 600;
    text-transform: uppercase;
}

.user-table tr:nth-child(even) {
    background-color: #1a1a1a;
}

.user-table td {
    color: #e6edf3;
}

.status-verified {
    color: #90ee90;
    font-weight: bold;
}

.status-unverified {
    color: #ff8c00;
}

#loading-message {
    text-align: center;
    padding: 50px;
    color: #b0c2d4;
}
/* ********************************************** */
/* STYLE RIÊNG CHO TRANG GAME DICE (ĐỎ ĐEN/TÀI XỈU) */
/* ********************************************** */

/* Cấu trúc chung và Header */
.game-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #161b22;
    border-bottom: 1px solid #2d3840;
    position: sticky;
    top: 0;
    z-index: 10;
}
.game-header .back-arrow {
    color: #e6edf3;
    font-size: 1.5rem;
    margin-right: 20px;
    cursor: pointer;
}
.game-header h2 {
    margin: 0;
    font-size: 18px;
    color: #FFD700;
    font-weight: 600;
    flex-grow: 1;
    text-align: center;
    transform: translateX(-15px); 
}
.game-header #history-btn {
     background-color: #3d495a;
     color: #e6edf3;
     padding: 8px 12px;
     border: none;
     border-radius: 6px;
     font-weight: bold;
     cursor: pointer;
     transition: transform 0.1s;
}
.game-header #history-btn:hover {
     transform: translateY(-1px);
}

.game-container {
    padding: 15px;
    flex-grow: 1;
}

/* Khu vực Số dư */
.wallet-action-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 20px;
    background-color: #161b22;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
.wallet-action-bar > div {
    font-size: 1.1rem;
    font-weight: 500;
    color: #b0c2d4;
}
#current-balance-display {
    font-size: 1.6rem;
    font-weight: bold;
    color: #90ee90;
    margin-left: 5px;
}

/* KHU VỰC TIMER VÀ DICE */
.top-info-area {
    background: linear-gradient(145deg, #161b22, #0d1117);
    padding: 20px 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid #2d3840;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}
.session-timer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
#game-status {
    font-size: 1.2rem;
    font-weight: 600;
    color: #b0c2d4;
}
#current-session-id {
    color: #FFD700;
}
#countdown-timer {
    font-size: 2.5rem; 
    font-weight: 900;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    letter-spacing: 1px;
}

/* XÚC XẮC VÀ KẾT QUẢ */
.dice-result-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}
.dice-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    min-height: 80px;
}
.dice {
    width: 50px;
    height: 50px;
    background-color: #4a4a7a;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8em;
    font-weight: bold;
    color: #ffffff;
    border: 2px solid #6a6ad0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.5s ease;
}
.dice.rolling {
    background-color: #ff9800; 
    animation: shake 0.2s infinite alternate;
}
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    100% { transform: translate(-1px, -1px) rotate(-1deg); }
}

#result-summary {
     font-size: 1.5rem;
     font-weight: bold;
     color: #90ee90;
     min-height: 1.5em;
}
.result-tags {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    font-size: 1em;
    font-weight: 600;
}
.result-tag {
    padding: 5px 10px;
    border-radius: 5px;
    background-color: #3d495a;
}

/* --- KHU VỰC ĐẶT CƯỢC --- */
.betting-area {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}
.bet-option {
    padding: 25px 10px;
    border-radius: 12px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    border: 3px solid transparent;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    text-align: center;
}
.bet-option:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.6);
}
.bet-option.selected {
    border-color: #FFD700;
    transform: scale(1.02);
}
#btn-tai { background: linear-gradient(145deg, #FF6347, #DC143C); } 
#btn-xiu { background: linear-gradient(145deg, #50C878, #2E8B57); } 
.bet-option.disabled { opacity: 0.5; cursor: not-allowed; }

/* Nút Cược Nhanh */
.quick-bet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px; 
    margin-bottom: 20px;
}
.quick-bet-grid button {
    padding: 12px 5px;
    background-color: #2d3840;
    color: #FFD700;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: background-color 0.1s;
}
.quick-bet-grid button:hover {
    background-color: #3d495a;
}
#btn-all-in {
    grid-column: span 3;
    background: linear-gradient(90deg, #B8860B, #FFC107); 
    color: #161b22;
}
#btn-confirm-bet {
    background: linear-gradient(90deg, #FFD700, #FFA500);
    color: #161b22;
    padding: 18px; 
    border: none;
    border-radius: 8px;
    width: 100%;
    font-weight: 900; 
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s;
}
#btn-confirm-bet:disabled {
    background: #555 !important;
    color: #999 !important;
    cursor: not-allowed;
    box-shadow: none;
}

/* KHU VỰC LỊCH SỬ CẦU MỚI */
.history-section {
    background-color: #1e1e3e;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid #3a3a6a;
}
.history-section h3 {
     color: #FFD700;
     margin-top: 0;
     margin-bottom: 10px;
     font-size: 1.2rem;
     text-align: center;
}
.history-grid {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    padding-bottom: 5px;
}
.history-item {
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}
/* Màu sắc cho Lịch sử Cầu */
.history-item.Lớn { background-color: #FF6347; }
.history-item.Nhỏ { background-color: #50C878; }
/* Màu cũ bị loại bỏ */
/* .history-item.Lẻ { background-color: #ff9800; } */
/* .history-item.Chẵn { background-color: #2196F3; } */