:root {
    --primary: #9C27B0;
    --secondary: #FFD600;
    --accent: #D4A017;
    --bg-app: #1A0A1E;
    --text-main: #F5E6FA;
    --text-muted: #C9A0D0;
    --glass-bg: rgba(80, 20, 90, 0.25);
    --glass-border: rgba(180, 120, 200, 0.15);
    --glass-shadow: rgba(0, 0, 0, 0.4);
    --input-bg: rgba(120, 50, 140, 0.2);
    --nav-glass: rgba(30, 10, 35, 0.95);
}

[data-theme="light"] {
    --primary: #9C27B0;
    --secondary: #FFD600;
    --accent: #D4A017;
    --bg-app: #F5F5FA;
    --bg-card: #FFFFFF;
    --text-main: #1A0A1E;
    --text-muted: #6B4C75;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(156, 39, 176, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.05);
    --input-bg: rgba(255, 255, 255, 0.8);
    --nav-glass: rgba(255, 255, 255, 0.95);
}

:root {
    --bg-card: #2A0E30;
}

.text-theme {
    color: var(--text-main) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.bg-app {
    background-color: var(--bg-app) !important;
}

.bg-card {
    background-color: var(--bg-card) !important;
}

.text-accent {
    color: var(--secondary) !important;
}

.bg-accent {
    background-color: var(--secondary) !important;
}

* {
    -webkit-tap-highlight-color: transparent;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

.vip-glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px var(--glass-shadow);
    position: relative;
    overflow: hidden;
}

[data-theme="pearl"] .theme-logo,
[data-theme="lavender"] .theme-logo,
[data-theme="sunset"] .theme-logo,
[data-theme="frost"] .theme-logo {
    filter: brightness(0) !important;
}

/* Gradient Borders for VIP Cards - Subtle in Light Mode */
.vip-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.15;
    pointer-events: none;
}

.glass-tint-indigo {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.25);
}

.glass-tint-rose {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.25);
}

.glass-tint-cyan {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.25);
}

.glass-tint-emerald {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
}

.glass-tint-amber {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
}

