:root {
    /* Core Colors */
    --bg-0: #070712;
    --bg-1: #0d0d1f;
    --bg-2: #13132b;
    --bg-3: #1a1a38;
    --bg-card: #141428;
    --bg-card-hover: #191935;

    /* Brand Gradients */
    --grad-primary: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    --grad-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --grad-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --grad-blue: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --grad-purple: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    --grad-cyan: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --grad-header: linear-gradient(180deg, rgba(13,13,31,0.98) 0%, rgba(13,13,31,0.0) 100%);

    /* Glow Shadows */
    --glow-gold: 0 0 20px rgba(245,158,11,0.35), 0 4px 16px rgba(0,0,0,0.5);
    --glow-purple: 0 0 20px rgba(124,58,237,0.4), 0 4px 16px rgba(0,0,0,0.5);
    --glow-green: 0 0 20px rgba(16,185,129,0.35), 0 4px 16px rgba(0,0,0,0.5);
    --shadow-card: 0 2px 12px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.7);

    /* Text */
    --text-1: #f0f0ff;
    --text-2: #9090c0;
    --text-3: #5050a0;
    --text-gold: #f59e0b;
    --text-green: #10b981;
    --text-red: #ef4444;

    /* Accent */
    --color-gold: #f59e0b;
    --color-primary: #7c3aed;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-blue: #3b82f6;

    /* Spacing */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-xl: 24px;
    --r-2xl: 32px;

    /* Nav height */
    --nav-h: 72px;
    --status-h: 64px;

    /* Fonts */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
}

/* ── RESET ── */
*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html { height: 100%; overflow: hidden; }

body {
    font-family: var(--font);
    background: var(--bg-0);
    color: var(--text-1);
    height: 100%;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

/* ── LOADING ── */
.loading-screen {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg-0);
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
}

.loading-content {
    display: flex; flex-direction: column; align-items: center; gap: 32px;
    animation: fadeInUp 0.5s ease;
}

.loading-logo { text-align: center; }

.logo-icon {
    width: 96px; height: 96px; margin: 0 auto 20px;
    background: var(--grad-primary);
    border-radius: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 48px;
    box-shadow: var(--glow-purple);
    animation: logoFloat 3s ease-in-out infinite;
}

