html {
    overflow-x: hidden;
    overscroll-behavior-x: none;
}
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}

/* iOS safe area - push content below notch using spacer inside themed containers */
.glass-ui.min-h-screen::before,
.dark-mode.min-h-screen::before,
.emerald-theme.min-h-screen::before {
    content: '';
    display: block;
    height: env(safe-area-inset-top, 0px);
}
.progress-bar {
    background: linear-gradient(to right, #8b5cf6, #ec4899, #f59e0b);
}

/* Loading Screen Animations */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

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

@keyframes logo-fade-in {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(20px);
        filter: blur(15px);
    }
    60% {
        opacity: 0.9;
        transform: scale(1.02) translateY(-2px);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

@keyframes logo-float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-12px) rotate(1deg);
    }
}

@keyframes logo-glow {
    0%, 100% {
        box-shadow: 0 20px 60px rgba(139, 92, 246, 0.4), 0 0 40px rgba(236, 72, 153, 0.3), 0 0 80px rgba(245, 158, 11, 0.2);
    }
    50% {
        box-shadow: 0 25px 80px rgba(139, 92, 246, 0.6), 0 0 60px rgba(236, 72, 153, 0.5), 0 0 100px rgba(245, 158, 11, 0.3);
    }
}

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

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

@keyframes fire-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 69, 0, 0.5), 0 0 20px rgba(255, 140, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 69, 0, 0.8), 0 0 40px rgba(255, 140, 0, 0.5), 0 0 60px rgba(255, 200, 0, 0.3);
    }
}

@keyframes fire-flicker {
    0%, 100% { transform: scale(1) rotate(-1deg); }
    25% { transform: scale(1.05) rotate(1deg); }
    50% { transform: scale(0.98) rotate(-0.5deg); }
    75% { transform: scale(1.02) rotate(0.5deg); }
}

@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.streak-fire {
    animation: fire-glow 2s ease-in-out infinite, fire-flicker 0.5s ease-in-out infinite;
}

.progress-ring {
    animation: progress-pulse 2s ease-in-out infinite;
}

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

.loading-gradient-bg {
    background: linear-gradient(-45deg, #8b5cf6, #ec4899, #f59e0b, #8b5cf6, #a855f7);
    background-size: 400% 400%;
    background-color: #7c3aed;
    animation: gradient-shift 10s ease infinite;
    position: relative;
}

.loading-gradient-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(236, 72, 153, 0.3) 0%, transparent 50%);
    animation: gradient-rotate 20s linear infinite;
}

.loading-logo {
    animation: logo-fade-in 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, 
               logo-float 4s ease-in-out infinite;
    animation-delay: 0s, 1.5s;
}

.loading-logo-container {
    animation: logo-glow 3s ease-in-out infinite;
}

.loading-text {
    animation: logo-fade-in 1.5s ease-out forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

@keyframes logo-image-fade-in {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-logo-image {
    animation: logo-image-fade-in 1s ease-out forwards;
    animation-delay: 0.1s;
    opacity: 1 !important; /* Override animation initial opacity to keep image visible */
}

.shimmer-effect {
    position: relative;
    border-radius: 2.5rem;
    overflow: hidden;
}

.shimmer-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use a softer, more gradual gradient */
    background: linear-gradient(110deg, 
        transparent 0%, 
        transparent 25%,
        rgba(255, 255, 255, 0.1) 35%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 65%,
        transparent 75%,
        transparent 100%);
    animation: shimmer 3s linear infinite;
    /* Force hardware acceleration */
    will-change: transform;
    /* Ensure it respects parent's border-radius */
    border-radius: inherit;
}

.shimmer-wrapper {
    border-radius: 2.5rem;
    overflow: hidden;
    clip-path: inset(0 round 2.5rem);
    -webkit-clip-path: inset(0 round 2.5rem);
    position: relative;
    isolation: isolate;
    will-change: clip-path;
}

@keyframes confetti-fall {
    0% { 
        transform: translateY(-100px) rotate(0deg) scale(1); 
        opacity: 1; 
    }
    10% { 
        transform: translateY(0) rotate(36deg) scale(1.1); 
        opacity: 1; 
    }
    100% { 
        transform: translateY(100vh) rotate(720deg) scale(0.3); 
        opacity: 0; 
    }
}

@keyframes confetti-tumble {
    0% { transform: rotate(0deg) translateX(0); }
    25% { transform: rotate(90deg) translateX(10px); }
    50% { transform: rotate(180deg) translateX(0); }
    75% { transform: rotate(270deg) translateX(-10px); }
    100% { transform: rotate(360deg) translateX(0); }
}

@keyframes fire-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 69, 0, 0.5), 0 0 20px rgba(255, 140, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 69, 0, 0.8), 0 0 40px rgba(255, 140, 0, 0.5), 0 0 60px rgba(255, 200, 0, 0.3);
    }
}

@keyframes fire-flicker {
    0%, 100% { transform: scale(1) rotate(-1deg); }
    25% { transform: scale(1.05) rotate(1deg); }
    50% { transform: scale(0.98) rotate(-0.5deg); }
    75% { transform: scale(1.02) rotate(0.5deg); }
}

.streak-fire {
    animation: fire-glow 2s ease-in-out infinite, fire-flicker 0.5s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-ring {
    animation: progress-pulse 2s ease-in-out infinite;
}

@keyframes confetti-wiggle {
    0%, 100% { transform: rotate(0deg) translateX(0); }
    25% { transform: rotate(5deg) translateX(2px); }
    50% { transform: rotate(0deg) translateX(0); }
    75% { transform: rotate(-5deg) translateX(-2px); }
}

.confetti-piece {
    animation: confetti-fall 3s ease-out forwards;
}

.confetti-tumble {
    animation: confetti-tumble 0.8s linear infinite;
}

.confetti-wiggle {
    animation: confetti-wiggle 0.6s ease-in-out infinite;
}

.confetti-square {
    width: 8px;
    height: 8px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    transform: rotate(45deg);
}

.confetti-circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
}

.confetti-triangle {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid #ffd93d;
}

