/*
 * UI/UX Optimization: Enhanced CSS Custom Properties System with Animation Support
 * Reason: Centralized design tokens for consistent spacing, typography, responsive design, and accessibility
 * Impact: Better maintainability, consistent visual hierarchy, improved scalability, reduced motion support
 */
:root {
  /* Theme color variables - will be set dynamically */
  --theme-primary: #667eea;
  --theme-secondary: #764ba2;
  --theme-accent: #f093fb;
  --theme-glow: rgba(102, 126, 234, 0.8);
  --theme-shadow: rgba(102, 126, 234, 0.4);
  
  /* 
   * Animation and Transition Settings
   * Respects user's motion preferences for accessibility
   */
  --animation-duration-fast: 0.15s;
  --animation-duration-normal: 0.3s;
  --animation-duration-slow: 0.6s;
  --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
  --animation-timing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* 
   * Responsive Spacing System
   * Uses 8px grid system for consistent spacing across all breakpoints
   */
  --spacing-xs: 0.5rem;   /* 8px */
  --spacing-sm: 1rem;     /* 16px */
  --spacing-md: 1.5rem;   /* 24px */
  --spacing-lg: 2rem;     /* 32px */
  --spacing-xl: 3rem;     /* 48px */
  --spacing-2xl: 4rem;    /* 64px */
  
  /* 
   * Typography Scale - Mobile-first approach
   * Minimum 16px base for mobile accessibility (WCAG guidelines)
   */
  --font-size-xs: 0.875rem;   /* 14px */
  --font-size-sm: 1rem;       /* 16px - minimum mobile size */
  --font-size-md: 1.125rem;   /* 18px */
  --font-size-lg: 1.25rem;    /* 20px */
  --font-size-xl: 1.5rem;     /* 24px */
  --font-size-2xl: 2rem;      /* 32px */
  --font-size-3xl: 2.5rem;    /* 40px */
  --font-size-4xl: 3rem;      /* 48px */
  
  /* Line heights for better readability */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Modern font families - Inter primary, Montserrat secondary */
  --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-family-secondary: 'Montserrat', var(--font-family-primary);
  --font-family-mono: 'Share Tech Mono', 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Consistent border radius values */
  --radius-sm: 0.5rem;    /* 8px */
  --radius-md: 0.75rem;   /* 12px */
  --radius-lg: 1rem;      /* 16px */
  --radius-xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;  /* Fully rounded */
  
  /* Touch target sizes for accessibility */
  --touch-target-min: 2.75rem; /* 44px minimum */
  --touch-target-comfortable: 3rem; /* 48px comfortable */
  
  /* Z-index system */
  --z-behind: -1;
  --z-base: 0;
  --z-raised: 10;
  --z-floating: 100;
  --z-overlay: 1000;
  --z-modal: 1100;
  --z-tooltip: 1200;
}

/*
 * UI/UX Optimization: Accessibility-First Animation System
 * Reason: Respect user's motion preferences, reduce motion sickness, improve accessibility
 * Impact: Better accessibility for users with vestibular disorders, improved performance
 */
@media (prefers-reduced-motion: reduce) {
  :root {
    --animation-duration-fast: 0.01ms;
    --animation-duration-normal: 0.01ms;
    --animation-duration-slow: 0.01ms;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  /* Disable complex background animations */
  body::before,
  body::after {
    animation: none !important;
  }
}

/* Goth Theme (Deep Gothic) */
.theme-goth {
  --theme-bg-primary: #0a0a0a;
  --theme-bg-secondary: #1a0f1a;
  --theme-bg-accent: #0f1420;
  --theme-text-primary: #ffffff;
  --theme-text-secondary: #b0b0b0;
  --theme-bubble-dark: rgba(20, 10, 20, 0.9);
  --theme-bubble-accent: #8b1538;
  --theme-glow-neon: rgba(138, 21, 56, 0.8);
  --theme-shadow-neon: rgba(138, 21, 56, 0.4);
  --theme-primary: #8b1538;
  --theme-secondary: #4c1d95;
  --theme-accent: #7c2d12;
  --theme-glow: rgba(138, 21, 56, 0.8);
  --theme-shadow: rgba(138, 21, 56, 0.4);
  --theme-font-family: 'Cinzel', 'Times New Roman', serif;
}


/* Hello Kitty Theme (Premium - Kawaii Pink) */
.theme-hellokitty {
  --theme-bg-primary: #ffb3d9;
  --theme-bg-secondary: #ff99cc;
  --theme-bg-accent: #ffe6f2;
  --theme-text-primary: #cc0066;
  --theme-text-secondary: #ff3399;
  --theme-bubble-light: rgba(255, 255, 255, 0.9);
  --theme-bubble-accent: #ff69b4;
  --theme-glow-kawaii: rgba(255, 105, 180, 0.8);
  --theme-shadow-kawaii: rgba(255, 105, 180, 0.4);
  --theme-primary: #ff69b4;
  --theme-secondary: #ff1493;
  --theme-accent: #ffb6c1;
  --theme-glow: rgba(255, 105, 180, 0.8);
  --theme-shadow: rgba(255, 105, 180, 0.4);
  --theme-font-family: 'Poppins', 'Arial', sans-serif;
}

/* Chill Theme (Premium - Ocean Blues) */
.theme-chill {
  --theme-bg-primary: #0077be;
  --theme-bg-secondary: #4da6d9;
  --theme-bg-accent: #87ceeb;
  --theme-text-primary: #ffffff;
  --theme-text-secondary: #e0f6ff;
  --theme-bubble-light: rgba(255, 255, 255, 0.2);
  --theme-bubble-accent: #00bfff;
  --theme-glow-ocean: rgba(0, 191, 255, 0.8);
  --theme-shadow-ocean: rgba(0, 191, 255, 0.4);
  --theme-primary: #00bfff;
  --theme-secondary: #1e90ff;
  --theme-accent: #87cefa;
  --theme-glow: rgba(0, 191, 255, 0.8);
  --theme-shadow: rgba(0, 191, 255, 0.4);
  --theme-font-family: 'Inter', 'Arial', sans-serif;
}

/* Chaos Theme (Premium - Wild Multicolor) */
.theme-chaos {
  --theme-bg-primary: #000000;
  --theme-bg-secondary: #1a0033;
  --theme-bg-accent: #330066;
  --theme-text-primary: #ffffff;
  --theme-text-secondary: #ffccff;
  --theme-bubble-dark: rgba(255, 0, 128, 0.2);
  --theme-bubble-accent: #ff0080;
  --theme-glow-chaos: rgba(255, 0, 128, 0.8);
  --theme-shadow-chaos: rgba(255, 0, 128, 0.4);
  --theme-primary: #ff0080;
  --theme-secondary: #00ff80;
  --theme-accent: #8000ff;
  --theme-glow: rgba(255, 0, 128, 0.8);
  --theme-shadow: rgba(255, 0, 128, 0.4);
  --theme-font-family: 'Orbitron', 'Arial', sans-serif;
}

/* Retro Neon Theme (Premium - 80s Cyberpunk) */
.theme-retroneon {
  --theme-bg-primary: #000000;
  --theme-bg-secondary: #0a0a1a;
  --theme-bg-accent: #1a0a2a;
  --theme-text-primary: #00bfff;
  --theme-text-secondary: #ff69b4;
  --theme-bubble-dark: rgba(0, 191, 255, 0.1);
  --theme-bubble-accent: #8a2be2;
  --theme-glow-neon: rgba(0, 191, 255, 0.8);
  --theme-shadow-neon: rgba(138, 43, 226, 0.6);
  --theme-primary: #00bfff;
  --theme-secondary: #8a2be2;
  --theme-accent: #ff69b4;
  --theme-tertiary: #ffff00;
  --theme-glow: rgba(0, 191, 255, 0.8);
  --theme-shadow: rgba(138, 43, 226, 0.6);
  --theme-font-family: 'Orbitron', 'Arial', sans-serif;
}

/* Digital Void Theme (Premium - Matrix Dark) */
.theme-digitalvoid {
  --theme-bg-primary: #000000;
  --theme-bg-secondary: #000000;
  --theme-bg-accent: #000000;
  --theme-text-primary: #00ff41;
  --theme-text-secondary: #008800;
  --theme-bubble-dark: rgba(0, 255, 65, 0.1);
  --theme-bubble-accent: #00ff41;
  --theme-glow-matrix: rgba(0, 255, 65, 0.8);
  --theme-shadow-matrix: rgba(0, 255, 65, 0.4);
  --theme-primary: #00ff41;
  --theme-secondary: #00cc33;
  --theme-accent: #00aa22;
  --theme-glow: rgba(0, 255, 65, 0.8);
  --theme-shadow: rgba(0, 255, 65, 0.4);
  --theme-font-family: 'Share Tech Mono', 'Courier New', monospace;
}

/*
 * UI/UX Optimization: Enhanced Color Contrast and Accessibility
 * Reason: WCAG AA/AAA compliance, better readability, improved accessibility
 * Impact: Better visibility for users with visual impairments, improved overall UX
 */

/* Glow Theme - Enhanced for better contrast */
.theme-glow {
  --theme-bg-primary: #fafbff;      /* Lighter background for better contrast */
  --theme-bg-secondary: #f3f4ff;
  --theme-bg-accent: #fef7d4;
  --theme-text-primary: #1e293b;    /* Darker text for better contrast ratio */
  --theme-text-secondary: #475569;  /* Improved secondary text contrast */
  --theme-bubble-light: rgba(255, 255, 255, 0.95);
  --theme-bubble-accent: #f59e0b;   /* Better contrast amber */
  --theme-glow-soft: rgba(245, 158, 11, 0.6);
  --theme-shadow-soft: rgba(245, 158, 11, 0.3);
  --theme-primary: #2563eb;         /* Better contrast blue */
  --theme-secondary: #dc2626;       /* Better contrast red */
  --theme-accent: #f59e0b;          /* Better contrast amber */
  --theme-glow: rgba(37, 99, 235, 0.6);
  --theme-shadow: rgba(37, 99, 235, 0.3);
  --theme-font-family: var(--font-family-primary);
}

/* Poltergeist Theme (Dark & Disturbing) */
.theme-poltergeist {
  --theme-bg-primary: #0a0a0a;
  --theme-bg-secondary: #1a1a1a;
  --theme-bg-accent: #0f0f0f;
  --theme-text-primary: #f0f0f0;
  --theme-text-secondary: #cccccc;
  --theme-bubble-dark: rgba(255, 255, 255, 0.05);
  --theme-bubble-accent: #ff2e2e;
  --theme-glow-disturbing: rgba(255, 46, 46, 0.8);
  --theme-shadow-disturbing: rgba(255, 46, 46, 0.4);
  --theme-primary: #ff2e2e;
  --theme-secondary: #00cfff;
  --theme-accent: #00cfff;
  --theme-glow: rgba(255, 46, 46, 0.8);
  --theme-shadow: rgba(255, 46, 46, 0.4);
  --theme-font-family: 'Orbitron', 'VT323', 'Share Tech Mono', monospace;
}

/*
 * UI/UX Optimization: Enhanced Body Foundation
 * Reason: Better responsive design, accessibility, and performance
 * Impact: Improved mobile experience, consistent typography, reduced layout shifts
 */
body {
  margin: 0;
  padding: 0;
  font-family: var(--theme-font-family, var(--font-family-primary));
  font-size: var(--font-size-sm); /* 16px minimum for mobile accessibility */
  line-height: var(--line-height-normal);
  background: #0f0f1a;
  color: #fff;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
  overflow-x: hidden;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth easing */
  
  /* Improved text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  
  /* Better touch scrolling on mobile */
  -webkit-overflow-scrolling: touch;
  
  /* Prevent horizontal scroll issues */
  width: 100%;
  max-width: 100vw;
}

/* Theme-specific body styles */
body.theme-goth {
  background: var(--theme-bg-primary);
  color: var(--theme-text-primary);
  font-family: var(--theme-font-family);
}



body.theme-glow {
  background: linear-gradient(135deg, var(--theme-bg-primary) 0%, var(--theme-bg-secondary) 50%, var(--theme-bg-accent) 100%);
  color: var(--theme-text-primary);
  font-family: var(--theme-font-family);
}

body.theme-poltergeist {
  background: var(--theme-bg-primary);
  color: var(--theme-text-primary);
  font-family: var(--theme-font-family);
  font-weight: 400;
  letter-spacing: 0.5px;
}

body.theme-hellokitty {
  background: #ffb6c1 !important;
  color: var(--theme-text-primary);
  font-family: var(--theme-font-family);
}

body.theme-chill {
  background: linear-gradient(135deg, var(--theme-bg-primary) 0%, var(--theme-bg-secondary) 50%, var(--theme-bg-accent) 100%);
  color: var(--theme-text-primary);
  font-family: var(--theme-font-family);
}

body.theme-chaos {
  background: var(--theme-bg-primary);
  color: var(--theme-text-primary);
  font-family: var(--theme-font-family);
  animation: chaos-flicker 0.1s infinite;
}

body.theme-retroneon {
  background: var(--theme-bg-primary);
  color: var(--theme-text-primary);
  font-family: var(--theme-font-family);
  font-weight: bold;
}

/* Retro neon theme overlay - remove swirl-texture animation */
body.theme-retroneon::after {
  background: radial-gradient(circle at 20% 80%, rgba(0, 191, 255, 0.2) 0%, transparent 60%),
              radial-gradient(circle at 80% 20%, rgba(138, 43, 226, 0.3) 0%, transparent 60%),
              radial-gradient(circle at 40% 40%, rgba(255, 105, 180, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 60% 70%, rgba(255, 255, 0, 0.1) 0%, transparent 45%);
  animation: aurora-overlay-retroneon 15s ease infinite reverse;
}

body.theme-digitalvoid {
  background: #000000 !important; /* Force absolute black background */
  color: var(--theme-text-primary);
  font-family: var(--theme-font-family);
}

/* Digital Void theme - Remove aurora background animations */
body.theme-digitalvoid::before {
  display: none !important;
}

body.theme-digitalvoid::after {
  display: none !important;
}

/* Aurora animated background - Default */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #1e3a8a, #7c3aed, #0891b2, #db2777);
  background-size: 400% 400%;
  animation: aurora 15s ease infinite;
  z-index: -2;
  transition: all 0.5s ease;
}

/* Goth theme background - Deep Goth enhancement */
body.theme-goth::before {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0f1a 25%, #2d1b69 50%, #1a0a2e 75%, #000000 100%);
  background-size: 400% 400%;
  animation: aurora-deep-goth 20s ease infinite;
}

/* Glow theme background */
body.theme-glow::before {
  background: linear-gradient(45deg, #e0f2fe, #fce7f3, #fef3c7, #dbeafe);
  background-size: 400% 400%;
}

/* Poltergeist theme background - Disturbing chaos */
body.theme-poltergeist::before {
  background: linear-gradient(45deg, #0a0a0a 0%, #1a1a1a 25%, #0f0f0f 50%, #0a0a0a 75%, #000000 100%);
  background-size: 400% 400%;
  animation: aurora-poltergeist 8s ease infinite;
  filter: contrast(1.2) brightness(0.8);
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 80%, rgba(120, 113, 255, 0.3) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255, 113, 181, 0.3) 0%, transparent 50%),
              radial-gradient(circle at 40% 40%, rgba(0, 255, 255, 0.2) 0%, transparent 50%),
              conic-gradient(from 0deg at 60% 30%, transparent 0deg, rgba(120, 113, 255, 0.1) 60deg, transparent 120deg),
              conic-gradient(from 180deg at 30% 70%, transparent 0deg, rgba(255, 113, 181, 0.08) 45deg, transparent 90deg);
  animation: aurora-overlay 20s ease infinite reverse, swirl-texture 25s linear infinite;
  z-index: -1;
  transition: all 0.5s ease;
}

/* Goth theme overlay - Enhanced with fog and sparkles */
body.theme-goth::after {
  background: radial-gradient(circle at 20% 80%, rgba(138, 21, 56, 0.4) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(76, 29, 149, 0.3) 0%, transparent 50%),
              radial-gradient(circle at 40% 40%, rgba(124, 45, 18, 0.2) 0%, transparent 50%);
  animation: aurora-overlay-goth 25s ease infinite reverse, swirl-texture 30s linear infinite;
}

/* Glow theme overlay */
body.theme-glow::after {
  background: radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.2) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.2) 0%, transparent 50%),
              radial-gradient(circle at 40% 40%, rgba(251, 191, 36, 0.15) 0%, transparent 50%);
}

