/* ========================================
   THEMES.CSS - Theme System for Jojio
   ======================================== */

/* Critical CSS - Prevent flash of unstyled content */
.start-screen {
  opacity: 1;
  transition: opacity 0.1s ease-in-out;
}

/* ========================================
   ORIGINAL THEME (Default)
   ======================================== */
:root {
  /* Original theme colors - keeping existing design */
  --theme-primary-bg: rgba(0, 0, 0, 0.8);
  --theme-secondary-bg: rgba(30, 30, 30, 0.25);
  --theme-accent-bg: rgba(31, 41, 55, 0.65);
  --theme-border: rgba(255, 255, 255, 0.18);
  --theme-text-primary: #ffffff;
  --theme-text-secondary: rgba(255, 255, 255, 0.7);
  --theme-button-bg: rgba(255, 255, 255, 0.1);
  --theme-button-border: rgba(255, 255, 255, 0.3);
  --theme-button-hover: rgba(255, 255, 255, 0.2);
  --theme-success: #4ade80;
  --theme-error: #f87171;
  --theme-warning: #ffd700;
  --theme-info: #60a5fa;
}

/* ========================================
   LIGHTER THEME (Based on Daily Challenge Modal)
   ======================================== */
[data-theme="lighter"] {
  /* Lighter theme colors inspired by daily challenge modal */
  --theme-primary-bg: rgba(26, 115, 232, 0.95);
  --theme-secondary-bg: rgba(0, 150, 136, 0.95);
  --theme-accent-bg: linear-gradient(135deg, rgba(26, 115, 232, 0.95), rgba(0, 150, 136, 0.95));
  --theme-border: rgba(255, 255, 255, 0.2);
  --theme-text-primary: #ffffff;
  --theme-text-secondary: rgba(255, 255, 255, 0.9);
  --theme-button-bg: rgba(255, 255, 255, 0.1);
  --theme-button-border: rgba(255, 255, 255, 0.3);
  --theme-button-hover: rgba(255, 255, 255, 0.2);
  --theme-success: #4ade80;
  --theme-error: #f87171;
  --theme-warning: #ffd700;
  --theme-info: #60a5fa;
  
  /* Additional lighter theme specific colors */
  --theme-modal-bg: linear-gradient(135deg, rgba(26, 115, 232, 0.95), rgba(0, 150, 136, 0.95));
  --theme-glass-bg: rgba(255, 255, 255, 0.1);
  --theme-glass-border: rgba(255, 255, 255, 0.2);
  --theme-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  --theme-blur: blur(20px);
}

/* ========================================
   GOOGLE MATERIAL DESIGN 3 THEME
   ======================================== */
[data-theme="material-design"] {
  /* Material Design 3 color palette */
  --theme-primary-bg: #1c1b1f;
  --theme-secondary-bg: #2b2930;
  --theme-accent-bg: #3a3740;
  --theme-border: #49454f;
  --theme-text-primary: #e6e1e5;
  --theme-text-secondary: #cac4d0;
  --theme-button-bg: #6750a4;
  --theme-button-border: #6750a4;
  --theme-button-hover: #5a4a8a;
  --theme-success: #4caf50;
  --theme-error: #f44336;
  --theme-warning: #ff9800;
  --theme-info: #2196f3;
  
  /* Material Design 3 surface colors */
  --theme-modal-bg: #1c1b1f;
  --theme-glass-bg: #2b2930;
  --theme-glass-border: #49454f;
  --theme-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --theme-blur: none;
  --theme-glass-refraction: transparent;
  --theme-glass-highlight: transparent;
  --theme-glass-shadow: transparent;
  
  /* Dynamic responsiveness variables */
  --theme-scale-hover: 1.02;
  --theme-scale-active: 0.98;
  --theme-transition-duration: 0.2s;
  --theme-transition-easing: cubic-bezier(0.2, 0, 0, 1);
}

/* ========================================
   PSYCHEDELIC TRIP THEME
   ======================================== */
[data-theme="psychedelic"] {
  /* Psychedelic color palette - wild and vibrant */
  --theme-primary-bg: linear-gradient(45deg, #ff0080, #8000ff, #0080ff, #00ff80, #ff8000, #ff0080);
  --theme-secondary-bg: rgba(255, 0, 128, 0.15);
  --theme-accent-bg: linear-gradient(135deg, rgba(255, 0, 128, 0.3), rgba(128, 0, 255, 0.3), rgba(0, 128, 255, 0.3));
  --theme-border: rgba(255, 255, 255, 0.4);
  --theme-text-primary: #ffffff;
  --theme-text-secondary: rgba(255, 255, 255, 0.9);
  --theme-button-bg: linear-gradient(45deg, rgba(255, 0, 128, 0.2), rgba(128, 0, 255, 0.2), rgba(0, 128, 255, 0.2));
  --theme-button-border: rgba(255, 255, 255, 0.6);
  --theme-button-hover: linear-gradient(45deg, rgba(255, 0, 128, 0.4), rgba(128, 0, 255, 0.4), rgba(0, 128, 255, 0.4));
  --theme-success: #00ff80;
  --theme-error: #ff4040;
  --theme-warning: #ffff00;
  --theme-info: #00ffff;
  
  /* Psychedelic specific properties */
  --theme-modal-bg: linear-gradient(45deg, rgba(255, 0, 128, 0.8), rgba(128, 0, 255, 0.8), rgba(0, 128, 255, 0.8));
  --theme-glass-bg: rgba(255, 255, 255, 0.1);
  --theme-glass-border: rgba(255, 255, 255, 0.3);
  --theme-shadow: 0 0 30px rgba(255, 0, 128, 0.5), 0 0 60px rgba(128, 0, 255, 0.3), 0 0 90px rgba(0, 128, 255, 0.2);
  --theme-blur: blur(10px) saturate(200%);
  
  /* Psychedelic animation variables */
  --psychedelic-hue-rotate: 0deg;
  --psychedelic-scale: 1;
  --psychedelic-rotation: 0deg;
  --psychedelic-pulse: 1;
  --psychedelic-wave: 0deg;
  
  /* Animation timing */
  --psychedelic-duration: 3s;
  --psychedelic-duration-fast: 1.5s;
  --psychedelic-duration-slow: 6s;
  --psychedelic-easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ========================================
   COLORBLIND-FRIENDLY THEME
   ======================================== */
.colorblind-mode {
  /* Colorblind-friendly color palette - optimized for all types of color blindness */
  --cb-primary: #2E3440;        /* Dark blue-grey - high contrast */
  --cb-secondary: #3B4252;      /* Medium blue-grey */
  --cb-accent: #4C566A;         /* Light blue-grey */
  --cb-success: #A3BE8C;        /* Muted green - distinguishable from red */
  --cb-warning: #EBCB8B;        /* Muted yellow - distinguishable from green */
  --cb-error: #BF616A;          /* Muted red - distinguishable from green */
  --cb-info: #88C0D0;           /* Light blue - distinguishable from other colors */
  --cb-text: #ECEFF4;           /* Light text for contrast */
  --cb-text-secondary: #D8DEE9; /* Secondary text */
  --cb-border: #4C566A;         /* Border color */
  --cb-shadow: rgba(0, 0, 0, 0.4);
  
  /* Pattern-based indicators for additional accessibility */
  --cb-pattern-correct: repeating-linear-gradient(45deg, transparent, transparent 2px, currentColor 2px, currentColor 4px);
  --cb-pattern-close: repeating-linear-gradient(90deg, transparent, transparent 3px, currentColor 3px, currentColor 6px);
  --cb-pattern-wrong: repeating-linear-gradient(135deg, transparent, transparent 1px, currentColor 1px, currentColor 2px);
}

/* ========================================
   COLORBLIND MODE APPLICATION STYLES
   ======================================== */

/* Background and layout adjustments */
.colorblind-mode .start-screen {
  background: var(--cb-primary) !important;
}

.colorblind-mode .game-info {
  background: var(--cb-secondary) !important;
  color: var(--cb-text) !important;
  border: 2px solid var(--cb-border) !important;
}

/* Button styles for colorblind mode */
.colorblind-mode .mode-buttons button {
  background: var(--cb-accent) !important;
  color: var(--cb-text) !important;
  border: 2px solid var(--cb-border) !important;
  box-shadow: 0 4px 15px var(--cb-shadow) !important;
  position: relative !important;
}

.colorblind-mode .mode-buttons button:hover {
  background: var(--cb-secondary) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px var(--cb-shadow) !important;
}

/* Specific button colors with patterns for colorblind users */
.colorblind-mode .mode-buttons button.beginner {
  background: var(--cb-success) !important;
  border-color: var(--cb-success) !important;
  color: var(--cb-primary) !important;
  font-weight: bold !important;
}

.colorblind-mode .mode-buttons button.easy {
  background: var(--cb-info) !important;
  border-color: var(--cb-info) !important;
  color: var(--cb-primary) !important;
  font-weight: bold !important;
}

.colorblind-mode .mode-buttons button.hard {
  background: var(--cb-warning) !important;
  border-color: var(--cb-warning) !important;
  color: var(--cb-primary) !important;
  font-weight: bold !important;
}

.colorblind-mode .mode-buttons button.options {
  background: var(--cb-accent) !important;
  border-color: var(--cb-border) !important;
  color: var(--cb-text) !important;
  font-weight: bold !important;
}

/* Game action buttons */
.colorblind-mode button#next-country,
.colorblind-mode button#mobile-next-country {
  background: var(--cb-success) !important;
  border-color: var(--cb-success) !important;
  color: var(--cb-primary) !important;
  font-weight: bold !important;
}

.colorblind-mode button#reset-game,
.colorblind-mode button#mobile-reset-game {
  background: var(--cb-error) !important;
  border-color: var(--cb-error) !important;
  color: var(--cb-text) !important;
  font-weight: bold !important;
}

