/* ═══════════════════════════════════════════════════════════════
   AIGold — Premium Crypto Investment Platform
   Complete Stylesheet — Glassmorphism Dark Theme
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ─── */
:root {
    --bg-primary: #0a1628;
    --bg-secondary: #0d1b2a;
    --bg-card: #1a2332;
    --bg-card-rgb: 26, 35, 50;
    --bg-glass: rgba(26, 35, 50, 0.65);
    --bg-glass-strong: rgba(26, 35, 50, 0.85);

    --accent-emerald: #00d4aa;
    --accent-cyan: #00bcd4;
    --accent-gradient: linear-gradient(135deg, #00d4aa, #00bcd4);
    --accent-gradient-hover: linear-gradient(135deg, #00e6bb, #00cde5);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    --border-emerald: rgba(0, 212, 170, 0.3);
    --border-subtle: rgba(255, 255, 255, 0.08);

    --success: #00e676;
    --warning: #ffd740;
    --error: #ff5252;

    --glow-emerald: 0 0 20px rgba(0, 212, 170, 0.15);
    --glow-emerald-strong: 0 0 40px rgba(0, 212, 170, 0.25);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --nav-height: 68px;
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background gradient pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 10%, rgba(0, 212, 170, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 500px 350px at 80% 80%, rgba(0, 188, 212, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--accent-emerald); text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* Scrollbar — hidden for clean mobile feel */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

/* ═══════════════════════════════════════════════════════════════
   GLASS CARD — Base Component
   ═══════════════════════════════════════════════════════════════ */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-emerald);
    border-radius: var(--radius-lg);
    box-shadow: var(--glow-emerald);
    transition: box-shadow var(--transition-smooth), transform var(--transition-smooth);
}

.glass-card:hover {
    box-shadow: var(--glow-emerald-strong);
}

/* ═══════════════════════════════════════════════════════════════
   ACCESS GATE OVERLAY
   ═══════════════════════════════════════════════════════════════ */
.access-gate {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse 500px 400px at 50% 30%, rgba(0, 212, 170, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 400px 300px at 30% 70%, rgba(0, 188, 212, 0.06) 0%, transparent 70%);
}

.access-gate.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.gate-card {
    width: 100%;
    max-width: 380px;
    padding: 40px 28px 32px;
    text-align: center;
    position: relative;
    animation: float 6s ease-in-out infinite;
    border: 1px solid transparent;
    background-clip: padding-box;
}

/* Animated glowing border */
.gate-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-lg) + 2px);
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan), transparent, var(--accent-emerald));
    background-size: 400% 400%;
    animation: borderGlow 4s ease-in-out infinite;
    z-index: -1;
    opacity: 0.6;
}

.gate-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: -1;
}

.gate-logo {
    margin-bottom: 32px;
}

.gate-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 212, 170, 0.1);
    border: 2px solid var(--border-emerald);
    margin-bottom: 16px;
    animation: pulse 3s ease-in-out infinite;
}

.gate-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.gate-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.5px;
}

.gate-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.gate-footer {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN APP CONTAINER
   ═══════════════════════════════════════════════════════════════ */
.main-app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px);
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--bg-primary);
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(0, 212, 170, 0.35);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-greeting {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-id {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.header-balance {
    text-align: right;
    display: flex;
    flex-direction: column;
}

.balance-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-emerald);
}

/* ═══════════════════════════════════════════════════════════════
   PRICE TICKER
   ═══════════════════════════════════════════════════════════════ */
.ticker-container {
    overflow: hidden;
    position: relative;
    border-top: 1px solid var(--border-subtle);
    padding: 8px 0;
    background: rgba(0, 0, 0, 0.15);
}

.ticker-container::before,
.ticker-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    z-index: 2;
    pointer-events: none;
}

.ticker-container::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-primary), transparent);
}

.ticker-container::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-primary), transparent);
}

.ticker-track {
    display: flex;
    gap: 28px;
    white-space: nowrap;
    animation: marquee 30s linear infinite;
    width: max-content;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.ticker-symbol {
    font-weight: 700;
    color: var(--text-primary);
}

.ticker-price {
    color: var(--text-primary);
    font-weight: 600;
}

.ticker-change {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
}

.ticker-change.up {
    color: var(--success);
    background: rgba(0, 230, 118, 0.1);
}

.ticker-change.down {
    color: var(--error);
    background: rgba(255, 82, 82, 0.1);
}

/* ═══════════════════════════════════════════════════════════════
   PAGES
   ═══════════════════════════════════════════════════════════════ */
.page {
    display: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--transition-smooth), transform var(--transition-smooth);
}