/* Poltergeist theme overlay - Disturbing energy */
body.theme-poltergeist::after {
  background: radial-gradient(circle at 20% 80%, rgba(255, 46, 46, 0.3) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(0, 207, 255, 0.2) 0%, transparent 50%),
              radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
              radial-gradient(circle at 60% 60%, rgba(255, 46, 46, 0.1) 0%, transparent 30%);
  animation: aurora-overlay-poltergeist 12s ease infinite reverse, poltergeist-disturbance 15s linear infinite;
}

/* Hello Kitty theme - clean background with no overlays */
body.theme-hellokitty::before {
  display: none !important;
}

body.theme-hellokitty::after {
  display: none !important;
}

@keyframes aurora {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes aurora-overlay {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1) rotate(0deg);
  }
  33% {
    opacity: 0.8;
    transform: scale(1.1) rotate(1deg);
  }
  66% {
    opacity: 0.7;
    transform: scale(0.9) rotate(-1deg);
  }
}

@keyframes swirl-texture {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(90deg) scale(1.02);
  }
  50% {
    transform: rotate(180deg) scale(1);
  }
  75% {
    transform: rotate(270deg) scale(0.98);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

/* Deep Goth Theme Enhancements */

/* Fog overlay for goth theme */
body.theme-goth .fog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.7;
  z-index: -1;
  background-image: url('/images/fog.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: fog-drift 40s ease-in-out infinite;
}

/* Sparkles overlay for deep goth atmosphere */
body.theme-goth .sparkles-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(138, 21, 56, 0.8), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(138, 21, 56, 0.9), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(2px 2px at 160px 30px, rgba(76, 29, 149, 0.7), transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: sparkle-twinkle 8s ease-in-out infinite alternate;
}

/* Moving shadows overlay */
body.theme-goth .shadows-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background: 
    radial-gradient(ellipse 400px 200px at 10% 90%, rgba(0, 0, 0, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse 300px 150px at 90% 10%, rgba(0, 0, 0, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse 500px 250px at 50% 50%, rgba(0, 0, 0, 0.2) 0%, transparent 50%);
  animation: shadows-drift 35s ease-in-out infinite;
}

/* Deep goth specific animations */
@keyframes aurora-deep-goth {
  0%, 100% {
    background-position: 0% 50%;
    filter: brightness(0.8) saturate(1.2);
  }
  25% {
    background-position: 50% 25%;
    filter: brightness(0.9) saturate(1.4);
  }
  50% {
    background-position: 100% 50%;
    filter: brightness(0.7) saturate(1.6);
  }
  75% {
    background-position: 25% 75%;
    filter: brightness(0.85) saturate(1.3);
  }
}

@keyframes aurora-overlay-goth {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1) rotate(0deg);
    filter: brightness(0.8) contrast(1.2);
  }
  33% {
    opacity: 0.7;
    transform: scale(1.05) rotate(1deg);
    filter: brightness(1.1) contrast(1.4);
  }
  66% {
    opacity: 0.5;
    transform: scale(0.95) rotate(-1deg);
    filter: brightness(0.9) contrast(1.3);
  }
}

@keyframes fog-drift {
  0% {
    transform: translateX(0) translateY(0) scale(1);
    opacity: 0.7;
  }
  25% {
    transform: translateX(-20px) translateY(10px) scale(1.02);
    opacity: 0.8;
  }
  50% {
    transform: translateX(15px) translateY(-15px) scale(0.98);
    opacity: 0.6;
  }
  75% {
    transform: translateX(-10px) translateY(20px) scale(1.01);
    opacity: 0.9;
  }
  100% {
    transform: translateX(0) translateY(0) scale(1);
    opacity: 0.7;
  }
}

@keyframes sparkle-twinkle {
  0% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
  100% {
    opacity: 0.4;
    transform: scale(0.9);
  }
}