.colorblind-mode button#submit-guess {
  background: var(--cb-info) !important;
  border-color: var(--cb-info) !important;
  color: var(--cb-primary) !important;
  font-weight: bold !important;
}

/* Stats and info elements */
.colorblind-mode .timer,
.colorblind-mode .score,
.colorblind-mode .guess-accuracy,
.colorblind-mode .countries-left {
  background: var(--cb-accent) !important;
  color: var(--cb-text) !important;
  border: 1px solid var(--cb-border) !important;
  font-weight: bold !important;
}

/* Country highlighting with patterns */
.colorblind-mode .country.correct {
  fill: var(--cb-success) !important;
  stroke: var(--cb-primary) !important;
  stroke-width: 2px !important;
}

.colorblind-mode .country.correct::after {
  content: '';
  position: absolute;
  background: var(--cb-pattern-correct);
  opacity: 0.3;
}

.colorblind-mode .country.close {
  fill: var(--cb-warning) !important;
  stroke: var(--cb-primary) !important;
  stroke-width: 2px !important;
}

.colorblind-mode .country.somewhat-close {
  fill: var(--cb-info) !important;
  stroke: var(--cb-primary) !important;
  stroke-width: 2px !important;
}

.colorblind-mode .country.wrong {
  fill: var(--cb-error) !important;
  stroke: var(--cb-primary) !important;
  stroke-width: 2px !important;
}

/* Text and typography improvements */
.colorblind-mode {
  font-family: 'Open Sans', 'Arial', sans-serif !important;
  line-height: 1.6 !important;
}

.colorblind-mode h1,
.colorblind-mode h2,
.colorblind-mode h3 {
  color: var(--cb-text) !important;
  text-shadow: 1px 1px 2px var(--cb-shadow) !important;
}

/* Form elements */
.colorblind-mode input,
.colorblind-mode select {
  background: var(--cb-accent) !important;
  color: var(--cb-text) !important;
  border: 2px solid var(--cb-border) !important;
  font-weight: bold !important;
}

.colorblind-mode input:focus,
.colorblind-mode select:focus {
  border-color: var(--cb-info) !important;
  box-shadow: 0 0 5px var(--cb-info) !important;
}

/* Modal and overlay improvements */
.colorblind-mode .options-menu,
.colorblind-mode .options-content {
  background: var(--cb-secondary) !important;
  border: 2px solid var(--cb-border) !important;
  color: var(--cb-text) !important;
}

/* Toggle button improvements */
.colorblind-mode .toggle-button {
  background: var(--cb-accent) !important;
  border: 2px solid var(--cb-border) !important;
  color: var(--cb-text) !important;
  font-weight: bold !important;
}

.colorblind-mode .toggle-button.active {
  background: var(--cb-success) !important;
  border-color: var(--cb-success) !important;
  color: var(--cb-primary) !important;
}

/* Accessibility indicators */
.colorblind-mode .colorblind-indicator {
  position: relative;
}

.colorblind-mode .colorblind-indicator::before {
  content: '♿';
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 12px;
  color: var(--cb-info);
  background: var(--cb-primary);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Colorblind mode indicator in options */
.colorblind-mode .toggle-button[id="toggle-colorblind"] {
  background: var(--cb-success) !important;
  border-color: var(--cb-success) !important;
  color: var(--cb-primary) !important;
  position: relative !important;
}

.colorblind-mode .toggle-button[id="toggle-colorblind"]::after {
  content: '✓';
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 14px;
  font-weight: bold;
  color: var(--cb-primary);
}

/* Enhanced contrast for better readability */
.colorblind-mode * {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Pattern overlays for additional visual cues */
.colorblind-mode .country.correct {
  background-image: var(--cb-pattern-correct) !important;
}

.colorblind-mode .country.close {
  background-image: var(--cb-pattern-close) !important;
}

.colorblind-mode .country.wrong {
  background-image: var(--cb-pattern-wrong) !important;
}

/* ========================================
   MATERIAL DESIGN 3 THEME SPECIFIC STYLES
   ======================================== */

/* Material Design 3 Button Animations - Exclude start menu buttons */
[data-theme="material-design"] .game-info button,
[data-theme="material-design"] .toggle-button,
[data-theme="material-design"] .options-content button,
[data-theme="material-design"] .daily-modal-content button,
[data-theme="material-design"] .right-panel button {
  position: relative;
  overflow: hidden;
  transition: all var(--theme-transition-duration) var(--theme-transition-easing);
  background: var(--theme-button-bg);
  border: 1px solid var(--theme-button-border);
  border-radius: 8px;
  box-shadow: var(--theme-shadow);
  color: var(--theme-text-primary);
  font-weight: 500;
}

[data-theme="material-design"] .game-info button:hover,
[data-theme="material-design"] .toggle-button:hover,
[data-theme="material-design"] .options-content button:hover,
[data-theme="material-design"] .daily-modal-content button:hover,
[data-theme="material-design"] .right-panel button:hover {
  background: var(--theme-button-hover);
  transform: scale(var(--theme-scale-hover));
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="material-design"] .game-info button:active,
[data-theme="material-design"] .toggle-button:active,
[data-theme="material-design"] .options-content button:active,
[data-theme="material-design"] .daily-modal-content button:active,
[data-theme="material-design"] .right-panel button:active {
  transform: scale(var(--theme-scale-active));
  transition-duration: 0.1s;
}

/* Material Design 3 Input Fields */
[data-theme="material-design"] input,
[data-theme="material-design"] select,
[data-theme="material-design"] .voice-dropdown {
  background: var(--theme-glass-bg);
  border: 1px solid var(--theme-glass-border);
  border-radius: 8px;
  box-shadow: var(--theme-shadow);
  transition: all var(--theme-transition-duration) var(--theme-transition-easing);
  color: var(--theme-text-primary);
}

[data-theme="material-design"] input:focus,
[data-theme="material-design"] select:focus {
  border-color: var(--theme-button-bg);
  box-shadow: 0 0 0 2px rgba(103, 80, 164, 0.2), var(--theme-shadow);
  background: var(--theme-accent-bg);
}

/* Material Design 3 Modal and Panel Styling */
[data-theme="material-design"] .options-content,
[data-theme="material-design"] .daily-modal-content,
[data-theme="material-design"] .game-info,
[data-theme="material-design"] .right-panel {
  background: var(--theme-modal-bg);
  border: 1px solid var(--theme-glass-border);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
}

[data-theme="liquid-glass"] .options-content::before,
[data-theme="liquid-glass"] .daily-modal-content::before,
[data-theme="liquid-glass"] .game-info::before,
[data-theme="liquid-glass"] .right-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.05) 0%, 
    transparent 50%, 
    rgba(255, 255, 255, 0.02) 100%);
  pointer-events: none;
  border-radius: inherit;
}

/* Liquid Glass Theme Selection */
[data-theme="liquid-glass"] .theme-option {
  background: var(--theme-glass-bg);
  border: 1px solid var(--theme-glass-border);
  backdrop-filter: var(--theme-blur);
  -webkit-backdrop-filter: var(--theme-blur);
  box-shadow: var(--theme-shadow);
  transition: all var(--theme-transition-duration) var(--theme-transition-easing);
}