.confetti-rectangle {
    width: 12px;
    height: 6px;
    background: linear-gradient(45deg, #a8e6cf, #88d8a3);
}

.confetti-star {
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #ff9ff3, #f368e0);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.confetti-explosion {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1000;
}

@keyframes screen-shake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-2px); }
    20% { transform: translateX(2px); }
    30% { transform: translateX(-2px); }
    40% { transform: translateX(2px); }
    50% { transform: translateX(-1px); }
    60% { transform: translateX(1px); }
    70% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
    90% { transform: translateX(-1px); }
}

.screen-shake {
    animation: screen-shake 0.5s ease-in-out;
}

@keyframes quest-complete-glow {
    0% { 
        box-shadow: 0 0 0 rgba(34, 197, 94, 0.4);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.8);
        transform: scale(1.05);
    }
    100% { 
        box-shadow: 0 0 0 rgba(34, 197, 94, 0.4);
        transform: scale(1);
    }
}

.quest-complete-glow {
    animation: quest-complete-glow 0.6s ease-out;
}

/* GSAP Confetti Styles */
.dot-container {
    position: absolute;
    left: 0;
    top: 0;
    overflow: visible;
    z-index: 5000;
    pointer-events: none;
}

.dot {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
}

@keyframes level-up-glow {
    0% { 
        transform: scale(0.8); 
        opacity: 0; 
        filter: blur(10px);
    }
    20% { 
        transform: scale(1.1); 
        opacity: 1; 
        filter: blur(2px);
    }
    80% { 
        transform: scale(1); 
        opacity: 1; 
        filter: blur(0px);
    }
    100% { 
        transform: scale(1); 
        opacity: 0; 
        filter: blur(0px);
    }
}

@keyframes level-up-text-glow {
    0% { 
        opacity: 0; 
        transform: translateY(20px) scale(0.8);
        text-shadow: 0 0 10px rgba(251, 191, 36, 0);
    }
    20% { 
        opacity: 1; 
        transform: translateY(0) scale(1.1);
        text-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
    }
    80% { 
        opacity: 1; 
        transform: translateY(0) scale(1);
        text-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
    }
    100% { 
        opacity: 0; 
        transform: translateY(-20px) scale(1);
        text-shadow: 0 0 30px rgba(251, 191, 36, 0);
    }
}

@keyframes level-up-level-glow {
    0% { 
        opacity: 0; 
        transform: scale(0.5) rotate(-10deg);
        text-shadow: 0 0 20px rgba(251, 191, 36, 0);
    }
    25% { 
        opacity: 1; 
        transform: scale(1.2) rotate(5deg);
        text-shadow: 0 0 30px rgba(251, 191, 36, 1);
    }
    75% { 
        opacity: 1; 
        transform: scale(1) rotate(0deg);
        text-shadow: 0 0 25px rgba(251, 191, 36, 0.8);
    }
    100% { 
        opacity: 0; 
        transform: scale(1) rotate(0deg);
        text-shadow: 0 0 40px rgba(251, 191, 36, 0);
    }
}

.level-up-glow-emblem {
    animation: level-up-glow 5s ease-out forwards;
}

.level-up-text-glow {
    animation: level-up-text-glow 5s ease-out forwards;
}

.level-up-level-glow {
    animation: level-up-level-glow 5s ease-out forwards;
}

.level-up-emblem {
    filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.8));
}

/* Custom Scrollbar Styles */
.overflow-y-auto::-webkit-scrollbar {
    width: 8px;
}

.overflow-y-auto::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.overflow-y-auto::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Dark Mode Scrollbar */
.dark-mode .overflow-y-auto::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.dark-mode .overflow-y-auto::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.dark-mode .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Dark Mode Styles */
.dark-mode {
    background-color: #1a1a1a !important;
}