.page.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.page-content {
    padding: 16px;
    padding-bottom: 8px;
}

.page-title-bar {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.back-btn-header {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    outline: none;
    margin-right: 12px;
}

.back-btn-header:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-3px);
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.25);
}

.back-btn-header:active {
    transform: scale(0.95);
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0 12px;
}

.section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   BALANCE CARD (Home)
   ═══════════════════════════════════════════════════════════════ */
.balance-card {
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 170, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.balance-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.balance-card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* ── Redesigned Portfolio Card ── */
.balance-card {
    background:
        radial-gradient(120% 140% at 85% -10%, rgba(0, 212, 170, 0.16) 0%, transparent 55%),
        var(--card-bg, rgba(26, 35, 50, 0.7));
    border: 1px solid rgba(0, 212, 170, 0.18);
}

.portfolio-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.portfolio-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(0, 212, 170, 0.12);
    color: var(--accent-emerald);
}

.portfolio-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--accent-emerald);
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.2);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.portfolio-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00e676;
    box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.6);
    animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
    0%   { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(0, 230, 118, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

.balance-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px 0 22px;
}

.balance-main-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.balance-main-value {
    font-size: 2.7rem;
    font-weight: 800;
    line-height: 1.05;
    background: linear-gradient(135deg, #00d4aa, #00bcd4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 24px rgba(0, 212, 170, 0.18);
}

.portfolio-assets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.asset-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(10, 22, 40, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.asset-logo {
    display: inline-flex;
    flex-shrink: 0;
}

.asset-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.asset-amount {
    font-size: 0.82rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asset-amount b {
    font-weight: 700;
}

.asset-usd {
    font-size: 0.7rem;
    color: var(--text-muted);
}


.settlement-timer {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--text-muted);
    background: rgba(0, 212, 170, 0.08);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(0, 212, 170, 0.15);
}

.settlement-timer svg {
    stroke: var(--accent-emerald);
}

.balance-grid {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.balance-item {
    flex: 1;
    text-align: center;
    padding: 8px 0;
}

.balance-divider {
    width: 1px;
    background: var(--border-emerald);
    margin: 0 12px;
}

.balance-currency {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.currency-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
}

.trx-icon {
    background: linear-gradient(135deg, #ff0013, #ff4560);
    color: white;
}

.usdt-icon {
    background: linear-gradient(135deg, #26a17b, #50d3a0);
    color: white;
}

.currency-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.balance-amount {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-emerald);
    line-height: 1.2;
}

.balance-usd {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.balance-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.daily-earnings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.daily-earnings strong {
    color: var(--success);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   QUICK ACTIONS
   ═══════════════════════════════════════════════════════════════ */
.quick-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.quick-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-action-btn:active {
    transform: scale(0.96);
}

.quick-action-btn:hover {
    border-color: var(--border-emerald);
    box-shadow: var(--glow-emerald);
}

.qa-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.2);
    color: var(--accent-emerald);
}

.qa-icon.withdraw-icon {
    background: rgba(0, 188, 212, 0.1);
    border-color: rgba(0, 188, 212, 0.2);
    color: var(--accent-cyan);
}

.qa-icon.referral-icon {
    background: rgba(255, 215, 64, 0.1);
    border-color: rgba(255, 215, 64, 0.2);
    color: var(--warning);
}

/* ═══════════════════════════════════════════════════════════════
   INVESTMENT TABLE
   ═══════════════════════════════════════════════════════════════ */
.investment-table {
    padding: 0;
    overflow: hidden;
}

.investment-table table {
    width: 100%;
    border-collapse: collapse;
}

.investment-table th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.15);
}

.investment-table td {
    font-size: 0.82rem;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: background var(--transition-fast);
}

.investment-table tr:last-child td {
    border-bottom: none;
}

.investment-table tbody tr:hover td {
    background: rgba(0, 212, 170, 0.04);
}

.roi-value {
    color: var(--success);
    font-weight: 600;
}

.level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--bg-primary);
}

.level-1 { background: linear-gradient(135deg, #00d4aa, #00e6bb); }
.level-2 { background: linear-gradient(135deg, #00bcd4, #00cde5); }
.level-3 { background: linear-gradient(135deg, #7c4dff, #b388ff); }
.level-4 { background: linear-gradient(135deg, #ffd740, #ffe082); }
.level-5 { background: linear-gradient(135deg, #ff5252, #ff8a80); }

/* ═══════════════════════════════════════════════════════════════
   CURRENCY TOGGLE
   ═══════════════════════════════════════════════════════════════ */
.currency-toggle {
    display: flex;
    gap: 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    padding: 4px;
    border: 1px solid var(--border-subtle);
    margin-bottom: 16px;
}

.toggle-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle-btn.active {
    background: var(--accent-gradient);
    color: var(--bg-primary);
    box-shadow: 0 2px 12px rgba(0, 212, 170, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   WALLET DISPLAY (Deposit)
   ═══════════════════════════════════════════════════════════════ */
.wallet-display {
    padding: 20px;
    margin-bottom: 16px;
}

.wallet-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: block;
}

.wallet-address-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 16px;
}

.wallet-address {
    flex: 1;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.72rem;
    color: var(--accent-emerald);
    word-break: break-all;
    white-space: normal;
    line-height: 1.4;
}

.copy-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-emerald);
    border-radius: var(--radius-sm);
    background: rgba(0, 212, 170, 0.08);
    color: var(--accent-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-btn:active {
    transform: scale(0.9);
}

.copy-btn:hover {
    background: rgba(0, 212, 170, 0.15);
}

.copy-btn.copied {
    background: var(--accent-emerald);
    color: var(--bg-primary);
    border-color: var(--accent-emerald);
}

.qr-code-area {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ═══════════════════════════════════════════════════════════════
   DEPOSIT FORM
   ═══════════════════════════════════════════════════════════════ */
.deposit-form,
.withdraw-form {
    padding: 20px;
    margin-bottom: 4px;
}

.form-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   WITHDRAW PAGE
   ═══════════════════════════════════════════════════════════════ */
.available-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(0, 212, 170, 0.06);
    border: 1px solid rgba(0, 212, 170, 0.15);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.82rem;
}

.available-balance span {
    color: var(--text-secondary);
}

.available-balance strong {
    color: var(--accent-emerald);
    font-weight: 700;
}

.input-with-btn {
    position: relative;
    display: flex;
}

.input-with-btn .form-input {
    padding-right: 70px;
}

.max-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 5px 14px;
    background: var(--accent-gradient);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.5px;
}

.max-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* ═══════════════════════════════════════════════════════════════
   REFERRAL PAGE
   ═══════════════════════════════════════════════════════════════ */
.referral-link-card {
    padding: 20px;
    margin-bottom: 16px;
}

.referral-link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.referral-link {
    flex: 1;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.72rem;
    color: var(--accent-cyan);
    word-break: break-all;
    white-space: normal;
    line-height: 1.4;
}

.referral-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}

.stat-card {
    padding: 16px;
    text-align: center;
}

/* Commission card — gold accent to distinguish from regular stats */
.stat-card--commission {
    border: 1px solid rgba(255, 200, 50, 0.25);
    background: linear-gradient(135deg, rgba(255, 190, 30, 0.08) 0%, rgba(255, 140, 0, 0.05) 100%);
}

.stat-card--commission .stat-label {
    color: rgba(255, 200, 80, 0.8);
}

.commission-glow {
    color: #ffc832 !important;
    text-shadow: 0 0 14px rgba(255, 200, 50, 0.5);
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-emerald);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}


/* ─── Rank Progress Card ─────────────────────────────────────── */
.rank-progress-card {
    padding: 16px 18px;
    margin-bottom: 0;
}

.rank-current-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rank-current-icon {
    font-size: 2rem;
    line-height: 1;
}

.rank-current-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rank-current-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.rank-current-rate {
    font-size: 0.75rem;
    color: #ffc832;
    font-weight: 600;
}

.rank-investor-badge {
    background: rgba(255,200,50,0.12);
    border: 1px solid rgba(255,200,50,0.3);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.72rem;
    color: #ffc832;
    font-weight: 600;
    white-space: nowrap;
}

.rank-progress-wrap {
    margin-top: 14px;
}

.rank-progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}

.rank-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffc832, #ff8c00);
    border-radius: 6px;
    transition: width 0.8s ease;
}

.rank-progress-label {
    font-size: 0.70rem;
    color: rgba(255,255,255,0.5);
}

/* Row highlight for current rank in the tiers table */
.rank-tier-row--current {
    background: rgba(255,200,50,0.07);
    border-left: 3px solid #ffc832;
}

.rank-tier-row--current td {
    color: #ffc832 !important;
    font-weight: 700;
}

.rank-tier-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
}

.rank-tier-badge--active {
    background: rgba(255,200,50,0.2);
    color: #ffc832;
    border: 1px solid rgba(255,200,50,0.4);
}

.rank-tier-badge--locked {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.3);
    border: 1px solid rgba(255,255,255,0.08);
}

.referral-table-card {
    padding: 0;
    overflow: hidden;
}


.referral-table {
    width: 100%;
    border-collapse: collapse;
}

.referral-table th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.15);
}

.referral-table td {
    font-size: 0.82rem;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.referral-table tr:last-child td {
    border-bottom: none;
}

/* ═══════════════════════════════════════════════════════════════
   ABOUT PAGE
   ═══════════════════════════════════════════════════════════════ */
.about-content {
    padding: 28px 20px;
}

.about-logo {
    text-align: center;
    margin-bottom: 16px;
}

.about-logo svg {
    display: inline-block;
}

.about-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 14px;
}

.about-text h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 3px solid var(--accent-emerald);
}

.about-text ul {
    padding-left: 0;
    margin-bottom: 14px;
}

.about-text li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 6px 0 6px 22px;
    position: relative;
}