.loading-logo h1 {
    font-family: var(--font-display);
    font-size: 28px; font-weight: 700;
    background: var(--grad-gold);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.loading-logo p { color: var(--text-2); font-size: 14px; }

.loading-bar-wrap {
    width: 240px; display: flex; flex-direction: column; gap: 8px; align-items: center;
}

.loading-bar {
    width: 100%; height: 4px; background: var(--bg-3); border-radius: 2px; overflow: hidden;
}

.loading-progress {
    height: 100%; width: 0%;
    background: var(--grad-gold);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.loading-percent { font-size: 13px; color: var(--text-2); font-family: var(--font-display); }

/* ── APP ── */
.app {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    background: var(--bg-0);
}

.hidden { display: none !important; }

/* ── STATUS BAR ── */
.status-bar {
    height: var(--status-h);
    background: rgba(10,10,26,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    z-index: 50;
    flex-shrink: 0;
}

.status-left { display: flex; align-items: center; gap: 10px; }

.avatar-wrap {
    position: relative; width: 40px; height: 40px; flex-shrink: 0;
}

.avatar-inner {
    width: 40px; height: 40px; border-radius: 12px;
    background: var(--grad-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700;
    box-shadow: var(--glow-purple);
}

.avatar-level {
    position: absolute; bottom: -4px; right: -4px;
    background: var(--grad-gold);
    color: #1a0e00; font-size: 9px; font-weight: 800;
    border-radius: 6px; padding: 1px 4px;
    min-width: 18px; text-align: center;
    font-family: var(--font-display);
}

.status-info { display: flex; flex-direction: column; gap: 4px; }

.status-name { font-size: 13px; font-weight: 600; line-height: 1; }

.xp-mini {
    width: 70px; height: 3px; background: var(--bg-3); border-radius: 2px; overflow: hidden;
}

.xp-mini-bar {
    height: 100%; width: 0%; background: var(--grad-gold);
    border-radius: 2px; transition: width 0.4s ease;
}

.status-right { display: flex; align-items: center; gap: 6px; }

.currency-pill {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 700;
    font-family: var(--font-display);
}

.currency-pill.gold {
    background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.25);
    color: var(--color-gold);
}

.currency-pill.blue {
    background: rgba(124,58,237,0.15);
    border: 1px solid rgba(124,58,237,0.25);
    color: #a78bfa;
}

.pps-pill {
    display: flex; align-items: center; gap: 4px;
    padding: 5px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.2);
    color: var(--color-success);
    font-family: var(--font-display);
}

/* ── MAIN CONTENT ── */
.main-content {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding-bottom: 8px;
}

/* Smooth scrollbar */
.main-content::-webkit-scrollbar { width: 3px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── BOTTOM NAV ── */
.bottom-nav {
    height: var(--nav-h);
    background: rgba(10,10,26,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex; align-items: center; justify-content: space-around;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    flex-shrink: 0;
    z-index: 50;
}

.nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: transparent; border: none;
    color: var(--text-3); cursor: pointer;
    padding: 8px 4px; border-radius: var(--r-lg);
    transition: color 0.2s;
    font-family: var(--font);
    font-size: 10px; font-weight: 500;
    position: relative;
}

.nav-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    font-size: 18px;
    transition: background 0.2s, transform 0.15s;
}

.nav-item.active { color: var(--color-gold); }

.nav-item.active .nav-icon {
    background: rgba(245,158,11,0.15);
    color: var(--color-gold);
    transform: translateY(-2px);
}

.nav-item:active .nav-icon { transform: scale(0.9) translateY(-1px); }

.nav-badge {
    position: absolute; top: 4px; right: calc(50% - 22px);
    width: 8px; height: 8px; background: var(--color-danger);
    border-radius: 50%; border: 2px solid var(--bg-0);
}

/* ── PAGE CONTAINER ── */
.page { padding: 16px; padding-top: 0; animation: pageIn 0.25s ease; }

@keyframes pageIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── SECTION HEADERS ── */
.page-header {
    padding: 16px 0 12px;
    display: flex; align-items: center; justify-content: space-between;
}

.page-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.page-sub { font-size: 13px; color: var(--text-2); margin-bottom: 16px; }

.section-title {
    font-size: 14px; font-weight: 600; color: var(--text-2);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin: 20px 0 10px;
}

/* ── CARDS ── */
.card {
    background: var(--bg-card);
    border-radius: var(--r-lg);
    padding: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(255,255,255,0.05);
    transition: border-color 0.15s;
}

.card:active { border-color: rgba(255,255,255,0.1); }

.card-sm { padding: 12px; border-radius: var(--r-md); }

/* ── HOME PAGE ── */
.home-hero {
    background: var(--bg-card);
    border-radius: 0 0 var(--r-2xl) var(--r-2xl);
    padding: 20px 16px 24px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    border-top: none;
    position: relative; overflow: hidden;
}

.home-hero::before {
    content: '';
    position: absolute; top: -40px; right: -40px;
    width: 160px; height: 160px;
    background: radial-gradient(circle, rgba(124,58,237,0.2) 0%, transparent 70%);
    pointer-events: none;
}

.hero-earnings {
    text-align: center; margin-bottom: 20px;
}

.hero-label { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }

.hero-amount {
    font-family: var(--font-display);
    font-size: 36px; font-weight: 800;
    color: var(--text-gold);
    line-height: 1;
}

.hero-pps { font-size: 13px; color: var(--text-green); margin-top: 6px; }

.xp-bar-full {
    background: var(--bg-2); border-radius: 8px; height: 10px; overflow: hidden;
    position: relative; margin-bottom: 8px;
}

.xp-bar-fill {
    height: 100%;
    background: var(--grad-gold);
    border-radius: 8px;
    transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
    position: relative; overflow: hidden;
}

.xp-bar-fill::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

.xp-bar-info {
    display: flex; justify-content: space-between;
    font-size: 11px; color: var(--text-2); font-family: var(--font-display);
}

.quick-actions {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin-bottom: 16px;
}

.quick-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--r-md); padding: 12px 8px;
    cursor: pointer; color: var(--text-1);
    transition: transform 0.15s, background 0.15s;
    font-size: 11px; font-family: var(--font); font-weight: 500;
}