@keyframes shadows-drift {
  0%, 100% {
    transform: translateX(0) translateY(0) rotate(0deg);
    opacity: 0.6;
  }
  33% {
    transform: translateX(30px) translateY(-20px) rotate(1deg);
    opacity: 0.4;
  }
  66% {
    transform: translateX(-25px) translateY(25px) rotate(-1deg);
    opacity: 0.8;
  }
}

/* Poltergeist Theme Animations */
@keyframes aurora-poltergeist {
  0%, 100% {
    background-position: 0% 50%;
    filter: contrast(1.2) brightness(0.8) hue-rotate(0deg);
  }
  25% {
    background-position: 50% 25%;
    filter: contrast(1.4) brightness(0.6) hue-rotate(10deg);
  }
  50% {
    background-position: 100% 50%;
    filter: contrast(1.1) brightness(0.9) hue-rotate(-5deg);
  }
  75% {
    background-position: 25% 75%;
    filter: contrast(1.3) brightness(0.7) hue-rotate(5deg);
  }
}

@keyframes aurora-overlay-poltergeist {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1) rotate(0deg);
    filter: brightness(0.8) saturate(1.2) hue-rotate(0deg);
  }
  33% {
    opacity: 0.6;
    transform: scale(1.03) rotate(0.5deg);
    filter: brightness(1.2) saturate(1.5) hue-rotate(15deg);
  }
  66% {
    opacity: 0.4;
    transform: scale(0.97) rotate(-0.3deg);
    filter: brightness(0.9) saturate(1.3) hue-rotate(-10deg);
  }
}

@keyframes poltergeist-disturbance {
  0% {
    transform: translateX(0) translateY(0) scale(1) rotate(0deg);
  }
  10% {
    transform: translateX(1px) translateY(-1px) scale(1.001) rotate(0.1deg);
  }
  20% {
    transform: translateX(-1px) translateY(2px) scale(0.999) rotate(-0.1deg);
  }
  30% {
    transform: translateX(1px) translateY(1px) scale(1.001) rotate(0.05deg);
  }
  40% {
    transform: translateX(0) translateY(-1px) scale(1) rotate(-0.05deg);
  }
  50% {
    transform: translateX(-1px) translateY(0) scale(1.001) rotate(0.1deg);
  }
  60% {
    transform: translateX(1px) translateY(1px) scale(0.999) rotate(0deg);
  }
  70% {
    transform: translateX(0) translateY(-1px) scale(1.001) rotate(-0.1deg);
  }
  80% {
    transform: translateX(-1px) translateY(1px) scale(1) rotate(0.05deg);
  }
  90% {
    transform: translateX(1px) translateY(0) scale(1.001) rotate(-0.05deg);
  }
  100% {
    transform: translateX(0) translateY(0) scale(1) rotate(0deg);
  }
}

/* Retro Neon Theme Animations */
@keyframes aurora-overlay-retroneon {
  0%, 100% {
    opacity: 0.8;
    transform: scale(1);
    filter: brightness(1) saturate(1.2);
  }
  25% {
    opacity: 0.6;
    transform: scale(1.02);
    filter: brightness(1.3) saturate(1.5);
  }
  50% {
    opacity: 0.9;
    transform: scale(0.98);
    filter: brightness(0.9) saturate(1.8);
  }
  75% {
    opacity: 0.7;
    transform: scale(1.01);
    filter: brightness(1.1) saturate(1.4);
  }
}

@keyframes neon-blink {
  0%, 85% {
    opacity: 1;
    filter: blur(0px);
  }
  86% {
    opacity: 0.3;
    filter: blur(1px);
  }
  88% {
    opacity: 1;
    filter: blur(0px);
  }
  90% {
    opacity: 0.1;
    filter: blur(2px);
  }
  92% {
    opacity: 1;
    filter: blur(0px);
  }
  100% {
    opacity: 1;
    filter: blur(0px);
  }
}

@keyframes neon-pulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes neon-drift {
  0% {
    transform: translateX(0) translateY(0);
  }
  25% {
    transform: translateX(10px) translateY(-5px);
  }
  50% {
    transform: translateX(-5px) translateY(10px);
  }
  75% {
    transform: translateX(-10px) translateY(-10px);
  }
  100% {
    transform: translateX(0) translateY(0);
  }
}

/*
 * UI/UX Optimization: Responsive Main Title
 * Reason: Better mobile experience, proper scaling, improved readability
 * Impact: Title scales properly across all devices, maintains visual hierarchy
 */
.glow {
  font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-4xl)); /* Responsive scaling */
  font-weight: 700;
  font-family: var(--font-family-secondary); /* Montserrat for display text */
  text-align: center;
  margin-top: clamp(var(--spacing-lg), 5vh, var(--spacing-2xl));
  margin-bottom: var(--spacing-lg);
  color: #fff;
  text-shadow: 0 0 1.25rem rgba(120, 113, 255, 0.8), 
               0 0 2.5rem rgba(255, 113, 181, 0.6),
               0 0 3.75rem rgba(0, 255, 255, 0.4),
               0 0 0.9375rem rgba(255, 255, 255, 0.5);
  letter-spacing: 0.125rem; /* Improved readability */
  line-height: var(--line-height-tight);
  transition: all var(--animation-duration-normal) var(--animation-timing);
  animation: glow-pulse 3s ease-in-out infinite alternate;
  position: relative;
  
  /* Better text rendering for display text */
  font-optical-sizing: auto;
  font-feature-settings: "kern" 1;
}

/* Goth theme title */
body.theme-goth .glow {
  color: var(--theme-text-primary);
  font-family: var(--theme-font-family);
  text-shadow: 0 0 20px var(--theme-glow-neon), 
               0 0 40px var(--theme-glow-neon),
               0 0 60px var(--theme-shadow-neon),
               0 0 80px var(--theme-primary),
               0 0 100px var(--theme-primary);
  letter-spacing: 3px;
  animation: glow-pulse-goth 4s ease-in-out infinite alternate;
}

/* Enhanced glow animation for goth theme */
@keyframes glow-pulse-goth {
  0% {
    text-shadow: 0 0 20px var(--theme-glow-neon), 
                 0 0 40px var(--theme-glow-neon),
                 0 0 60px var(--theme-shadow-neon),
                 0 0 80px var(--theme-primary);
    transform: scale(1);
  }
  50% {
    text-shadow: 0 0 30px var(--theme-glow-neon), 
                 0 0 50px var(--theme-glow-neon),
                 0 0 80px var(--theme-shadow-neon),
                 0 0 100px var(--theme-primary),
                 0 0 120px var(--theme-primary);
    transform: scale(1.02);
  }
}

/* Enhanced goth theme UI elements */
body.theme-goth .start-btn {
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 50%, var(--theme-accent) 100%);
  box-shadow: 0 8px 32px var(--theme-shadow),
              0 0 0 1px rgba(255, 255, 255, 0.1),
              0 0 40px var(--theme-glow-neon),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid var(--theme-primary);
}

body.theme-goth .start-btn:hover {
  box-shadow: 0 15px 50px var(--theme-shadow),
              0 0 0 1px rgba(255, 255, 255, 0.2),
              0 0 60px var(--theme-glow-neon),
              0 0 80px var(--theme-primary),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Enhanced chat bubbles for goth theme */
body.theme-goth .msg-bubble {
  backdrop-filter: blur(15px);
  border: 1px solid rgba(138, 21, 56, 0.3);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4),
              0 0 20px var(--theme-shadow-neon);
}

body.theme-goth .msg-right {
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 50%, var(--theme-accent) 100%);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4),
              0 0 25px var(--theme-glow-neon);
  border: 1px solid var(--theme-primary);
}

body.theme-goth .msg-left {
  background: rgba(20, 10, 20, 0.8);
  border: 1px solid rgba(138, 21, 56, 0.4);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4),
              0 0 15px rgba(138, 21, 56, 0.3);
}

/* Enhanced input for goth theme */
body.theme-goth .chat-input {
  background: rgba(20, 10, 20, 0.7);
  border: 1px solid rgba(138, 21, 56, 0.4);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3),
              0 0 15px rgba(138, 21, 56, 0.2);
}

body.theme-goth .chat-input:focus {
  border-color: var(--theme-primary);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3),
              0 0 25px var(--theme-glow-neon),
              0 0 40px var(--theme-shadow-neon);
}

/* Enhanced input for glow theme - make it visually dominant */
body.theme-glow .chat-input {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(251, 191, 36, 0.15) 50%, rgba(255, 255, 255, 0.9) 100%);
  border: 3px solid var(--theme-primary);
  box-shadow: 0 0 30px var(--theme-glow),
              0 0 50px var(--theme-shadow),
              inset 0 2px 10px rgba(251, 191, 36, 0.2),
              0 8px 25px rgba(59, 130, 246, 0.3);
  color: var(--theme-text-primary);
  font-weight: 600;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

body.theme-glow .chat-input:focus {
  border: 4px solid var(--theme-accent);
  box-shadow: 0 0 40px var(--theme-glow),
              0 0 70px var(--theme-shadow),
              0 0 90px rgba(251, 191, 36, 0.6),
              inset 0 2px 15px rgba(251, 191, 36, 0.3),
              0 10px 35px rgba(59, 130, 246, 0.4);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(251, 191, 36, 0.25) 50%, rgba(255, 255, 255, 0.95) 100%);
  transform: scale(1.02);
}

body.theme-glow .chat-input::placeholder {
  color: var(--theme-text-secondary);
  font-weight: 500;
}

/* Enhanced buttons for goth theme */
body.theme-goth .send-btn,
body.theme-goth .notif-btn {
  box-shadow: 0 4px 15px var(--theme-shadow),
              0 0 20px var(--theme-glow-neon);
  border: 1px solid var(--theme-primary);
}

body.theme-goth .send-btn:hover,
body.theme-goth .notif-btn:hover {
  box-shadow: 0 6px 25px var(--theme-shadow),
              0 0 30px var(--theme-glow-neon),
              0 0 45px var(--theme-primary);
}

/* Enhanced send button for glow theme - make it visually dominant */
body.theme-glow .send-btn {
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 50%, var(--theme-secondary) 100%);
  border: 3px solid var(--theme-accent);
  box-shadow: 0 8px 25px var(--theme-shadow),
              0 0 30px var(--theme-glow),
              0 0 50px rgba(251, 191, 36, 0.4);
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