.dark-mode .bg-white {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

.dark-mode .text-gray-900 {
    color: #ffffff !important;
}

.dark-mode .text-gray-700 {
    color: #d1d5db !important;
}

.dark-mode .text-gray-600 {
    color: #9ca3af !important;
}

.dark-mode .text-gray-500 {
    color: #6b7280 !important;
}

.dark-mode .bg-gray-50 {
    background-color: #374151 !important;
}

.dark-mode .bg-gray-100 {
    background-color: #4b5563 !important;
}

.dark-mode .bg-gray-200 {
    background-color: #6b7280 !important;
}

.dark-mode .border-gray-200 {
    border-color: #404040 !important;
}

.dark-mode .border-gray-300 {
    border-color: #525252 !important;
}

.dark-mode .hover\:bg-gray-50:hover {
    background-color: #374151 !important;
}

.dark-mode .hover\:bg-gray-100:hover {
    background-color: #4b5563 !important;
}

.dark-mode .hover\:bg-gray-200:hover {
    background-color: #6b7280 !important;
}

.dark-mode .hover\:border-gray-300:hover {
    border-color: #525252 !important;
}

.dark-mode .bg-gray-100.text-gray-600 {
    background-color: #4b5563 !important;
    color: #9ca3af !important;
}

.dark-mode .bg-gray-100.text-gray-700 {
    background-color: #4b5563 !important;
    color: #d1d5db !important;
}

.dark-mode .border-t {
    border-color: #404040 !important;
}

.dark-mode .border {
    border-color: #404040 !important;
}

.dark-mode .progress-bar {
    background: linear-gradient(90deg, #8b5cf6, #a855f7) !important;
}

.dark-mode .bg-black {
    background-color: #ffffff !important;
    color: #000000 !important;
}

.dark-mode .text-black {
    color: #ffffff !important;
}

.dark-mode .bg-blue-100.text-blue-900 {
    color: #1e3a8a !important;
}

.dark-mode .font-semibold {
    color: #ffffff !important;
}

.dark-mode .font-bold {
    color: #ffffff !important;
}

/* Emerald Theme */
.emerald-theme {
    background: linear-gradient(135deg, #0a1a1a 0%, #0f2f2f 50%, #0a1a1a 100%);
    color: #ffffff;
}
.emerald-theme .bg-white {
    background: rgba(0, 200, 83, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 230, 118, 0.3);
}
.emerald-theme .text-gray-900 {
    color: #ffffff;
}
.emerald-theme .text-gray-700 {
    color: #e5e5e5;
}
.emerald-theme .text-gray-600 {
    color: #d1d5db;
}
.emerald-theme .bg-gray-50 {
    background: rgba(0, 200, 83, 0.05);
}
.emerald-theme .bg-gray-100 {
    background: rgba(0, 230, 118, 0.1);
}
.emerald-theme .border-gray-200 {
    border-color: rgba(0, 230, 118, 0.3);
}
.emerald-theme .border-gray-300 {
    border-color: rgba(0, 230, 118, 0.4);
}
.emerald-theme .bg-gray-800 {
    background: rgba(0, 150, 63, 0.2);
}
.emerald-theme .text-gray-400 {
    color: #86efac;
}
.emerald-theme .bg-gray-900 {
    background: rgba(10, 26, 26, 0.8);
}
.emerald-theme .bg-slate-800 {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.15), rgba(0, 230, 118, 0.1));
}
.emerald-theme .bg-slate-900 {
    background: linear-gradient(135deg, rgba(0, 150, 63, 0.2), rgba(0, 200, 83, 0.1));
}
.emerald-theme .border-slate-700 {
    border-color: rgba(0, 230, 118, 0.4);
}
.emerald-theme .bg-amber-50 {
    background: rgba(0, 200, 83, 0.1);
}
.emerald-theme .text-amber-700 {
    color: #86efac;
}
.emerald-theme .border-amber-200 {
    border-color: rgba(0, 230, 118, 0.3);
}
.emerald-theme .bg-indigo-50 {
    background: rgba(0, 180, 63, 0.1);
}
.emerald-theme .text-indigo-700 {
    color: #6ee7b7;
}
.emerald-theme .border-indigo-200 {
    border-color: rgba(0, 230, 118, 0.3);
}
.emerald-theme .bg-purple-50 {
    background: rgba(0, 160, 43, 0.1);
}
.emerald-theme .text-purple-700 {
    color: #5eead4;
}
.emerald-theme .border-purple-200 {
    border-color: rgba(0, 230, 118, 0.3);
}
.emerald-theme .bg-green-50 {
    background: rgba(0, 200, 83, 0.15);
}
.emerald-theme .text-green-700 {
    color: #00e676;
}
.emerald-theme .border-green-200 {
    border-color: rgba(0, 230, 118, 0.4);
}
.emerald-theme .bg-red-50 {
    background: rgba(255, 99, 99, 0.1);
}
.emerald-theme .text-red-700 {
    color: #fca5a5;
}
.emerald-theme .border-red-200 {
    border-color: rgba(255, 99, 99, 0.3);
}
.emerald-theme .bg-blue-50 {
    background: rgba(0, 180, 83, 0.1);
}
.emerald-theme .text-blue-700 {
    color: #67e8f9;
}
.emerald-theme .border-blue-200 {
    border-color: rgba(0, 230, 118, 0.3);
}
.emerald-theme .bg-yellow-50 {
    background: rgba(0, 200, 83, 0.1);
}
.emerald-theme .text-yellow-700 {
    color: #bef264;
}
.emerald-theme .border-yellow-200 {
    border-color: rgba(0, 230, 118, 0.3);
}
.emerald-theme .bg-pink-50 {
    background: rgba(255, 118, 118, 0.1);
}
.emerald-theme .text-pink-700 {
    color: #f9a8d4;
}
.emerald-theme .border-pink-200 {
    border-color: rgba(255, 118, 118, 0.3);
}
.emerald-theme .bg-teal-50 {
    background: rgba(0, 200, 83, 0.15);
}
.emerald-theme .text-teal-700 {
    color: #5eead4;
}
.emerald-theme .border-teal-200 {
    border-color: rgba(0, 230, 118, 0.4);
}
.emerald-theme .bg-orange-50 {
    background: rgba(255, 165, 0, 0.1);
}
.emerald-theme .text-orange-700 {
    color: #fdba74;
}
.emerald-theme .border-orange-200 {
    border-color: rgba(255, 165, 0, 0.3);
}
.emerald-theme .bg-cyan-50 {
    background: rgba(0, 200, 83, 0.1);
}
.emerald-theme .text-cyan-700 {
    color: #67e8f9;
}
.emerald-theme .border-cyan-200 {
    border-color: rgba(0, 230, 118, 0.3);
}
.emerald-theme .bg-lime-50 {
    background: rgba(0, 230, 118, 0.1);
}
.emerald-theme .text-lime-700 {
    color: #bef264;
}
.emerald-theme .border-lime-200 {
    border-color: rgba(0, 230, 118, 0.4);
}
.emerald-theme .bg-emerald-50 {
    background: rgba(0, 200, 83, 0.2);
}
.emerald-theme .text-emerald-700 {
    color: #00e676;
}
.emerald-theme .border-emerald-200 {
    border-color: rgba(0, 230, 118, 0.5);
}
.emerald-theme .bg-violet-50 {
    background: rgba(0, 180, 83, 0.1);
}
.emerald-theme .text-violet-700 {
    color: #c4b5fd;
}
.emerald-theme .border-violet-200 {
    border-color: rgba(0, 230, 118, 0.3);
}
.emerald-theme .bg-rose-50 {
    background: rgba(255, 118, 118, 0.1);
}
.emerald-theme .text-rose-700 {
    color: #f9a8d4;
}
.emerald-theme .border-rose-200 {
    border-color: rgba(255, 118, 118, 0.3);
}
.emerald-theme .hover\:bg-gray-200:hover {
    background-color: rgba(0, 230, 118, 0.2) !important;
}
.emerald-theme .hover\:border-gray-300:hover {
    border-color: rgba(0, 230, 118, 0.5) !important;
}
.emerald-theme .bg-gray-100.text-gray-600 {
    background-color: rgba(0, 200, 83, 0.1) !important;
    color: #86efac !important;
}
.emerald-theme .bg-gray-100.text-gray-700 {
    background-color: rgba(0, 200, 83, 0.1) !important;
    color: #e5e5e5 !important;
}
.emerald-theme .border-t {
    border-color: rgba(0, 230, 118, 0.3) !important;
}
.emerald-theme .border {
    border-color: rgba(0, 230, 118, 0.3) !important;
}
.emerald-theme .progress-bar {
    background: linear-gradient(90deg, #00c853, #00e676) !important;
}
.emerald-theme .bg-black {
    background-color: rgba(0, 230, 118, 0.1) !important;
    color: #ffffff !important;
}
.emerald-theme .text-black {
    color: #ffffff !important;
}
.emerald-theme .font-semibold {
    color: #ffffff !important;
}
.emerald-theme .font-bold {
    color: #ffffff !important;
}

/* Emerald theme hover text fixes */
.emerald-theme .hover\:bg-gray-50:hover .text-gray-900 {
    color: #1f2937 !important;
}
.emerald-theme .hover\:bg-gray-50:hover .text-gray-700 {
    color: #374151 !important;
}
.emerald-theme .hover\:bg-gray-50:hover .text-gray-600 {
    color: #4b5563 !important;
}
/* Keep white text white on dark backgrounds (like main quest cards) */
.emerald-theme .bg-gradient-to-r.from-slate-800.to-slate-900 .text-white,
.emerald-theme .bg-gradient-to-r.from-slate-800.to-slate-900:hover .text-white {
    color: #ffffff !important;
}
/* Only change white text to dark on light backgrounds */
.emerald-theme .hover\:bg-gray-50:hover .text-white:not(.bg-gradient-to-r) {
    color: #1f2937 !important;
}

/* Emerald theme button text fixes */
.emerald-theme .bg-blue-100 {
    background-color: rgba(0, 200, 83, 0.1) !important;
    color: #1f2937 !important;
}
.emerald-theme .text-blue-700 {
    color: #1f2937 !important;
}
.emerald-theme .hover\:bg-blue-200:hover {
    background-color: rgba(0, 200, 83, 0.2) !important;
}

/* Glass UI — default theme on dark gradient background */
.glass-ui {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #f0f0f0;
}
.glass-ui .bg-white {
    background: rgba(255, 255, 255, 0.10) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    color: #f0f0f0 !important;
}
.glass-ui .text-gray-900 { color: #ffffff !important; }
.glass-ui .text-gray-800 { color: #f0f0f0 !important; }
.glass-ui .text-gray-700 { color: #e0e0e0 !important; }
.glass-ui .text-gray-600 { color: #c0c0c0 !important; }
.glass-ui .text-gray-500 { color: #a0a0a0 !important; }
.glass-ui .text-gray-400 { color: #909090 !important; }
.glass-ui .text-black { color: #ffffff !important; }
.glass-ui .font-semibold { color: #ffffff !important; }
.glass-ui .font-bold { color: #ffffff !important; }
.glass-ui .bg-gray-50 { background: rgba(255, 255, 255, 0.05) !important; }
.glass-ui .bg-gray-100 { background: rgba(255, 255, 255, 0.08) !important; }
.glass-ui .bg-gray-200 { background: rgba(255, 255, 255, 0.12) !important; }
.glass-ui .border-gray-200 { border-color: rgba(255, 255, 255, 0.12) !important; }
.glass-ui .border-gray-300 { border-color: rgba(255, 255, 255, 0.18) !important; }
.glass-ui .border { border-color: rgba(255, 255, 255, 0.12) !important; }
.glass-ui .hover\:bg-gray-50:hover { background: rgba(255, 255, 255, 0.1) !important; }
.glass-ui .hover\:bg-gray-100:hover { background: rgba(255, 255, 255, 0.14) !important; }
.glass-ui input, .glass-ui select, .glass-ui textarea {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #f0f0f0 !important;
}
.glass-ui input::placeholder, .glass-ui textarea::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}
.glass-ui .bg-black\/30 {
    background: rgba(0, 0, 0, 0.5) !important;
}
.glass-ui::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); }
.glass-ui::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }
.glass-ui .progress-bar {
    background: linear-gradient(to right, #8b5cf6, #ec4899, #f59e0b) !important;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}
.glass-ui .bg-gradient-to-br {
}
.glass-ui .bg-black {
    background: rgba(255, 255, 255, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}
.glass-ui .bg-purple-100, .glass-ui .bg-pink-100, .glass-ui .bg-blue-100,
.glass-ui .bg-green-100, .glass-ui .bg-yellow-100, .glass-ui .bg-red-100 {
    background: rgba(255, 255, 255, 0.1) !important;
}
.glass-ui .bg-red-100.text-red-700 {
    color: #fca5a5 !important;
}
.glass-ui .bg-green-100.text-green-700 {
    color: #86efac !important;
}
.glass-ui .divide-gray-200 > * + * {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Fix rank title text on glass-ui dark background */
.glass-ui .rank-title {
    color: rgba(255, 255, 255, 0.6) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.6) !important;
}

/* Professional UI Enhancements */
@keyframes progress-pulse {
    0%, 100% { 
        transform: scaleX(1);
        opacity: 1;
    }
    50% { 
        transform: scaleX(1.02);
        opacity: 0.8;
    }
}

.progress-bar-pulse {
    animation: progress-pulse 2s ease-in-out infinite;
}

@keyframes card-hover-glow {
    0% { 
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }
    100% { 
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(156, 163, 175, 0.1);
    }
}

.card-hover-glow:hover {
    animation: card-hover-glow 0.3s ease-out forwards;
}

/* Liquid Progress Bar Animation */
@keyframes liquid-flow {
    0% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg) brightness(1);
    }
    25% {
        background-position: 100% 50%;
        filter: hue-rotate(5deg) brightness(1.1);
    }
    50% {
        background-position: 200% 50%;
        filter: hue-rotate(-5deg) brightness(1.2);
    }
    75% {
        background-position: 300% 50%;
        filter: hue-rotate(3deg) brightness(1.1);
    }
    100% {
        background-position: 400% 50%;
        filter: hue-rotate(0deg) brightness(1);
    }
}

@keyframes liquid-glow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(155, 93, 229, 0.4),
            0 0 40px rgba(155, 93, 229, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(155, 93, 229, 0.6),
            0 0 60px rgba(155, 93, 229, 0.3),
            0 0 90px rgba(245, 91, 181, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

@keyframes liquid-glow-emerald {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(0, 200, 83, 0.4),
            0 0 40px rgba(0, 200, 83, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(0, 230, 118, 0.6),
            0 0 60px rgba(0, 230, 118, 0.3),
            0 0 90px rgba(0, 200, 83, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

.liquid-progress {
    background: linear-gradient(
        45deg,
        #9b5de5 0%,
        #f15bb5 25%,
        #9b5de5 50%,
        #f15bb5 75%,
        #9b5de5 100%
    );
    background-size: 400% 400%;
    animation: liquid-flow 8s ease-in-out infinite, liquid-glow 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.emerald-theme .liquid-progress {
    background: linear-gradient(
        45deg,
        #00695c 0%,
        #00c853 25%,
        #00695c 50%,
        #00c853 75%,
        #00695c 100%
    );
    background-size: 400% 400%;
    animation: liquid-flow 8s ease-in-out infinite, liquid-glow-emerald 3s ease-in-out infinite;
}

.liquid-progress::before {
    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 ease-in-out infinite;
}

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

/* Liquid Bubbles Animation */
@keyframes bubble-float-1 {
    0% {
        transform: translateY(120%) scale(0.3);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-30%) scale(1.1);
        opacity: 0;
    }
}

@keyframes bubble-float-2 {
    0% {
        transform: translateY(140%) scale(0.4);
        opacity: 0;
    }
    15% {
        opacity: 0.6;
    }
    85% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-40%) scale(0.9);
        opacity: 0;
    }
}

@keyframes bubble-float-3 {
    0% {
        transform: translateY(110%) scale(0.2);
        opacity: 0;
    }
    8% {
        opacity: 0.9;
    }
    92% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(-35%) scale(0.8);
        opacity: 0;
    }
}

@keyframes bubble-float-4 {
    0% {
        transform: translateY(130%) scale(0.6);
        opacity: 0;
    }
    12% {
        opacity: 0.7;
    }
    88% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-25%) scale(1.3);
        opacity: 0;
    }
}

@keyframes bubble-float-5 {
    0% {
        transform: translateY(150%) scale(0.3);
        opacity: 0;
    }
    18% {
        opacity: 0.5;
    }
    82% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-45%) scale(1.0);
        opacity: 0;
    }
}

@keyframes bubble-float-6 {
    0% {
        transform: translateY(125%) scale(0.5);
        opacity: 0;
    }
    14% {
        opacity: 0.8;
    }
    86% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-20%) scale(0.7);
        opacity: 0;
    }
}

.liquid-bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(1px);
}

.bubble-1 {
    width: 5px;
    height: 5px;
    left: 12%;
    animation: bubble-float-1 2.3s ease-in-out infinite;
    animation-delay: 0s;
}

.bubble-2 {
    width: 7px;
    height: 7px;
    left: 28%;
    animation: bubble-float-2 2.7s ease-in-out infinite;
    animation-delay: 0.8s;
}

.bubble-3 {
    width: 3px;
    height: 3px;
    left: 45%;
    animation: bubble-float-3 1.9s ease-in-out infinite;
    animation-delay: 1.6s;
}

.bubble-4 {
    width: 6px;
    height: 6px;
    left: 62%;
    animation: bubble-float-4 2.1s ease-in-out infinite;
    animation-delay: 0.4s;
}

.bubble-5 {
    width: 4px;
    height: 4px;
    left: 78%;
    animation: bubble-float-5 2.5s ease-in-out infinite;
    animation-delay: 1.2s;
}

.bubble-6 {
    width: 8px;
    height: 8px;
    left: 8%;
    animation: bubble-float-6 2.8s ease-in-out infinite;
    animation-delay: 2.0s;
}

.bubble-7 {
    width: 3px;
    height: 3px;
    left: 35%;
    animation: bubble-float-1 1.7s ease-in-out infinite;
    animation-delay: 0.6s;
}

.bubble-8 {
    width: 5px;
    height: 5px;
    left: 52%;
    animation: bubble-float-2 2.2s ease-in-out infinite;
    animation-delay: 1.8s;
}

.bubble-9 {
    width: 6px;
    height: 6px;
    left: 85%;
    animation: bubble-float-3 2.4s ease-in-out infinite;
    animation-delay: 0.2s;
}

.bubble-10 {
    width: 4px;
    height: 4px;
    left: 18%;
    animation: bubble-float-4 1.8s ease-in-out infinite;
    animation-delay: 1.4s;
}

.bubble-11 {
    width: 7px;
    height: 7px;
    left: 72%;
    animation: bubble-float-5 2.6s ease-in-out infinite;
    animation-delay: 1.0s;
}

.shimmer-effect {
    position: relative;
    overflow: hidden;
}

.shimmer-effect::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

/* ========================================
   GENRE THEME SYSTEM
   ======================================== */

/* Genre base — overrides glass-ui/dark/emerald when active */
.genre-active {
    background-attachment: fixed;
}

/* Genre background wrapper — fixed fullscreen behind content */
.genre-bg-fantasy,
.genre-bg-scifi,
.genre-bg-anime,
.genre-bg-survival {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* All content sits above animated backgrounds */
.genre-active .max-w-7xl,
.genre-active .max-w-4xl,
.genre-active .max-w-3xl {
    position: relative;
    z-index: 1;
}

.genre-active .bg-white {
    background: var(--genre-card-bg) !important;
    border-color: var(--genre-card-border) !important;
}

.genre-active .text-gray-900,
.genre-active .text-gray-800,
.genre-active .text-gray-700 {
    color: var(--genre-text-primary) !important;
}

.genre-active .text-gray-500,
.genre-active .text-gray-400 {
    color: var(--genre-text-secondary) !important;
}

.genre-active .border-gray-200,
.genre-active .border-gray-300 {
    border-color: var(--genre-card-border) !important;
}

.genre-active .bg-gray-100,
.genre-active .bg-gray-50 {
    background: var(--genre-card-bg) !important;
}

.genre-active select,
.genre-active input[type="text"],
.genre-active input[type="number"],
.genre-active textarea {
    background: rgba(255,255,255,0.08) !important;
    border-color: var(--genre-card-border) !important;
    color: var(--genre-text-primary) !important;
}

.genre-active select option {
    background: #1a1a2e;
    color: #f3f4f6;
}

/* Fix rank title text — black on dark backgrounds */
.genre-active .rank-title {
    color: var(--genre-text-secondary) !important;
    -webkit-text-fill-color: var(--genre-text-secondary) !important;
}

/* ── Genre-active button color harmonization ───────────────── */
/* Campaigns & campaign action buttons: emerald/teal → warm gold */
.genre-active .from-emerald-500 { --tw-gradient-from: #d4a846 !important; }
.genre-active .to-teal-500 { --tw-gradient-to: #a87d2a !important; }
.genre-active .hover\:from-emerald-600:hover { --tw-gradient-from: #c49a3c !important; }
.genre-active .hover\:to-teal-600:hover { --tw-gradient-to: #8b6820 !important; }
.genre-active .border-emerald-400,
.genre-active .border-teal-400 { border-color: rgba(212, 168, 70, 0.3) !important; }

/* Achievements button: blue → deep purple */
.genre-active .from-blue-500 { --tw-gradient-from: #7c3aed !important; }
.genre-active .to-blue-600 { --tw-gradient-to: #6d28d9 !important; }
.genre-active .hover\:from-blue-600:hover { --tw-gradient-from: #6d28d9 !important; }
.genre-active .hover\:to-blue-700:hover { --tw-gradient-to: #5b21b6 !important; }
.genre-active .border-blue-600 { border-color: rgba(124, 58, 237, 0.4) !important; }

/* Stats numbers */
.genre-active .text-blue-600 { color: #d4a846 !important; }
.genre-active .text-green-600 { color: #a78bfa !important; }

/* Badge/pill overrides */
.genre-active .bg-blue-100 { background: rgba(124, 58, 237, 0.15) !important; }
.genre-active .text-blue-700 { color: #a78bfa !important; }
.genre-active .hover\:bg-blue-200:hover { background: rgba(124, 58, 237, 0.25) !important; }
.genre-active .bg-blue-100.text-blue-900 { color: #c4b5fd !important; }

/* Delete/cancel — keep red semantic but soften on dark bg */
.genre-active .bg-red-100 { background: rgba(239, 68, 68, 0.12) !important; }
.genre-active .text-red-700 { color: #fca5a5 !important; }
.genre-active .hover\:bg-red-100:hover { background: rgba(239, 68, 68, 0.18) !important; }
.genre-active .hover\:bg-red-200:hover { background: rgba(239, 68, 68, 0.22) !important; }
.genre-active .text-red-600 { color: #f87171 !important; }
.genre-active .border-red-300 { border-color: rgba(239, 68, 68, 0.3) !important; }

/* Success states — green → warm gold */
.genre-active .bg-green-100 { background: rgba(212, 168, 70, 0.12) !important; }
.genre-active .text-green-700 { color: #d4a846 !important; }
.genre-active .text-green-300 { color: #d4a846 !important; }
.genre-active .border-green-300 { border-color: rgba(212, 168, 70, 0.3) !important; }

/* Purple/pink workspace button — keep but deepen */
.genre-active .from-purple-500 { --tw-gradient-from: #7c3aed !important; }
.genre-active .to-pink-500 { --tw-gradient-to: #9333ea !important; }
.genre-active .hover\:from-purple-600:hover { --tw-gradient-from: #6d28d9 !important; }
.genre-active .hover\:to-pink-600:hover { --tw-gradient-to: #7e22ce !important; }

/* Indigo daily tags */
.genre-active .bg-indigo-50 { background: rgba(124, 58, 237, 0.1) !important; }
.genre-active .text-indigo-700 { color: #a78bfa !important; }
.genre-active .border-indigo-200 { border-color: rgba(124, 58, 237, 0.25) !important; }

/* Amber side-task tags */
.genre-active .bg-amber-50 { background: rgba(212, 168, 70, 0.1) !important; }
.genre-active .text-amber-700 { color: #d4a846 !important; }
.genre-active .border-amber-200 { border-color: rgba(212, 168, 70, 0.25) !important; }

/* Orange warning tags */
.genre-active .bg-orange-100 { background: rgba(245, 158, 11, 0.12) !important; }
.genre-active .text-orange-700 { color: #fbbf24 !important; }
.genre-active .border-orange-300 { border-color: rgba(245, 158, 11, 0.3) !important; }

/* Purple/prestige badges */
.genre-active .bg-purple-100 { background: rgba(124, 58, 237, 0.12) !important; }
.genre-active .text-purple-700 { color: #a78bfa !important; }
.genre-active .text-purple-600 { color: #a78bfa !important; }

/* Settings button (gray) — already covered by .bg-gray-100 override */

/* Level progress track on dark bg */
.genre-active .level-progress-track {
    background: rgba(255, 255, 255, 0.08);
}

/* Achievement notification — soften the yellow/orange on dark */
.genre-active .from-yellow-400 { --tw-gradient-from: #d4a846 !important; }
.genre-active .to-orange-500 { --tw-gradient-to: #a87d2a !important; }
.genre-active .border-yellow-600 { border-color: rgba(212, 168, 70, 0.4) !important; }

/* --- FANTASY --- */
.genre-fantasy {
    --genre-card-bg: rgba(212, 168, 70, 0.06);
    --genre-card-border: rgba(212, 168, 70, 0.14);
    --genre-text-primary: #f5f0e0;
    --genre-text-secondary: rgba(245, 240, 224, 0.50);
    background: linear-gradient(135deg, #080412 0%, #150a2e 35%, #0d0820 65%, #1a0d38 100%) !important;
    background-attachment: fixed !important;
}

/* Fantasy wallpaper — subtle background scene with slow drift */
@keyframes wallpaper-drift {
    0%   { transform: translate(0, 0)      scale(1.3); }
    25%  { transform: translate(-3%, -2%)   scale(1.3); }
    50%  { transform: translate(-1%, -4%)   scale(1.3); }
    75%  { transform: translate(-4%, -1%)   scale(1.3); }
    100% { transform: translate(0, 0)       scale(1.3); }
}
.genre-bg-fantasy .genre-wallpaper {
    position: absolute;
    inset: -30%;
    background: url('https://ktnkfbmdecgpyhhpqxcs.supabase.co/storage/v1/object/public/genre-avatars/wallpapers/fantasy-bg.png') center center / contain no-repeat;
    background-size: 100% auto;
    opacity: 0.12;
    animation: wallpaper-drift 60s ease-in-out infinite;
    will-change: transform;
}

/* Fantasy animated background */
.genre-bg-fantasy .genre-orb-1 {
    position: absolute; top: 15%; left: 20%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.18) 0%, transparent 70%);
    border-radius: 50%; filter: blur(60px);
    animation: genre-float-1 8s ease-in-out infinite;
}
.genre-bg-fantasy .genre-orb-2 {
    position: absolute; bottom: 20%; right: 15%;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(212, 168, 70, 0.12) 0%, transparent 70%);
    border-radius: 50%; filter: blur(80px);
    animation: genre-float-2 10s ease-in-out infinite;
}
.genre-bg-fantasy .genre-orb-3 {
    position: absolute; top: 50%; left: 60%;
    width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    border-radius: 50%; filter: blur(50px);
    animation: genre-float-3 12s ease-in-out infinite;
}
/* Fantasy aurora shimmer */
.genre-bg-fantasy .genre-aurora {
    position: absolute; top: 0; left: 0; right: 0; height: 40%;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.06) 0%, transparent 100%);
    animation: genre-aurora 6s ease-in-out infinite alternate;
}
/* Fantasy floating embers */
@keyframes ember-float {
    0% { transform: translateY(0) scale(0); opacity: 0; }
    8% { opacity: 1; transform: translateY(-8vh) scale(1); }
    85% { opacity: 0.8; }
    100% { transform: translateY(-100vh) scale(0.3); opacity: 0; }
}
.genre-embers {
    position: absolute; inset: 0; overflow: hidden;
}
.genre-ember {
    position: absolute;
    bottom: -5%;
    width: 3px; height: 3px;
    background: #d4a846;
    border-radius: 50%;
    box-shadow: 0 0 6px 2px rgba(212, 168, 70, 0.4), 0 0 12px 4px rgba(212, 168, 70, 0.15);
    animation: ember-float linear infinite;
}
.genre-ember:nth-child(1)  { animation-duration: 8s;  animation-delay: 0s; }
.genre-ember:nth-child(2)  { animation-duration: 11s; animation-delay: 1.2s; width: 2px; height: 2px; }
.genre-ember:nth-child(3)  { animation-duration: 9s;  animation-delay: 2.5s; }
.genre-ember:nth-child(4)  { animation-duration: 13s; animation-delay: 0.8s; width: 4px; height: 4px; }
.genre-ember:nth-child(5)  { animation-duration: 10s; animation-delay: 3.1s; width: 2px; height: 2px; }
.genre-ember:nth-child(6)  { animation-duration: 12s; animation-delay: 1.7s; }
.genre-ember:nth-child(7)  { animation-duration: 8.5s; animation-delay: 4.2s; width: 2px; height: 2px; }
.genre-ember:nth-child(8)  { animation-duration: 14s; animation-delay: 0.3s; }
.genre-ember:nth-child(9)  { animation-duration: 9.5s; animation-delay: 2.8s; width: 4px; height: 4px; background: #f59e0b; }
.genre-ember:nth-child(10) { animation-duration: 11.5s; animation-delay: 5s; width: 2px; height: 2px; }
.genre-ember:nth-child(11) { animation-duration: 10.5s; animation-delay: 1.5s; }
.genre-ember:nth-child(12) { animation-duration: 7.5s; animation-delay: 3.8s; width: 2px; height: 2px; }
.genre-ember:nth-child(13) { animation-duration: 13.5s; animation-delay: 0.6s; background: #fbbf24; }
.genre-ember:nth-child(14) { animation-duration: 9s;  animation-delay: 4.5s; width: 2px; height: 2px; }
.genre-ember:nth-child(15) { animation-duration: 12.5s; animation-delay: 2s; }

/* --- SCI-FI --- */
.genre-scifi {
    --genre-card-bg: rgba(34, 211, 238, 0.06);
    --genre-card-border: rgba(34, 211, 238, 0.18);
    --genre-text-primary: #e0f2fe;
    --genre-text-secondary: rgba(224, 242, 254, 0.5);
    background: linear-gradient(135deg, #0a0e1a 0%, #0d1b2a 40%, #1b2838 70%, #0a0e1a 100%) !important;
    background-attachment: fixed !important;
}

/* Sci-fi starfield */
.genre-bg-scifi .genre-stars {
    position: absolute; inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(2px 2px at 15% 75%, rgba(34,211,238,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 85%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 65% 25%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(2px 2px at 85% 55%, rgba(34,211,238,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 45%, rgba(255,255,255,0.5) 0%, transparent 100%);
    animation: genre-drift 30s linear infinite;
}
/* Sci-fi scan line */
.genre-bg-scifi .genre-scanline {
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(34, 211, 238, 0.015) 2px,
        rgba(34, 211, 238, 0.015) 4px
    );
}
.genre-bg-scifi .genre-orb-1 {
    position: absolute; top: 30%; right: 10%;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.12) 0%, transparent 70%);
    border-radius: 50%; filter: blur(80px);
    animation: genre-float-2 14s ease-in-out infinite;
}

/* --- ANIME --- */
.genre-anime {
    --genre-card-bg: rgba(244, 114, 182, 0.06);
    --genre-card-border: rgba(244, 114, 182, 0.18);
    --genre-text-primary: #fdf2f8;
    --genre-text-secondary: rgba(253, 242, 248, 0.5);
    background: linear-gradient(135deg, #1a0520 0%, #2d1040 40%, #1a0520 70%, #3d1560 100%) !important;
    background-attachment: fixed !important;
}

/* Anime energy orbs */
.genre-bg-anime .genre-orb-1 {
    position: absolute; top: 20%; left: 15%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(244, 114, 182, 0.20) 0%, transparent 70%);
    border-radius: 50%; filter: blur(60px);
    animation: genre-float-1 7s ease-in-out infinite;
}
.genre-bg-anime .genre-orb-2 {
    position: absolute; bottom: 25%; right: 20%;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(251, 146, 60, 0.15) 0%, transparent 70%);
    border-radius: 50%; filter: blur(70px);
    animation: genre-float-2 9s ease-in-out infinite;
}
.genre-bg-anime .genre-orb-3 {
    position: absolute; top: 60%; left: 50%;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(219, 39, 119, 0.18) 0%, transparent 70%);
    border-radius: 50%; filter: blur(50px);
    animation: genre-float-3 11s ease-in-out infinite;
}
/* Anime pulse ring */
.genre-bg-anime .genre-pulse {
    position: absolute; top: 50%; left: 50%;
    width: 600px; height: 600px;
    margin-top: -300px; margin-left: -300px;
    border: 1px solid rgba(244, 114, 182, 0.08);
    border-radius: 50%;
    animation: genre-pulse-ring 4s ease-out infinite;
}

/* --- SURVIVAL --- */
.genre-survival {
    --genre-card-bg: rgba(245, 158, 11, 0.06);
    --genre-card-border: rgba(245, 158, 11, 0.18);
    --genre-text-primary: #fefce8;
    --genre-text-secondary: rgba(254, 252, 232, 0.5);
    background: linear-gradient(135deg, #1a1a0e 0%, #2d2d1a 40%, #1a1a0e 70%, #3d3d20 100%) !important;
    background-attachment: fixed !important;
}

/* Survival fog layers */
.genre-bg-survival .genre-fog-1 {
    position: absolute; bottom: 0; left: -20%;
    width: 140%; height: 40%;
    background: linear-gradient(0deg, rgba(245, 158, 11, 0.04) 0%, transparent 100%);
    filter: blur(30px);
    animation: genre-fog 20s ease-in-out infinite;
}
.genre-bg-survival .genre-fog-2 {
    position: absolute; bottom: 5%; left: -10%;
    width: 120%; height: 30%;
    background: linear-gradient(0deg, rgba(217, 119, 6, 0.03) 0%, transparent 100%);
    filter: blur(40px);
    animation: genre-fog 25s ease-in-out infinite reverse;
}
.genre-bg-survival .genre-orb-1 {
    position: absolute; top: 25%; right: 20%;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.10) 0%, transparent 70%);
    border-radius: 50%; filter: blur(50px);
    animation: genre-float-1 15s ease-in-out infinite;
}

/* ---- Genre Animations ---- */
@keyframes genre-float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
    50% { transform: translate(30px, -40px) scale(1.1); opacity: 1; }
}
@keyframes genre-float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    50% { transform: translate(-40px, 30px) scale(1.15); opacity: 0.9; }
}
@keyframes genre-float-3 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
    33% { transform: translate(20px, -30px) scale(1.05); opacity: 0.8; }
    66% { transform: translate(-25px, 15px) scale(0.95); opacity: 0.6; }
}
@keyframes genre-aurora {
    0% { opacity: 0.3; transform: scaleY(1); }
    100% { opacity: 0.6; transform: scaleY(1.2); }
}
@keyframes genre-drift {
    0% { transform: translateY(0); }
    100% { transform: translateY(-20px); }
}
@keyframes genre-pulse-ring {
    0% { transform: scale(0.5); opacity: 0.3; }
    100% { transform: scale(1.5); opacity: 0; }
}
@keyframes genre-fog {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5%); }
}

/* Genre avatar display */
.genre-avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.genre-avatar-emoji {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

.genre-avatar-emoji:hover {
    transform: scale(1.15);
}

/* Genre avatar images (AI-generated art) */
.genre-avatar-img {
    object-fit: cover;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Crossfade container for emotion transitions */
.genre-avatar-crossfade {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.genre-avatar-crossfade img {
    transition: opacity 0.3s ease;
}

.genre-portrait-crossfade {
    position: relative;
    width: 100%;
    height: 100%;
}
.genre-portrait-crossfade img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.3s ease;
}

.genre-avatar-img:hover {
    transform: scale(1.15);
}

/* Portrait blend (transparent PNGs, no blend mode needed) */
.genre-portrait-blend {
    border-radius: 0;
}

/* Tiny inline avatar for next-tier preview */
.genre-next-tier-img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 2px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

.genre-avatar-label {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
    color: var(--genre-text-secondary, rgba(255,255,255,0.5));
    text-transform: uppercase;
    line-height: 1;
}

/* Genre avatar progression card v2 — large portrait with 20-stage slider */
.genre-avatar-card-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 10px;
    border-radius: 16px;
    background: var(--genre-card-bg, rgba(255,255,255,0.06));
    border: 1px solid var(--genre-card-border, rgba(255,255,255,0.12));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Arrow + portrait row */
.genre-portrait-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    justify-content: center;
}

/* Portrait frame — large, no circle crop */
.genre-portrait-frame {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    flex-shrink: 0;
}

/* Large portrait image */
.genre-portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.3s ease;
}

.genre-portrait-img:hover {
    transform: scale(1.05);
}

/* Loading shimmer for avatar/portrait placeholders */
@keyframes genre-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.genre-avatar-shimmer,
.genre-portrait-shimmer {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: genre-shimmer 1.5s ease-in-out infinite;
}
.genre-avatar-shimmer {
    flex-shrink: 0;
}
.genre-portrait-shimmer {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

/* Portrait label (character name) */
.genre-portrait-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
}

.genre-avatar-card-v2 .genre-tier-name {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--genre-text-secondary, rgba(255,255,255,0.5));
    margin-top: -2px;
}

/* Slider arrows for stage browsing */
.genre-slider-arrow {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px;
    transition: opacity 0.2s ease, transform 0.15s ease;
    line-height: 1;
}

.genre-slider-arrow:hover:not(:disabled) {
    opacity: 1 !important;
    transform: scale(1.2);
}

.genre-slider-arrow:disabled {
    cursor: default;
}

/* Locked stage badge overlay */
.genre-locked-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 0.55rem;
    font-weight: 700;
    background: rgba(0,0,0,0.75);
    color: rgba(255,255,255,0.6);
    padding: 2px 6px;
    border-radius: 6px;
    letter-spacing: 0.03em;
}

/* Progress bar with milestone markers */
.genre-stage-progress-wrap {
    width: 100%;
    padding: 0 4px;
}

.genre-stage-progress {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-top: 4px;
}

.genre-stage-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, opacity 0.3s ease;
}

/* Clickable milestone markers on progress bar */
.genre-stage-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1;
}

.genre-stage-marker:hover {
    transform: translate(-50%, -50%) scale(1.4);
}

/* Stage labels below progress bar */
.genre-stage-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.45rem;
    color: rgba(255,255,255,0.35);
    margin-top: 2px;
    letter-spacing: 0.03em;
}

/* Genre picker cards in settings */
.genre-picker-card {
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.04);
}

.genre-picker-card:hover {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.08);
    transform: translateY(-2px);
}

.genre-picker-card.selected {
    border-color: var(--genre-card-border, rgba(139, 92, 246, 0.5));
    background: var(--genre-card-bg, rgba(139, 92, 246, 0.12));
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.genre-picker-card .genre-icon {
    font-size: 2rem;
    margin-bottom: 4px;
}

.genre-picker-card .genre-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f3f4f6;
}

.genre-picker-card .genre-desc {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}

.genre-picker-card .genre-swatch {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    margin-top: 8px;
}
