/* ============================================
   CHURUPO WALLET - Premium Crypto Wallet UI
   ============================================ */

/* ---------- CSS CUSTOM PROPERTIES ---------- */
:root {
    /* Colors */
    --gold-100: #fef3c7;
    --gold-200: #f0d060;
    --gold-300: #daa520;
    --gold-400: #c8952e;
    --gold-500: #b8860b;
    --gold-600: #996515;
    --gold-gradient: linear-gradient(135deg, #f0d060 0%, #c8952e 50%, #daa520 100%);
    --gold-gradient-h: linear-gradient(90deg, #f0d060 0%, #c8952e 50%, #daa520 100%);
    --gold-shimmer: linear-gradient(90deg, transparent 0%, rgba(240, 208, 96, 0.4) 50%, transparent 100%);

    /* Dark theme */
    --bg-primary: #08080e;
    --bg-secondary: #0f0f1a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-glass: rgba(255, 255, 255, 0.06);

    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;

    --green: #22c55e;
    --red: #ef4444;

    /* Spacing */
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- RESET & BASE ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---------- UTILITY ---------- */
.positive { color: var(--green); }
.negative { color: var(--red); }

/* ================================================================
   SPLASH / LOADING SCREEN
   ================================================================ */

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #12101c 0%, #08080e 60%, #050508 100%);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.splash-screen.fade-out {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.splash-screen.hidden {
    display: none;
}

/* -- Radial glow behind logo -- */
.splash-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 149, 46, 0.15) 0%, rgba(200, 149, 46, 0.05) 40%, transparent 70%);
    animation: glowPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
}

/* -- Particles -- */
.particles-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--gold-200);
    pointer-events: none;
    opacity: 0;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(0);
    }
    10% {
        opacity: 0.8;
        transform: scale(1);
    }
    90% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) translateX(var(--drift, 30px)) scale(0.3);
    }
}

/* -- Splash Content -- */
.splash-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* -- Logo -- */
.logo-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logoEntry 1.2s var(--ease-out-back) both;
}

@keyframes logoEntry {
    0% {
        opacity: 0;
        transform: scale(0.3) rotateY(90deg);
    }
    60% {
        opacity: 1;
        transform: scale(1.05) rotateY(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.logo-img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 20px rgba(200, 149, 46, 0.5));
    animation: logoPulse 2.5s ease-in-out infinite 1.2s, logoSpin 20s linear infinite;
}

@keyframes logoPulse {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(200, 149, 46, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(240, 208, 96, 0.8)) drop-shadow(0 0 80px rgba(200, 149, 46, 0.3));
    }
}

@keyframes logoSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

/* Decorative rotating rings */
.logo-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid transparent;
}

.logo-ring--outer {
    width: 180px;
    height: 180px;
    border-top-color: rgba(240, 208, 96, 0.4);
    border-right-color: rgba(240, 208, 96, 0.1);
    animation: ringRotate 4s linear infinite;
}

.logo-ring--inner {
    width: 165px;
    height: 165px;
    border-bottom-color: rgba(200, 149, 46, 0.3);
    border-left-color: rgba(200, 149, 46, 0.1);
    animation: ringRotate 3s linear infinite reverse;
}

@keyframes ringRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Shine effect over logo */
.logo-shine {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
}

.logo-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        135deg,
        transparent 40%,
        rgba(255, 255, 255, 0.15) 45%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.15) 55%,
        transparent 60%
    );
    animation: shineMove 3s ease-in-out infinite 1.5s;
}

@keyframes shineMove {
    0% { transform: translateX(-100%) translateY(-100%) rotate(0deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(0deg); }
}

/* -- Title -- */
.splash-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    background: var(--gold-gradient-h);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleEntry 0.8s var(--ease-out-expo) 0.6s both;
    text-align: center;
}

@keyframes titleEntry {
    0% {
        opacity: 0;
        letter-spacing: 0.8em;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        letter-spacing: 0.3em;
        transform: translateY(0);
    }
}

.splash-subtitle {
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
    animation: fadeUp 0.6s var(--ease-out-expo) 0.9s both;
    margin-top: -12px;
}