body.theme-glow .send-btn:hover {
  transform: scale(1.08);
  border: 4px solid var(--theme-accent);
  box-shadow: 0 12px 35px var(--theme-shadow),
              0 0 40px var(--theme-glow),
              0 0 70px rgba(251, 191, 36, 0.6),
              0 0 90px var(--theme-primary);
}

/* Enhanced chat input row for glow theme */
body.theme-glow .chat-input-row {
  padding: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(251, 191, 36, 0.1) 50%, rgba(59, 130, 246, 0.1) 100%);
  border-radius: 2rem;
  border: 2px solid rgba(251, 191, 36, 0.3);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.2),
              0 0 40px rgba(251, 191, 36, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Enhanced theme switcher and online count for goth */
body.theme-goth .theme-switcher,
body.theme-goth .online-count,
body.theme-goth .language-switcher {
  background: rgba(20, 10, 20, 0.8);
  border: 1px solid rgba(138, 21, 56, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
              0 0 20px rgba(138, 21, 56, 0.3);
}

body.theme-goth .theme-switcher:hover,
body.theme-goth .language-switcher:hover {
  background: rgba(20, 10, 20, 0.9);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
              0 0 30px var(--theme-glow-neon);
}

/* Enhanced UI elements for retro neon theme */
body.theme-retroneon .glow {
  color: var(--theme-text-primary);
  font-family: var(--theme-font-family);
  font-weight: bold;
  text-shadow: 0 0 20px var(--theme-glow-neon), 
               0 0 40px var(--theme-glow-neon),
               0 0 60px var(--theme-shadow-neon),
               0 0 80px var(--theme-primary),
               0 0 100px var(--theme-secondary);
  letter-spacing: 3px;
  animation: glow-pulse-retroneon 3s ease-in-out infinite alternate;
}

@keyframes glow-pulse-retroneon {
  0% {
    text-shadow: 0 0 20px var(--theme-glow-neon), 
                 0 0 40px var(--theme-glow-neon),
                 0 0 60px var(--theme-shadow-neon),
                 0 0 80px var(--theme-primary);
    transform: scale(1);
  }
  50% {
    text-shadow: 0 0 30px var(--theme-glow-neon), 
                 0 0 50px var(--theme-glow-neon),
                 0 0 80px var(--theme-shadow-neon),
                 0 0 100px var(--theme-primary),
                 0 0 120px var(--theme-secondary),
                 0 0 140px var(--theme-accent);
    transform: scale(1.03);
  }
}

body.theme-retroneon .start-btn {
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 50%, var(--theme-accent) 100%);
  box-shadow: 0 8px 32px var(--theme-shadow),
              0 0 0 1px rgba(0, 191, 255, 0.3),
              0 0 40px var(--theme-glow-neon),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 2px solid var(--theme-primary);
  font-weight: bold;
  text-shadow: 0 0 10px var(--theme-glow);
}

body.theme-retroneon .start-btn:hover {
  box-shadow: 0 15px 50px var(--theme-shadow),
              0 0 0 2px rgba(0, 191, 255, 0.5),
              0 0 60px var(--theme-glow-neon),
              0 0 80px var(--theme-primary),
              0 0 100px var(--theme-secondary),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.theme-retroneon .msg-bubble {
  backdrop-filter: blur(15px);
  border: 2px solid var(--theme-primary);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4),
              0 0 20px var(--theme-shadow-neon);
  font-weight: bold;
}

body.theme-retroneon .msg-right {
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 50%, var(--theme-accent) 100%);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4),
              0 0 25px var(--theme-glow-neon),
              0 0 40px var(--theme-primary);
  border: 2px solid var(--theme-primary);
}

body.theme-retroneon .msg-left {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid var(--theme-secondary);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4),
              0 0 15px var(--theme-shadow-neon);
}

body.theme-retroneon .chat-input {
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid var(--theme-primary);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3),
              0 0 15px var(--theme-glow-neon);
  font-weight: bold;
  color: var(--theme-text-primary);
}

body.theme-retroneon .chat-input:focus {
  border-color: var(--theme-accent);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3),
              0 0 25px var(--theme-glow-neon),
              0 0 40px var(--theme-shadow-neon),
              0 0 60px var(--theme-primary);
}

body.theme-retroneon .send-btn,
body.theme-retroneon .notif-btn {
  box-shadow: 0 4px 15px var(--theme-shadow),
              0 0 20px var(--theme-glow-neon);
  border: 2px solid var(--theme-primary);
  font-weight: bold;
  text-shadow: 0 0 10px var(--theme-glow);
}

body.theme-retroneon .send-btn:hover,
body.theme-retroneon .notif-btn:hover {
  box-shadow: 0 6px 25px var(--theme-shadow),
              0 0 30px var(--theme-glow-neon),
              0 0 45px var(--theme-primary);
}

body.theme-retroneon .theme-switcher,
body.theme-retroneon .online-count,
body.theme-retroneon .language-switcher {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid var(--theme-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
              0 0 20px var(--theme-glow-neon);
  font-weight: bold;
}

body.theme-retroneon .theme-switcher:hover,
body.theme-retroneon .language-switcher:hover {
  background: rgba(0, 0, 0, 0.9);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
              0 0 30px var(--theme-glow-neon);
}

/* Glow theme title */
body.theme-glow .glow {
  color: var(--theme-text-primary);
  font-family: var(--theme-font-family);
  text-shadow: 0 0 15px var(--theme-glow-soft), 
               0 0 30px var(--theme-glow-soft),
               0 0 45px var(--theme-shadow-soft);
  letter-spacing: 1px;
}

@keyframes glow-pulse {
  0% {
    text-shadow: 0 0 20px rgba(120, 113, 255, 0.8), 
                 0 0 40px rgba(255, 113, 181, 0.6),
                 0 0 60px rgba(0, 255, 255, 0.4),
                 0 0 15px rgba(255, 255, 255, 0.5);
  }
  100% {
    text-shadow: 0 0 30px rgba(120, 113, 255, 1), 
                 0 0 50px rgba(255, 113, 181, 0.8),
                 0 0 70px rgba(0, 255, 255, 0.6),
                 0 0 25px rgba(255, 255, 255, 0.8);
  }
}
.online-count {
  position: absolute;
  top: 30px;
  right: 30px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 18px;
  border-radius: 1.3rem;
  font-size: 1.15rem;
  color: #e0f7ff;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: fade-in 0.6s ease-out;
}

/*
 * UI/UX Optimization: Enhanced Floating Action Buttons with Settings Button
 * Reason: Better accessibility, consistent design, improved interaction patterns
 * Impact: More accessible controls, better mobile experience, consistent visual design
 */
.theme-switcher,
.language-switcher,
.stats-button,
.bug-feedback-button,
.settings-button {
  position: fixed;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(1.25rem);
  -webkit-backdrop-filter: blur(1.25rem);
  border: 0.0625rem solid rgba(255, 255, 255, 0.2);
  padding: var(--spacing-sm);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-lg);
  min-height: var(--touch-target-comfortable);
  min-width: var(--touch-target-comfortable);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3);
  animation: fade-in var(--animation-duration-slow) var(--animation-timing);
  transition: all var(--animation-duration-normal) var(--animation-timing);
  z-index: var(--z-floating);
  color: inherit;
  text-decoration: none;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Settings button positioning */
.settings-button {
  top: var(--spacing-lg);
  right: var(--spacing-lg);
}

/* Original buttons positioning (now hidden but preserved) */
.theme-switcher {
  top: var(--spacing-lg);
  right: 10rem;
}

.language-switcher {
  top: var(--spacing-lg);
  right: 5.625rem;
}

.stats-button {
  top: var(--spacing-lg);
  right: 14.375rem;
}

.bug-feedback-button {
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
}
}

/*
 * UI/UX Optimization: Enhanced Floating Button Interactions
 * Reason: Better accessibility, consistent feedback, improved user experience
 * Impact: More accessible for keyboard/screen readers, better visual feedback
 */
.theme-switcher:hover,
.language-switcher:hover,
.stats-button:hover,
.bug-feedback-button:hover,
.settings-button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-0.125rem);
  box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.3);
}

.theme-switcher:focus,
.language-switcher:focus,
.stats-button:focus,
.bug-feedback-button:focus,
.settings-button:focus {
  outline: 0.125rem solid rgba(255, 255, 255, 0.6);
  outline-offset: 0.125rem;
  background: rgba(255, 255, 255, 0.15);
}

.theme-switcher:focus:not(:focus-visible),
.language-switcher:focus:not(:focus-visible),
.stats-button:focus:not(:focus-visible),
.bug-feedback-button:focus:not(:focus-visible),
.settings-button:focus:not(:focus-visible) {
  outline: none;
}

.theme-switcher:active,
.language-switcher:active,
.stats-button:active,
.bug-feedback-button:active,
.settings-button:active {
  transform: translateY(0.0625rem);
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-icon,
.language-icon,
.stats-icon,
.feedback-icon,
.settings-icon {
  display: block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: inherit;
}

.theme-switcher:hover .theme-icon,
.language-switcher:hover .language-icon,
.stats-button:hover .stats-icon,
.bug-feedback-button:hover .feedback-icon,
.settings-button:hover .settings-icon {
  transform: scale(1.1) rotate(15deg);
}

/* Language switcher specific styles removed - now handled by common floating button styles above */

.language-switcher:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.language-icon {
  display: block;
  transition: transform 0.3s ease;
}

.language-switcher:hover .language-icon {
  transform: scale(1.1);
}

/*
 * Settings Dropdown Menu Styles
 * Modern dropdown with smooth animations and clean design
 */
.settings-dropdown {
  position: fixed;
  top: calc(var(--spacing-lg) + var(--touch-target-comfortable) + 0.5rem);
  right: var(--spacing-lg);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(1.5rem);
  -webkit-backdrop-filter: blur(1.5rem);
  border: 0.0625rem solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.4);
  z-index: var(--z-modal);
  min-width: 12rem;
  opacity: 0;
  transform: translateY(-0.5rem) scale(0.95);
  transition: all var(--animation-duration-normal) var(--animation-timing-bounce);
  pointer-events: none;
}

.settings-dropdown.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.settings-dropdown-content {
  padding: var(--spacing-xs);
}

.settings-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--animation-duration-fast) var(--animation-timing);
  color: inherit;
  text-decoration: none;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  gap: var(--spacing-sm);
}

