:root {
    --bg-dark: #090614;
    --bg-card: #151029;
    --bg-card-hover: #1e163a;
    --gold: #fbbf24;
    --gold-dark: #d97706;
    --purple: #7c3aed;
    --purple-light: #a78bfa;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --danger: #ef4444;
    --success: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Noto Sans Myanmar', -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at top, #1f1242 0%, var(--bg-dark) 60%);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 85px;
    line-height: 1.5;
}

.hidden { display: none !important; }

/* Header */
.top-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(9, 6, 20, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gold), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.25);
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #fde68a, var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.welcome-msg { font-size: 0.72rem; color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, opacity 0.2s ease, background 0.2s ease;
}
button:active { transform: scale(0.96); }

.btn-lang, .btn-cs, .btn-account {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-account {
    background: linear-gradient(135deg, var(--purple), #5b21b6);
    border-color: rgba(167, 139, 250, 0.4);
}
.btn-lang:hover, .btn-cs:hover { background: rgba(255, 255, 255, 0.15); }

.sub-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 16px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.balance-pill {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
}
.bal-amount { color: var(--gold); font-weight: 700; margin-left: 4px; }
.bal-guest { color: #fde68a; }

.btn-download-app {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
}

.page-section { display: none; animation: fadeIn 0.25s ease; }
.page-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Hero */
.hero-banner {
    background: linear-gradient(135deg, #2e1065 0%, #1e1b4b 50%, #3b0764 100%);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 20px;
    padding: 32px 24px;
    margin-bottom: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.hero-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--gold);
    background: rgba(251, 191, 36, 0.12);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.hero-banner h1 { font-size: clamp(1.5rem, 4vw, 2.3rem); margin-bottom: 10px; }
.hero-banner p { color: var(--text-muted); max-width: 600px; margin-bottom: 20px; }
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #111827;
    font-weight: 700;
    padding: 11px 20px;
    border-radius: 12px;
    font-size: 0.92rem;
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--border);
    font-weight: 600;
    padding: 11px 20px;
    border-radius: 12px;
}
.btn-download-hero {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-weight: 700;
    padding: 11px 20px;
    border-radius: 12px;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-danger {
    background: var(--danger);
    color: white;
    font-weight: 600;
    padding: 11px 20px;
    border-radius: 12px;
}
.full-width { width: 100%; }

/* Dedicated App Download Banner */
.app-download-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(124, 58, 237, 0.16));
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.app-dl-info { display: flex; align-items: center; gap: 14px; }
.app-dl-icon { font-size: 36px; }
.app-dl-info h3 { font-size: 1rem; margin-bottom: 3px; color: #ecfdf5; }
.app-dl-info p { font-size: 0.84rem; color: var(--text-muted); }
.btn-download-main {
    background: linear-gradient(135deg, #10b981, #047857);
    color: white;
    font-weight: 700;
    padding: 11px 20px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* Games Grid */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.section-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.25);
    color: var(--purple-light);
}
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent, var(--gold));
}
.game-thumb { position: relative; padding: 14px 14px 0; }
.slot-art { width: 100%; height: auto; display: block; border-radius: 12px; }
.game-badge {
    position: absolute;
    top: 22px;
    right: 22px;
    background: var(--accent, var(--gold));
    color: #090614;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
}
.game-info { padding: 14px 16px 18px; }
.game-info h3 { font-size: 1.05rem; margin-bottom: 6px; }
.game-info p { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 14px; min-height: 38px; }
.btn-play {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--purple), #6d28d9);
    color: white;
}

/* Placeholder & Profile Cards */
.placeholder-card, .profile-card {
    max-width: 520px;
    margin: 24px auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px 22px;
    text-align: center;
}
.placeholder-icon { font-size: 46px; margin-bottom: 12px; }
.placeholder-card p { color: var(--text-muted); margin: 10px 0 18px; }
.payment-methods-preview { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pm-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}
.phase-notice {
    background: rgba(251, 191, 36, 0.1);
    color: var(--gold);
    padding: 10px;
    border-radius: 10px;
    font-size: 0.84rem;
}

.profile-card { text-align: left; }
.profile-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--gold));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}
.status-pill {
    display: inline-block;
    font-size: 0.72rem;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    text-transform: uppercase;
}
.profile-details {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 18px;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.detail-row:last-child { border-bottom: none; }
.gold-text { color: var(--gold); }

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(15, 10, 30, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px 4px;
}
.nav-item {
    background: transparent;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 10px;
}
.nav-item.active { color: var(--gold); background: rgba(251, 191, 36, 0.08); }
.nav-icon { font-size: 1.2rem; }
.nav-label { font-size: 0.72rem; font-weight: 600; }

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #17112e;
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 20px;
    padding: 26px 22px;
}
.center-text { text-align: center; }
.info-icon { font-size: 44px; margin-bottom: 10px; }
.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.6rem;
    line-height: 1;
}
.modal-title { margin-bottom: 6px; }
.modal-subtitle { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 16px; }

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
}
.auth-tab {
    padding: 9px;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
}
.auth-tab.active { background: var(--purple); color: white; }