@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* -- Progress Bar -- */
.progress-container {
    width: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: fadeUp 0.6s var(--ease-out-expo) 1.1s both;
}

.progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gold-gradient-h);
    border-radius: var(--radius-full);
    transition: width 0.1s linear;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gold-shimmer);
    animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.progress-glow {
    position: absolute;
    top: -4px;
    right: 0;
    width: 30px;
    height: 12px;
    background: radial-gradient(circle, rgba(240, 208, 96, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.progress-track:has(.progress-bar[style]) .progress-glow {
    opacity: 1;
}

.progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold-300);
    letter-spacing: 0.1em;
}

/* -- Loading text -- */
.loading-text {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    animation: fadeUp 0.6s var(--ease-out-expo) 1.3s both, textPulse 2s ease-in-out infinite 1.5s;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ================================================================
   WELCOME / MAIN SCREEN
   ================================================================ */

.welcome-screen {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-primary);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ease-out-expo) 0.3s, transform 0.8s var(--ease-out-expo) 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.welcome-screen.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Background subtle particles */
.welcome-bg-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.welcome-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--gold-300);
    border-radius: 50%;
    opacity: 0.15;
    animation: welcomeParticleDrift 15s linear infinite;
}

@keyframes welcomeParticleDrift {
    0% { transform: translateY(100vh) translateX(0); opacity: 0; }
    10% { opacity: 0.15; }
    90% { opacity: 0.05; }
    100% { transform: translateY(-20px) translateX(var(--drift, 20px)); opacity: 0; }
}

/* ---------- HEADER ---------- */
.wallet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    position: relative;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(200, 149, 46, 0.3);
}

.header-brand {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--gold-gradient-h);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.header-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    position: relative;
}

.header-icon:hover {
    background: var(--bg-card-hover);
    color: var(--gold-200);
    transform: translateY(-1px);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    background: var(--gold-300);
    border-radius: 50%;
    border: 1.5px solid var(--bg-primary);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ---------- BALANCE CARD ---------- */
.wallet-main {
    flex: 1;
    padding: 0 20px 100px;
    position: relative;
    z-index: 1;
    overflow-y: auto;
}

.balance-card {
    position: relative;
    background: linear-gradient(145deg, rgba(200, 149, 46, 0.12) 0%, rgba(200, 149, 46, 0.03) 100%);
    border: 1px solid rgba(200, 149, 46, 0.15);
    border-radius: var(--radius-xl);
    padding: 28px 24px 20px;
    margin-bottom: 28px;
    overflow: hidden;
    animation: cardSlideUp 0.6s var(--ease-out-expo) both;
}

@keyframes cardSlideUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.balance-card-bg {
    position: absolute;
    top: -50%;
    right: -30%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 208, 96, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.balance-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 6px;
}

.balance-amount {
    font-size: 2.6rem;
    font-weight: 800;
    background: var(--gold-gradient-h);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    margin-bottom: 8px;
}

.balance-change {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(34, 197, 94, 0.1);
    margin-bottom: 20px;
}

/* Action buttons */
.balance-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    transition: all 0.3s var(--ease-out-expo);
}

.action-btn:hover {
    background: rgba(200, 149, 46, 0.15);
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0) scale(0.97);
}

.action-btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gold-gradient);
    color: #1a1000;
}

/* ---------- TOKENS SECTION ---------- */
.tokens-section {
    animation: cardSlideUp 0.6s var(--ease-out-expo) 0.15s both;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.see-all-btn {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gold-300);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.see-all-btn:hover {
    color: var(--gold-200);
}

.token-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Token item */
.token-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    animation: tokenFadeIn 0.5s var(--ease-out-expo) both;
}

.token-item:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.token-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.token-info {
    flex: 1;
    min-width: 0;
}