[data-theme="liquid-glass"] .theme-option:hover {
  transform: scale(var(--theme-scale-hover)) translateY(-2px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="liquid-glass"] .theme-option.active {
  background: rgba(96, 165, 250, 0.2);
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3), var(--theme-shadow);
}

/* Liquid Glass Preview Styling */
[data-theme="liquid-glass"] .theme-preview.liquid-glass-theme {
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.85) 0%, 
    rgba(255, 255, 255, 0.08) 50%, 
    rgba(255, 255, 255, 0.12) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

[data-theme="liquid-glass"] .theme-preview.liquid-glass-theme::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    transparent 50%, 
    rgba(255, 255, 255, 0.03) 100%);
  pointer-events: none;
}

/* Liquid Glass Fact Cards */
[data-theme="liquid-glass"] .fact-card {
  background: var(--theme-glass-bg);
  border: 1px solid var(--theme-glass-border);
  backdrop-filter: var(--theme-blur);
  -webkit-backdrop-filter: var(--theme-blur);
  box-shadow: var(--theme-shadow);
  transition: all var(--theme-transition-duration) var(--theme-transition-easing);
}

[data-theme="liquid-glass"] .fact-card:hover {
  transform: scale(var(--theme-scale-hover)) translateY(-2px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Liquid Glass Flag Container */
[data-theme="liquid-glass"] .flag-container {
  background: var(--theme-glass-bg);
  border: 1px solid var(--theme-glass-border);
  backdrop-filter: var(--theme-blur);
  -webkit-backdrop-filter: var(--theme-blur);
  box-shadow: var(--theme-shadow);
}

/* Liquid Glass Streak Tab */
[data-theme="liquid-glass"] .streak-tab {
  background: var(--theme-glass-bg);
  border: 1px solid var(--theme-glass-border);
  backdrop-filter: var(--theme-blur);
  -webkit-backdrop-filter: var(--theme-blur);
  box-shadow: var(--theme-shadow);
}

/* Enhanced Liquid Glass Transitions - Exclude start screen */
[data-theme="liquid-glass"] *:not(.start-screen):not(.start-screen *) {
  transition: background-color var(--theme-transition-duration) var(--theme-transition-easing),
              border-color var(--theme-transition-duration) var(--theme-transition-easing),
              color var(--theme-transition-duration) var(--theme-transition-easing),
              box-shadow var(--theme-transition-duration) var(--theme-transition-easing),
              transform var(--theme-transition-duration) var(--theme-transition-easing) !important;
}

/* ========================================
   PSYCHEDELIC THEME ANIMATIONS & STYLES
   ======================================== */

/* Psychedelic Keyframe Animations */
@keyframes psychedelicHueRotate {
  0% { filter: hue-rotate(0deg) saturate(1.5) brightness(1.2); }
  25% { filter: hue-rotate(90deg) saturate(2) brightness(1.4); }
  50% { filter: hue-rotate(180deg) saturate(1.8) brightness(1.1); }
  75% { filter: hue-rotate(270deg) saturate(2.2) brightness(1.3); }
  100% { filter: hue-rotate(360deg) saturate(1.5) brightness(1.2); }
}

@keyframes psychedelicPulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.05) rotate(1deg); }
  50% { transform: scale(1.1) rotate(0deg); }
  75% { transform: scale(1.05) rotate(-1deg); }
}

@keyframes psychedelicWave {
  0% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(5px) rotate(1deg); }
  50% { transform: translateX(0) rotate(0deg); }
  75% { transform: translateX(-5px) rotate(-1deg); }
  100% { transform: translateX(0) rotate(0deg); }
}

@keyframes psychedelicFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-3px) rotate(1deg); }
  66% { transform: translateY(2px) rotate(-1deg); }
}

@keyframes psychedelicGlow {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.5), 
                0 0 40px rgba(128, 0, 255, 0.3), 
                0 0 60px rgba(0, 128, 255, 0.2);
  }
  50% { 
    box-shadow: 0 0 30px rgba(255, 0, 128, 0.8), 
                0 0 60px rgba(128, 0, 255, 0.5), 
                0 0 90px rgba(0, 128, 255, 0.3);
  }
}