.settings-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(0.125rem);
}

.settings-item:focus {
  background: rgba(255, 255, 255, 0.1);
  outline: 0.125rem solid rgba(255, 255, 255, 0.4);
  outline-offset: 0.125rem;
}

.settings-item:focus:not(:focus-visible) {
  outline: none;
}

.settings-item:active {
  transform: scale(0.98);
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-item-icon {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.settings-item-text {
  flex: 1;
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: nowrap;
}

.settings-item-arrow {
  font-size: 0.875rem;
  opacity: 0.7;
  transition: transform var(--animation-duration-fast) var(--animation-timing);
}

.settings-item:hover .settings-item-arrow {
  transform: translateX(0.125rem);
  opacity: 1;
}

.settings-item-current {
  font-size: 1rem;
  opacity: 0.8;
}

.settings-divider {
  height: 0.0625rem;
  background: rgba(255, 255, 255, 0.1);
  margin: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
}

/* Settings dropdown animations */
@keyframes settings-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-0.5rem) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes settings-dropdown-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-0.5rem) scale(0.95);
  }
}

/*
 * UI/UX Optimization: Enhanced Centered Layout
 * Reason: Better responsive design, flexible spacing, improved mobile experience
 * Impact: Layout adapts better to different screen sizes and orientations
 */
.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  min-height: 80dvh; /* Dynamic viewport height for mobile */
  padding: var(--spacing-md) var(--spacing-sm);
  max-width: 100%;
  animation: fade-in var(--animation-duration-slow) var(--animation-timing);
  gap: var(--spacing-md); /* Consistent spacing between elements */
}

/*
 * UI/UX Optimization: Enhanced fade-in animation with design tokens
 * Reason: Consistent timing, better performance, accessibility support
 * Impact: Smoother entrance animations, respects user motion preferences
 */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/*
 * UI/UX Optimization: Enhanced Start Button
 * Reason: Better accessibility, proper touch targets, improved interaction feedback
 * Impact: More accessible on mobile, better visual feedback, consistent sizing
 */
.start-btn {
  margin-top: 0; /* Removed - using gap in parent */
  padding: var(--spacing-md) var(--spacing-xl);
  min-height: var(--touch-target-comfortable); /* Accessible touch target */
  min-width: 12rem; /* Consistent minimum width */
  font-size: clamp(var(--font-size-lg), 3vw, var(--font-size-xl));
  font-weight: 700;
  font-family: var(--font-family-secondary);
  border-radius: var(--radius-xl);
  border: none;
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 50%, var(--theme-accent) 100%);
  background-size: 200% 200%;
  color: #fff;
  text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.5);
  box-shadow: 0 0.5rem 2rem var(--theme-shadow),
              0 0 0 0.0625rem rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  
  /* Better text rendering */
  text-decoration: none;
  text-align: center;
  line-height: 1;
  
  /* Focus accessibility */
  outline: none;
  
  /* Prevent text selection */
  user-select: none;
  -webkit-user-select: none;
}
  overflow: hidden;
  animation: gradient-shift 3s ease infinite, pulse-on-load 2s ease-out;
}

.start-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

/*
 * UI/UX Optimization: Enhanced Button Interactions
 * Reason: Better accessibility, improved user feedback, consistent interaction patterns
 * Impact: More accessible for keyboard users, better visual feedback on all interactions
 */
.start-btn:hover {
  transform: scale(1.05) translateY(-0.125rem);
  box-shadow: 0 0.9375rem 2.5rem var(--theme-shadow),
              0 0 0 0.125rem rgba(255, 255, 255, 0.2),
              0 0 1.875rem var(--theme-glow);
}

.start-btn:focus {
  outline: 0.125rem solid var(--theme-primary);
  outline-offset: 0.25rem;
  box-shadow: 0 0.9375rem 2.5rem var(--theme-shadow),
              0 0 0 0.125rem rgba(255, 255, 255, 0.2),
              0 0 1.875rem var(--theme-glow);
}

.start-btn:focus:not(:focus-visible) {
  outline: none;
}

.start-btn:hover::before {
  left: 100%;
}

.start-btn:active {
  transform: scale(0.95) translateY(-0.0625rem);
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulse-on-load {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Sound toggle */
/*
 * UI/UX Optimization: Enhanced Sound Toggle Component
 * Reason: Better accessibility, responsive design, improved interaction patterns
 * Impact: More accessible, better mobile experience, consistent visual design
 */
.sound-toggle-container {
  margin-top: 0; /* Removed - using gap in parent */
  animation: fade-in 1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
}

.sound-toggle {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  min-height: var(--touch-target-min); /* Accessible touch target */
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(0.5rem);
  -webkit-backdrop-filter: blur(0.5rem);
  border: 0.0625rem solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: var(--font-size-sm);
  font-family: var(--font-family-primary);
  text-decoration: none;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

/*
 * UI/UX Optimization: Enhanced Sound Toggle Interactions
 * Reason: Better accessibility, consistent interaction patterns, improved feedback
 * Impact: More accessible for keyboard/screen reader users, better visual feedback
 */
.sound-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-0.0625rem);
  box-shadow: 0 0.1875rem 0.75rem rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.25);
}

.sound-toggle:focus {
  outline: 0.125rem solid rgba(255, 255, 255, 0.5);
  outline-offset: 0.125rem;
  background: rgba(255, 255, 255, 0.12);
}

.sound-toggle:focus:not(:focus-visible) {
  outline: none;
}

.sound-toggle:active {
  transform: translateY(0.0625rem);
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.sound-toggle.muted {
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.04);
}

.sound-toggle.muted .sound-icon {
  opacity: 0.6;
}

.sound-text {
  font-size: 0.8rem;
  letter-spacing: 0.3px;
}

@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}
/*
 * UI/UX Optimization: Enhanced Chat Container
 * Reason: Better mobile experience, proper overflow handling, improved layout
 * Impact: Chat interface works properly on all devices, scrolling only where needed
 */
.chat-container {
  display: none;
  flex-direction: column;
  height: 90vh;
  height: 90dvh; /* Dynamic viewport height for mobile browsers */
  max-height: 90vh;
  max-height: 90dvh;
  width: 100%;
  max-width: 37.5rem; /* 600px */
  margin: var(--spacing-sm) auto;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(1.25rem);
  -webkit-backdrop-filter: blur(1.25rem);
  border: 0.0625rem solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-xl);
  box-shadow: 0 0.5rem 2.5rem rgba(0, 0, 0, 0.3),
              inset 0 0.0625rem 0 rgba(255, 255, 255, 0.2);
  padding: var(--spacing-lg) var(--spacing-sm) var(--spacing-sm);
  animation: slide-up var(--animation-duration-slow) var(--animation-timing);
  
  /* Prevent overall container from scrolling */
  overflow: hidden;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
/*
 * UI/UX Optimization: Enhanced Messages Container
 * Reason: Proper scrolling behavior, improved spacing, better mobile experience
 * Impact: Only messages area scrolls, consistent spacing, better UX
 */
.messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scroll */
  padding: 0 var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  
  /* Smooth scrolling */
  scroll-behavior: smooth;
  
  /* Better scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* Custom scrollbar for webkit browsers */
.messages::-webkit-scrollbar {
  width: 0.375rem; /* 6px */
}

.messages::-webkit-scrollbar-track {
  background: transparent;
}

.messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
}

.messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}
.msg-bubble {
  max-width: 80%;
  padding: 13px 22px;
  border-radius: 1.7rem;
  margin-bottom: 0;
  position: relative;
  word-break: break-word;
  font-size: 1.15rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  animation: bubble-appear 0.4s ease-out;
  transition: all 0.3s ease;
  display: inline-block;
  white-space: pre-wrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.msg-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

@keyframes bubble-appear {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.msg-right {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 50%, var(--theme-accent) 100%);
  background-size: 200% 200%;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: bubble-appear 0.4s ease-out, gradient-shift 4s ease infinite;
}

.msg-left {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.msg-time {
  display: inline-block;
  font-size: 0.89rem;
  color: #c0d0d9;
  margin-left: 10px;
  margin-top: 2px;
  vertical-align: middle;
  float: right;
  font-weight: 400;
}
.typing-indicator {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
}
.typing-dot {
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
  border-radius: 50%;
  display: inline-block;
  opacity: 0.8;
  animation: typing-blink 1.2s infinite both;
  box-shadow: 0 0 10px var(--theme-shadow);
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typing-blink {
  0%,100% { 
    opacity: .3;
    transform: scale(1);
  }
  50% { 
    opacity: 1;
    transform: scale(1.2);
  }
}

/*
 * UI/UX Optimization: Enhanced Chat Input Interface
 * Reason: Better mobile experience, proper form styling, improved accessibility
 * Impact: Better text input experience, proper focus states, consistent styling
 */
.chat-input-row {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  padding: var(--spacing-xs);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  border: 0.0625rem solid rgba(255, 255, 255, 0.1);
}

.chat-input {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  min-height: var(--touch-target-min); /* Accessible touch target */
  font-size: var(--font-size-sm); /* Minimum 16px for mobile */
  font-family: var(--font-family-primary);
  border-radius: var(--radius-lg);
  border: 0.0625rem solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(0.625rem);
  -webkit-backdrop-filter: blur(0.625rem);
  color: #fff;
  outline: none;
  transition: all var(--animation-duration-normal) var(--animation-timing);
  resize: none; /* Prevent textarea resizing if applicable */
}

.chat-input:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 1.25rem var(--theme-shadow);
  background: rgba(255, 255, 255, 0.15);
  outline: 0.125rem solid var(--theme-primary);
  outline-offset: 0.125rem;
}

.chat-input:focus:not(:focus-visible) {
  outline: none;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--font-size-sm);
}

.send-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
  border-radius: var(--radius-lg);
  border: none;
  font-weight: 700;
  font-family: var(--font-family-secondary);
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
  color: #fff;
  font-size: var(--font-size-sm);
  cursor: pointer;
  box-shadow: 0 0.25rem 0.9375rem var(--theme-shadow);
  transition: all var(--animation-duration-normal) var(--animation-timing);
  position: relative;
  overflow: hidden;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}
}

.send-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

/*
 * UI/UX Optimization: Enhanced Send Button Interactions
 * Reason: Better accessibility, consistent interaction patterns, improved feedback
 * Impact: More accessible for all users, better visual feedback
 */