.token-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.token-symbol {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.token-values {
    text-align: right;
}

.token-balance {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.token-usd {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

@keyframes tokenFadeIn {
    0% { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* ---------- BOTTOM NAV ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 8px calc(8px + var(--safe-bottom));
    background: linear-gradient(to top, rgba(8, 8, 14, 0.98) 60%, rgba(8, 8, 14, 0.8) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out-expo);
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 3px;
    border-radius: var(--radius-full);
    background: var(--gold-gradient-h);
    transition: transform 0.3s var(--ease-out-expo);
}

.nav-item.active {
    color: var(--gold-200);
}

.nav-item.active::before {
    transform: translateX(-50%) scaleX(1);
}

.nav-item:hover:not(.active) {
    color: var(--text-secondary);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 380px) {
    .splash-title {
        font-size: 1.5rem;
    }

    .logo-wrapper {
        width: 130px;
        height: 130px;
    }

    .logo-img {
        width: 110px;
        height: 110px;
    }

    .logo-ring--outer {
        width: 150px;
        height: 150px;
    }

    .logo-ring--inner {
        width: 135px;
        height: 135px;
    }

    .balance-amount {
        font-size: 2rem;
    }
}

@media (min-width: 600px) {
    .wallet-main {
        max-width: 500px;
        margin: 0 auto;
    }

    .wallet-header {
        max-width: 500px;
        margin: 0 auto;
    }

    .bottom-nav {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
}

/* ================================================================
   USER PROFILE CHIP & MODALS
   ================================================================ */
.user-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(200, 149, 46, 0.12);
    border: 1px solid rgba(200, 149, 46, 0.3);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    color: var(--gold-200);
}

.user-chip:hover {
    background: rgba(200, 149, 46, 0.25);
    transform: translateY(-1px);
}

.user-chip-avatar {
    font-size: 1rem;
}

.user-chip-alias {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ---------- TAB CONTENTS ---------- */
.tab-content {
    animation: tabFadeIn 0.4s var(--ease-out-expo) both;
}

@keyframes tabFadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.placeholder-tab-view {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.placeholder-tab-view h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.placeholder-tab-view p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ================================================================
   REFERRAL & PYRAMID SYSTEM STYLES
   ================================================================ */
.referral-card {
    background: linear-gradient(135deg, rgba(200, 149, 46, 0.15) 0%, rgba(15, 15, 26, 0.8) 100%);
    border: 1px solid rgba(240, 208, 96, 0.25);
    border-radius: var(--radius-xl);
    padding: 22px 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.referral-card-header {
    margin-bottom: 16px;
}

.ref-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--gold-gradient);
    color: #120b00;
    margin-bottom: 8px;
}

.ref-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ref-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.ref-code-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(240, 208, 96, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 14px;
}

.ref-code-info {
    display: flex;
    flex-direction: column;
}

.ref-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ref-code-value {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--gold-200);
}

.btn-copy-ref {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--gold-gradient);
    border: none;
    border-radius: var(--radius-sm);
    color: #120b00;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
}

.btn-copy-ref:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-primary-action {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
}

.btn-primary-action:hover {
    background: rgba(240, 208, 96, 0.15);
    border-color: rgba(240, 208, 96, 0.4);
    color: var(--gold-200);
}

/* ---------- STATS GRID ---------- */
.pyramid-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.p-stat-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.p-stat-card.highlight {
    background: rgba(200, 149, 46, 0.08);
    border-color: rgba(200, 149, 46, 0.2);
}

.p-stat-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.p-stat-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--gold-200);
}

.p-stat-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* ---------- HIERARCHY TIERS SECTION ---------- */
.pyramid-tiers-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hierarchy-badge {
    font-size: 0.75rem;
    color: var(--gold-300);
    background: rgba(200, 149, 46, 0.1);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.tier-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    transition: all 0.3s var(--ease-out-expo);
}

.tier-card.level-1 { border-left: 4px solid var(--gold-200); }
.tier-card.level-2 { border-left: 4px solid #627eea; }
.tier-card.level-3 { border-left: 4px solid #9945ff; }

.tier-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
}

.tier-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: #120b00;
}

.level-1 .tier-icon { background: var(--gold-gradient); }
.level-2 .tier-icon { background: linear-gradient(135deg, #627eea, #8fa8ff); color: #fff; }
.level-3 .tier-icon { background: linear-gradient(135deg, #9945ff, #14f195); color: #fff; }

.tier-info {
    flex: 1;
}

.tier-info h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tier-info p {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.tier-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold-300);
}

.tier-user-list {
    padding: 6px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tier-empty-msg {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 8px 0;
}

.tier-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.t-user-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.t-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(200, 149, 46, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.t-user-details {
    display: flex;
    flex-direction: column;
}

.t-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.t-user-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.t-user-earnings {
    text-align: right;
}

.t-earning-val {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--green);
}

.t-earning-label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* ================================================================
   MODALS & OVERLAYS
   ================================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(5, 5, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out-expo);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: 100%;
    max-width: 440px;
    background: #0d0d16;
    border: 1px solid rgba(240, 208, 96, 0.25);
    border-radius: var(--radius-xl);
    padding: 26px 22px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.3s var(--ease-out-expo);
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-icon {
    font-size: 2.2rem;
    margin-bottom: 6px;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.modal-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus {
    border-color: var(--gold-300);
    background: rgba(200, 149, 46, 0.08);
    box-shadow: 0 0 10px rgba(240, 208, 96, 0.2);
}

.sponsor-preview-box {
    margin-top: 4px;
    padding: 8px 12px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-label {
    color: var(--text-secondary);
}

.preview-name {
    font-weight: 700;
    color: var(--green);
}

/* Error message inside referral verification modal */
.refcheck-error {
    margin-top: -4px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.btn-submit-form {
    width: 100%;
    padding: 14px;
    background: var(--gold-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: #120b00;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    transition: all 0.3s var(--ease-out-expo);
}

.btn-submit-form:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 149, 46, 0.4);
}

.user-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.account-item:hover {
    background: rgba(200, 149, 46, 0.15);
    border-color: rgba(200, 149, 46, 0.3);
}

.account-item.active {
    background: rgba(200, 149, 46, 0.2);
    border-color: var(--gold-300);
}

.account-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-avatar {
    font-size: 1.2rem;
}

.account-info {
    display: flex;
    flex-direction: column;
}

.account-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.account-code {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.account-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gold-200);
    padding: 2px 8px;
    background: rgba(200, 149, 46, 0.15);
    border-radius: var(--radius-full);
}

.btn-secondary-action {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary-action:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--gold-300);
}

/* Toast */
.toast-notification {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(18, 16, 28, 0.95);
    border: 1px solid var(--gold-300);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s var(--ease-out-expo);
    z-index: 2000;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* ================================================================
   AUTH SCREEN (LOGIN GATE)
   ================================================================ */
.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.auth-screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

.auth-content {
    background: linear-gradient(145deg, rgba(200, 149, 46, 0.08) 0%, rgba(200, 149, 46, 0.02) 100%);
    border: 1px solid rgba(200, 149, 46, 0.15);
    border-radius: var(--radius-xl);
    padding: 40px 24px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: cardSlideUp 0.8s var(--ease-out-expo) both;
}

.auth-logo-wrapper {
    margin: 0 auto 24px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    padding: 4px;
    background: var(--gold-gradient);
}

.auth-logo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-primary);
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--gold-gradient-h);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    font-size: 1rem;
}

/* ================================================================
   ADMIN PANEL STYLES
   ================================================================ */
.admin-screen {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-primary);
    position: relative;
    z-index: 800;
    display: flex;
    flex-direction: column;
}

.admin-screen.hidden {
    display: none;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(15, 15, 26, 0.95);
    border-bottom: 1px solid rgba(200, 149, 46, 0.2);
}

.btn-logout-admin {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout-admin:hover {
    background: rgba(239, 68, 68, 0.25);
}

.admin-main {
    flex: 1;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-toolbar-actions {
    display: flex;
    gap: 10px;
}

.admin-users-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-user-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    transition: all 0.2s;
}

.admin-user-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(200, 149, 46, 0.3);
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 240px;
}

.admin-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(200, 149, 46, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.admin-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-user-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-user-alias {
    font-size: 0.78rem;
    color: var(--gold-200);
    font-weight: 600;
}

.admin-user-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.admin-user-balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 140px;
}

.admin-balance-val {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold-300);
}

.admin-balance-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.admin-user-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-admin-act {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-admin-act:hover {
    background: rgba(200, 149, 46, 0.2);
    border-color: var(--gold-300);
    color: var(--gold-200);
}

.btn-admin-act.danger {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
}

.btn-admin-act.danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: var(--red);
    color: #fff;
}