@keyframes psychedelicBackground {
  0% { 
    background: linear-gradient(45deg, #ff0080, #8000ff, #0080ff, #00ff80, #ff8000);
    transform: rotate(0deg) scale(1);
  }
  25% { 
    background: linear-gradient(135deg, #8000ff, #0080ff, #00ff80, #ff8000, #ff0080);
    transform: rotate(90deg) scale(1.1);
  }
  50% { 
    background: linear-gradient(225deg, #0080ff, #00ff80, #ff8000, #ff0080, #8000ff);
    transform: rotate(180deg) scale(1);
  }
  75% { 
    background: linear-gradient(315deg, #00ff80, #ff8000, #ff0080, #8000ff, #0080ff);
    transform: rotate(270deg) scale(1.1);
  }
  100% { 
    background: linear-gradient(45deg, #ff0080, #8000ff, #0080ff, #00ff80, #ff8000);
    transform: rotate(360deg) scale(1);
  }
}

@keyframes psychedelicCorrectGuess {
  0% { 
    transform: scale(1.2) rotate(5deg) translateY(0);
    filter: hue-rotate(0deg) saturate(2) brightness(1.5);
  }
  25% { 
    transform: scale(1.3) rotate(15deg) translateY(-10px);
    filter: hue-rotate(90deg) saturate(2.5) brightness(1.8);
  }
  50% { 
    transform: scale(1.4) rotate(25deg) translateY(0);
    filter: hue-rotate(180deg) saturate(3) brightness(2);
  }
  75% { 
    transform: scale(1.3) rotate(15deg) translateY(10px);
    filter: hue-rotate(270deg) saturate(2.5) brightness(1.8);
  }
  100% { 
    transform: scale(1.2) rotate(5deg) translateY(0);
    filter: hue-rotate(360deg) saturate(2) brightness(1.5);
  }
}

@keyframes psychedelicSwirl {
  0% { 
    transform: scale(1.1) rotate(-3deg);
    filter: hue-rotate(0deg) saturate(2.5) brightness(1.8);
  }
  20% { 
    transform: scale(1.2) rotate(15deg);
    filter: hue-rotate(72deg) saturate(3) brightness(2.2);
  }
  40% { 
    transform: scale(1.3) rotate(33deg);
    filter: hue-rotate(144deg) saturate(3.5) brightness(2.5);
  }
  60% { 
    transform: scale(1.2) rotate(51deg);
    filter: hue-rotate(216deg) saturate(3) brightness(2.2);
  }
  80% { 
    transform: scale(1.1) rotate(69deg);
    filter: hue-rotate(288deg) saturate(2.5) brightness(1.8);
  }
  100% { 
    transform: scale(1.1) rotate(87deg);
    filter: hue-rotate(360deg) saturate(2.5) brightness(1.8);
  }
}

/* Psychedelic Button Animations - Apply to game buttons with movement */
[data-theme="psychedelic"] .game-info button,
[data-theme="psychedelic"] .toggle-button,
[data-theme="psychedelic"] .options-content button,
[data-theme="psychedelic"] .daily-modal-content button,
[data-theme="psychedelic"] .right-panel button,
[data-theme="psychedelic"] .start-screen .mode-buttons button,
[data-theme="psychedelic"] .fact-card,
[data-theme="psychedelic"] .flag-container,
[data-theme="psychedelic"] .streak-tab {
  position: relative;
  overflow: hidden;
  animation: psychedelicFloat var(--psychedelic-duration-slow) var(--psychedelic-easing) infinite;
  backdrop-filter: var(--theme-blur);
  -webkit-backdrop-filter: var(--theme-blur);
  border: 2px solid var(--theme-button-border);
  box-shadow: var(--theme-shadow);
  background: var(--theme-button-bg);
  filter: hue-rotate(var(--psychedelic-hue-rotate));
}


/* CRITICAL: Override the general mode-buttons button rule that's disabling psychedelic effects */
[data-theme="psychedelic"] .mode-buttons button {
  position: relative !important;
  overflow: hidden !important;
  filter: hue-rotate(var(--psychedelic-hue-rotate)) !important;
  animation: psychedelicPulse var(--psychedelic-duration-fast) var(--psychedelic-easing) infinite !important;
}

/* CRITICAL: Override specific button classes for psychedelic effects */
[data-theme="psychedelic"] .mode-buttons button.beginner,
[data-theme="psychedelic"] .mode-buttons button.easy,
[data-theme="psychedelic"] .mode-buttons button.hard,
[data-theme="psychedelic"] .mode-buttons button[id*="flag"],
[data-theme="psychedelic"] .mode-buttons button[id*="blitz"],
[data-theme="psychedelic"] .mode-buttons button[id*="daily"],
[data-theme="psychedelic"] .mode-buttons button[id*="compare"],
[data-theme="psychedelic"] .mode-buttons button[id*="leaderboard"],
[data-theme="psychedelic"] .mode-buttons button.leaderboard-btn {
  position: relative !important;
  overflow: hidden !important;
  filter: hue-rotate(var(--psychedelic-hue-rotate)) !important;
  animation: psychedelicPulse var(--psychedelic-duration-fast) var(--psychedelic-easing) infinite !important;
  background: var(--theme-button-bg) !important;
  border: 2px solid var(--theme-glass-border) !important;
  box-shadow: var(--theme-shadow) !important;
}

[data-theme="psychedelic"] .game-info button::before,
[data-theme="psychedelic"] .toggle-button::before,
[data-theme="psychedelic"] .options-content button::before,
[data-theme="psychedelic"] .daily-modal-content button::before,
[data-theme="psychedelic"] .right-panel button::before,
[data-theme="psychedelic"] .start-screen .mode-buttons button::before,
[data-theme="psychedelic"] .mode-buttons button.beginner::before,
[data-theme="psychedelic"] .mode-buttons button.easy::before,
[data-theme="psychedelic"] .mode-buttons button.hard::before,
[data-theme="psychedelic"] .mode-buttons button[id*="flag"]::before,
[data-theme="psychedelic"] .mode-buttons button[id*="blitz"]::before,
[data-theme="psychedelic"] .mode-buttons button[id*="daily"]::before,
[data-theme="psychedelic"] .mode-buttons button[id*="compare"]::before,
[data-theme="psychedelic"] .mode-buttons button[id*="leaderboard"]::before,
[data-theme="psychedelic"] .mode-buttons button.leaderboard-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    rgba(255, 0, 128, 0.3),
    rgba(128, 0, 255, 0.3),
    rgba(0, 128, 255, 0.3),
    rgba(0, 255, 128, 0.3),
    rgba(255, 128, 0, 0.3),
    rgba(255, 0, 128, 0.3)
  );
  animation: psychedelicHueRotate var(--psychedelic-duration) linear infinite;
  opacity: 0.6;
  pointer-events: none;
  z-index: -1;
}


[data-theme="psychedelic"] .game-info button:hover,
[data-theme="psychedelic"] .toggle-button:hover,
[data-theme="psychedelic"] .options-content button:hover,
[data-theme="psychedelic"] .daily-modal-content button:hover,
[data-theme="psychedelic"] .right-panel button:hover,
[data-theme="psychedelic"] .start-screen .mode-buttons button:hover,
[data-theme="psychedelic"] .mode-buttons button.beginner:hover,
[data-theme="psychedelic"] .mode-buttons button.easy:hover,
[data-theme="psychedelic"] .mode-buttons button.hard:hover,
[data-theme="psychedelic"] .mode-buttons button[id*="flag"]:hover,
[data-theme="psychedelic"] .mode-buttons button[id*="blitz"]:hover,
[data-theme="psychedelic"] .mode-buttons button[id*="daily"]:hover,
[data-theme="psychedelic"] .mode-buttons button[id*="compare"]:hover,
[data-theme="psychedelic"] .mode-buttons button[id*="leaderboard"]:hover,
[data-theme="psychedelic"] .mode-buttons button.leaderboard-btn:hover {
  animation: psychedelicPulse var(--psychedelic-duration-fast) var(--psychedelic-easing) infinite,
             psychedelicGlow var(--psychedelic-duration) var(--psychedelic-easing) infinite;
  transform: scale(1.1) translateY(-2px);
  filter: hue-rotate(180deg) saturate(2) brightness(1.3);
  border-color: rgba(255, 255, 255, 0.8);
}


[data-theme="psychedelic"] .game-info button:active,
[data-theme="psychedelic"] .toggle-button:active,
[data-theme="psychedelic"] .options-content button:active,
[data-theme="psychedelic"] .daily-modal-content button:active,
[data-theme="psychedelic"] .right-panel button:active,
[data-theme="psychedelic"] .start-screen .mode-buttons button:active,
[data-theme="psychedelic"] .mode-buttons button.beginner:active,
[data-theme="psychedelic"] .mode-buttons button.easy:active,
[data-theme="psychedelic"] .mode-buttons button.hard:active,
[data-theme="psychedelic"] .mode-buttons button[id*="flag"]:active,
[data-theme="psychedelic"] .mode-buttons button[id*="blitz"]:active,
[data-theme="psychedelic"] .mode-buttons button[id*="daily"]:active,
[data-theme="psychedelic"] .mode-buttons button[id*="compare"]:active,
[data-theme="psychedelic"] .mode-buttons button[id*="leaderboard"]:active,
[data-theme="psychedelic"] .mode-buttons button.leaderboard-btn:active {
  animation: psychedelicWave var(--psychedelic-duration-fast) var(--psychedelic-easing) infinite;
  transform: scale(0.95);
  filter: hue-rotate(270deg) saturate(2.5) brightness(1.5);
}


/* Psychedelic Input Fields */
[data-theme="psychedelic"] input,
[data-theme="psychedelic"] select,
[data-theme="psychedelic"] .voice-dropdown {
  background: var(--theme-glass-bg);
  border: 2px solid var(--theme-glass-border);
  backdrop-filter: var(--theme-blur);
  -webkit-backdrop-filter: var(--theme-blur);
  box-shadow: var(--theme-shadow);
  animation: psychedelicFloat var(--psychedelic-duration-slow) var(--psychedelic-easing) infinite;
  filter: hue-rotate(var(--psychedelic-hue-rotate));
}

[data-theme="psychedelic"] input:focus,
[data-theme="psychedelic"] select:focus {
  animation: psychedelicGlow var(--psychedelic-duration) var(--psychedelic-easing) infinite;
  border-color: rgba(0, 255, 255, 0.8);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5), var(--theme-shadow);
  background: linear-gradient(45deg, rgba(255, 0, 128, 0.1), rgba(128, 0, 255, 0.1), rgba(0, 128, 255, 0.1));
  filter: hue-rotate(90deg) saturate(1.8) brightness(1.2);
}

/* Psychedelic Modal and Panel Styling */
[data-theme="psychedelic"] .options-content,
[data-theme="psychedelic"] .daily-modal-content,
[data-theme="psychedelic"] .game-info,
[data-theme="psychedelic"] .right-panel,
[data-theme="psychedelic"] .start-screen {
  background: var(--theme-secondary-bg) !important;
  backdrop-filter: var(--theme-blur, blur(20px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(20px)) !important;
  border: 1px solid var(--theme-border) !important;
  box-shadow: var(--theme-shadow, 0 8px 32px 0 rgba(31, 38, 135, 0.37)) !important;
  position: relative;
  animation: psychedelicFloat var(--psychedelic-duration-slow) var(--psychedelic-easing) infinite !important;
  filter: hue-rotate(var(--psychedelic-hue-rotate)) !important;
}




[data-theme="psychedelic"] .options-content::before,
[data-theme="psychedelic"] .daily-modal-content::before,
[data-theme="psychedelic"] .game-info::before,
[data-theme="psychedelic"] .right-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: conic-gradient(
    from 0deg,
    rgba(255, 0, 128, 0.1),
    rgba(128, 0, 255, 0.1),
    rgba(0, 128, 255, 0.1),
    rgba(0, 255, 128, 0.1),
    rgba(255, 128, 0, 0.1),
    rgba(255, 0, 128, 0.1)
  );
  animation: psychedelicHueRotate var(--psychedelic-duration) linear infinite;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.7;
}

/* CRITICAL: Override part1.css start-screen ::before rule with maximum specificity */
[data-theme="psychedelic"] .start-screen::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: conic-gradient(
    from 0deg,
    rgba(255, 0, 128, 0.1),
    rgba(128, 0, 255, 0.1),
    rgba(0, 128, 255, 0.1),
    rgba(0, 255, 128, 0.1),
    rgba(255, 128, 0, 0.1),
    rgba(255, 0, 128, 0.1)
  ) !important;
  animation: psychedelicHueRotate var(--psychedelic-duration) linear infinite !important;
  pointer-events: none !important;
  border-radius: inherit !important;
  opacity: 0.7 !important;
  inset: 0 !important;
  height: 100% !important;
  z-index: 1 !important;
}



/* Psychedelic Theme Selection */
[data-theme="psychedelic"] .theme-option {
  background: var(--theme-glass-bg);
  border: 2px solid var(--theme-glass-border);
  backdrop-filter: var(--theme-blur);
  -webkit-backdrop-filter: var(--theme-blur);
  box-shadow: var(--theme-shadow);
  animation: psychedelicFloat var(--psychedelic-duration-slow) var(--psychedelic-easing) infinite;
  filter: hue-rotate(var(--psychedelic-hue-rotate));
}

[data-theme="psychedelic"] .theme-option:hover {
  animation: psychedelicPulse var(--psychedelic-duration-fast) var(--psychedelic-easing) infinite,
             psychedelicGlow var(--psychedelic-duration) var(--psychedelic-easing) infinite;
  transform: scale(1.15) translateY(-3px);
  filter: hue-rotate(180deg) saturate(2) brightness(1.3);
  border-color: rgba(255, 255, 255, 0.8);
}

[data-theme="psychedelic"] .theme-option.active {
  background: linear-gradient(45deg, rgba(0, 255, 255, 0.3), rgba(255, 0, 128, 0.3), rgba(128, 0, 255, 0.3));
  border-color: rgba(0, 255, 255, 0.8);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.6), var(--theme-shadow);
  animation: psychedelicGlow var(--psychedelic-duration) var(--psychedelic-easing) infinite;
}