.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0.375rem 1.25rem var(--theme-shadow);
}

.send-btn:focus {
  outline: 0.125rem solid rgba(255, 255, 255, 0.6);
  outline-offset: 0.125rem;
  box-shadow: 0 0.375rem 1.25rem var(--theme-shadow);
}

.send-btn:focus:not(:focus-visible) {
  outline: none;
}

.send-btn:active {
  transform: scale(0.95);
  transition: all var(--animation-duration-fast) var(--animation-timing);
}

.send-btn:hover::before {
  left: 100%;
}
.notif {
  margin: 20px auto 0 auto;
  padding: 17px 23px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1.5rem;
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  text-align: center;
  font-weight: 500;
  animation: fade-in 0.5s ease-out;
}
.notif-btns {
  margin-top: 17px;
  display: flex;
  gap: 18px;
  justify-content: center;
}
.notif-btn {
  padding: 12px 29px;
  border-radius: 1.1rem;
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
  color: #fff;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--theme-shadow);
  position: relative;
  overflow: hidden;
}

.notif-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.notif-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--theme-shadow);
}

.notif-btn:hover::before {
  left: 100%;
}
/* Theme Selector Modal */
.theme-selector-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  animation: fade-in 0.3s ease-out;
}

.theme-selector-content {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2rem;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.theme-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.theme-selector-title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  text-shadow: 0 0 10px var(--theme-glow);
}

.theme-selector-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
  line-height: 1;
}

.theme-selector-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.theme-section {
  margin-bottom: 25px;
}

.theme-section-title {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.premium-badge {
  font-size: 1rem;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.theme-item {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.theme-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.theme-item.active {
  border-color: var(--theme-primary);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 20px var(--theme-glow);
}

.theme-item.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.theme-item.locked:hover {
  transform: none;
  box-shadow: none;
}

.theme-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}

.theme-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.theme-description {
  font-size: 0.7rem;
  opacity: 0.8;
  line-height: 1.2;
}

.theme-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
}

.theme-lock-icon {
  font-size: 1.5rem;
  color: #ffd700;
}

.premium-unlock-hint {
  text-align: center;
  padding: 15px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 1rem;
  color: #ffd700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.unlock-icon {
  font-size: 1.2rem;
}

/* Enhanced Theme Selector Styles */
.theme-status-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1rem;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.theme-item.free-theme .theme-status-indicator {
  background: rgba(59, 130, 246, 0.8); /* Blue for free themes */
}

.theme-item.unlocked-theme .theme-status-indicator {
  background: rgba(255, 215, 0, 0.8); /* Yellow for unlocked premium themes */
}

.theme-item.locked-theme .theme-status-indicator {
  background: rgba(255, 215, 0, 0.8); /* Yellow for locked premium themes */
}

/* Premium subsection headers */
.premium-subsection-header {
  margin: 20px 0 15px 0;
}

.premium-subsection-header:first-child {
  margin-top: 0;
}

.subsection-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.subsection-icon {
  font-size: 1.1rem;
}

/* Premium subsection separator */
.premium-subsection-separator {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  margin: 20px 0;
}

.theme-price-info {
  font-size: 0.7rem;
  color: #ffd700;
  margin-top: 4px;
  font-weight: 600;
}

.theme-purchase-button {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border: none;
  border-radius: 0.5rem;
  color: #fff;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 6px 12px;
  transition: all 0.3s ease;
  text-align: center;
}

.theme-purchase-button:hover {
  background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
}

.theme-separator {
  display: flex;
  align-items: center;
  margin: 20px 0;
  grid-column: 1 / -1;
}

.separator-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.separator-text {
  margin: 0 15px;
  font-size: 0.8rem;
  color: #fff;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-indicator {
  font-size: 0.9rem;
}

.free-indicator {
  color: #22c55e;
}

.unlocked-indicator {
  color: #3b82f6;
}

.locked-indicator {
  color: #ef4444;
}

.locked-count {
  font-size: 0.8rem;
  opacity: 0.7;
  font-weight: normal;
}

/* Premium section enhancements */
.theme-section.enhanced-premium-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  margin-top: 20px;
}

.enhanced-premium-info {
  text-align: center;
  margin-top: 15px;
  padding: 12px;
  background: rgba(240, 147, 251, 0.1);
  border: 1px solid rgba(240, 147, 251, 0.3);
  border-radius: 0.8rem;
  color: #f093fb;
  font-size: 0.85rem;
}

/* Responsive improvements for theme items */
@media (max-width: 640px) {
  .theme-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
  }
  
  .theme-item {
    padding: 12px;
  }
  
  .theme-icon {
    font-size: 1.6rem;
    margin-bottom: 6px;
  }
  
  .theme-name {
    font-size: 0.8rem;
  }
  
  .theme-description {
    font-size: 0.65rem;
  }
  
  .theme-purchase-button {
    font-size: 0.65rem;
    padding: 5px 10px;
  }
}

/* Chaos theme animation */
@keyframes chaos-flicker {
  0%, 98% { filter: hue-rotate(0deg) brightness(1); }
  99% { filter: hue-rotate(180deg) brightness(1.2); }
  100% { filter: hue-rotate(0deg) brightness(1); }
}

/* Retro Neon Effects - 80s Authentic Style */
.retro-neon-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.3;
  z-index: -1;
  background: 
    /* Neon circles */
    radial-gradient(circle at 15% 25%, rgba(0, 191, 255, 0.4) 2px, transparent 3px),
    radial-gradient(circle at 85% 75%, rgba(138, 43, 226, 0.5) 3px, transparent 4px),
    radial-gradient(circle at 50% 10%, rgba(255, 105, 180, 0.3) 1px, transparent 2px),
    radial-gradient(circle at 75% 35%, rgba(255, 255, 0, 0.4) 2px, transparent 3px),
    radial-gradient(circle at 25% 80%, rgba(0, 191, 255, 0.3) 1px, transparent 2px),
    radial-gradient(circle at 90% 20%, rgba(255, 105, 180, 0.4) 2px, transparent 3px),
    /* Neon stripes */
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(0, 191, 255, 0.1) 41px,
      rgba(0, 191, 255, 0.1) 42px,
      transparent 43px,
      transparent 80px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 60px,
      rgba(138, 43, 226, 0.08) 61px,
      rgba(138, 43, 226, 0.08) 62px,
      transparent 63px,
      transparent 120px
    );
  background-size: 
    100px 100px,
    120px 120px,
    80px 80px,
    150px 150px,
    90px 90px,
    110px 110px,
    100% 100%,
    100% 100%;
  animation: neon-blink 4s ease-in-out infinite, neon-drift 20s ease-in-out infinite;
}

/* Additional neon elements for polygonal shapes */
.retro-neon-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    /* Hexagonal patterns */
    conic-gradient(from 0deg at 20% 30%, transparent 0deg, rgba(255, 255, 0, 0.2) 60deg, transparent 120deg),
    conic-gradient(from 120deg at 80% 70%, transparent 0deg, rgba(255, 105, 180, 0.15) 60deg, transparent 120deg),
    conic-gradient(from 240deg at 60% 50%, transparent 0deg, rgba(0, 191, 255, 0.1) 60deg, transparent 120deg);
  animation: neon-pulse 6s ease-in-out infinite alternate;
}

.retro-neon-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    /* Moving neon scan lines */
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 4px,
      rgba(0, 191, 255, 0.05) 4px,
      rgba(0, 191, 255, 0.05) 5px
    );
  animation: neon-scan-vertical 8s linear infinite;
}

@keyframes neon-scan-vertical {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

@keyframes neon-quick-blink {
  0%, 100% { opacity: 1; filter: blur(0px); }
  50% { opacity: 0.3; filter: blur(1px); }
}

/* Digital Void Matrix Effects */
.digital-void-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.matrix-rain {
  position: absolute;
  top: -100px;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: 16px;
  color: #00ff41;
  text-shadow: 0 0 5px #00ff41, 0 0 10px #00ff41;
  opacity: 0.8;
  animation: matrix-fall linear infinite;
  user-select: none;
}

.matrix-rain.bright {
  color: #ffffff;
  text-shadow: 0 0 8px #00ff41, 0 0 15px #00ff41, 0 0 20px #00ff41;
  opacity: 1;
}

.matrix-rain.dim {
  color: #00aa22;
  text-shadow: 0 0 3px #00ff41;
  opacity: 0.4;
}

@keyframes matrix-fall {
  0% {
    transform: translateY(-100px);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(calc(100vh + 100px));
    opacity: 0;
  }
}
/*
 * UI/UX Optimization: Mobile Chat Container Improvements
 * Integrated into comprehensive responsive system above
 */
  }
  
  .floating-idea-button {
    top: 20px;
    right: 190px;
    padding: 8px 12px;
    font-size: 0.9rem;
    gap: 6px;
  }
  
  .floating-idea-button .idea-icon {
    font-size: 1rem;
  }
  
  .floating-idea-button .idea-text {
    font-size: 0.8rem;
  }
  
  .online-count {
    right: 20px;
    padding: 6px 12px;
    font-size: 1rem;
  }
  
  .rating-content {
    padding: 30px 20px;
  }
  
  .rating-options {
    flex-direction: column;
    gap: 15px;
  }
  
  .rating-btn {
    min-width: auto;
    width: 100%;
  }
  
  .stats-content {
    padding: 30px 20px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .challenges-list {
    max-height: 150px;
  }
  
  .challenge-item {
    padding: 10px 12px;
  }
  
  .challenge-name {
    font-size: 0.8rem;
  }
  
  .challenge-points {
    font-size: 0.7rem;
  }
  
  .challenge-description {
    font-size: 0.75rem;
  }
}

/*
 * UI/UX Optimization: Comprehensive Responsive Design System
 * Reason: Better mobile experience, consistent scaling, improved accessibility
 * Impact: App works seamlessly across all device sizes, better UX on mobile/tablet
 */