.about-text li::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-emerald);
}

/* ═══════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION
   ═══════════════════════════════════════════════════════════════ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    height: var(--nav-height);
    padding-bottom: var(--safe-bottom);
    background: var(--bg-glass-strong);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border-subtle);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-item.active {
    color: var(--accent-emerald);
}

.nav-item .nav-icon {
    transition: transform var(--transition-fast);
}

.nav-item.active .nav-icon {
    transform: translateY(-2px);
}

.nav-indicator {
    position: absolute;
    bottom: calc(var(--safe-bottom) + 4px);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-emerald);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.nav-item.active .nav-indicator {
    opacity: 1;
}

.nav-label {
    letter-spacing: 0.2px;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.2px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--bg-primary);
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.25);
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 6px 24px rgba(0, 212, 170, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.97) translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-emerald);
    border: 1px solid var(--border-emerald);
}

.btn-secondary:hover {
    background: rgba(0, 212, 170, 0.08);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.78rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   INPUTS
   ═══════════════════════════════════════════════════════════════ */
.input-group {
    margin-bottom: 14px;
}

.input-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.88rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--accent-emerald);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.form-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(255, 82, 82, 0.1);
}

/* Shake animation for error */
.form-input.shake {
    animation: shake 0.5s ease;
}

/* ═══════════════════════════════════════════════════════════════
   HISTORY LIST & STATUS BADGES
   ═══════════════════════════════════════════════════════════════ */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}