/* Psychedelic Preview Styling */
[data-theme="psychedelic"] .theme-preview.psychedelic-theme {
  background: linear-gradient(45deg, #ff0080, #8000ff, #0080ff, #00ff80, #ff8000);
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 30px rgba(255, 0, 128, 0.5), 0 0 60px rgba(128, 0, 255, 0.3);
  position: relative;
  overflow: hidden;
  animation: psychedelicBackground var(--psychedelic-duration) linear infinite;
}

[data-theme="psychedelic"] .theme-preview.psychedelic-theme::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.3),
    rgba(255, 0, 128, 0.3),
    rgba(128, 0, 255, 0.3),
    rgba(0, 128, 255, 0.3),
    rgba(0, 255, 128, 0.3),
    rgba(255, 128, 0, 0.3),
    rgba(255, 255, 255, 0.3)
  );
  animation: psychedelicHueRotate var(--psychedelic-duration) linear infinite;
  pointer-events: none;
}

/* Psychedelic Fact Cards */
[data-theme="psychedelic"] .fact-card {
  background: var(--theme-glass-bg);
  border: 2px solid var(--theme-glass-border);
  backdrop-filter: var(--theme-blur);
  -webkit-backdrop-filter: var(--theme-blur);
  box-shadow: var(--theme-shadow);
  animation: psychedelicFloat var(--psychedelic-duration-slow) var(--psychedelic-easing) infinite;
  filter: hue-rotate(var(--psychedelic-hue-rotate));
}

[data-theme="psychedelic"] .fact-card:hover {
  animation: psychedelicPulse var(--psychedelic-duration-fast) var(--psychedelic-easing) infinite,
             psychedelicGlow var(--psychedelic-duration) var(--psychedelic-easing) infinite;
  transform: scale(1.1) translateY(-3px);
  filter: hue-rotate(180deg) saturate(2) brightness(1.3);
  border-color: rgba(255, 255, 255, 0.8);
}

/* Psychedelic Flag Container */
[data-theme="psychedelic"] .flag-container {
  background: var(--theme-glass-bg);
  border: 2px solid var(--theme-glass-border);
  backdrop-filter: var(--theme-blur);
  -webkit-backdrop-filter: var(--theme-blur);
  box-shadow: var(--theme-shadow);
  animation: psychedelicFloat var(--psychedelic-duration-slow) var(--psychedelic-easing) infinite;
  filter: hue-rotate(var(--psychedelic-hue-rotate));
}

/* Psychedelic Streak Tab */
[data-theme="psychedelic"] .streak-tab {
  background: var(--theme-glass-bg);
  border: 2px solid var(--theme-glass-border);
  backdrop-filter: var(--theme-blur);
  -webkit-backdrop-filter: var(--theme-blur);
  box-shadow: var(--theme-shadow);
  animation: psychedelicFloat var(--psychedelic-duration-slow) var(--psychedelic-easing) infinite;
  filter: hue-rotate(var(--psychedelic-hue-rotate));
}

/* Psychedelic Background Canvas - Disabled in favor of JavaScript implementation */
[data-theme="psychedelic"] .globe-container {
  position: relative;
  overflow: hidden;
}

/* Disabled CSS pseudo-elements - using JavaScript gradient instead */
[data-theme="psychedelic"] .globe-container::before {
  display: none !important;
}

/* Disabled CSS pseudo-elements - using JavaScript gradient instead */
[data-theme="psychedelic"] .globe-container::after {
  display: none !important;
}