.form-group { margin-bottom: 14px; text-align: left; }
.form-group label { display: block; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 6px; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.92rem;
}
.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 42px; }
.eye-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.alert-box {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 14px;
}
.alert-box.error { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35); }
.alert-box.success { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.35); }

.btn-telegram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #0088cc;
    color: white;
    text-decoration: none;
    padding: 11px;
    border-radius: 12px;
    font-weight: 700;
}
.divider { text-align: center; margin: 16px 0; font-size: 0.75rem; color: var(--text-muted); }

/* Admin Styles */
.admin-body { padding: 24px 16px; }
.admin-login-box { max-width: 380px; margin: 60px auto; background: var(--bg-card); padding: 28px; border-radius: 18px; border: 1px solid var(--border); }
.admin-wrapper { max-width: 1150px; margin: 0 auto; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.muted { color: var(--text-muted); font-size: 0.88rem; }

.admin-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.admin-nav-link {
    text-decoration: none;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}
.admin-nav-link.active {
    background: var(--purple);
    color: white;
    border-color: var(--purple-light);
}

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.stat-card strong { font-size: 1.8rem; }
.green-text { color: var(--success); }
.red-text { color: var(--danger); }
.admin-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 22px; }
.admin-panel h2 { font-size: 1.1rem; margin-bottom: 14px; }
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); }
th { color: var(--gold); }

.badge-online { color: #34d399; font-weight: 700; font-size: 0.84rem; }
.badge-offline { color: #94a3b8; font-size: 0.84rem; }

.inline-reset-form { display: flex; gap: 6px; align-items: center; }
.inline-reset-form input {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.35);
    color: white;
    width: 145px;
    font-size: 0.8rem;
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; }

.logs-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.clear-logs-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.clear-logs-form select {
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0f0a1e;
    color: white;
}
.table-actions { margin-bottom: 12px; }

@media (max-width: 480px) {
    .hide-xs { display: none; }
    .hero-banner { padding: 22px 16px; }
}
/* --- Phase 2: Deposit & Withdraw UI --- */
.finance-card {
    max-width: 620px;
    margin: 16px auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 26px 20px;
}
.finance-card h2 { margin-bottom: 6px; }
.field-heading {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--gold);
    margin: 18px 0 10px;
}
.wallet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.wallet-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--border);
    color: var(--text-main);
    text-align: left;
}
.wallet-option.active {
    border-color: var(--gold);
    background: rgba(251, 191, 36, 0.1);
}
.wallet-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.72rem;
    line-height: 1.1;
    text-align: center;
    flex-shrink: 0;
}
.kpay-badge { background: linear-gradient(135deg, #0055a5, #0077cc); color: #fff; }
.wave-badge { background: linear-gradient(135deg, #facc15, #eab308); color: #0f172a; }
.wallet-meta { display: flex; flex-direction: column; }
.wallet-meta span { font-size: 0.75rem; color: var(--text-muted); }

.amount-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.amount-chip {
    padding: 10px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.84rem;
}
.amount-chip.active {
    background: var(--purple);
    border-color: var(--purple-light);
    color: white;
}

.back-link {
    display: inline-block;
    color: var(--purple-light);
    text-decoration: none;
    font-size: 0.88rem;
    margin-bottom: 14px;
}
.merchant-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 14px;
    padding: 14px 16px;
    margin: 16px 0 20px;
}
.merchant-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    gap: 10px;
    font-size: 0.9rem;
}
.merchant-row:last-child { border-bottom: none; }
.copy-group { display: flex; align-items: center; gap: 8px; }
.btn-copy {
    background: var(--purple);
    color: white;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
}

.history-box { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); }
.history-box h3 { font-size: 1rem; margin-bottom: 12px; }
.tx-status {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
}
.status-pending { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.status-approved { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-rejected { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.action-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.wallet-logo-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}
/* 2-Col Mobile / 3-Col Desktop Logo Cards & Admin Alert Badges */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}
.game-logo-card {
    position: relative;
    display: block;
    text-decoration: none;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.14);
    transition: transform 0.18s ease, border-color 0.2s ease;
}
.game-logo-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent, var(--gold));
}
.game-logo-stage {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.lobby-logo-img {
    width: 82%;
    height: 82%;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.75));
}
.game-logo-card .game-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}
.nav-alert-badge {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 999px;
    margin-left: 4px;
}
/* Force 2-Col Mobile / 3-Col Desktop Square Logo Cards */
#lobbyGrid.games-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
}
@media (min-width: 768px) {
    #lobbyGrid.games-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 18px !important;
    }
}
#lobbyGrid .game-logo-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    text-decoration: none;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(251, 191, 36, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}
#lobbyGrid .game-logo-stage {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}
#lobbyGrid .lobby-logo-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.75));
}