.quick-btn:active { transform: scale(0.93); background: var(--bg-3); }

.quick-btn-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}

.qb-gold { background: rgba(245,158,11,0.15); color: var(--color-gold); }
.qb-purple { background: rgba(124,58,237,0.15); color: #a78bfa; }
.qb-green { background: rgba(16,185,129,0.15); color: var(--color-success); }
.qb-blue { background: rgba(59,130,246,0.15); color: #60a5fa; }

.stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card); border-radius: var(--r-lg);
    padding: 14px; border: 1px solid rgba(255,255,255,0.05);
}

.stat-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; margin-bottom: 10px;
}

.stat-value { font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1; margin-bottom: 3px; }
.stat-label { font-size: 11px; color: var(--text-2); }

/* Daily login streak */
.streak-card {
    background: linear-gradient(135deg, rgba(245,158,11,0.12) 0%, rgba(217,119,6,0.08) 100%);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: var(--r-lg); padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}

.streak-left { display: flex; align-items: center; gap: 12px; }
.streak-fire { font-size: 28px; }
.streak-info { }
.streak-num { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--color-gold); line-height: 1; }
.streak-label { font-size: 12px; color: var(--text-2); }

/* Active investments mini */
.invest-mini {
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--r-lg); padding: 14px; margin-bottom: 10px;
}

.invest-mini-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.invest-mini-name { font-weight: 600; font-size: 14px; }
.invest-mini-amount { font-family: var(--font-display); color: var(--color-gold); font-size: 13px; }

.mini-progress-bar {
    height: 6px; background: var(--bg-3); border-radius: 4px; overflow: hidden;
}

.mini-progress-fill {
    height: 100%; background: var(--grad-blue);
    border-radius: 4px; transition: width 1s linear;
}

/* ── UPGRADE CARDS ── */
.upgrade-card {
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--r-lg); padding: 14px; margin-bottom: 10px;
    display: flex; align-items: center; gap: 14px;
    transition: border-color 0.2s;
    position: relative; overflow: hidden;
}

.upgrade-card.locked { opacity: 0.55; }

.upgrade-card.maxed { border-color: rgba(245,158,11,0.2); }

.upgrade-icon-wrap {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; flex-shrink: 0;
}

.upgrade-info { flex: 1; min-width: 0; }

.upgrade-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.upgrade-desc { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }

.upgrade-meta { display: flex; align-items: center; gap: 10px; }

.upgrade-pps { font-size: 12px; color: var(--color-success); font-family: var(--font-display); }

.upgrade-level-badge {
    font-size: 11px; padding: 2px 8px; border-radius: 20px;
    background: rgba(255,255,255,0.07); color: var(--text-2);
    font-family: var(--font-display);
}

.upgrade-action { flex-shrink: 0; }

.lock-badge {
    position: absolute; top: 10px; right: 10px;
    background: rgba(239,68,68,0.2); color: var(--color-danger);
    font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
    border: 1px solid rgba(239,68,68,0.3);
    display: flex; align-items: center; gap: 4px;
}

/* ── BUTTONS ── */
.btn-primary, .btn-success, .btn-danger, .btn-outline, .btn-ghost, .btn-glow {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: var(--r-md);
    font-family: var(--font); font-size: 14px; font-weight: 600;
    border: none; cursor: pointer; transition: all 0.15s;
    min-height: 42px; white-space: nowrap;
}

.btn-primary {
    background: var(--grad-primary); color: #fff;
    box-shadow: 0 2px 12px rgba(124,58,237,0.3);
}