.history-item:hover {
    border-color: var(--border-emerald);
}

.history-item-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-amount {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.history-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.history-item-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.badge-pending {
    background: rgba(255, 215, 64, 0.12);
    color: var(--warning);
    border: 1px solid rgba(255, 215, 64, 0.25);
}

.badge-approved {
    background: rgba(0, 230, 118, 0.12);
    color: var(--success);
    border: 1px solid rgba(0, 230, 118, 0.25);
}

.badge-rejected {
    background: rgba(255, 82, 82, 0.12);
    color: var(--error);
    border: 1px solid rgba(255, 82, 82, 0.25);
}

.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.empty-state svg {
    margin: 0 auto 12px;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    left: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: slideIn 0.35s var(--transition-spring);
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.toast.toast-exit {
    animation: slideOut 0.3s ease forwards;
}

.toast-success {
    background: rgba(0, 230, 118, 0.15);
    border: 1px solid rgba(0, 230, 118, 0.3);
}

.toast-success::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--success);
    color: var(--bg-primary);
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
}

.toast-error {
    background: rgba(255, 82, 82, 0.15);
    border: 1px solid rgba(255, 82, 82, 0.3);
}

.toast-error::before {
    content: '✕';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--error);
    color: white;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
}

.toast-info {
    background: rgba(0, 188, 212, 0.15);
    border: 1px solid rgba(0, 188, 212, 0.3);
}