/* Mobile-first responsive breakpoints */
@media (max-width: 480px) {
  /* Small mobile devices */
  :root {
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.75rem;   /* 12px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 2.5rem;   /* 40px */
  }
  
  .glow {
    font-size: clamp(1.75rem, 6vw, 2.25rem);
    margin-top: var(--spacing-md);
    letter-spacing: 0.0625rem;
  }
  
  .start-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-lg);
    min-width: 10rem;
  }
  
  .centered {
    padding: var(--spacing-sm);
    min-height: 75vh;
    min-height: 75dvh;
  }
  
  /* Floating action buttons optimization */
  .theme-switcher,
  .language-switcher,
  .stats-button,
  .settings-button {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 1rem;
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
  }
  
  /* Settings button positioning for small mobile */
  .settings-button { 
    right: var(--spacing-sm); 
    top: var(--spacing-sm);
  }
  
  /* Original buttons positioning (hidden) */
  .theme-switcher { right: 4rem; }
  .language-switcher { right: 0.75rem; }
  .stats-button { right: 7.5rem; }
  
  /* Settings dropdown positioning for mobile */
  .settings-dropdown {
    right: var(--spacing-sm);
    top: calc(var(--spacing-sm) + var(--touch-target-min) + 0.5rem);
    min-width: 10rem;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  /* Large mobile and small tablet */
  .glow {
    font-size: clamp(2rem, 5vw, 2.75rem);
  }
  
  /* Settings button positioning for large mobile */
  .settings-button { 
    right: var(--spacing-lg); 
    top: var(--spacing-lg);
  }
  
  /* Original buttons positioning (hidden) */
  .theme-switcher { right: 7.5rem; }
  .language-switcher { right: 4.375rem; }  
  .stats-button { right: 12.5rem; }
  
  /* Settings dropdown positioning for large mobile */
  .settings-dropdown {
    right: var(--spacing-lg);
    top: calc(var(--spacing-lg) + var(--touch-target-comfortable) + 0.5rem);
  }
}

@media (max-width: 768px) {
  /* General mobile and tablet optimizations */
  .chat-container {
    max-width: 98vw;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-sm);
    margin: var(--spacing-xs);
  }
  
  .messages {
    padding: 0 var(--spacing-xs) var(--spacing-sm);
  }
  
  /* Improved touch targets for mobile */
  .theme-switcher,
  .language-switcher,
  .stats-button,
  .bug-feedback-button,
  .settings-button {
    padding: var(--spacing-sm);
    font-size: 1.2rem;
    min-height: var(--touch-target-comfortable);
    min-width: var(--touch-target-comfortable);
  }
  
  /* Settings dropdown adjustments for mobile */
  .settings-dropdown {
    min-width: 11rem;
  }
  
  .settings-item {
    padding: var(--spacing-md);
  }
  
  .settings-item-text {
    font-size: var(--font-size-md);
  }
}

/* Landscape mobile optimization */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .centered {
    min-height: 70vh;
    min-height: 70dvh;
    padding: var(--spacing-sm);
  }
  
  .glow {
    font-size: 2.2rem;
    margin-top: var(--spacing-sm);
  }
  
  .start-btn {
    padding: var(--spacing-sm) var(--spacing-xl);
    font-size: var(--font-size-lg);
  }
}

/* Small landscape screens optimization */
@media (max-width: 768px) and (max-height: 400px) and (orientation: landscape) {
  .glow {
    font-size: 1.8rem;
    margin-top: var(--spacing-xs);
  }
  
  .start-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-md);
  }
  
  .centered {
    min-height: 60vh;
    min-height: 60dvh;
  }
}

/* Large screens optimization */
@media (min-width: 1200px) {
  .glow {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
  }
  
  .start-btn {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: var(--font-size-xl);
  }
  
  .centered {
    padding: var(--spacing-lg);
  }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
  .centered {
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* Page transitions */
#mainPage, #chatPage, #notification, #loadingOverlay {
  transition: opacity 0.3s ease-in-out;
}

#mainPage {
  opacity: 1;
}

#chatPage {
  opacity: 1;
}

#notification {
  opacity: 1;
}

#loadingOverlay {
  opacity: 1;
}
.chat-actions {
  display: flex;
  gap: 15px;
  margin-top: 12px;
}

.skip-btn, .end-btn {
  flex: 1;
  padding: 14px;
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  border-radius: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.skip-btn::before, .end-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.skip-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
}

.end-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.skip-btn:hover, .end-btn:hover {
  transform: scale(1.02) translateY(-2px);
}

.skip-btn:hover {
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.end-btn:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.skip-btn:hover::before, .end-btn:hover::before {
  left: 100%;
}

/* Loading Overlay - Subtle Style */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fade-in 0.3s ease-out;
}

.loading-bubble {
  position: relative;
  text-align: center;
  z-index: 2;
}

.loading-text {
  font-size: 1.8rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 20px var(--theme-glow), 0 0 40px var(--theme-glow);
  letter-spacing: 1.5px;
  animation: text-glow 2s ease-in-out infinite alternate;
}

/* Poltergeist loading text with signal flickering */
body.theme-poltergeist .loading-text {
  font-family: var(--theme-font-family);
  color: var(--theme-text-primary);
  text-shadow: 0 0 20px var(--theme-glow-disturbing), 0 0 40px var(--theme-glow-disturbing);
  animation: poltergeist-signal-flicker 1.5s ease-in-out infinite, text-glow 2s ease-in-out infinite alternate;
  letter-spacing: 2px;
  font-weight: 700;
}

@keyframes poltergeist-signal-flicker {
  0%, 80%, 100% {
    opacity: 1;
    text-shadow: 0 0 20px var(--theme-glow-disturbing), 0 0 40px var(--theme-glow-disturbing);
  }
  81% {
    opacity: 0.3;
    text-shadow: 0 0 5px var(--theme-glow-disturbing);
  }
  82% {
    opacity: 1;
    text-shadow: 0 0 20px var(--theme-glow-disturbing), 0 0 40px var(--theme-glow-disturbing);
  }
  83% {
    opacity: 0.1;
    text-shadow: 0 0 2px var(--theme-glow-disturbing);
  }
  84% {
    opacity: 0.8;
    text-shadow: 0 0 15px var(--theme-glow-disturbing), 0 0 30px var(--theme-glow-disturbing);
  }
  85% {
    opacity: 0.2;
    text-shadow: 0 0 3px var(--theme-glow-disturbing);
  }
  86%, 90% {
    opacity: 1;
    text-shadow: 0 0 20px var(--theme-glow-disturbing), 0 0 40px var(--theme-glow-disturbing);
  }
}

/* Exit button in loading overlay */
.exit-btn {
  margin-top: 30px;
  padding: 12px 30px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 1.2rem;
  border: none;
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--theme-shadow);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.exit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.exit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--theme-shadow);
}

.exit-btn:hover::before {
  left: 100%;
}

.exit-btn:active {
  transform: translateY(0px);
  box-shadow: 0 2px 10px var(--theme-shadow);
}

/* Goth theme styling for exit button */
body.theme-goth .exit-btn {
  box-shadow: 0 4px 15px var(--theme-shadow),
              0 0 20px var(--theme-glow-neon);
  border: 1px solid var(--theme-primary);
}

body.theme-goth .exit-btn:hover {
  box-shadow: 0 6px 25px var(--theme-shadow),
              0 0 30px var(--theme-glow-neon),
              0 0 45px var(--theme-primary);
}

@keyframes text-glow {
  0% {
    text-shadow: 0 0 20px var(--theme-glow), 0 0 40px var(--theme-glow);
  }
  100% {
    text-shadow: 0 0 30px var(--theme-glow), 0 0 60px var(--theme-glow), 0 0 80px var(--theme-accent);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.02);
  }
}

/* Subtle background pulsation effect for partner search */
.searching-partner::before {
  animation: aurora-search 4s ease-in-out infinite, aurora 15s ease infinite;
}

.searching-partner::after {
  animation: aurora-overlay-search 5s ease-in-out infinite, aurora-overlay 20s ease infinite reverse;
}

@keyframes aurora-search {
  0%, 100% {
    opacity: 0.6;
    filter: brightness(1) saturate(1);
  }
  50% {
    opacity: 0.9;
    filter: brightness(1.3) saturate(1.4);
  }
}

@keyframes aurora-overlay-search {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1) rotate(0deg);
    filter: brightness(1) saturate(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.05) rotate(0.5deg);
    filter: brightness(1.2) saturate(1.3);
  }
}

/* Statistics Button */
/* Stats button specific styles removed - now handled by common floating button styles above */
/* Removed duplicate hover styles - now handled by common floating button styles above */

/* Bug report / feedback button - bottom right corner - Updated per requirements */
.bug-feedback-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.5); /* Semi-transparent as requested */
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%; /* Round as requested */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 1000;
  opacity: 0.7; /* Semi-transparent */
}

.bug-feedback-button:hover {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.15);
}

.feedback-icon {
  font-size: 18px;
  transition: transform 0.3s ease;
}

.bug-feedback-button:hover .feedback-icon {
  transform: scale(1.1);
}

