/* ============================================================ */
/* CSS - MINI GAMES - FULLY UPDATED WITH FIXES                 */
/* ============================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* FIX: Input text size - original size (13px) */
input, textarea, select {
    font-size: 13px !important;
    -webkit-text-size-adjust: 100% !important;
}

body {
    background: #0c102a;
    display: flex;
    justify-content: center;
    color: #fff;
    min-height: 100vh;
    overflow: hidden;
    height: 100vh;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

#networkError {
    position: fixed;
    inset: 0;
    background: #0c102a;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    padding: 20px;
    text-align: center;
}
#networkError.show { display: flex; }
.network-icon { font-size: 48px; color: #ef4444; margin-bottom: 10px; }
.network-title { font-size: 16px; font-weight: bold; color: #1e293b; margin-bottom: 4px; }
.network-desc { font-size: 12px; color: #64748b; max-width: 280px; line-height: 1.5; }

#screenLoading {
    position: fixed;
    inset: 0;
    background: #0c102a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease;
}
#screenLoading.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}
.loading-container { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.loading-title { font-size: 20px; font-weight: 900; color: #fff; letter-spacing: 2px; }
.loading-subtitle { font-size: 15px; font-weight: 900; color: #2f82ff; letter-spacing: 3px; text-transform: uppercase; }
.loading-spinner { width: 38px; height: 38px; border: 3px solid rgba(47,130,255,0.1); border-radius: 50%; border-top-color: #2f82ff; border-right-color: #2f82ff; animation: spinCircle 0.85s linear infinite; margin: 10px auto 0; }

#appWrapper {
    width: 100%;
    max-width: 414px;
    background: #171d4a;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ============================================================ */
/* APP CONTENT - FIXED SCROLLING                               */
/* ============================================================ */
.app-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 14px 75px 14px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-top: 10px;
    min-height: 0;
    height: 100%;
}
.app-content::-webkit-scrollbar { width: 0; background: transparent; }

/* ============================================================ */
/* SCREENS - Allow full scrolling                              */
/* ============================================================ */
.app-screen {
    display: none;
    width: 100%;
    min-height: 100%;
    height: auto;
}
.app-screen.active { display: block; }

/* Login and Register - normal screens inside app */
.app-screen.flex-center {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 20px;
    background: #171d4a;
}
.app-screen.flex-center.active {
    display: flex !important;
}

.app-screen.flex-center .auth-container {
    width: 100%;
    max-width: 340px;
    margin: auto;
}

/* ============================================================ */
/* HEADER                                                       */
/* ============================================================ */
.header {
    height: 52px;
    background: #171d4a;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
    z-index: 20;
}
.header-title { font-size: 16px; font-weight: 600; color: #fff; margin-left: 4px; flex: 1; }
.back-btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 4px; }
.back-btn img { width: 20px; height: 20px; }
.header-login-btn { background: #2a3478; color: #c5cee9; border: none; padding: 3px 10px; border-radius: 6px; font-size: 9px; font-weight: 600; cursor: pointer; }
.header-register-btn { background: linear-gradient(135deg, #fbbf24, #d97706); color: #171d4a; border: none; padding: 3px 10px; border-radius: 6px; font-size: 9px; font-weight: 600; cursor: pointer; }
.header-balance-box { display: flex; align-items: center; background: #21285c; padding: 3px 8px; border-radius: 16px; border: 1px solid #2a3478; font-size: 10px; gap: 3px; }
.balance-currency { color: #f39c12; font-weight: bold; }
.balance-amount { font-weight: bold; color: #fff; }
.balance-loader { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(47,130,255,0.2); border-radius: 50%; border-top-color: #2f82ff; animation: spinCircle 0.8s linear infinite; margin-left: 4px; vertical-align: middle; }
.refresh-btn { cursor: pointer; display: inline-flex; align-items: center; margin-left: 3px; }
.refresh-icon { width: 12px; height: 12px; }

/* ============================================================ */
/* BOTTOM NAV                                                   */
/* ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 414px;
    height: 60px;
    background: #12163b;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    z-index: 30;
    flex-shrink: 0;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    color: #6b769e;
    font-size: 8px;
    text-decoration: none;
    flex: 1;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 0;
}
.nav-item.active { color: #2f82ff; }
.nav-item svg { width: 18px; height: 18px; fill: currentColor; }
.nav-item.promotion-center { position: relative; top: -8px; }
.nav-text { font-size: 8px; }

.diamond-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(180deg, #2a82e4 0%, #2578db 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(42,130,228,0.5);
    border: 3px solid #171d4a;
}
.diamond-circle svg { width: 20px; height: 20px; fill: #fff; }
.promo-label { font-size: 8px; font-weight: 700; color: #2f82ff; margin-top: 1px; }

/* ============================================================ */
/* COMMON                                                       */
/* ============================================================ */
.card-navy { background: #21285c; border-radius: 12px; padding: 14px; margin-bottom: 12px; }

.btn-primary {
    background: linear-gradient(180deg, #2a82e4 0%, #2578db 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    text-align: center;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { background: #363c5d; color: #737c9e; cursor: not-allowed; }

.btn-outline {
    background: transparent;
    border: 1px solid #233e8c;
    color: #2f82ff;
    border-radius: 20px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    text-align: center;
}
.btn-outline:active { background: rgba(47,130,255,0.1); }

.text-muted { color: #8c95bf; }
.text-gold { color: #f39c12; }
.text-blue { color: #2f82ff; }
.text-xs { font-size: 10px; }
.text-sm { font-size: 12px; }
.cursor-pointer { cursor: pointer; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.hidden { display: none !important; }

/* ============================================================ */
/* AUTH CONTAINER                                               */
/* ============================================================ */
.auth-container {
    background: #21285c;
    border: 1px solid #2a3478;
    padding: 16px;
    border-radius: 14px;
    width: 100%;
    max-width: 340px;
}
.auth-header { text-align: center; margin-bottom: 12px; }
.auth-header h3 { font-size: 18px; font-weight: 600; color: #2f82ff; }
.auth-header p { font-size: 11px; color: #8c95bf; margin-top: 3px; }

.form-group { margin-bottom: 12px; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #c5cee9; margin-bottom: 4px; }
.label-svg { width: 15px; height: 15px; fill: #2f82ff; }

.phone-input-row { display: flex; gap: 6px; position: relative; }
.country-selector {
    background: #21285c;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    height: 40px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    gap: 4px;
    min-width: 60px;
    user-select: none;
    border: 1px solid #2a3478;
}
.country-dropdown {
    position: absolute;
    top: 44px;
    left: 0;
    width: 100%;
    max-width: 240px;
    background: #21285c;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 100;
    display: none;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}
.country-dropdown.show { display: block; }
.country-item { padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; color: #fff; font-size: 13px; cursor: pointer; background: #2a82e4; }
.country-item span { font-weight: 500; }

.input-box {
    background: #21285c;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    height: 40px;
    flex: 1;
    border: 1px solid #2a3478;
}
.input-box:focus-within { border-color: #2f82ff; }
.input-field {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 13px !important;
}
.input-field::placeholder { color: #586193; }

.password-input-wrapper { position: relative; width: 100%; }
.password-input-wrapper input { width: 100%; padding-right: 34px; }
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.password-toggle img { width: 16px; height: 16px; }

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.custom-checkbox {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1.5px solid #485280;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s, border-color 0.2s;
}
.checkbox-container.checked .custom-checkbox { border-color: #2f82ff; background-color: #2f82ff; }
.custom-checkbox::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    display: none;
    margin-bottom: 1px;
}
.checkbox-container.checked .custom-checkbox::after { display: block; }
.checkbox-label { font-size: 10px; color: #7b85a8; }

.tab-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #2f82ff;
    font-size: 13px;
    font-weight: 500;
    padding-bottom: 8px;
    border-bottom: 2px solid #2f82ff;
    margin-bottom: 14px;
}
.tab-header svg { fill: #2f82ff; width: 18px; height: 18px; }

/* ============================================================ */
/* GAME TABS                                                    */
/* ============================================================ */
.game-tabs { display: flex; gap: 3px; border-bottom: 1px solid #2a3478; margin-bottom: 8px; }
.game-tab-active { background: #2a3478; color: #2f82ff; font-weight: bold; border-bottom: 2px solid #2f82ff; padding: 5px 12px; border-radius: 6px 6px 0 0; font-size: 11px; border: none; cursor: pointer; }
.game-tab-inactive { color: #8c95bf; border-bottom: 2px solid transparent; padding: 5px 12px; border-radius: 6px 6px 0 0; cursor: pointer; font-size: 11px; background: transparent; border-top: none; border-left: none; border-right: none; }
.game-tab-inactive:hover { color: #c5cee9; }

/* ============================================================ */
/* BANNER - Home screen 3 image slider                         */
/* ============================================================ */
.banner-slider-h {
    display: flex;
    gap: 0;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
    height: 180px;
    margin-bottom: 8px;
    background: #0a0d24;
}
.banner-slider-h .banner-track {
    display: flex;
    transition: transform 0.7s ease-in-out;
    height: 100%;
    width: 100%;
}
.banner-slider-h .banner-card {
    flex: 0 0 100%;
    height: 100%;
    border-radius: 0;
    overflow: hidden;
    background: #0a0d24;
    border: none;
}
.banner-slider-h .banner-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0a0d24;
}

/* Activity screen banner - single image, no scroll */
.banner-slider-v {
    display: block;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 10px;
    background: #0a0d24;
}
.banner-slider-v .banner-card {
    width: 100%;
    border-radius: 0;
    overflow: hidden;
    background: #0a0d24;
    border: none;
}
.banner-slider-v .banner-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: #0a0d24;
}

/* ============================================================ */
/* MARQUEE / SLIDE TEXT                                        */
/* ============================================================ */
.slide-text-container {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    background: rgba(33,40,92,0.6);
    border: 1px solid #2a3478;
    border-radius: 6px;
    padding: 4px 10px;
    margin-bottom: 10px;
}
.slide-text {
    display: inline-block;
    animation: slideText 20s linear infinite;
    font-size: 10px;
    color: #60a5fa;
}
.slide-text i { margin-right: 4px; }

/* ============================================================ */
/* WINNER                                                       */
/* ============================================================ */
.winner-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 4px 0;
}
.winner-title svg { fill: #2f82ff; width: 18px; height: 18px; }

.winner-podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 10px 0 20px 0;
    gap: 6px;
}
.winner-podium-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.winner-podium-col.rank-2 { width: 28%; }
.winner-podium-col.rank-1 { width: 34%; z-index: 2; margin-bottom: 10px; }
.winner-podium-col.rank-3 { width: 28%; }

.winner-avatar-wrapper { position: relative; margin-bottom: -12px; z-index: 5; }
.winner-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2f82ff;
    background: #21285c;
}
.rank-1 .winner-avatar { width: 56px; height: 56px; border: 3px solid #f39c12; }
.winner-rank-badge {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: #2f82ff;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 0px 6px;
    border-radius: 10px;
    border: 1px solid #171d4a;
}
.rank-1 .winner-rank-badge { background: #f39c12; }
.rank-3 .winner-rank-badge { background: #e67e22; }

.winner-pillar {
    width: 100%;
    border-radius: 12px 12px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    padding-bottom: 8px;
    background: #21285c;
    border: 1px solid rgba(255,255,255,0.08);
}
.rank-1 .winner-pillar { height: 140px; border-color: rgba(243,156,18,0.4); }
.rank-2 .winner-pillar { height: 110px; }
.rank-3 .winner-pillar { height: 100px; }
.winner-pillar-name { font-size: 11px; font-weight: 600; color: #fff; margin-bottom: 2px; text-align: center; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winner-pillar-rank-num { font-size: 16px; font-weight: 800; opacity: 0.3; color: #fff; }
.winner-pillar-amount { font-size: 10px; font-weight: 700; color: #2f82ff; text-align: center; }
.rank-1 .winner-pillar-amount { font-size: 12px; color: #f39c12; }

.winner-leaderboard-list {
    background: #21285c;
    border-radius: 16px 16px 0 0;
    padding: 8px 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.winner-leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.winner-leaderboard-item:last-child { border-bottom: none; }
.winner-leaderboard-left { display: flex; align-items: center; gap: 10px; }
.winner-rank-number { font-size: 13px; font-weight: 700; color: #2f82ff; width: 14px; text-align: center; }
.winner-list-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #2a3478; }
.winner-list-username { font-size: 12px; font-weight: 600; color: #fff; }
.winner-list-amount { font-size: 12px; font-weight: 700; color: #2f82ff; }

/* ============================================================ */
/* ACCOUNT                                                      */
/* ============================================================ */
.account-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.account-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-name { font-size: 16px; font-weight: 600; color: #fff; }
.account-uid-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; background: rgba(243,156,18,0.12); padding: 2px 10px; border-radius: 10px; width: fit-content; }
.uid-label { font-size: 12px; color: #f39c12; }
.uid-value { font-family: monospace; color: #f39c12; }
.account-last-login { font-size: 10px; color: #7b85a8; margin-top: 2px; }

.balance-card {
    background: linear-gradient(135deg, #252e6a 0%, #21285c 100%);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}
.balance-label { font-size: 12px; color: #8c95bf; margin-bottom: 4px; }
.balance-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.balance-amount-large { font-size: 24px; font-weight: 700; color: #fff; }

.action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.action-item { text-align: center; cursor: pointer; }
.action-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
}
.action-icon.wallet { background: rgba(235,77,75,0.2); }
.action-icon.deposit { background: rgba(240,147,43,0.2); }
.action-icon.withdraw { background: rgba(46,134,222,0.2); }
.action-icon.vip { background: rgba(16,172,137,0.2); }
.action-icon svg { width: 18px; height: 18px; }
.action-label { font-size: 9px; color: #c5cee9; }

.history-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.history-item-card {
    background: #21285c;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
}
.history-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.history-icon.deposit-icon { background: rgba(235,77,75,0.2); }
.history-icon.withdraw-icon { background: rgba(240,147,43,0.2); }
.history-title { font-size: 13px; font-weight: 600; color: #fff; }
.history-sub { font-size: 9px; color: #7b85a8; }

.list-section {
    background: #21285c;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 12px;
}
.list-item {
    padding: 14px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    width: 100%;
    gap: 10px;
}
.list-item:last-child { border-bottom: none; }
.list-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.list-icon { width: 20px; height: 20px; fill: #2f82ff; flex-shrink: 0; }
.list-text { font-size: 13px; color: #c5cee9; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; margin-right: 12px; }
.list-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.service-card {
    background: #21285c;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
}
.service-title { font-size: 13px; font-weight: 600; color: #ffffff; margin-bottom: 12px; }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); row-gap: 14px; column-gap: 6px; text-align: center; }
.service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.service-icon { width: 24px; height: 24px; fill: #2f82ff; }
.service-label { font-size: 10px; color: #c5cee9; }

.btn-logout {
    width: 100%;
    height: 44px;
    border-radius: 22px;
    border: 1px solid #233e8c;
    background: transparent;
    color: #2f82ff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 12px;
    transition: background 0.2s;
}
.btn-logout:active { background: rgba(47,130,255,0.1); }
.logout-icon { width: 18px; height: 18px; stroke: #2f82ff; fill: none; stroke-width: 2; }
.version-text { text-align: center; font-size: 8px; color: #8c95bf; padding-top: 4px; }

/* ============================================================ */
/* VIP BADGE                                                    */
/* ============================================================ */
.vip-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 26px;
    background: #2a3478;
    border-radius: 4px;
    border: 1px solid rgba(243,156,18,0.3);
    overflow: hidden;
    flex-shrink: 0;
}
.vip-badge img { width: 100%; height: 100%; object-fit: contain; display: block; }
.vip-badge-loading { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(243,156,18,0.2); border-radius: 50%; border-top-color: #f39c12; animation: spinCircle 0.8s linear infinite; }

.profile-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2f82ff;
    flex-shrink: 0;
    background: #2a3478;
    cursor: pointer;
}

/* ============================================================ */
/* WALLET                                                       */
/* ============================================================ */
.wallet-balance-card {
    background: #252e6a;
    border-radius: 12px;
    text-align: center;
    padding: 16px;
    margin-bottom: 12px;
}
.wallet-balance-label { color: #8c95bf; font-size: 11px; }
.wallet-balance-amount { font-size: 22px; font-weight: bold; color: #fff; }

.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.wallet-action {
    background: #21285c;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
}
.wallet-action-icon { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.wallet-action-title { font-weight: 600; font-size: 12px; color: #fff; }
.wallet-action-sub { font-size: 9px; color: #8c95bf; }

/* ============================================================ */
/* ACTIVITY                                                     */
/* ============================================================ */
.activity-grid { display: flex; gap: 10px; margin-bottom: 12px; }
.activity-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.activity-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(47,130,255,0.15);
    border: 1px solid rgba(47,130,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.activity-label { font-size: 9px; color: #c5cee9; text-align: center; line-height: 1.2; }

.activity-grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.activity-card {
    background: #21285c;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
}
.activity-card-icon {
    width: 100%;
    height: 60px;
    background: linear-gradient(135deg, #2a82e4, #171d4a);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.activity-card-title { font-size: 12px; font-weight: 600; color: #fff; }
.activity-card-desc { font-size: 9px; color: #8c95bf; }

/* ============================================================ */
/* PROMOTION - NEW AGENT UI                                     */
/* ============================================================ */

/* Hero Banner */
.promo-hero-banner {
    background: linear-gradient(180deg, #184391 0%, #0d2352 100%);
    margin: 8px 0 16px 0;
    border-radius: 16px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.promo-hero-amount {
    font-size: 34px;
    font-weight: bold;
    color: #ffbe1a;
    text-shadow: 0 2px 10px rgba(255, 190, 26, 0.3);
    margin-bottom: 5px;
}

.promo-hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 18px;
    border-radius: 20px;
    font-size: 13px;
    margin: 6px 0;
    backdrop-filter: blur(5px);
    color: #ffffff;
}

.promo-hero-subtext {
    font-size: 13px;
    color: #8e9bb0;
    margin-top: 5px;
}

/* Stats Container */
.promo-stats-container {
    background: #141e38;
    margin: 16px 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #24345c;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.promo-stats-header {
    background: linear-gradient(90deg, #182544, #1c2a4f);
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    padding: 14px;
    color: #00c6ff;
    border-bottom: 1px solid #24345c;
    letter-spacing: 0.5px;
}

.promo-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 18px;
    gap: 15px;
}

.promo-stat-box {
    text-align: center;
    background: #182645;
    padding: 16px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
    transition: transform 0.3s ease;
}

.promo-stat-box:active {
    transform: scale(0.96);
}

.promo-stat-val {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 6px;
}

.promo-stat-lbl {
    font-size: 12px;
    color: #8e9bb0;
    line-height: 1.4;
}

/* Invite Button */
.promo-invite-btn-large {
    background: linear-gradient(90deg, #1e62d0, #00c6ff);
    margin: 0 0 20px 0;
    padding: 15px;
    text-align: center;
    border-radius: 25px;
    font-weight: bold;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 198, 255, 0.3);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.promo-invite-btn-large:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 198, 255, 0.3);
}

/* Menu List */
.promo-menu-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.promo-menu-item {
    background: #141e38;
    border: 1px solid #24345c;
    padding: 14px 16px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.2s;
}

.promo-menu-item:active {
    background: #1c2a4f;
}

.promo-menu-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.promo-menu-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #1e2c4f;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00c6ff;
    font-size: 16px;
}

.promo-menu-text {
    font-size: 14px;
    color: #ffffff;
    font-weight: 500;
}

.promo-menu-right {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8e9bb0;
    font-size: 13px;
}

.promo-copy-btn-icon {
    color: #00c6ff;
    font-size: 16px;
}

/* ============================================================ */
/* INVITE RULES SCREEN                                          */
/* ============================================================ */
.invite-rules-card {
    background: #141836;
    border: 1px solid rgba(0,198,255,0.15);
    border-radius: 16px;
    margin-top: 20px;
    margin-bottom: 24px;
    padding: 28px 20px 20px 20px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.invite-rules-tab {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #0072ff, #00c6ff);
    color: #fff;
    padding: 6px 36px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 20px;
    border: 3px solid #0b0e27;
    box-shadow: 0 4px 10px rgba(0,114,255,0.4);
    letter-spacing: 1px;
}

.invite-rules-text {
    font-size: 14px;
    color: #d1d5db;
    line-height: 1.75;
    text-align: left;
}

.invite-rules-highlight {
    color: #ef4444;
    font-weight: 600;
    display: inline-block;
    margin-top: 10px;
    cursor: pointer;
}

.invite-rules-vip-table {
    background: #141836;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #242b5c;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    width: 100%;
}

.invite-rules-vip-table table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 12px;
}

.invite-rules-vip-table th {
    background: rgba(0,198,255,0.1);
    color: #00c6ff;
    padding: 12px 6px;
    font-weight: 600;
    border-bottom: 1px solid #242b5c;
}

.invite-rules-vip-table td {
    padding: 10px 4px;
    color: #e5e7eb;
    border-bottom: 1px solid rgba(36,43,92,0.5);
}

.invite-rules-vip-table tr:last-child td {
    border-bottom: none;
}

.invite-rules-vip-table tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

.vip-badge-tag {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 10px;
    color: #fff;
    gap: 3px;
}

.vip-badge-tag i {
    font-size: 9px;
    color: #fffde7;
}

/* ============================================================ */
/* DOWNLINE SEARCH - NEW UI                                     */
/* ============================================================ */
.downline-search-container {
    background: #21285c;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.downline-search-header {
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid #2a3478;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.downline-search-title {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    flex: 1;
    text-align: center;
    margin-right: 20px;
}

.downline-search-box {
    display: flex;
    gap: 6px;
}

.downline-search-input {
    flex: 1;
    background: #1a1f4a;
    border: 1px solid #2a3478;
    border-radius: 6px;
    padding: 6px 10px;
    color: #fff;
    font-size: 13px !important;
    outline: none;
}

.downline-search-input:focus {
    border-color: #2f82ff;
}

.downline-search-btn {
    width: auto;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11px;
    background: linear-gradient(180deg, #2a82e4 0%, #2578db 100%);
    color: #fff;
    border: none;
    cursor: pointer;
}

.downline-search-result {
    margin-top: 8px;
    display: none;
    background: #1a1f4a;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #2a3478;
    color: #c5cee9;
    font-size: 11px;
    text-align: center;
}

/* ============================================================ */
/* NEW DOWNLINE - FIXED: scrollbar hidden, enhanced styling    */
/* ============================================================ */
#screenNewDownline .filter-btn-active {
    background: linear-gradient(135deg, #2a82e4, #1a6bc4) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 10px rgba(42, 130, 228, 0.3) !important;
}

#screenNewDownline .filter-btn-inactive {
    background: #1a1f4a !important;
    color: #8c95bf !important;
    border: 1px solid #2a3478 !important;
}

#screenNewDownline .filter-btn-inactive:hover {
    background: #252d5a !important;
    color: #c5cee9 !important;
}

#downlineListView {
    max-height: 320px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding-right: 4px;
}

#downlineListView::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.downline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1f4a;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #2a3478;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.downline-item:active {
    transform: scale(0.98);
    background: #222a5a;
}

.downline-item .uid {
    color: #2f82ff;
    font-weight: 600;
    font-size: 14px;
}

.downline-item .time {
    color: #586193;
    font-size: 11px;
    white-space: nowrap;
}

.downline-item .phone {
    color: #8c95bf;
    font-size: 12px;
}

/* ============================================================ */
/* COMMISSION RATIO                                              */
/* ============================================================ */
.commission-filter-tabs {
    display: flex;
    gap: 4px;
    margin: 8px 0 12px 0;
    border-bottom: 1px solid #2a3478;
    padding-bottom: 4px;
}
.comm-tab-active {
    background: #2a3478;
    color: #2f82ff;
    font-weight: bold;
    border-bottom: 2px solid #2f82ff;
    padding: 4px 14px;
    border-radius: 6px 6px 0 0;
    font-size: 11px;
    border: none;
    cursor: pointer;
}
.comm-tab-inactive {
    color: #8c95bf;
    border-bottom: 2px solid transparent;
    padding: 4px 14px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 11px;
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
}
.comm-tab-inactive:hover { color: #c5cee9; }

.commission-content { margin-top: 6px; }
.commission-subtitle { font-size: 11px; color: #8c95bf; margin-bottom: 8px; }
.commission-level-item {
    background: #1a1f4a;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #2a3478;
}
.level-name { font-size: 12px; font-weight: 600; color: #fff; }
.level-rate { font-size: 12px; font-weight: 700; color: #2f82ff; }
.commission-info {
    font-size: 9px;
    color: #586193;
    margin-top: 8px;
    padding: 8px;
    background: #1a1f4a;
    border-radius: 6px;
    border: 1px solid #2a3478;
}

/* ============================================================ */
/* VIP                                                          */
/* ============================================================ */
.vip-user-banner {
    background: linear-gradient(135deg, #252e6a 0%, #171d4a 100%);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px 12px 0 0;
}
.vip-user-banner .avatar-wrapper {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #f39c12;
    flex-shrink: 0;
    background: #21285c;
}
.vip-user-banner .avatar-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.vip-username-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vip-username { font-size: 15px; font-weight: 600; color: #fff; }
.vip-level-img-badge { width: 28px; height: 28px; object-fit: contain; }

.vip-user-banner .user-info { display: flex; flex-direction: column; gap: 4px; }
.exp-payout-row { display: flex; gap: 8px; flex-wrap: wrap; }
.info-badge {
    background: #21285c;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    color: #f39c12;
    border: 1px solid rgba(243,156,18,0.2);
}

.vip-notice {
    padding: 8px 12px;
    background: #21285c;
    margin: 8px 0;
    border-radius: 8px;
    font-size: 10px;
    color: #8c95bf;
    border: 1px solid rgba(255,255,255,0.05);
}

.vip-slider-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 12px 0;
    scroll-behavior: smooth;
    cursor: grab;
    user-select: none;
}
.vip-slider-container:active { cursor: grabbing; }
.vip-slider-container::-webkit-scrollbar { height: 3px; }
.vip-slider-container::-webkit-scrollbar-track { background: #2a3478; border-radius: 4px; }
.vip-slider-container::-webkit-scrollbar-thumb { background: #2f82ff; border-radius: 4px; }

.vip-card {
    flex: 0 0 260px;
    scroll-snap-align: center;
    background: linear-gradient(135deg, #323d8c 0%, #1f275c 100%);
    border-radius: 14px;
    padding: 14px;
    border: 1px solid rgba(243,156,18,0.3);
    min-width: 240px;
    cursor: pointer;
    transition: transform 0.2s;
}
.vip-card:active { transform: scale(0.97); }
.vip-card .vip-title-tag { font-size: 16px; font-weight: 700; color: #f39c12; }
.vip-card .vip-status-pill { font-size: 9px; padding: 1px 8px; border-radius: 8px; }
.vip-card .vip-req-text { font-size: 10px; color: #c5cee9; margin: 4px 0; }

.vip-benefits-section { padding: 0 2px; margin-top: 10px; }
.vip-benefits-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.vip-benefits-title svg { fill: #2ecc71; width: 16px; height: 16px; }

.vip-benefits-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.vip-benefit-card {
    background: #21285c;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(255,255,255,0.05);
    min-height: 130px;
}
.vip-benefit-card .card-top-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.vip-benefit-card .reward-amount-badge { background: rgba(243,156,18,0.15); color: #f39c12; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; }
.vip-benefit-card .reward-icon-box { width: 24px; height: 24px; background: rgba(46,204,113,0.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.vip-benefit-card .reward-icon-box svg { width: 14px; height: 14px; fill: #2ecc71; }
.vip-benefit-card .card-middle { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.vip-benefit-card .card-title { font-size: 12px; font-weight: 600; color: #fff; }
.vip-benefit-card .card-desc { font-size: 9px; color: #8c95bf; line-height: 1.3; }

.btn-claim-status {
    width: 100%;
    padding: 6px 0;
    border-radius: 16px;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
}
.btn-claim-status.unclaimed {
    background: linear-gradient(180deg, #2a82e4 0%, #2578db 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(42,130,228,0.4);
}
.btn-claim-status.claimed {
    background: #2f365d;
    color: #7b85a8;
    cursor: not-allowed;
    opacity: 0.7;
}
.btn-claim-status.unclaimed:active { transform: scale(0.95); }
.btn-claim-status:disabled { background: #2f365d; color: #7b85a8; cursor: not-allowed; opacity: 0.6; }

/* ============================================================ */
/* DEPOSIT & WITHDRAW HISTORY                                   */
/* ============================================================ */
.payment-tabs-wrapper {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.payment-tabs-wrapper::-webkit-scrollbar { display: none; }

.payment-tab {
    background-color: #141836;
    border: 1px solid #242b5c;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: #9ba4b5;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.payment-tab.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}
.payment-tab .tab-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.filter-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.select-box {
    flex: 1;
    background-color: #141836;
    border: 1px solid #242b5c;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #ffffff;
    cursor: pointer;
}
.select-box i {
    color: #9ba4b5;
    font-size: 12px;
}

.record-card {
    background-color: #141836;
    border: 1px solid #242b5c;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(36, 43, 92, 0.6);
}

.badge-deposit {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.badge-withdraw {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.status-text {
    font-size: 13px;
    font-weight: 600;
}
.status-approved { color: #10b981; }
.status-pending { color: #f59e0b; }
.status-rejected { color: #ef4444; }

.record-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
}

.row-label { color: #9ba4b5; }
.row-value { color: #ffffff; font-weight: 500; }
.row-value.amount { color: #f3b134; font-weight: bold; font-size: 14px; }

.row-value.order-no {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: monospace;
    font-size: 12px;
    color: #d1d5db;
}

.copy-icon { color: #9ba4b5; cursor: pointer; }
.copy-icon:hover { color: #10b981; }

.no-more-data {
    text-align: center;
    color: #9ba4b5;
    font-size: 13px;
    margin-top: 25px;
    margin-bottom: 15px;
}

/* ============================================================ */
/* MODAL / BOTTOM SHEET                                         */
/* ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.bottom-sheet {
    width: 100%;
    max-width: 480px;
    background-color: #141836;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-top: 1px solid #242b5c;
    padding: 15px 20px 25px;
    transform: translateY(100%);
    transition: transform 0.2s cubic-bezier(0, 0, 0.2, 1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.8);
}

.modal-overlay.active .bottom-sheet {
    transform: translateY(0);
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #242b5c;
}

.sheet-cancel-btn {
    color: #9ba4b5;
    cursor: pointer;
    font-size: 14px;
}

.sheet-title {
    font-size: 15px;
    font-weight: 500;
    color: #ffffff;
}

.sheet-confirm-btn {
    color: #10b981;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.picker-container {
    display: flex;
    justify-content: space-around;
    height: 180px;
    position: relative;
    margin-top: 10px;
    overflow: hidden;
}

.picker-highlight {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 40px;
    margin-top: -20px;
    border-top: 1px solid #242b5c;
    border-bottom: 1px solid #242b5c;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.picker-column {
    flex: 1;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    text-align: center;
}

.picker-column::-webkit-scrollbar {
    display: none;
}

.picker-item {
    height: 40px;
    line-height: 40px;
    font-size: 14px;
    color: #9ba4b5;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    transition: color 0.1s, font-size 0.1s;
    cursor: pointer;
    white-space: nowrap;
}

.picker-item.selected {
    color: #ffffff;
    font-weight: bold;
    font-size: 16px;
}

.picker-spacer {
    height: 70px;
}

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 3000;
    display: none;
}

/* ============================================================ */
/* DEPOSIT                                                      */
/* ============================================================ */
.deposit-title {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid #2a3478;
    padding-bottom: 8px;
}
.form-label { font-size: 9px; color: #8c95bf; display: block; margin-bottom: 3px; }
.form-select {
    width: 100%;
    background: #1a1f4a;
    border: 1px solid #2a3478;
    padding: 6px 10px;
    border-radius: 6px;
    color: #c5cee9;
    font-size: 13px !important;
    outline: none;
    appearance: none;
}
.form-input {
    width: 100%;
    background: #1a1f4a;
    border: 1px solid #2a3478;
    padding: 6px 10px;
    border-radius: 6px;
    color: #fff;
    font-size: 13px !important;
    outline: none;
}
.form-input::placeholder { color: #586193; }

.deposit-gateway-info {
    background: #1a1f4a;
    padding: 8px;
    border-radius: 6px;
    border: 1px dashed #2a3478;
    font-size: 10px;
    margin-bottom: 8px;
}
.gateway-header { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.gateway-logo { width: 20px; height: 20px; object-fit: contain; }
.gateway-name { font-weight: bold; color: #fff; }
.gateway-detail { color: #8c95bf; }
.gateway-value { color: #c5cee9; font-weight: bold; }
.gateway-number-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #21285c;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #2a3478;
    margin-top: 3px;
}
.gateway-number { font-family: monospace; color: #2f82ff; font-weight: bold; }
.copy-icon { width: 10px; height: 10px; }

.deposit-submit { background: linear-gradient(135deg, #10b981, #059669); font-size: 11px; padding: 6px; }

/* ============================================================ */
/* WITHDRAW                                                     */
/* ============================================================ */
.withdraw-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #2a3478;
    padding-bottom: 8px;
}
.withdraw-title {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}
.edit-bank-btn {
    color: #2f82ff;
    font-size: 10px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
}

.bank-display {
    background: #1a1f4a;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #2a3478;
    margin-top: 8px;
}
.bank-display-header { display: flex; align-items: center; gap: 4px; }
.bank-display-icon { width: 20px; height: 20px; object-fit: contain; }
.bank-display-name { font-weight: bold; color: #fff; }
.bank-display-detail { font-size: 10px; color: #8c95bf; }
.bank-display-value { color: #c5cee9; }
.bank-display-number { font-family: monospace; }

.bank-select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%238c95bf' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 34px;
}

.withdraw-info-box {
    background: #1a1f4a;
    border: 1px solid #2a3478;
    border-radius: 6px;
    padding: 8px;
    font-size: 9px;
    color: #8c95bf;
    margin-bottom: 8px;
}
.withdraw-info-box p { margin: 2px 0; }
.withdraw-info-box .highlight { color: #fbbf24; font-weight: bold; }

.withdraw-submit { background: linear-gradient(135deg, #f59e0b, #d97706); font-size: 11px; padding: 6px; }

/* ============================================================ */
/* COMMON UI                                                    */
/* ============================================================ */
.screen-header {
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid #2a3478;
    padding-bottom: 8px;
}
.screen-title {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    flex: 1;
    text-align: center;
    margin-right: 20px;
}

.filter-tabs { display: flex; gap: 4px; margin: 8px 0; flex-wrap: wrap; }
.filter-icon { width: 12px; height: 12px; display: inline; vertical-align: middle; margin-right: 3px; }

.bank-setup-card { width: 100%; max-width: 320px; }
.bank-setup-title { font-size: 13px; font-weight: bold; color: #2f82ff; border-bottom: 1px solid #2a3478; padding-bottom: 8px; }
.bank-save-btn { background: linear-gradient(135deg, #fbbf24, #d97706); color: #171d4a; font-size: 11px; padding: 6px; }

.setting-list { margin-top: 8px; }
.setting-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 4px;
    cursor: pointer;
    border-radius: 6px;
}
.setting-item.disabled { opacity: 0.5; cursor: not-allowed; }
.setting-label { color: #c5cee9; font-size: 11px; }
.setting-label i { margin-right: 8px; }

.password-change-card { width: 100%; max-width: 320px; }
.password-field { position: relative; margin-bottom: 8px; }
.password-field .form-input { padding-right: 32px; }
.password-submit { background: linear-gradient(135deg, #fbbf24, #d97706); color: #171d4a; font-size: 11px; padding: 6px; }

.nickname-change-card { width: 100%; max-width: 320px; }
.nickname-submit { background: linear-gradient(135deg, #fbbf24, #d97706); color: #171d4a; font-size: 11px; padding: 6px; }

.language-change-card { width: 100%; max-width: 320px; }
.language-options { margin-top: 8px; }
.language-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #1a1f4a;
    border-radius: 6px;
    margin-bottom: 4px;
}
.language-option.active { border: 1px solid #2f82ff; }
.language-option.disabled { opacity: 0.5; }
.language-name { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.language-flag { width: 16px; height: 16px; }

.notification-item {
    background: #1a1f4a;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-left: 3px solid #2f82ff;
}
.notification-item .notif-body { display: flex; align-items: flex-start; gap: 10px; }
.notification-item .notif-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notification-item .notif-icon svg { width: 14px; height: 14px; fill: currentColor; }
.notification-item .notif-content { flex: 1; }
.notification-item .notif-title { font-size: 13px; font-weight: 600; color: #fff; }
.notification-item .notif-desc { font-size: 11px; color: #8c95bf; margin-top: 2px; line-height: 1.4; }
.notification-item .notif-time { font-size: 9px; color: #586193; margin-top: 4px; display: block; }

.gift-image { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; margin-top: 8px; }
.gift-message { margin-top: 8px; font-size: 11px; color: #c5cee9; }
.gift-message p { margin: 4px 0; }
.gift-input-row { display: flex; gap: 4px; margin-top: 8px; }
.gift-input {
    flex: 1;
    background: #1a1f4a;
    border: 1px solid #2a3478;
    padding: 6px 10px;
    border-radius: 6px;
    color: #fff;
    font-size: 13px !important;
    outline: none;
}
.gift-redeem-btn {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #171d4a;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
}
.gift-history-section { margin-top: 10px; }
.gift-history-title { font-size: 9px; font-weight: bold; color: #8c95bf; border-bottom: 1px solid #2a3478; padding-bottom: 4px; }
#giftHistoryList { margin-top: 4px; max-height: 110px; overflow-y: auto; }

.customer-service-bg { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; margin-top: 8px; }
.telegram-links { margin-top: 10px; }
.telegram-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #21285c;
    border: 1px solid #2a3478;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}
.telegram-link:hover { border-color: #2f82ff; }
.telegram-icon { width: 28px; height: 28px; object-fit: contain; }
.telegram-text { color: #c5cee9; font-weight: bold; font-size: 12px; }
.ml-auto { margin-left: auto; }

.profile-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    overflow: hidden;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
}
.profile-options-grid::-webkit-scrollbar { display: none; }
.profile-option-item {
    background: #21285c;
    border: 1px solid #2a3478;
    border-radius: 10px;
    padding: 6px 4px;
    text-align: center;
    cursor: pointer;
}
.profile-option-item.selected { border-color: #2f82ff; background: #2a3478; }
.profile-option-item img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; margin: 0 auto 3px; border: 2px solid transparent; }
.profile-option-item.selected img { border-color: #2f82ff; }
.profile-option-item .check-mark { display: none; color: #2f82ff; font-size: 12px; }
.profile-option-item.selected .check-mark { display: inline-block; }
.profile-save-btn { background: linear-gradient(135deg, #fbbf24, #d97706); color: #171d4a; font-size: 11px; padding: 6px; margin-top: 8px; }

/* ============================================================ */
/* DIALOGS                                                      */
/* ============================================================ */
.custom-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.custom-dialog-overlay.hidden { display: none !important; }
.custom-dialog-box {
    background: #21285c;
    border: 1px solid #2a3478;
    border-radius: 14px;
    padding: 20px;
    max-width: 340px;
    width: 100%;
    text-align: center;
}
.dialog-icon { width: 38px; height: 38px; margin: 0 auto 8px; display: block; object-fit: contain; }
.dialog-title { font-size: 14px; font-weight: bold; color: #fff; margin-bottom: 4px; }
.dialog-msg { font-size: 11px; color: #8c95bf; margin-bottom: 14px; line-height: 1.4; }
.dialog-btn {
    background: linear-gradient(135deg, #2a82e4 0%, #2578db 100%);
    color: #fff;
    font-weight: bold;
    padding: 8px 0;
    border-radius: 10px;
    width: 100%;
    border: none;
    font-size: 12px;
    cursor: pointer;
}

/* ============================================================ */
/* SESSION EXPIRED DIALOG                                      */
/* ============================================================ */
.session-expired-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    flex-direction: column;
}
.session-expired-overlay.show {
    display: flex !important;
}
.session-expired-overlay.hidden {
    display: none !important;
}
.session-expired-box {
    background: #21285c;
    border: 1px solid rgba(47,130,255,0.3);
    border-radius: 12px;
    padding: 16px 18px 18px 18px;
    max-width: 280px;
    width: 100%;
    text-align: center;
    animation: fadeInScale 0.25s ease;
}
.session-expired-icon {
    font-size: 28px;
    margin-bottom: 4px;
    display: flex;
    justify-content: center;
}
.session-expired-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}
.session-expired-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.3;
}
.session-expired-desc {
    font-size: 10px;
    color: #8c95bf;
    margin-bottom: 12px;
    line-height: 1.4;
}
.se-btn {
    background: linear-gradient(135deg, #2a82e4 0%, #2578db 100%);
    color: #fff;
    font-weight: 600;
    padding: 7px 0;
    border-radius: 8px;
    width: 100%;
    border: none;
    font-size: 12px;
    cursor: pointer;
}
.se-btn:active { transform: scale(0.97); }

@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* ============================================================ */
/* OTHER DIALOGS                                                */
/* ============================================================ */
.insufficient-balance-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.insufficient-balance-overlay.hidden { display: none !important; }
.insufficient-balance-box {
    background: #21285c;
    border: 1px solid #2a3478;
    border-radius: 14px;
    padding: 20px;
    max-width: 300px;
    width: 100%;
    text-align: center;
}
.ib-icon { font-size: 38px; margin-bottom: 8px; }
.ib-title { font-size: 14px; font-weight: bold; color: #fff; margin-bottom: 4px; }
.ib-desc { font-size: 11px; color: #8c95bf; margin-bottom: 14px; }
.ib-btn-cancel {
    background: #2a3478;
    color: #8c95bf;
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-right: 8px;
}
.ib-btn-deposit {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.game-deposit-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.game-deposit-dialog-overlay.hidden { display: none !important; }
.game-deposit-dialog-box {
    background: #21285c;
    border: 1px solid #2a3478;
    border-radius: 14px;
    padding: 20px;
    max-width: 320px;
    width: 100%;
    text-align: center;
}
.gd-title { font-size: 14px; font-weight: bold; color: #fff; margin-bottom: 4px; }
.gd-desc { font-size: 11px; color: #8c95bf; margin-bottom: 14px; line-height: 1.4; }
.gd-btn-group { display: flex; gap: 8px; }
.gd-btn-cancel {
    background: #2a3478;
    color: #8c95bf;
    flex: 1;
    padding: 8px 0;
    border-radius: 10px;
    border: none;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}
.gd-btn-deposit {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    flex: 1;
    padding: 8px 0;
    border-radius: 10px;
    border: none;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

#actionSpinnerOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 50;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#actionSpinnerOverlay .spinner-box {
    background: #21285c;
    border: 1px solid #2a3478;
    padding: 20px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
    width: 120px;
    text-align: center;
}
.spinner-circle {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(47,130,255,0.1);
    border-radius: 50%;
    border-top-color: #2f82ff;
    border-right-color: #2f82ff;
    animation: spinCircle 0.85s linear infinite;
}
.spinner-text { font-size: 11px; font-weight: bold; color: #2f82ff; letter-spacing: 1px; animation: pulse 1s ease-in-out infinite; }

.fab-chat {
    position: fixed;
    right: 14px;
    bottom: 80px;
    width: 50px;
    height: 50px;
    z-index: 9999;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
}
.fab-chat img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ============================================================ */
/* GAME CARD                                                    */
/* ============================================================ */
.game-card-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1135/1536;
    object-fit: cover;
    border-radius: 10px;
}
.game-card-wrapper { cursor: pointer; }

.grid-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.grid-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid-4col { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

.copy-btn {
    background: #2a3478;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    color: #2f82ff;
    cursor: pointer;
    border: 1px solid #334155;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* ============================================================ */
/* ANIMATIONS                                                   */
/* ============================================================ */
@keyframes spinCircle {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes slideText {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================================ */
/* EMPTY STATE                                                  */
/* ============================================================ */
.empty-state {
    text-align: center;
    padding: 20px 0;
    color: #8c95bf;
}
.empty-state img {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    display: block;
    opacity: 0.6;
}
.empty-state p {
    font-size: 13px;
}

/* ============================================================ */
/* DOWNLINE DATA SCREEN                                         */
/* ============================================================ */
.downline-data-container {
    background: #21285c;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.downline-data-header {
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid #2a3478;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.downline-data-header .back-icon {
    font-size: 14px;
    color: #8c95bf;
    cursor: pointer;
    padding: 4px;
}

.downline-data-header .title {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    flex: 1;
    text-align: center;
    margin-right: 20px;
}

.downline-data-search {
    display: flex;
    background: #1a1f4a;
    border: 1px solid #2a3478;
    border-radius: 25px;
    overflow: hidden;
    align-items: center;
    margin-bottom: 12px;
}

.downline-data-search input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 16px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

.downline-data-search input::placeholder {
    color: #586193;
}

.downline-data-search button {
    background: linear-gradient(135deg, #2a82e4, #1a6bc4);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 25px;
    margin: 3px;
    cursor: pointer;
    font-size: 13px;
}

.downline-data-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.downline-data-filter {
    flex: 1;
    background: #1a1f4a;
    border: 1px solid #2a3478;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: #fff;
    font-size: 12px;
}

.downline-data-filter i {
    color: #8c95bf;
    font-size: 10px;
}

.downline-data-stats {
    background: linear-gradient(135deg, #2a3c98, #1e2d7a);
    border-radius: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    overflow: hidden;
}

.downline-data-stat {
    padding: 14px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.downline-data-stat:nth-child(odd)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    height: 70%;
    width: 1px;
    background-color: rgba(255,255,255,0.1);
}

.downline-data-stat:nth-child(-n+4)::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    width: 70%;
    height: 1px;
    background-color: rgba(255,255,255,0.1);
}

.downline-data-stat .value {
    font-size: 20px;
    font-weight: bold;
    color: #f4c150;
    margin-bottom: 4px;
}

.downline-data-stat .label {
    font-size: 10px;
    color: rgba(255,255,255,0.75);
    line-height: 1.3;
}

.downline-data-card {
    background: #1a1f4a;
    border: 1px solid #2a3478;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
}

.downline-data-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #2a3478;
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.downline-data-card .uid {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.downline-data-card .uid .copy-icon {
    color: #8c95bf;
    cursor: pointer;
    font-size: 12px;
}

.downline-data-card .uid .copy-icon:hover {
    color: #2f82ff;
}

.downline-data-card .row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #c5cee9;
    padding: 3px 0;
}

.downline-data-card .row .label {
    color: #8c95bf;
}

.downline-data-card .row .value {
    color: #c5cee9;
}

.downline-data-card .row .value.highlight {
    color: #f4c150;
    font-weight: bold;
}

.downline-data-empty {
    text-align: center;
    padding: 30px 0;
    color: #8c95bf;
}

.downline-data-empty i {
    font-size: 36px;
    color: #2a3478;
    margin-bottom: 8px;
    display: block;
}

.downline-data-empty p {
    font-size: 13px;
}

/* ============================================================ */
/* SCROLL FIXES - All screens scroll to top                   */
/* ============================================================ */

.app-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 14px 75px 14px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-top: 10px;
    min-height: 0;
    height: 100%;
}
.app-content::-webkit-scrollbar { width: 0; background: transparent; }

/* Fix for screens not scrolling to top */
.app-screen {
    display: none;
    width: 100%;
    min-height: 100%;
    height: auto;
}
.app-screen.active { display: block; }

/* Force scroll on all screens */
#screenHome.active,
#screenAccount.active,
#screenPromotion.active,
#screenActivity.active,
#screenWallet.active,
#screenVip.active,
#screenDownlineData.active,
#screenNewDownline.active,
#screenDownlineSearch.active,
#screenCommissionRatio.active,
#screenInviteRules.active {
    display: block;
    min-height: 100%;
    height: auto;
}

/* ============================================================ */
/* FAB CHAT ANIMATION                                          */
/* ============================================================ */

.fab-chat {
    position: fixed;
    right: 14px;
    bottom: 80px;
    width: 50px;
    height: 50px;
    z-index: 9999;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    transition: opacity 0.3s ease;
    opacity: 1;
}
.fab-chat img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* Blink animation for FAB chat */
@keyframes fabBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.fab-chat.blink {
    animation: fabBlink 1.5s ease-in-out 3;
}

/* ============================================================ */
/* RESPONSIVE                                                   */
/* ============================================================ */
@media (max-width: 380px) {
    .downline-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .downline-item .time {
        font-size: 10px;
        color: #586193;
    }
    
    .downline-data-stat .value {
        font-size: 16px;
    }
    
    .downline-data-stat .label {
        font-size: 9px;
    }
}