.toast-info::before {
    content: 'i';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-cyan);
    color: var(--bg-primary);
    font-size: 0.72rem;
    font-weight: 800;
    font-style: italic;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════════════════════════ */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner-ring {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-emerald);
    border-right-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════════
   CONFIRMATION MODAL
   ═══════════════════════════════════════════════════════════════ */
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 22, 40, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.confirm-card {
    width: 100%;
    max-width: 340px;
    padding: 24px;
    text-align: center;
}

.confirm-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.confirm-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 10px;
}

.confirm-actions .btn {
    flex: 1;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.2); }
    50% { box-shadow: 0 0 0 12px rgba(0, 212, 170, 0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-4px); }
    30%, 70% { transform: translateX(4px); }
}

@keyframes borderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page transition classes */
.page-enter {
    animation: fadeInUp 0.35s ease forwards;
}

.page-exit {
    animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile First (320px – 430px)
   ═══════════════════════════════════════════════════════════════ */

/* Extra small screens */
@media (max-width: 340px) {
    .header-top {
        padding: 10px 12px;
    }

    .balance-amount {
        font-size: 1.15rem;
    }

    .quick-actions {
        gap: 6px;
    }

    .quick-action-btn {
        padding: 10px 6px;
        font-size: 0.7rem;
    }

    .qa-icon {
        width: 34px;
        height: 34px;
    }

    .investment-table th,
    .investment-table td,
    .referral-table th,
    .referral-table td {
        padding: 10px 8px;
        font-size: 0.72rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }
}

/* Standard mobile */
@media (min-width: 341px) and (max-width: 430px) {
    .page-content {
        padding: 16px;
    }
}

/* Prevent oversized display on larger screens */
@media (min-width: 431px) {
    body {
        max-width: 430px;
        margin: 0 auto;
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
        position: relative;
    }

    body::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #050d18;
        z-index: -2;
    }

    .bottom-nav {
        max-width: 430px;
        left: 50%;
        transform: translateX(-50%);
    }

    .toast-container {
        max-width: 430px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }

    .access-gate {
        max-width: 430px;
        left: 50%;
        transform: translateX(-50%);
    }

    .loading-overlay {
        max-width: 430px;
        left: 50%;
        transform: translateX(-50%);
    }

    .confirm-modal {
        max-width: 430px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */
.text-emerald { color: var(--accent-emerald); }
.text-cyan { color: var(--accent-cyan); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ═══════════════════════════════════════════════════════════════════
   DEPOSIT WARNING BANNER
   ═══════════════════════════════════════════════════════════════════ */
.deposit-warning-banner {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 87, 34, 0.1));
    border: 1px solid rgba(255, 152, 0, 0.4);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.deposit-warning-banner .warning-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.deposit-warning-banner .warning-text {
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}
.deposit-warning-banner .warning-text strong {
    color: #ffab40;
}
.deposit-warning-wallets {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.deposit-warning-wallets .wallet-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(0, 212, 170, 0.08);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 20px;
    font-size: 0.7rem;
    color: #00d4aa;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════
   DEPOSIT PROCESSING OVERLAY (Step 4)
   ═══════════════════════════════════════════════════════════════════ */
.deposit-processing {
    text-align: center;
    padding: 30px 20px;
}
.processing-circle-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 24px;
}
.processing-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 6;
}
.processing-circle-progress {
    fill: none;
    stroke: url(#processingGrad);
    stroke-width: 6;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 1s linear;
}
.processing-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.processing-timer {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
}
.processing-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}
.processing-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}
.processing-subtitle {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
}
.processing-details {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 14px;
    text-align: left;
}
.processing-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.8rem;
}
.processing-detail-row .detail-label {
    color: rgba(255, 255, 255, 0.5);
}
.processing-detail-row .detail-value {
    color: #fff;
    font-weight: 600;
}
.processing-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    color: #00d4aa;
    font-weight: 600;
    margin-top: 16px;
}
.processing-status-badge .pulse-dot {
    width: 8px;
    height: 8px;
    background: #00d4aa;
    border-radius: 50%;
    animation: pulseDot 1.5s ease-in-out infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}
.processing-success {
    text-align: center;
    padding: 30px 20px;
}
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.2), rgba(0, 188, 212, 0.15));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.4s ease-out;
}
@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   REFERRAL TREE VISUALIZATION
   ═══════════════════════════════════════════════════════════════════ */