/* Feedback tooltip */
.feedback-tooltip {
  position: fixed;
  bottom: 70px;
  right: 20px;
  background: rgba(26, 32, 44, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  min-width: 250px;
  max-width: 300px;
  animation: tooltipFadeIn 0.3s ease-out;
}

.tooltip-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tooltip-text {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  text-align: center;
}

.tooltip-button {
  background: linear-gradient(135deg, #e1306c, #fd1d1d);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.floating-idea-button:hover .idea-icon,
.floating-idea-button:hover .idea-text {
  transform: scale(1.1);
}

/* Theme-specific styling for floating idea button */
body.theme-goth .floating-idea-button {
  background: linear-gradient(135deg, rgba(74, 85, 104, 0.9) 0%, rgba(45, 55, 72, 0.9) 50%, rgba(26, 32, 44, 0.9) 100%);
  border: 2px solid rgba(138, 21, 56, 0.4);
  color: #e2e8f0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(138, 21, 56, 0.3);
}

body.theme-goth .floating-idea-button:hover {
  background: linear-gradient(135deg, rgba(45, 55, 72, 0.95) 0%, rgba(26, 32, 44, 0.95) 50%, rgba(74, 85, 104, 0.9) 100%);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 0 0 30px rgba(138, 21, 56, 0.5);
  border-color: rgba(138, 21, 56, 0.6);
}

body.theme-goth .custom-tooltip {
  background: linear-gradient(135deg, rgba(138, 21, 56, 0.95) 0%, rgba(76, 29, 149, 0.9) 100%);
  border-color: rgba(138, 21, 56, 0.3);
}

body.theme-goth .custom-tooltip::after {
  border-top-color: rgba(138, 21, 56, 0.95);

  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(225, 48, 108, 0.3);
}

.tooltip-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 48, 108, 0.4);
  background: linear-gradient(135deg, #fd1d1d, #e1306c);
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Theme-specific styles for bug feedback button */


body.theme-glow .bug-feedback-button {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}

body.theme-glow .bug-feedback-button:hover {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 25px rgba(59, 130, 246, 0.3);
}

body.theme-poltergeist .bug-feedback-button {
  background: rgba(10, 10, 10, 0.9);
  border-color: rgba(255, 46, 46, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 46, 46, 0.3);
}

body.theme-poltergeist .bug-feedback-button:hover {
  background: rgba(10, 10, 10, 0.95);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 46, 46, 0.5);
}

/* Mobile responsive adjustments for feedback button */
@media (max-width: 768px) {
  .bug-feedback-button {
    bottom: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
  }
  
  .feedback-icon {
    font-size: 16px;
  }
  
  .feedback-tooltip {
    bottom: 55px;
    right: 15px;
    min-width: 220px;
    max-width: 280px;
  }
  
  .tooltip-text {
    font-size: 13px;
  }
  
  .tooltip-button {
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* Theme Selection Modal */
.theme-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fade-in 0.3s ease-out;
}

.theme-modal-content {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2rem;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.theme-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.theme-modal-title {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
  text-shadow: 0 0 10px var(--theme-glow);
}

.theme-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
  line-height: 1;
}

.theme-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.theme-categories {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.theme-category {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
}

.theme-category-title {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 15px 0;
  text-align: center;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.theme-option:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
  border-color: var(--theme-primary);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.theme-option.selected {
  border-color: var(--theme-primary);
  background: rgba(var(--theme-primary-rgb, 138, 21, 56), 0.2);
  box-shadow: 0 0 20px var(--theme-glow);
}

.theme-preview {
  font-size: 2.5rem;
  transition: transform 0.3s ease;
  margin-bottom: 5px;
}

.theme-option:hover .theme-preview {
  transform: scale(1.1);
}

.theme-name {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

.premium-locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.premium-locked:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.premium-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

/* Theme preview colors */


.glow-preview {
  color: #3b82f6;
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
}

.poltergeist-preview {
  color: #ff2e2e;
  text-shadow: 0 0 10px rgba(255, 46, 46, 0.8);
}

.premium-preview {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24);
  background-size: 300% 300%;
  animation: premium-glow 2s ease-in-out infinite alternate;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes premium-glow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

/* Mobile responsive for theme modal */
@media (max-width: 768px) {
  .theme-modal-content {
    padding: 25px 20px;
    margin: 10px;
  }
  
  .theme-modal-title {
    font-size: 1.4rem;
  }
  
  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .theme-option {
    padding: 12px;
  }
  
  .theme-preview {
    font-size: 2rem;
  }
  
  .theme-name {
    font-size: 0.8rem;
  }
}
.rating-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fade-in 0.3s ease-out;
}

.rating-content {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2rem;
  padding: 40px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 500px;
  width: 90%;
}

.rating-title {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0 0 30px 0;
  text-shadow: 0 0 10px var(--theme-glow);
}

.rating-options {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.rating-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
  min-width: 120px;
}

.rating-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.rating-emoji {
  font-size: 2.5rem;
  transition: transform 0.3s ease;
}

.rating-btn:hover .rating-emoji {
  transform: scale(1.2);
}

.rating-text {
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

/* Statistics Panel */
.stats-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fade-in 0.3s ease-out;
}

.stats-content {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2rem;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

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

.stats-title {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0;
  text-shadow: 0 0 10px var(--theme-glow);
}

.stats-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
  line-height: 1;
}

.stats-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-item {
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--theme-primary);
  text-shadow: 0 0 10px var(--theme-glow);
  margin-bottom: 8px;
}

.stat-label {
  color: #fff;
  font-size: 0.9rem;
  opacity: 0.8;
}

.stats-options {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

.stats-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
}

.stats-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
}

.stats-checkbox:hover .checkmark {
  background: rgba(255, 255, 255, 0.2);
}

.stats-checkbox input:checked ~ .checkmark {
  background: var(--theme-primary);
  border-color: var(--theme-primary);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.stats-checkbox input:checked ~ .checkmark:after {
  display: block;
}

/* Public Badge */
.public-badge {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  padding: 10px 15px;
  margin-bottom: 15px;
  text-align: center;
  animation: fade-in 0.5s ease-out;
}

.badge-text {
  color: #fff;
  font-size: 0.9rem;
  opacity: 0.8;
  font-style: italic;
}

/* Challenges Section */
.challenges-section {
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

.challenges-title {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 15px 0;
  text-shadow: 0 0 10px var(--theme-glow);
}

.challenges-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.challenge-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 12px 15px;
  transition: all 0.3s ease;
}

.challenge-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.challenge-item.completed {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
}

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

.challenge-name {
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}

.challenge-points {
  color: #ffd700;
  font-size: 0.8rem;
  font-weight: 600;
}

.challenge-description {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.challenge-progress {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  height: 6px;
  overflow: hidden;
}

.challenge-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-accent));
  transition: width 0.3s ease;
  border-radius: 10px;
}

.challenge-progress-text {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 3px;
  text-align: right;
}

.challenges-summary {
  text-align: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
}

.total-points {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.points-label {
  color: #fff;
  font-size: 1rem;
}

.points-value {
  color: #ffd700;
  font-size: 1.2rem;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Challenge Popup */
.challenge-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2rem;
  padding: 30px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s ease;
  min-width: 300px;
}

.challenge-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.challenge-popup-content {
  color: #fff;
}

.challenge-emoji {
  font-size: 4rem;
  margin-bottom: 15px;
  animation: bounce 0.6s ease;
}

.challenge-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--theme-primary);
  text-shadow: 0 0 10px var(--theme-glow);
}

.challenge-name {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.challenge-reward {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffd700;
  margin-bottom: 5px;
}

.challenge-reward-desc {
  font-size: 0.9rem;
  opacity: 0.8;
  font-style: italic;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Leveling System Styles */
.leveling-section {
  margin: 20px 0;
  padding: 15px;
  background: rgba(var(--theme-primary-rgb, 138, 21, 56), 0.1);
  border-radius: 12px;
  border: 1px solid rgba(var(--theme-primary-rgb, 138, 21, 56), 0.2);
}

.level-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--theme-text-primary, #ffffff);
}

.level-icon {
  font-size: 20px;
}

.level-number {
  background: var(--theme-primary);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 14px;
  margin-left: auto;
}

.xp-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.xp-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-accent));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.xp-text {
  font-size: 12px;
  color: var(--theme-text-secondary, #b0b0b0);
  text-align: center;
}

.xp-to-next {
  font-style: italic;
  opacity: 0.8;
}

/* Favorites System Styles */
.favorites-section {
  margin: 20px 0;
  padding: 15px;
  background: rgba(var(--theme-accent-rgb, 124, 45, 18), 0.1);
  border-radius: 12px;
  border: 1px solid rgba(var(--theme-accent-rgb, 124, 45, 18), 0.2);
}

.favorites-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--theme-text-primary, #ffffff);
}

.favorites-icon {
  font-size: 20px;
}

.favorites-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 12px;
}

.favorite-stat {
  text-align: center;
}

.favorite-count {
  display: block;
  font-size: 20px;
  font-weight: bold;
  color: var(--theme-primary);
}

.favorite-label {
  font-size: 12px;
  color: var(--theme-text-secondary, #b0b0b0);
}

.favorites-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.favorites-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(var(--theme-primary-rgb, 138, 21, 56), 0.4);
}

.favorites-emoji {
  font-size: 16px;
}

/* Favorite Option in Rating Modal */
.favorite-option {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.favorite-text {
  margin-bottom: 10px;
  color: var(--theme-text-secondary, #b0b0b0);
  font-size: 14px;
}

.favorite-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 auto;
}

.favorite-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.favorite-emoji {
  font-size: 16px;
}

/* XP Notification Popup */
.xp-popup {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  opacity: 0;
  transform: translateX(300px);
  transition: all 0.3s ease;
}

.xp-popup.show {
  opacity: 1;
  transform: translateX(0);
}

.xp-popup-content {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  text-align: center;
  min-width: 150px;
}

.xp-icon {
  font-size: 24px;
  margin-bottom: 5px;
}

.xp-gained {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 3px;
}

.xp-level {
  font-size: 12px;
  opacity: 0.9;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .leveling-section,
  .favorites-section {
    margin: 15px 0;
    padding: 12px;
  }
  
  .level-title,
  .favorites-title {
    font-size: 14px;
  }
  
  .xp-popup {
    right: 10px;
    top: 10px;
  }
  
  .xp-popup-content {
    padding: 10px 16px;
    min-width: 120px;
  }
}

/* XP and Coin Notification Popups */
.xp-popup, .coin-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.coin-popup {
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
  color: #333;
}

.xp-popup.show, .coin-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.xp-popup-content, .coin-popup-content {
  text-align: center;
}

.xp-icon, .coin-icon {
  font-size: 2em;
  margin-bottom: 10px;
}

.xp-gained, .coin-gained {
  font-size: 1.5em;
  font-weight: 600;
  margin-bottom: 5px;
}

.xp-level, .coin-total {
  font-size: 1em;
  opacity: 0.9;
}

/* Enhanced Theme Purchase UI */
.theme-purchase-button {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.3s ease;
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.theme-purchase-button:hover {
  background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.theme-purchase-button.insufficient-coins {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
  cursor: not-allowed;
}

.theme-purchase-button.insufficient-coins:hover {
  transform: none;
  box-shadow: none;
}

.insufficient-text {
  font-size: 0.75em;
  display: block;
  margin-top: 2px;
}

.theme-price-info {
  font-size: 0.8em;
  color: #ffd700;
  margin-top: 5px;
  font-weight: 500;
}

.user-coins {
  background: rgba(255, 215, 0, 0.1);
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Enhanced Theme Item Styles */
.theme-item.locked .theme-preview {
  filter: grayscale(50%) brightness(0.7);
  position: relative;
}

.theme-item.locked .theme-preview::after {
  content: '🔒';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