.btn-primary:active { transform: scale(0.95); }

.btn-success {
    background: var(--grad-success); color: #fff;
    box-shadow: 0 2px 12px rgba(16,185,129,0.3);
}

.btn-success:active { transform: scale(0.95); }

.btn-success:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-danger { background: var(--grad-danger); color: #fff; }
.btn-danger:active { transform: scale(0.95); }

.btn-outline {
    background: transparent; color: var(--text-1);
    border: 1px solid rgba(255,255,255,0.15);
}

.btn-outline:active { background: rgba(255,255,255,0.05); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:active { color: var(--text-1); }

.btn-ghost-sm { background: transparent; color: var(--text-2); border: none; cursor: pointer; font-size: 13px; padding: 8px 16px; font-family: var(--font); }

.btn-glow {
    background: var(--grad-gold); color: #1a0e00; font-weight: 700;
    box-shadow: var(--glow-gold);
    width: 100%;
}

.btn-glow:active { transform: scale(0.97); }

.btn-coin {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 14px; border-radius: 22px; border: none;
    background: rgba(245,158,11,0.15); color: var(--color-gold);
    border: 1px solid rgba(245,158,11,0.25);
    font-family: var(--font-display); font-size: 13px; font-weight: 700;
    cursor: pointer; transition: all 0.15s; min-height: 38px;
}

.btn-coin:active { transform: scale(0.93); background: rgba(245,158,11,0.25); }

.w100 { width: 100%; }

/* ── TABS ── */
.tab-scroll {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 16px;
    scrollbar-width: none;
}

.tab-scroll::-webkit-scrollbar { display: none; }

.tab-btn {
    flex-shrink: 0; padding: 7px 16px; border-radius: 20px; border: none;
    background: var(--bg-3); color: var(--text-2);
    font-family: var(--font); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}

.tab-btn.active {
    background: var(--grad-primary); color: #fff;
    box-shadow: 0 2px 10px rgba(124,58,237,0.3);
}

/* ── MODALS ── */
.modal {
    position: fixed; inset: 0; z-index: 500;
    display: flex; align-items: flex-end; justify-content: center;
    padding: 0;
}

.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    position: relative; z-index: 1;
    background: var(--bg-2);
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    width: 100%; max-width: 600px;
    padding: 32px 24px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0));
    text-align: center;
    box-shadow: var(--shadow-xl);
    border-top: 1px solid rgba(255,255,255,0.08);
    animation: sheetUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes sheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-close {
    position: absolute; top: 16px; right: 16px;
    background: var(--bg-3); border: none; color: var(--text-2);
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 14px;
    transition: background 0.15s;
}

.modal-close:hover { background: var(--bg-card); color: var(--text-1); }

/* Level Up Modal */
.level-up-modal { padding-top: 40px; }

.level-up-bg {
    position: absolute; inset: 0; border-radius: inherit;
    background: radial-gradient(ellipse at top, rgba(245,158,11,0.12) 0%, transparent 60%);
    pointer-events: none;
}