.referral-tree-container {
    margin-top: 4px;
}
.referral-tree-level {
    margin-bottom: 12px;
}
.referral-tree-level-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    margin-bottom: 6px;
}
.tree-level-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: #fff;
}
.tree-level-badge.lvl-1 { background: linear-gradient(135deg, #00d4aa, #00bcd4); }
.tree-level-badge.lvl-2 { background: linear-gradient(135deg, #7c4dff, #536dfe); }
.tree-level-badge.lvl-3 { background: linear-gradient(135deg, #ff6d00, #ff9100); }
.tree-level-info { flex: 1; }
.tree-level-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}
.tree-level-commission {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
}
.tree-level-count {
    font-size: 1rem;
    font-weight: 800;
    color: #00d4aa;
}
.referral-tree-members {
    padding-left: 20px;
    border-left: 2px solid rgba(0, 212, 170, 0.15);
    margin-left: 14px;
}
.tree-member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    position: relative;
}
.tree-member-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    width: 16px;
    height: 2px;
    background: rgba(0, 212, 170, 0.15);
}
.tree-member-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(0, 212, 170, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #00d4aa;
    flex-shrink: 0;
}
.tree-member-info { flex: 1; min-width: 0; }
.tree-member-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tree-member-date {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.35);
}
.tree-member-invest {
    font-size: 0.8rem;
    font-weight: 700;
    color: #00d4aa;
    flex-shrink: 0;
}
.referral-empty-tree {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.82rem;
}

/* ═══════════════════════════════════════════════════════════════════
   WITHDRAWAL COOLDOWN TIMER CARD
   ═══════════════════════════════════════════════════════════════════ */
.cooldown-card {
    padding: 24px 20px;
    text-align: center;
    margin-bottom: 24px;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.cooldown-status-header {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.cooldown-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}
.cooldown-badge.available {
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: var(--success);
}
.cooldown-badge.active-cooldown {
    background: rgba(255, 110, 64, 0.1);
    border: 1px solid rgba(255, 110, 64, 0.3);
    color: #ff6e40;
}
.cooldown-badge .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: cooldownPulse 1.5s ease-in-out infinite;
}
.cooldown-badge.available .pulse-dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}
.cooldown-badge.active-cooldown .pulse-dot {
    background: #ff6e40;
    box-shadow: 0 0 8px #ff6e40;
}
@keyframes cooldownPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}
.cooldown-timer-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.timer-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 64px;
}
.timer-num {
    font-size: 2.2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #fff;
    line-height: 1.2;
    background: linear-gradient(180deg, #fff, rgba(255,255,255,0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.15);
}
.cooldown-badge.active-cooldown ~ .cooldown-timer-display .timer-num {
    background: linear-gradient(180deg, #ffab40, #ff6d00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(255, 109, 0, 0.25);
}
.timer-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
    letter-spacing: 0.5px;
}
.timer-colon {
    font-size: 1.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    margin-top: -16px;
    animation: colonFlash 1s step-end infinite;
}
@keyframes colonFlash {
    50% { opacity: 0.3; }
}
.cooldown-info-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 280px;
    margin: 0 auto;
}

@keyframes rotateWheel {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════
   VISUAL REFERRAL TREE DIAGRAM (Org-Chart Style)
   ═══════════════════════════════════════════════════════════════════ */
.referral-tree-graph {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: auto;
    padding: 20px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 15px;
    width: 100%;
}

.tree-level-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    padding-top: 20px;
}

.tree-level-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 20px;
    background: rgba(0, 212, 170, 0.4);
}

.tree-node-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0 8px;
}

.tree-node-wrapper::before, .tree-node-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    width: 50%;
    height: 20px;
    border-top: 2px solid rgba(0, 212, 170, 0.4);
}
.tree-node-wrapper::after {
    left: 50%;
    border-left: 2px solid rgba(0, 212, 170, 0.4);
}

.tree-node-wrapper:only-child::after, .tree-node-wrapper:only-child::before {
    display: none;
}
.tree-node-wrapper:only-child {
    padding-top: 0;
}
.tree-node-wrapper:only-child > .tree-level-container::before {
    top: -20px;
    height: 20px;
}