.btn-premium {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
    box-shadow: 0 4px 20px rgba(156, 39, 176, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white !important;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.btn-premium:active {
    transform: scale(0.95);
    filter: brightness(1.1);
}

/* Active Nav State */
.nav-item-active {
    color: #FFD600 !important;
    background: rgba(255, 214, 0, 0.15);
    border-radius: 1.25rem;
    text-shadow: 0 0 12px rgba(255, 214, 0, 0.6), 0 0 20px rgba(255, 214, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 214, 0, 0.1);
}

.dark .nav-item-active {
    color: #FFD600 !important;
    background: rgba(255, 214, 0, 0.12);
    text-shadow: 0 0 15px rgba(255, 214, 0, 0.8), 0 0 25px rgba(255, 214, 0, 0.3);
}

.vip-nav {
    background: linear-gradient(180deg, rgba(60, 20, 40, 0.97) 0%, rgba(30, 10, 20, 0.98) 100%);
    border: 1px solid rgba(120, 60, 30, 0.3);
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.5), 0 10px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.vip-nav::after {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(212, 160, 23, 0.6), rgba(255, 214, 0, 0.8), rgba(212, 160, 23, 0.6), transparent);
    border-radius: 0 0 2px 2px;
}

.vip-nav button {
    color: #A88FAD;
    transition: all 0.3s ease;
}

.vip-nav button:hover {
    color: white;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.safe-area-inset-top {
    padding-top: env(safe-area-inset-top);
}

.safe-area-inset-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* Custom Dropdown (Apple Style) */
.custom-select-container {
    position: relative;
    cursor: pointer;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    right: 0;
    z-index: 1000;
    overflow: hidden;
    border-radius: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(42, 14, 48, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.custom-select-container.active .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Drop-up support */
.custom-select-container.drop-up .custom-select-options {
    top: auto;
    bottom: calc(100% + 0.75rem);
    transform: translateY(20px) scale(0.95);
}

.custom-select-container.drop-up.active .custom-select-options {
    transform: translateY(0) scale(1);
}

.modal-content-wrapper {
    overflow: visible !important;
}

.custom-option {
    padding: 1.25rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFD600;
}

.custom-option.selected {
    background: rgba(255, 255, 255, 0.15);
    color: #FFD600;
}

/* Apple Spring Scale */
.apple-spring {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.apple-spring:active {
    transform: scale(0.92);
}

input,
select,
textarea {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.dark input,
.dark select,
.dark textarea {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

option {
    background-color: var(--bg-app);
    color: var(--text-main);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.5;
}

@keyframes slide-up {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slide-up 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

input:focus {
    border-color: #FFD600 !important;
    box-shadow: 0 0 0 2px rgba(255, 214, 0, 0.1) !important;
}

/* Logo & Splash Animations */
@keyframes logoReveal {
    0% {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
        filter: blur(20px) brightness(0) invert(1);
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
        filter: blur(0px) brightness(0) invert(1);
    }
}

@keyframes taglineReveal {
    0% {
        letter-spacing: 1.5em;
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        letter-spacing: 0.5em;
        opacity: 1;
        transform: translateY(0);
    }
}

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

    100% {
        transform: translateX(100%);
    }
}

@keyframes blobFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.animate-logo-reveal {
    animation: logoReveal 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.animate-tagline-reveal {
    animation: taglineReveal 2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

.animate-loading-slide {
    animation: loadingSlide 2.5s infinite linear;
}

.animate-blob-float {
    animation: blobFloat 15s infinite ease-in-out;
}

.animate-blob-float-delayed {
    animation: blobFloat 20s infinite ease-in-out reverse;
    animation-delay: -5s;
}

#splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.1);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Unified White Logo - Auto adapt */
.theme-logo {
    filter: brightness(0) invert(1) !important;
}

[data-theme="pearl"] .theme-logo {
    filter: brightness(0) !important;
}

/* Premium Custom Select */
.custom-select-container {
    position: relative;
    width: 100%;
    cursor: pointer;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-item-active {
    color: var(--secondary) !important;
}

.custom-select-container.active .custom-select-trigger {
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.05);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #2A0E30;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    padding: 0.5rem;
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: 250px;
    overflow-y: auto;
}

.custom-select-container.active .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-container.drop-up .custom-select-options {
    top: auto;
    bottom: calc(100% + 8px);
    transform: translateY(-10px);
}

.custom-select-container.drop-up.active .custom-select-options {
    transform: translateY(0);
}

.custom-option {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.custom-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.custom-option.selected {
    background: var(--secondary);
    color: black;
}

.custom-select-options::-webkit-scrollbar {
    width: 4px;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.category-chip {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-chip.active {
    background: var(--secondary) !important;
    color: black !important;
    box-shadow: 0 4px 15px var(--glass-shadow);
    border-color: transparent !important;
}

.text-vip-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px 5px rgba(168, 85, 247, 0.5);
    }
}

.animate-pulse-glow {
    animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes scaleIn {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-scale-in {
    animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- Profile 2.0: Identity Center --- */
.level-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 12px rgba(255, 160, 0, 0.3);
}

.xp-bar-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.xp-bar-fill {
    background: linear-gradient(90deg, #00C6FF, #0072FF);
    box-shadow: 0 0 20px rgba(0, 114, 255, 0.5);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* --- Sticky Header Logic --- */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(26, 10, 30, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.sticky-strip {
    position: sticky;
    top: 100px;
    /* Adjust based on header height */
    z-index: 40;
    background: rgba(26, 10, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 0 -1.5rem;
    /* Negative margin to span full width */
    padding: 1rem 1.5rem;
    border-radius: 0 0 2rem 2rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}