.level-up-icon {
    font-size: 64px; color: var(--color-gold); margin-bottom: 16px; display: block;
    animation: iconBounce 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

.level-up-badge {
    width: 80px; height: 80px; margin: 0 auto 16px;
    background: var(--grad-gold); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 42px; font-weight: 900;
    color: #1a0e00; box-shadow: var(--glow-gold);
    animation: levelPop 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.1s both;
}

.level-up-modal h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.level-up-modal p { color: var(--text-2); font-size: 14px; margin-bottom: 20px; }

/* Investment modal */
.invest-modal { }
.invest-icon { font-size: 56px; margin-bottom: 16px; display: block; }
.invest-icon.success { color: var(--color-success); }
.invest-icon.failure { color: var(--color-danger); }
.invest-modal h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.invest-modal p { color: var(--text-2); font-size: 13px; margin-bottom: 20px; }


/* Legal modal (Privacy Policy / Terms of Use) */
.legal-modal-content {
    text-align: left;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.legal-text-body {
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
}

.legal-text-body h4 {
    font-size: 12px; font-weight: 700; color: var(--color-gold);
    text-transform: uppercase; letter-spacing: 0.04em;
    margin: 16px 0 6px;
}

.legal-text-body h4:first-child { margin-top: 0; }

.legal-text-body p {
    font-size: 13px; line-height: 1.6; color: var(--text-2);
    margin-bottom: 4px;
}

.legal-text-body::-webkit-scrollbar { width: 4px; }
.legal-text-body::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }

.invest-result-box {
    background: var(--bg-3); border-radius: var(--r-md); padding: 16px; margin-bottom: 20px;
}

.invest-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.invest-row span:first-child { color: var(--text-2); font-size: 13px; }
.invest-row .val { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.invest-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 6px 0; }

/* Ad modal */
.ad-modal { }
.ad-gift-icon {
    width: 72px; height: 72px; margin: 0 auto 16px;
    background: var(--grad-gold); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; color: #1a0e00;
    animation: giftPulse 2s ease-in-out infinite;
}

.ad-modal h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.ad-modal p { color: var(--text-2); font-size: 13px; margin-bottom: 20px; }

/* Rewards row */
.reward-row {
    display: flex; gap: 12px; justify-content: center; margin-bottom: 24px;
}

.reward-chip {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 18px; border-radius: 20px;
    font-family: var(--font-display); font-size: 16px; font-weight: 700;
}

.reward-chip.gold {
    background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.3);
    color: var(--color-gold);
}

.reward-chip.blue {
    background: rgba(124,58,237,0.15);
    border: 1px solid rgba(124,58,237,0.3);
    color: #a78bfa;
}

/* ── TASKS ── */
.task-card {
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--r-lg); padding: 14px; margin-bottom: 10px;
    display: flex; gap: 12px; position: relative;
}

.task-card.completed-card { border-color: rgba(16,185,129,0.2); }

.task-card-icon {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
}

.task-card-info { flex: 1; min-width: 0; }
.task-card-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.task-card-desc { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }

.task-card-bottom { display: flex; align-items: center; justify-content: space-between; }

.task-rewards { display: flex; gap: 8px; align-items: center; }

.t-reward { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 3px; }
.t-reward .fa-coins { color: var(--color-gold); }
.t-reward .fa-gem { color: #a78bfa; }
.t-reward .fa-star { color: var(--color-gold); }

.task-progress-bar {
    height: 4px; background: var(--bg-3); border-radius: 2px; overflow: hidden; margin-bottom: 6px;
}

.task-progress-fill { height: 100%; background: var(--grad-purple); border-radius: 2px; transition: width 0.4s; }

.task-progress-text { font-size: 11px; color: var(--text-3); font-family: var(--font-display); }

.task-dot {
    position: absolute; top: 12px; right: 12px;
    width: 8px; height: 8px; background: var(--color-danger);
    border-radius: 50%;
    animation: dotPulse 1.5s ease-in-out infinite;
}

/* ── LEADERBOARD ── */
.lb-my-rank {
    background: linear-gradient(135deg, rgba(124,58,237,0.15) 0%, rgba(79,70,229,0.1) 100%);
    border: 1px solid rgba(124,58,237,0.25);
    border-radius: var(--r-lg); padding: 14px; margin-bottom: 16px;
    display: flex; align-items: center; gap: 12px;
}

.lb-row {
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--r-md); padding: 12px; margin-bottom: 8px;
    display: flex; align-items: center; gap: 12px;
}

.lb-rank {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: 14px;
    flex-shrink: 0;
}