/* Psychedelic Correct Guess - Particle System with Gradient Background */
@keyframes psychedelicGradientShift {
  0% { 
    background: conic-gradient(from 0deg, #ff0080, #ff4000, #ffff00, #00ff00, #0080ff, #8000ff, #ff0080);
  }
  16.66% { 
    background: conic-gradient(from 60deg, #ff4000, #ffff00, #00ff00, #0080ff, #8000ff, #ff0080, #ff4000);
  }
  33.33% { 
    background: conic-gradient(from 120deg, #ffff00, #00ff00, #0080ff, #8000ff, #ff0080, #ff4000, #ffff00);
  }
  50% { 
    background: conic-gradient(from 180deg, #00ff00, #0080ff, #8000ff, #ff0080, #ff4000, #ffff00, #00ff00);
  }
  66.66% { 
    background: conic-gradient(from 240deg, #0080ff, #8000ff, #ff0080, #ff4000, #ffff00, #00ff00, #0080ff);
  }
  83.33% { 
    background: conic-gradient(from 300deg, #8000ff, #ff0080, #ff4000, #ffff00, #00ff00, #0080ff, #8000ff);
  }
  100% { 
    background: conic-gradient(from 360deg, #ff0080, #ff4000, #ffff00, #00ff00, #0080ff, #8000ff, #ff0080);
  }
}

/* Psychedelic particle system styles */
.psychedelic-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.psychedelic-gradient-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.8;
}

/* Make psychedelic gradient more transparent on mobile to allow globe visibility */
@media (max-width: 768px) {
  .psychedelic-gradient-bg {
    opacity: 0.3 !important;
  }
}

/* Additional mobile-specific psychedelic styles */
@media (max-width: 768px) {
  .globe-container.correct-guess .psychedelic-gradient-bg {
    opacity: 0.2 !important;
  }
}

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

/* Enhanced Psychedelic Transitions - Exclude correct guess effects */
[data-theme="psychedelic"] *:not(.globe-container.correct-guess):not(.globe-container.correct-guess *) {
  transition: background-color 0.3s var(--psychedelic-easing),
              border-color 0.3s var(--psychedelic-easing),
              color 0.3s var(--psychedelic-easing),
              box-shadow 0.3s var(--psychedelic-easing),
              transform 0.3s var(--psychedelic-easing),
              filter 0.3s var(--psychedelic-easing) !important;
}

/* ========================================
   THEME ISOLATION & CLEANUP
   ======================================== */

/* Ensure psychedelic theme is completely isolated */
[data-theme]:not([data-theme="psychedelic"]):not([data-theme="lighter"]) * {
  animation: none !important;
  filter: none !important;
  transform: none !important;
}

/* Reset psychedelic animations when switching themes */
[data-theme]:not([data-theme="psychedelic"]):not([data-theme="lighter"]) .game-info button,
[data-theme]:not([data-theme="psychedelic"]):not([data-theme="lighter"]) .toggle-button,
[data-theme]:not([data-theme="psychedelic"]):not([data-theme="lighter"]) .options-content button,
[data-theme]:not([data-theme="psychedelic"]):not([data-theme="lighter"]) .daily-modal-content button,
[data-theme]:not([data-theme="psychedelic"]):not([data-theme="lighter"]) .right-panel button {
  animation: none !important;
  filter: none !important;
  transform: none !important;
}

[data-theme]:not([data-theme="psychedelic"]) .globe-container::before,
[data-theme]:not([data-theme="psychedelic"]) .globe-container::after {
  display: none !important;
}

/* Ensure smooth transitions when switching away from psychedelic */
[data-theme]:not([data-theme="psychedelic"]) {
  --psychedelic-hue-rotate: 0deg;
  --psychedelic-scale: 1;
  --psychedelic-rotation: 0deg;
  --psychedelic-pulse: 1;
  --psychedelic-wave: 0deg;
}

/* Psychedelic theme cleanup on theme switch */
body:not([data-theme="psychedelic"]) .globe-container::before,
body:not([data-theme="psychedelic"]) .globe-container::after {
  display: none !important;
  animation: none !important;
}

/* Ensure other themes work properly after psychedelic - Exclude start screen */
[data-theme="original"] *:not(.start-screen):not(.start-screen *),
[data-theme="liquid-glass"] *:not(.start-screen):not(.start-screen *) {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  animation-fill-mode: none !important;
}

/* ========================================
   THEME APPLICATION STYLES
   ======================================== */

/* Options Menu Theme Application */
.options-menu {
  background-color: var(--theme-primary-bg) !important;
}

.options-content {
  background: var(--theme-secondary-bg) !important;
  backdrop-filter: var(--theme-blur, blur(20px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(20px)) !important;
  border: 1px solid var(--theme-border) !important;
  box-shadow: var(--theme-shadow, 0 8px 32px 0 rgba(31, 38, 135, 0.37)) !important;
}

.options-title {
  color: var(--theme-text-primary) !important;
}

/* Toggle Buttons Theme Application */
.toggle-button {
  background: var(--theme-button-bg) !important;
  border: 1px solid var(--theme-button-border) !important;
  color: var(--theme-text-primary) !important;
  backdrop-filter: var(--theme-blur, blur(10px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(10px)) !important;
}

.toggle-button:hover {
  background: var(--theme-button-hover) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
}

.toggle-button.active {
  background: var(--theme-info) !important;
  border-color: var(--theme-info) !important;
  box-shadow: 0 4px 15px rgba(96, 165, 250, 0.4) !important;
}

/* Game Info Container Theme Application */


.game-info {
  color: var(--theme-text-primary) !important;
}

/* Daily Challenge Modal Theme Application */
.daily-modal-overlay {
  background: var(--theme-primary-bg) !important;
  backdrop-filter: var(--theme-blur, blur(10px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(10px)) !important;
}

.daily-modal-content {
  background: var(--theme-modal-bg, var(--theme-accent-bg)) !important;
  border: 1px solid var(--theme-border) !important;
  box-shadow: var(--theme-shadow) !important;
}

.daily-modal-header {
  background: var(--theme-glass-bg) !important;
  border-bottom: 1px solid var(--theme-glass-border) !important;
}

.daily-modal-title {
  color: var(--theme-text-primary) !important;
}

.daily-modal-message {
  color: var(--theme-text-secondary) !important;
}

.daily-modal-country {
  background: var(--theme-glass-bg) !important;
  border: 1px solid var(--theme-glass-border) !important;
  backdrop-filter: var(--theme-blur, blur(10px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(10px)) !important;
}

.country-name {
  color: var(--theme-text-primary) !important;
}

.daily-modal-button {
  background: var(--theme-button-bg) !important;
  border: 1px solid var(--theme-button-border) !important;
  color: var(--theme-text-primary) !important;
  backdrop-filter: var(--theme-blur, blur(10px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(10px)) !important;
}

.daily-modal-button:hover {
  background: var(--theme-button-hover) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
}

.daily-modal-button.primary {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.8), rgba(76, 175, 80, 0.6)) !important;
  border-color: rgba(76, 175, 80, 0.9) !important;
}

.daily-modal-button.primary:hover {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.9), rgba(76, 175, 80, 0.7)) !important;
  box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3) !important;
}

.daily-modal-button.secondary {
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.8), rgba(156, 39, 176, 0.6)) !important;
  border-color: rgba(156, 39, 176, 0.9) !important;
}

.daily-modal-button.secondary:hover {
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.9), rgba(156, 39, 176, 0.7)) !important;
  box-shadow: 0 8px 20px rgba(156, 39, 176, 0.3) !important;
}





/* Specific start screen rules for lighter and liquid glass themes */
[data-theme="lighter"] .start-screen:not(.hidden),
[data-theme="liquid-glass"] .start-screen:not(.hidden) {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  z-index: 10 !important;
  transition: none !important;
  animation: none !important;
}

/* Override media query positioning issues - Preserve all original properties */
@media (max-width: 768px) {
  .start-screen:not(.hidden) {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: clamp(300px, 90vw, 400px) !important;
    padding: clamp(16px, 4vw, 24px) !important;
    max-height: 98vh !important;
    min-height: fit-content !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .start-screen:not(.hidden) {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: clamp(300px, 90vw, 600px) !important;
    padding: clamp(16px, 4vw, 24px) !important;
    max-height: 98vh !important;
    min-height: fit-content !important;
  }
}

@media (min-width: 1024px) and (max-width: 1365px) {
  .start-screen:not(.hidden) {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: clamp(800px, 80vw, 1200px) !important;
    height: fit-content !important;
    max-height: 90vh !important;
    padding: clamp(32px, 4vh, 40px) !important;
  }
}

@media (min-width: 1366px) {
  .start-screen:not(.hidden) {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: clamp(1100px, 70vw, 1400px) !important;
    padding: clamp(32px, 4vh, 40px) !important;
  }
}

.mode-buttons button {
  background: var(--theme-button-bg) !important;
  border: 1px solid var(--theme-button-border) !important;
  color: var(--theme-text-primary) !important;
  backdrop-filter: var(--theme-blur, blur(10px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(10px)) !important;
  /* Ensure start menu buttons are not affected by any theme animations */
  animation: none !important;
  filter: none !important;
  transform: none !important;
  position: static !important;
  overflow: visible !important;
}

.mode-buttons button:hover {
  background: var(--theme-button-hover) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
  /* Override any psychedelic effects on hover */
  animation: none !important;
  filter: none !important;
}

/* Mode-specific button colors for lighter theme - Enhanced with unique colors */
[data-theme="lighter"] .mode-buttons button.beginner {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(22, 163, 74, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(34, 197, 94, 1) !important;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
  position: relative !important;
  overflow: hidden !important;
}

[data-theme="lighter"] .mode-buttons button.beginner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

[data-theme="lighter"] .mode-buttons button.beginner:hover::before {
  left: 100%;
}

[data-theme="lighter"] .mode-buttons button.easy {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(59, 130, 246, 1) !important;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
  position: relative !important;
  overflow: hidden !important;
}

[data-theme="lighter"] .mode-buttons button.easy::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

[data-theme="lighter"] .mode-buttons button.easy:hover::before {
  left: 100%;
}

[data-theme="lighter"] .mode-buttons button.hard {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.9), rgba(147, 51, 234, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(168, 85, 247, 1) !important;
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
  position: relative !important;
  overflow: hidden !important;
}

[data-theme="lighter"] .mode-buttons button.hard::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

[data-theme="lighter"] .mode-buttons button.hard:hover::before {
  left: 100%;
}

[data-theme="lighter"] .mode-buttons button.options {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.9), rgba(75, 85, 99, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(107, 114, 128, 1) !important;
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
  position: relative !important;
  overflow: hidden !important;
}

[data-theme="lighter"] .mode-buttons button.options::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

[data-theme="lighter"] .mode-buttons button.options:hover::before {
  left: 100%;
}

/* Additional button styles for other modes - Unique colors */
[data-theme="lighter"] .mode-buttons button[id*="flag"] {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(245, 158, 11, 1) !important;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="lighter"] .mode-buttons button[id*="blitz"] {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(239, 68, 68, 1) !important;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="lighter"] .mode-buttons button[id*="daily"] {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(79, 70, 229, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(99, 102, 241, 1) !important;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="lighter"] .mode-buttons button[id*="comparison"] {
  background: linear-gradient(135deg, rgba(120, 113, 108, 0.9), rgba(87, 83, 78, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(120, 113, 108, 1) !important;
  box-shadow: 0 6px 20px rgba(120, 113, 108, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="lighter"] .mode-buttons button[id*="leaderboard"] {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.9), rgba(245, 158, 11, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(251, 191, 36, 1) !important;
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Mobile button consistency for all themes */
@media (max-width: 768px) {
  [data-theme="original"] .mode-buttons button,
  [data-theme="liquid-glass"] .mode-buttons button,
  [data-theme="psychedelic"] .mode-buttons button {
    min-height: clamp(50px, 6vh, 70px) !important;
    height: auto !important;
    padding: clamp(10px, 2vh, 16px) clamp(12px, 3vw, 20px) !important;
    font-size: clamp(11px, 2.5vw, 14px) !important;
  }
  
  [data-theme="original"] .mode-buttons button span:first-child,
  [data-theme="liquid-glass"] .mode-buttons button span:first-child,
  [data-theme="psychedelic"] .mode-buttons button span:first-child {
    font-size: clamp(12px, 2.8vw, 16px) !important;
    margin-bottom: clamp(1px, 0.3vh, 4px) !important;
  }
  
  [data-theme="original"] .mode-buttons button .subtext,
  [data-theme="liquid-glass"] .mode-buttons button .subtext,
  [data-theme="psychedelic"] .mode-buttons button .subtext {
    font-size: clamp(9px, 2vw, 12px) !important;
  }
}

@media (max-width: 480px) {
  [data-theme="original"] .mode-buttons button,
  [data-theme="liquid-glass"] .mode-buttons button,
  [data-theme="psychedelic"] .mode-buttons button {
    min-height: clamp(45px, 5vh, 60px) !important;
    height: auto !important;
    padding: clamp(8px, 1.5vh, 12px) clamp(10px, 2.5vw, 16px) !important;
    font-size: clamp(10px, 3vw, 13px) !important;
  }
  
  [data-theme="original"] .mode-buttons button span:first-child,
  [data-theme="liquid-glass"] .mode-buttons button span:first-child,
  [data-theme="psychedelic"] .mode-buttons button span:first-child {
    font-size: clamp(11px, 3.2vw, 14px) !important;
    margin-bottom: clamp(1px, 0.2vh, 2px) !important;
  }
  
  [data-theme="original"] .mode-buttons button .subtext,
  [data-theme="liquid-glass"] .mode-buttons button .subtext,
  [data-theme="psychedelic"] .mode-buttons button .subtext {
    font-size: clamp(8px, 2.5vw, 11px) !important;
    line-height: 1.2 !important;
  }
}

@media (max-width: 360px) {
  [data-theme="original"] .mode-buttons button,
  [data-theme="liquid-glass"] .mode-buttons button,
  [data-theme="psychedelic"] .mode-buttons button {
    min-height: clamp(40px, 4.5vh, 55px) !important;
    height: auto !important;
    padding: clamp(6px, 1.2vh, 10px) clamp(8px, 2vw, 12px) !important;
    font-size: clamp(9px, 2.8vw, 12px) !important;
  }
  
  [data-theme="original"] .mode-buttons button span:first-child,
  [data-theme="liquid-glass"] .mode-buttons button span:first-child,
  [data-theme="psychedelic"] .mode-buttons button span:first-child {
    font-size: clamp(10px, 2.9vw, 13px) !important;
    margin-bottom: clamp(1px, 0.1vh, 2px) !important;
  }
  
  [data-theme="original"] .mode-buttons button .subtext,
  [data-theme="liquid-glass"] .mode-buttons button .subtext,
  [data-theme="psychedelic"] .mode-buttons button .subtext {
    font-size: clamp(7px, 2.2vw, 10px) !important;
    line-height: 1.2 !important;
  }
}


/* Mobile button consistency for lighter theme */
@media (max-width: 768px) {
  [data-theme="lighter"] .mode-buttons button {
    min-height: clamp(50px, 6vh, 70px) !important;
    height: auto !important;
    padding: clamp(10px, 2vh, 16px) clamp(12px, 3vw, 20px) !important;
    font-size: clamp(11px, 2.5vw, 14px) !important;
  }
  
  [data-theme="lighter"] .mode-buttons button span:first-child {
    font-size: clamp(12px, 2.8vw, 16px) !important;
    margin-bottom: clamp(1px, 0.3vh, 4px) !important;
  }
  
  [data-theme="lighter"] .mode-buttons button .subtext {
    font-size: clamp(9px, 2vw, 12px) !important;
  }
}

@media (max-width: 480px) {
  [data-theme="lighter"] .mode-buttons button {
    min-height: clamp(45px, 5vh, 60px) !important;
    height: auto !important;
    padding: clamp(8px, 1.5vh, 12px) clamp(10px, 2.5vw, 16px) !important;
    font-size: clamp(10px, 3vw, 13px) !important;
  }
  
  [data-theme="lighter"] .mode-buttons button span:first-child {
    font-size: clamp(11px, 3.2vw, 14px) !important;
    margin-bottom: clamp(1px, 0.2vh, 2px) !important;
  }
  
  [data-theme="lighter"] .mode-buttons button .subtext {
    font-size: clamp(8px, 2.5vw, 11px) !important;
    line-height: 1.2 !important;
  }
}

@media (max-width: 360px) {
  [data-theme="lighter"] .mode-buttons button {
    min-height: clamp(40px, 4.5vh, 55px) !important;
    height: auto !important;
    padding: clamp(6px, 1.2vh, 10px) clamp(8px, 2vw, 12px) !important;
    font-size: clamp(9px, 2.8vw, 12px) !important;
  }
  
  [data-theme="lighter"] .mode-buttons button span:first-child {
    font-size: clamp(10px, 2.9vw, 13px) !important;
    margin-bottom: clamp(1px, 0.1vh, 2px) !important;
  }
  
  [data-theme="lighter"] .mode-buttons button .subtext {
    font-size: clamp(7px, 2.2vw, 10px) !important;
    line-height: 1.2 !important;
  }
}

/* Apply button style to other buttons in lighter theme */
[data-theme="lighter"] button#next-country,
[data-theme="lighter"] button#mobile-next-country {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(22, 163, 74, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(34, 197, 94, 1) !important;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="lighter"] button#reset-game,
[data-theme="lighter"] button#mobile-reset-game {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(239, 68, 68, 1) !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="lighter"] button#submit-guess {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(59, 130, 246, 1) !important;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="lighter"] button#back-to-main {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.9), rgba(75, 85, 99, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(107, 114, 128, 1) !important;
  box-shadow: 0 4px 15px rgba(107, 114, 128, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="lighter"] button#test-voice {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.9), rgba(147, 51, 234, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(168, 85, 247, 1) !important;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="lighter"] button#results-main-menu {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(239, 68, 68, 1) !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="lighter"] button#results-play-again {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(22, 163, 74, 0.9)) !important;
  color: #ffffff !important;
  border: 2px solid rgba(34, 197, 94, 1) !important;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Results Modal Theme Application */
#results-modal {
  background: var(--theme-accent-bg) !important;
  backdrop-filter: var(--theme-blur, blur(14px) saturate(120%)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(14px) saturate(120%)) !important;
  color: var(--theme-text-primary) !important;
  border: 1px solid var(--theme-border) !important;
}

/* Game Info Panel Theme Application */
.game-info {
  background: var(--theme-accent-bg) !important;
  backdrop-filter: var(--theme-blur, blur(14px) saturate(120%)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(14px) saturate(120%)) !important;
  color: var(--theme-text-primary) !important;
  border: 1px solid var(--theme-border) !important;
}

/* Lighter Theme: Copy Silly Mode approach - NO positioning overrides, just colors */

  /* Daily Challenge Elements Theme Application */
  .daily-challenge-input {
    background: var(--theme-glass-bg) !important;
    backdrop-filter: var(--theme-blur, blur(10px)) !important;
    -webkit-backdrop-filter: var(--theme-blur, blur(10px)) !important;
  }
  
  .daily-guesses {
  background: var(--theme-glass-bg) !important;
  backdrop-filter: var(--theme-blur, blur(5px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(5px)) !important;
}

/* Mobile Daily Challenge Exit Button Theme Application */
.mobile-daily-exit-button {
  background: rgba(244, 67, 54, 0.3) !important;
  border: 1px solid rgba(244, 67, 54, 0.5) !important;
  color: var(--theme-text-primary) !important;
  backdrop-filter: var(--theme-blur, blur(10px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(10px)) !important;
}

.mobile-daily-exit-button:hover {
  background: rgba(244, 67, 54, 0.5) !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 25px rgba(244, 67, 54, 0.3) !important;
}

/* Streak Tab Theme Application */
.streak-tab {
  background: var(--theme-accent-bg) !important;
  backdrop-filter: var(--theme-blur, blur(10px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(10px)) !important;
  border: 1px solid var(--theme-border) !important;
  color: var(--theme-text-primary) !important;
}

/* Right Panel (Facts Panel) Theme Application */
.right-panel {
  background: var(--theme-accent-bg) !important;
  backdrop-filter: var(--theme-blur, blur(20px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(20px)) !important;
  border: 1px solid var(--theme-border) !important;
  box-shadow: var(--theme-shadow, 0 8px 32px 0 rgba(31, 38, 135, 0.37)) !important;
}

/* Facts Panel Content Theme Application */
.country-facts-scroll {
  color: var(--theme-text-primary) !important;
}

.fact-card {
  background: var(--theme-glass-bg, rgba(50, 50, 50, 0.25)) !important;
  border: 1px solid var(--theme-glass-border, rgba(255, 255, 255, 0.1)) !important;
  backdrop-filter: var(--theme-blur, blur(5px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(5px)) !important;
}

.fact-card:hover {
  background: var(--theme-button-hover, rgba(50, 50, 50, 0.3)) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
}

.fact-title {
  color: var(--theme-info, #6ea6ff) !important;
}

.fact-value {
  color: var(--theme-text-secondary, #ddd) !important;
}

.fact-group h4 {
  color: var(--theme-text-primary) !important;
  border-bottom: 1px solid var(--theme-border, #555) !important;
}

.fact-group p {
  color: var(--theme-text-secondary) !important;
}

/* Flag Container Theme Application */
.flag-container {
  background: var(--theme-glass-bg, rgba(255, 255, 255, 0.1)) !important;
  border: 1px solid var(--theme-glass-border, rgba(255, 255, 255, 0.2)) !important;
  backdrop-filter: var(--theme-blur, blur(10px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(10px)) !important;
}

.flag-container h3 {
  color: var(--theme-text-primary) !important;
}

/* Panel Toggle Button Theme Application */
.panel-toggle {
  background: var(--theme-button-bg) !important;
  border: 1px solid var(--theme-button-border) !important;
  color: var(--theme-text-primary) !important;
  backdrop-filter: var(--theme-blur, blur(10px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(10px)) !important;
}

.panel-toggle:hover {
  background: var(--theme-button-hover) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

/* Panel Handle Theme Application */
.panel-handle {
  background: var(--theme-border, #ccc) !important;
}

/* Loading Facts Theme Application */
.loading-fact {
  background: var(--theme-glass-bg, rgba(50, 50, 50, 0.3)) !important;
  border-radius: 8px !important;
}

/* Facts Panel Scrollbar Theme Application */
.country-facts-scroll::-webkit-scrollbar-thumb {
  background: var(--theme-border, rgba(255, 255, 255, 0.3)) !important;
}

.country-facts-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--theme-button-hover, rgba(255, 255, 255, 0.5)) !important;
}

/* Voice Selection Theme Application */


.voice-dropdown {
  background: var(--theme-button-bg) !important;
  border: 1px solid var(--theme-button-border) !important;
  color: var(--theme-text-primary) !important;
}

.test-voice-btn {
  background: var(--theme-button-bg) !important;
  border: 1px solid var(--theme-button-border) !important;
  color: var(--theme-text-primary) !important;
  backdrop-filter: var(--theme-blur, blur(10px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(10px)) !important;
}

.test-voice-btn:hover {
  background: var(--theme-button-hover) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
}

/* Back Button Theme Application */
.back-button {
  background: var(--theme-button-bg) !important;
  border: 1px solid var(--theme-button-border) !important;
  color: var(--theme-text-primary) !important;
  backdrop-filter: var(--theme-blur, blur(10px)) !important;
  -webkit-backdrop-filter: var(--theme-blur, blur(10px)) !important;
}

.back-button:hover {
  background: var(--theme-button-hover) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
}

/* ========================================
   THEME TRANSITION ANIMATIONS
   ======================================== */
* {
  transition: background-color 0.3s ease, 
              border-color 0.3s ease, 
              color 0.3s ease, 
              box-shadow 0.3s ease !important;
}

/* ========================================
   THEME SELECTION UI STYLES
   ======================================== */
.theme-selection {
  margin: 20px 0;
  padding: 20px;
  background: var(--theme-glass-bg, rgba(255, 255, 255, 0.1));
  border: 1px solid var(--theme-glass-border, rgba(255, 255, 255, 0.2));
  border-radius: 15px;
  backdrop-filter: var(--theme-blur, blur(10px));
  -webkit-backdrop-filter: var(--theme-blur, blur(10px));
}

.theme-title {
  color: var(--theme-text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 15px 0;
  text-align: center;
  font-family: 'Lexend', sans-serif;
}

.theme-options {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 10px;
  border-radius: 12px;
  background: var(--theme-button-bg);
  border: 1px solid var(--theme-button-border);
  transition: all 0.3s ease;
  min-width: 70px;
}

.theme-option:hover {
  background: var(--theme-button-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.theme-option.active {
  background: var(--theme-info);
  border-color: var(--theme-info);
  box-shadow: 0 4px 15px rgba(96, 165, 250, 0.4);
}

.theme-preview {
  width: 35px;
  height: 35px;
  border-radius: 8px;
  margin-bottom: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.theme-preview.original-theme {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(30, 30, 30, 0.25));
  border-color: rgba(255, 255, 255, 0.18);
}

.theme-preview.lighter-theme {
  background: linear-gradient(135deg, rgba(26, 115, 232, 0.95), rgba(0, 150, 136, 0.95));
  border-color: rgba(255, 255, 255, 0.2);
}

.theme-preview.psychedelic-theme {
  background: linear-gradient(45deg, #ff0080, #8000ff, #0080ff, #00ff80, #ff8000);
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 30px rgba(255, 0, 128, 0.5), 0 0 60px rgba(128, 0, 255, 0.3);
  position: relative;
  overflow: hidden;
  animation: psychedelicBackground 3s linear infinite;
}

.theme-preview.psychedelic-theme::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.3),
    rgba(255, 0, 128, 0.3),
    rgba(128, 0, 255, 0.3),
    rgba(0, 128, 255, 0.3),
    rgba(0, 255, 128, 0.3),
    rgba(255, 128, 0, 0.3),
    rgba(255, 255, 255, 0.3)
  );
  animation: psychedelicHueRotate 3s linear infinite;
  pointer-events: none;
}

.theme-option.active .theme-preview {
  border-color: var(--theme-text-primary);
  box-shadow: 0 0 0 2px var(--theme-info);
}

.theme-name {
  color: var(--theme-text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  font-family: 'Lexend', sans-serif;
}

/* ========================================
   MOBILE FACTS PANEL THEME APPLICATION
   ======================================== */
@media (max-width: 768px) {
  /* Mobile Right Panel Theme Application */
  .right-panel {
    background: var(--theme-secondary-bg, rgba(30, 30, 30, 0.25)) !important;
    backdrop-filter: var(--theme-blur, blur(20px)) !important;
    -webkit-backdrop-filter: var(--theme-blur, blur(20px)) !important;
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.18)) !important;
    box-shadow: var(--theme-shadow, 0 8px 32px 0 rgba(31, 38, 135, 0.37)) !important;
  }
  
  /* Mobile Facts Panel Expanded State */
  .right-panel.expanded {
    background: var(--theme-accent-bg) !important;
    backdrop-filter: var(--theme-blur, blur(25px)) !important;
    -webkit-backdrop-filter: var(--theme-blur, blur(25px)) !important;
  }
  
  /* Mobile Facts Panel Content */
  .right-panel .country-facts-scroll {
    color: var(--theme-text-primary) !important;
  }
  
  .right-panel .fact-group h4 {
    color: var(--theme-text-primary) !important;
    border-bottom: 1px solid var(--theme-border, #555) !important;
  }
  
  .right-panel .fact-group p {
    color: var(--theme-text-secondary) !important;
  }
  
  /* Mobile Flag Container */
  .right-panel .flag-container {
    background: var(--theme-glass-bg, rgba(255, 255, 255, 0.1)) !important;
    border: 1px solid var(--theme-glass-border, rgba(255, 255, 255, 0.2)) !important;
    backdrop-filter: var(--theme-blur, blur(10px)) !important;
    -webkit-backdrop-filter: var(--theme-blur, blur(10px)) !important;
  }
  
  .right-panel .flag-container h3 {
    color: var(--theme-text-primary) !important;
  }
}

/* ========================================
   RESPONSIVE THEME ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
  [data-theme="lighter"] {
    --theme-blur: blur(15px);
    --theme-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
  }
  
  .theme-options {
    gap: 10px;
  }
  
  .theme-option {
    min-width: 60px;
    padding: 8px;
  }
  
  .theme-preview {
    width: 30px;
    height: 30px;
  }
}

@media (min-width: 1440px) {
  [data-theme="lighter"] {
    --theme-blur: blur(25px);
    --theme-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
  }
  
  .theme-options {
    gap: 20px;
  }
  
  .theme-option {
    min-width: 80px;
    padding: 12px;
  }
  
  .theme-preview {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 600px) {
  .flag-mobile-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 8px;
  }
  
  .flag-stats-row{
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink: 0;
  }
  .flag-stats-row img{
    width:48vw;
    max-width:150px;
    height:auto;
  }
  
  /* Hide mobile neighbors hint in flag mode */
  .game-info.flag-mode #mobile-neighbors-hint {
    display: none !important;
  }
}