.tree-node-wrapper:first-child::before {
    border: 0 none;
}
.tree-node-wrapper:last-child::after {
    border: 0 none;
}
.tree-node-wrapper:first-child::after {
    border-left: 2px solid rgba(0, 212, 170, 0.4);
    border-radius: 8px 0 0 0;
}
.tree-node-wrapper:last-child::before {
    border-right: 2px solid rgba(0, 212, 170, 0.4);
    border-radius: 0 8px 0 0;
}

.tree-node-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 12px;
    min-width: 90px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    position: relative;
    z-index: 5;
    transition: all 0.3s ease;
}
.tree-node-card:hover {
    transform: translateY(-2px);
    border-color: #00d4aa;
    box-shadow: 0 6px 18px rgba(0, 212, 170, 0.25);
}

.tree-node-card.lvl-0 {
    border-color: #ffb300;
    background: linear-gradient(135deg, #2a2010, #141008);
    box-shadow: 0 4px 15px rgba(255, 179, 0, 0.15);
}
.tree-node-card.lvl-1 {
    border-color: #00d4aa;
}
.tree-node-card.lvl-2 {
    border-color: #7c4dff;
}
.tree-node-card.lvl-3 {
    border-color: #ff6d00;
}

.tree-node-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    margin: 0 auto 5px;
    color: #fff;
}
.lvl-0 .tree-node-avatar { background: rgba(255, 179, 0, 0.15); color: #ffb300; }
.lvl-1 .tree-node-avatar { background: rgba(0, 212, 170, 0.15); color: #00d4aa; }
.lvl-2 .tree-node-avatar { background: rgba(124, 77, 255, 0.15); color: #7c4dff; }
.lvl-3 .tree-node-avatar { background: rgba(255, 109, 0, 0.15); color: #ff6d00; }

.tree-node-name {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.tree-node-invest {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════
   VERTICAL COMPACT RESPONSIVE TREE GRAPH
   ═══════════════════════════════════════════════════════════════════ */
.vertical-tree-root {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    box-sizing: border-box;
}

.vertical-tree-node-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 8px;
}

.vertical-tree-node-card {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    gap: 12px;
    position: relative;
    z-index: 2;
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
}

.vertical-tree-node-card:hover {
    border-color: #00d4aa;
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.15);
}

/* Level Specific Card Borders */
.vertical-tree-node-wrapper.lvl-0 > .vertical-tree-node-card {
    border-left: 4px solid #ffb300;
    background: linear-gradient(135deg, rgba(255, 179, 0, 0.1), rgba(15, 23, 42, 0.75));
}
.vertical-tree-node-wrapper.lvl-1 > .vertical-tree-node-card {
    border-left: 4px solid #00d4aa;
}
.vertical-tree-node-wrapper.lvl-2 > .vertical-tree-node-card {
    border-left: 4px solid #7c4dff;
}
.vertical-tree-node-wrapper.lvl-3 > .vertical-tree-node-card {
    border-left: 4px solid #ff6d00;
}

.vertical-tree-node-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
}

.lvl-0 .vertical-tree-node-avatar { background: rgba(255, 179, 0, 0.15); color: #ffb300; }
.lvl-1 .vertical-tree-node-avatar { background: rgba(0, 212, 170, 0.15); color: #00d4aa; }
.lvl-2 .vertical-tree-node-avatar { background: rgba(124, 77, 255, 0.15); color: #7c4dff; }
.lvl-3 .vertical-tree-node-avatar { background: rgba(255, 109, 0, 0.15); color: #ff6d00; }

.vertical-tree-node-info {
    flex: 1;
    min-width: 0;
}

.vertical-tree-node-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vertical-tree-node-level {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
}

.vertical-tree-node-invest {
    font-size: 0.82rem;
    font-weight: 700;
    color: #00d4aa;
    background: rgba(0, 212, 170, 0.08);
    border: 1px solid rgba(0, 212, 170, 0.15);
    padding: 3px 8px;
    border-radius: 12px;
    flex-shrink: 0;
}

/* Children Container & Line Connections */
.vertical-tree-children-container {
    padding-left: 20px;
    margin-left: 16px;
    border-left: 1.5px dashed rgba(0, 212, 170, 0.2);
    position: relative;
    margin-top: 4px;
}

.vertical-tree-children-container > .vertical-tree-node-wrapper::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 26px;
    width: 20px;
    height: 1.5px;
    background: rgba(0, 212, 170, 0.2);
}


/* ═══════════════════════════════════════════════════════════════
   Referral — Top Banner, Rank Card, Commission column
   ═══════════════════════════════════════════════════════════════ */

.top-referrer-banner {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    margin-bottom: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #b8860b 0%, #ffd54f 45%, #f57f17 100%);
    box-shadow: 0 8px 24px rgba(245, 127, 23, 0.35);
    border: 1px solid rgba(255, 236, 179, 0.6);
}

.top-referrer-banner .top-crown {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    animation: crownBob 2.4s ease-in-out infinite;
}

@keyframes crownBob {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-4px) rotate(4deg); }
}

.top-referrer-banner .top-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 2;
}

.top-referrer-banner .top-rank-tag {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #4e2f00;
    text-transform: uppercase;
}

.top-referrer-banner .top-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #2b1a00;
    text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}

.top-referrer-banner .top-shine {
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent);
    transform: skewX(-20deg);
    animation: shineSweep 3.2s ease-in-out infinite;
}

@keyframes shineSweep {
    0% { left: -60%; }
    60%, 100% { left: 130%; }
}

/* ── Top Referrers Podium (medal stand for the 3 leaders) ── */
.top-referrer-podium {
    position: relative;
    overflow: hidden;
    padding: 14px 14px 16px;
    margin-bottom: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2a1c05 0%, #4d3608 45%, #2a1c05 100%);
    border: 1px solid rgba(255, 215, 130, 0.35);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.top-referrer-podium .podium-title {
    position: relative;
    z-index: 2;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffe08a;
    margin-bottom: 12px;
}
.top-referrer-podium .podium-row {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
}
.top-referrer-podium .podium-place {
    flex: 1 1 0;
    max-width: 33%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.top-referrer-podium .place-1 { order: 2; }
.top-referrer-podium .place-2 { order: 1; }
.top-referrer-podium .place-3 { order: 3; }
.top-referrer-podium .podium-crown {
    font-size: 1.4rem;
    line-height: 1;
    margin-bottom: 2px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
    animation: crownBob 2.4s ease-in-out infinite;
}
.top-referrer-podium .podium-avatar {
    position: relative;
    font-size: 1.7rem;
    line-height: 1;
    margin-bottom: 4px;
}
.top-referrer-podium .place-1 .podium-avatar { font-size: 2rem; }
.top-referrer-podium .podium-medal-rank {
    position: absolute;
    right: -6px;
    bottom: -4px;
    width: 14px;
    height: 14px;
    font-size: 0.6rem;
    font-weight: 800;
    color: #2b1a00;
    background: #ffd54f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.top-referrer-podium .podium-name {
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
}
.top-referrer-podium .podium-refs {
    font-size: 0.92rem;
    font-weight: 900;
    color: #ffe08a;
    margin-top: 2px;
}
.top-referrer-podium .podium-refs-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #c9b78a;
    margin-bottom: 6px;
}
.top-referrer-podium .podium-bar {
    width: 100%;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 6px;
    font-weight: 900;
    font-size: 1rem;
    color: rgba(0,0,0,0.55);
}
.top-referrer-podium .place-1 .podium-bar { height: 64px; background: linear-gradient(180deg, #ffe066, #f5a623); }
.top-referrer-podium .place-2 .podium-bar { height: 46px; background: linear-gradient(180deg, #e6e9ef, #aab4c4); }
.top-referrer-podium .place-3 .podium-bar { height: 34px; background: linear-gradient(180deg, #f0b892, #c17a45); }

.rank-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.rank-card .rank-icon {
    font-size: 1.8rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(0, 212, 170, 0.12);
    border: 1px solid rgba(0, 212, 170, 0.25);
}

.rank-card .rank-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.rank-card .rank-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rank-card .rank-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #00d4aa;
}

.rank-card .rank-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-left: 14px;
    border-left: 1px solid rgba(255,255,255,0.08);
}

.rank-card .rank-count-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
}

.rank-card .rank-count-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.5);
}

.referral-table .commission-pct {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #00d4aa;
    background: rgba(0, 212, 170, 0.12);
    border: 1px solid rgba(0, 212, 170, 0.25);
}

.referral-link .referral-link,
#referral-link {
    word-break: break-all;
}

.wheel-text {
    position: absolute;
    width: 60px;
    height: 20px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 900;
    transform-origin: center center;
    pointer-events: none;
    line-height: 20px;
}