.lb-rank.gold { background: var(--grad-gold); color: #1a0e00; }
.lb-rank.silver { background: linear-gradient(135deg, #c0c0c0 0%, #808080 100%); color: #fff; }
.lb-rank.bronze { background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%); color: #fff; }
.lb-rank.normal { background: var(--bg-3); color: var(--text-2); }

.lb-avatar {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--grad-primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; flex-shrink: 0;
}

.lb-info { flex: 1; }
.lb-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.lb-meta { font-size: 12px; color: var(--text-2); font-family: var(--font-display); }
.lb-val { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--color-gold); }

/* ── MARKET ── */
.market-banner {
    background: var(--grad-purple); border-radius: var(--r-xl);
    padding: 20px; margin-bottom: 16px; position: relative; overflow: hidden;
}

.market-banner::after {
    content: ''; position: absolute; top: -20px; right: -20px;
    width: 120px; height: 120px;
    background: rgba(255,255,255,0.08); border-radius: 50%;
}

.market-banner .discount-tag {
    display: inline-block;
    background: var(--color-danger); color: #fff;
    font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
    margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em;
}

.market-banner h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.market-banner p { font-size: 13px; opacity: 0.85; margin-bottom: 16px; }

.market-item {
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--r-lg); padding: 14px;
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}

.market-item-left { display: flex; align-items: center; gap: 12px; }

.market-item-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
    flex-shrink: 0;
}

.market-item-name { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.market-item-sub { font-size: 12px; color: var(--text-2); }

/* ── STOCK / INVESTMENT ── */
.stock-card {
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--r-lg); padding: 14px; margin-bottom: 10px;
}

.stock-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stock-symbol {
    width: 44px; height: 44px; border-radius: 10px; background: var(--bg-3);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 11px; font-weight: 700;
    color: var(--text-2);
}

.stock-name-wrap { flex: 1; padding: 0 12px; }
.stock-name { font-weight: 600; font-size: 14px; }
.stock-price { font-family: var(--font-display); font-size: 13px; color: var(--text-2); }
.stock-change { font-size: 13px; font-weight: 600; font-family: var(--font-display); }
.stock-change.up { color: var(--color-success); }
.stock-change.down { color: var(--color-danger); }

/* Active investment progress */
.active-inv-card {
    background: linear-gradient(135deg, rgba(59,130,246,0.12) 0%, rgba(37,99,235,0.08) 100%);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: var(--r-lg); padding: 14px; margin-bottom: 10px;
}

.active-inv-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.active-inv-name { font-weight: 600; font-size: 14px; }
.active-inv-amount { font-family: var(--font-display); font-size: 13px; color: var(--color-gold); }
.active-inv-time { font-family: var(--font-display); font-size: 12px; color: var(--text-2); margin-top: 2px; text-align: right; }

/* ── PROFILE ── */
.profile-hero {
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--r-xl); padding: 24px 16px 20px;
    text-align: center; margin-bottom: 16px;
    position: relative; overflow: hidden;
}

.profile-hero::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 80px;
    background: linear-gradient(180deg, rgba(124,58,237,0.15) 0%, transparent 100%);
    pointer-events: none;
}

.profile-avatar {
    width: 80px; height: 80px; margin: 0 auto 12px;
    border-radius: 24px; display: flex; align-items: center; justify-content: center;
    font-size: 40px; font-weight: 700; position: relative;
}

.profile-level-ring {
    position: absolute; inset: -3px; border-radius: 27px;
    border: 2px solid transparent;
    background: var(--grad-gold) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
}

.profile-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.profile-level-badge {
    display: inline-block; padding: 4px 16px; border-radius: 20px;
    background: var(--grad-primary); font-size: 13px; font-weight: 600; margin-bottom: 12px;
}

.profile-xp-bar { margin: 0 16px 8px; }

.profile-stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px;
}

.p-stat {
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--r-md); padding: 12px;
    display: flex; justify-content: space-between; align-items: center;
}

.p-stat-label { font-size: 12px; color: var(--text-2); }
.p-stat-val { font-family: var(--font-display); font-size: 15px; font-weight: 700; }

/* Frames grid */
.frames-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}

.frame-item {
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--r-md); padding: 12px;
    text-align: center; cursor: pointer;
    transition: border-color 0.2s;
}

.frame-item.active-frame { border-color: var(--color-gold); box-shadow: var(--glow-gold); }

.frame-preview {
    width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700;
}

