/* Aspenini-Fun Theme System - Spacy & Performant */

/* Default Theme Variables (Deep Space - Purple) */
:root {
    --bg-primary: radial-gradient(ellipse at center, #1a1a2e 0%, #16213e 35%, #0f0f23 100%);
    --bg-secondary: linear-gradient(135deg, rgba(22, 33, 62, 0.3), rgba(15, 15, 35, 0.4));
    --bg-card: linear-gradient(135deg, rgba(26, 26, 46, 0.4), rgba(22, 33, 62, 0.3));
    --bg-stat: linear-gradient(135deg, rgba(26, 26, 46, 0.3), rgba(22, 33, 62, 0.2));
    
    --accent-primary: #8a77ff;
    --accent-secondary: #4c9aff;
    --accent-tertiary: #00d4ff;
    --accent-gradient: linear-gradient(45deg, #8a77ff, #4c9aff);
    --accent-gradient-hover: linear-gradient(45deg, #9d8aff, #5fa5ff);
    
    --text-primary: #e8e8ff;
    --text-secondary: #b8b8ff;
    --text-muted: rgba(184, 184, 255, 0.7);
    
    --border-color: rgba(138, 119, 255, 0.15);
    --border-color-hover: rgba(138, 119, 255, 0.3);
    
    --glow-color: rgba(138, 119, 255, 0.4);
    --glow-secondary: rgba(76, 154, 255, 0.3);
    
    --star-opacity: 0.6;
    --stars-bg: 
        radial-gradient(2px 2px at 20px 30px, #ffffff20, transparent),
        radial-gradient(2px 2px at 40px 70px, #ffffff15, transparent),
        radial-gradient(1px 1px at 90px 40px, #ffffff25, transparent),
        radial-gradient(1px 1px at 130px 80px, #ffffff20, transparent),
        radial-gradient(2px 2px at 160px 30px, #ffffff15, transparent);
}

/* Theme: Cosmic Blue */
[data-theme="cosmic-blue"] {
    --bg-primary: radial-gradient(ellipse at center, #0a1929 0%, #001e3c 35%, #000810 100%);
    --bg-secondary: linear-gradient(135deg, rgba(0, 30, 60, 0.3), rgba(0, 8, 16, 0.4));
    --bg-card: linear-gradient(135deg, rgba(10, 25, 41, 0.4), rgba(0, 30, 60, 0.3));
    --bg-stat: linear-gradient(135deg, rgba(10, 25, 41, 0.3), rgba(0, 30, 60, 0.2));
    
    --accent-primary: #00b4ff;
    --accent-secondary: #0091ea;
    --accent-tertiary: #00e5ff;
    --accent-gradient: linear-gradient(45deg, #00b4ff, #0091ea);
    --accent-gradient-hover: linear-gradient(45deg, #33c4ff, #00a8ff);
    
    --text-primary: #e3f2fd;
    --text-secondary: #b3e5fc;
    --text-muted: rgba(179, 229, 252, 0.7);
    
    --border-color: rgba(0, 180, 255, 0.15);
    --border-color-hover: rgba(0, 180, 255, 0.3);
    
    --glow-color: rgba(0, 180, 255, 0.4);
    --glow-secondary: rgba(0, 145, 234, 0.3);
}

/* Theme: Aurora Green */
[data-theme="aurora-green"] {
    --bg-primary: radial-gradient(ellipse at center, #0d1f1a 0%, #0a1812 35%, #050b09 100%);
    --bg-secondary: linear-gradient(135deg, rgba(10, 24, 18, 0.3), rgba(5, 11, 9, 0.4));
    --bg-card: linear-gradient(135deg, rgba(13, 31, 26, 0.4), rgba(10, 24, 18, 0.3));
    --bg-stat: linear-gradient(135deg, rgba(13, 31, 26, 0.3), rgba(10, 24, 18, 0.2));
    
    --accent-primary: #00ff88;
    --accent-secondary: #00cc6f;
    --accent-tertiary: #00ffaa;
    --accent-gradient: linear-gradient(45deg, #00ff88, #00cc6f);
    --accent-gradient-hover: linear-gradient(45deg, #33ff99, #00dd7f);
    
    --text-primary: #e0fff4;
    --text-secondary: #b3ffe0;
    --text-muted: rgba(179, 255, 224, 0.7);
    
    --border-color: rgba(0, 255, 136, 0.15);
    --border-color-hover: rgba(0, 255, 136, 0.3);
    
    --glow-color: rgba(0, 255, 136, 0.4);
    --glow-secondary: rgba(0, 204, 111, 0.3);
}

/* Theme: Solar Red */
[data-theme="solar-red"] {
    --bg-primary: radial-gradient(ellipse at center, #2a0f0f 0%, #1f0a0a 35%, #0f0505 100%);
    --bg-secondary: linear-gradient(135deg, rgba(31, 10, 10, 0.3), rgba(15, 5, 5, 0.4));
    --bg-card: linear-gradient(135deg, rgba(42, 15, 15, 0.4), rgba(31, 10, 10, 0.3));
    --bg-stat: linear-gradient(135deg, rgba(42, 15, 15, 0.3), rgba(31, 10, 10, 0.2));
    
    --accent-primary: #ff4444;
    --accent-secondary: #ff6b6b;
    --accent-tertiary: #ff8888;
    --accent-gradient: linear-gradient(45deg, #ff4444, #ff6b6b);
    --accent-gradient-hover: linear-gradient(45deg, #ff5555, #ff7c7c);
    
    --text-primary: #ffe0e0;
    --text-secondary: #ffb3b3;
    --text-muted: rgba(255, 179, 179, 0.7);
    
    --border-color: rgba(255, 68, 68, 0.15);
    --border-color-hover: rgba(255, 68, 68, 0.3);
    
    --glow-color: rgba(255, 68, 68, 0.4);
    --glow-secondary: rgba(255, 107, 107, 0.3);
}

/* Theme: Nebula Pink */
[data-theme="nebula-pink"] {
    --bg-primary: radial-gradient(ellipse at center, #2a1a2e 0%, #1f1428 35%, #0f0a14 100%);
    --bg-secondary: linear-gradient(135deg, rgba(31, 20, 40, 0.3), rgba(15, 10, 20, 0.4));
    --bg-card: linear-gradient(135deg, rgba(42, 26, 46, 0.4), rgba(31, 20, 40, 0.3));
    --bg-stat: linear-gradient(135deg, rgba(42, 26, 46, 0.3), rgba(31, 20, 40, 0.2));
    
    --accent-primary: #ff6ec7;
    --accent-secondary: #ff49b3;
    --accent-tertiary: #ff8cd6;
    --accent-gradient: linear-gradient(45deg, #ff6ec7, #ff49b3);
    --accent-gradient-hover: linear-gradient(45deg, #ff7fce, #ff5abb);
    
    --text-primary: #ffe3f7;
    --text-secondary: #ffb3e6;
    --text-muted: rgba(255, 179, 230, 0.7);
    
    --border-color: rgba(255, 110, 199, 0.15);
    --border-color-hover: rgba(255, 110, 199, 0.3);
    
    --glow-color: rgba(255, 110, 199, 0.4);
    --glow-secondary: rgba(255, 73, 179, 0.3);
}

/* Theme: Midnight Cyan */
[data-theme="midnight-cyan"] {
    --bg-primary: radial-gradient(ellipse at center, #0a1a1f 0%, #061115 35%, #030809 100%);
    --bg-secondary: linear-gradient(135deg, rgba(6, 17, 21, 0.3), rgba(3, 8, 9, 0.4));
    --bg-card: linear-gradient(135deg, rgba(10, 26, 31, 0.4), rgba(6, 17, 21, 0.3));
    --bg-stat: linear-gradient(135deg, rgba(10, 26, 31, 0.3), rgba(6, 17, 21, 0.2));
    
    --accent-primary: #00d4d4;
    --accent-secondary: #00b3b3;
    --accent-tertiary: #00e5e5;
    --accent-gradient: linear-gradient(45deg, #00d4d4, #00b3b3);
    --accent-gradient-hover: linear-gradient(45deg, #00e0e0, #00c4c4);
    
    --text-primary: #e0ffff;
    --text-secondary: #b3f5f5;
    --text-muted: rgba(179, 245, 245, 0.7);
    
    --border-color: rgba(0, 212, 212, 0.15);
    --border-color-hover: rgba(0, 212, 212, 0.3);
    
    --glow-color: rgba(0, 212, 212, 0.4);
    --glow-secondary: rgba(0, 179, 179, 0.3);
}

/* Theme: Dark Matter */
[data-theme="dark-matter"] {
    --bg-primary: radial-gradient(ellipse at center, #1a1a1a 0%, #0f0f0f 35%, #050505 100%);
    --bg-secondary: linear-gradient(135deg, rgba(15, 15, 15, 0.3), rgba(5, 5, 5, 0.4));
    --bg-card: linear-gradient(135deg, rgba(26, 26, 26, 0.4), rgba(15, 15, 15, 0.3));
    --bg-stat: linear-gradient(135deg, rgba(26, 26, 26, 0.3), rgba(15, 15, 15, 0.2));
    
    --accent-primary: #ffffff;
    --accent-secondary: #dddddd;
    --accent-tertiary: #f5f5f5;
    --accent-gradient: linear-gradient(45deg, #ffffff, #dddddd);
    --accent-gradient-hover: linear-gradient(45deg, #ffffff, #eeeeee);
    
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: rgba(204, 204, 204, 0.7);
    
    --border-color: rgba(255, 255, 255, 0.15);
    --border-color-hover: rgba(255, 255, 255, 0.3);
    
    --glow-color: rgba(255, 255, 255, 0.4);
    --glow-secondary: rgba(221, 221, 221, 0.3);
}

/* Apply theme variables to elements */
body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

body::before {
    background-image: var(--stars-bg);
    opacity: var(--star-opacity);
}

.hero {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: 0 8px 32px var(--glow-secondary);
}

.game-card, .stat-card, .no-games {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.game-card:hover {
    border-color: var(--border-color-hover);
    box-shadow: 0 15px 35px var(--glow-color), 0 5px 15px var(--glow-secondary);
}

.logo {
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary), var(--accent-primary));
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px var(--glow-color);
    filter: drop-shadow(0 0 20px var(--glow-secondary));
}

.section-title {
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 25px var(--glow-color);
}

.play-button, .account-btn {
    background: var(--accent-gradient);
    box-shadow: 0 4px 15px var(--glow-color);
}

.play-button:hover, .account-btn:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 8px 25px var(--glow-color), 0 4px 10px var(--glow-secondary);
}

.account-button, .theme-button {
    background: rgba(138, 119, 255, 0.1);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.account-button:hover, .theme-button:hover {
    background: rgba(138, 119, 255, 0.2);
    border-color: var(--border-color-hover);
}

.stat-number {
    color: var(--accent-primary);
    text-shadow: 0 0 15px var(--glow-color);
}

.tagline, .stat-label, .game-description {
    color: var(--text-secondary);
}

.footer {
    border-top-color: var(--border-color);
    color: var(--text-secondary);
}

/* Theme button and controls */
.hero-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.theme-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(138, 119, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    transform: translateZ(0);
}

.theme-button:hover {
    background: rgba(138, 119, 255, 0.2);
    border-color: var(--border-color-hover);
    transform: translateY(-1px) translateZ(0);
}

/* Theme Panel */
.theme-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 15, 35, 0.9);
    backdrop-filter: blur(10px);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow: auto;
}

.theme-panel.active {
    opacity: 1;
    visibility: visible;
}

.theme-panel-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color-hover);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 60px var(--glow-color);
    display: flex;
    flex-direction: column;
}

.theme-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(138, 119, 255, 0.1);
}

.theme-header h3 {
    font-family: 'Orbitron', monospace;
    color: var(--accent-primary);
    margin: 0;
    text-shadow: 0 0 10px var(--glow-color);
}

.theme-body {
    padding: 30px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

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

.theme-option {
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-stat);
    position: relative;
    overflow: hidden;
}

.theme-option:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--glow-color);
}

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

.theme-option.active::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

.theme-preview {
    width: 100%;
    height: 60px;
    border-radius: 10px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.theme-name {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Theme change animation */
@keyframes themeFlash {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Responsive theme panel */
@media (max-width: 768px) {
    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-controls {
        top: 15px;
        right: 15px;
        gap: 8px;
    }
    
    .theme-button {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .theme-grid {
        grid-template-columns: 1fr;
    }
}