.frame-name { font-size: 11px; color: var(--text-2); margin-bottom: 6px; }

/* ── REFERRAL ── */
.referral-code-card {
    background: var(--grad-purple); border-radius: var(--r-xl);
    padding: 24px; text-align: center; margin-bottom: 16px;
    position: relative; overflow: hidden;
}

.referral-code-box {
    background: rgba(0,0,0,0.3); border-radius: var(--r-md);
    padding: 12px 20px; display: inline-flex; align-items: center; gap: 12px;
    margin: 12px 0;
}

.referral-code { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: 0.05em; }

.copy-btn {
    background: transparent; border: none; color: rgba(255,255,255,0.7);
    font-size: 18px; cursor: pointer; padding: 4px;
    transition: color 0.15s;
}

.copy-btn:active { color: #fff; }

/* ── SETTINGS ── */
.settings-section { margin-bottom: 20px; }
.settings-section-title { font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; }

.settings-row {
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--r-md); padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px; cursor: pointer;
}

.settings-row:active { background: var(--bg-3); }

.settings-row-left { display: flex; align-items: center; gap: 12px; }

.settings-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}

.settings-label { font-weight: 500; font-size: 14px; }
.settings-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; }

/* Slider */
input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 4px; border-radius: 2px;
    background: var(--bg-3); outline: none;
    accent-color: var(--color-primary);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--grad-primary); cursor: pointer;
    box-shadow: 0 2px 8px rgba(124,58,237,0.4);
}

/* ── MORE PAGE ── */
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.more-card {
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--r-lg); padding: 16px;
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
    cursor: pointer; transition: border-color 0.15s;
}

.more-card:active { border-color: rgba(255,255,255,0.12); background: var(--bg-3); }

.more-card-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
}

.more-card-label { font-weight: 600; font-size: 14px; }
.more-card-sub { font-size: 12px; color: var(--text-2); }

/* ── NOTIFICATIONS ── */
.toast {
    position: fixed; top: 80px; left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: var(--bg-2); border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--r-lg); padding: 12px 18px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: var(--shadow-xl);
    z-index: 9000; min-width: 260px; max-width: 90%;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
    opacity: 0;
    border-left: 3px solid var(--color-primary);
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-gold); }

.toast i { font-size: 18px; }
.toast.success i { color: var(--color-success); }
.toast.error i { color: var(--color-danger); }
.toast.warning i { color: var(--color-gold); }

.toast span { font-size: 13px; font-weight: 500; }

/* Floating earn */
.float-earn {
    position: fixed; z-index: 8000; pointer-events: none;
    font-family: var(--font-display); font-size: 16px; font-weight: 700;
    color: var(--color-gold); text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

/* ── INPUT ── */
.game-input {
    width: 100%; background: var(--bg-3); border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--r-md); padding: 12px 14px;
    color: var(--text-1); font-family: var(--font); font-size: 14px;
    outline: none; transition: border-color 0.15s;
    -webkit-user-select: text; user-select: text;
}

.game-input:focus { border-color: rgba(124,58,237,0.4); }
.game-input::placeholder { color: var(--text-3); }

/* ── UTILS ── */
.text-gold { color: var(--color-gold); }
.text-green { color: var(--color-success); }
.text-red { color: var(--color-danger); }
.text-muted { color: var(--text-2); }
.fw700 { font-weight: 700; }
.font-display { font-family: var(--font-display); }

.divider { height: 1px; background: rgba(255,255,255,0.06); margin: 12px 0; }

/* ── ANIMATIONS ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes iconBounce {
    0% { transform: scale(0) rotate(-15deg); }
    60% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes levelPop {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes giftPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

@keyframes coinFloat {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-60px); opacity: 0; }
}

/* ── RESPONSIVE ── */
@media (min-width: 480px) {
    .modal-content { border-radius: var(--r-2xl); max-width: 440px; margin: auto; }
    .modal { align-items: center; padding: 20px; }
    .main-content { max-width: 560px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.1ms !important;
    }
}