/* Wavelength Radio Player Styles */

/* Prevent horizontal scrolling on mobile */
html {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

.radio-player-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: cosmicGradient 20s ease infinite;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    font-family: 'AnimeAce', Arial, sans-serif;
}

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

.radio-container {
    position: relative;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Mystical Canvas - where floating imagery appears */
.mystical-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Background Gallery - Episode images displayed transparently */
.background-gallery {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
}

.background-gallery.active {
    opacity: 1;
}

.background-gallery-image {
    position: absolute;
    object-fit: cover;
    opacity: 0.08;
    transition: all 8s ease-in-out;
    filter: blur(2px);
    animation: drift 30s ease-in-out infinite;
}

@keyframes drift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(20px, -20px) scale(1.05);
    }
    50% {
        transform: translate(-15px, 15px) scale(0.98);
    }
    75% {
        transform: translate(10px, -10px) scale(1.02);
    }
}

/* Floating mystical elements */
.mystical-element {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    animation: float 6s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.6));
}

.mystical-element:hover {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.9));
}

.mystical-element.mushroom {
    font-size: 3rem;
    animation: float 6s ease-in-out infinite, glow 2s ease-in-out infinite;
}

.mystical-element.star {
    font-size: 2.5rem;
    animation: float 5s ease-in-out infinite, twinkle 1.5s ease-in-out infinite, spin 8s linear infinite;
}

.mystical-element.horseshoe {
    font-size: 2.5rem;
    animation: float 7s ease-in-out infinite, spin 10s linear infinite, neonGreenPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px #00ff00)
            drop-shadow(0 0 15px #39ff14)
            brightness(0) saturate(100%) invert(100%) sepia(100%) saturate(10000%) hue-rotate(90deg);
    text-shadow: 0 0 10px #00ff00,
                 0 0 20px #39ff14;
    background: radial-gradient(circle, rgba(0, 255, 0, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    padding: 10px;
}

.mystical-element.horseshoe:hover {
    filter: drop-shadow(0 0 12px #00ff00)
            drop-shadow(0 0 20px #39ff14)
            brightness(0) saturate(100%) invert(100%) sepia(100%) saturate(10000%) hue-rotate(90deg);
    text-shadow: 0 0 15px #00ff00,
                 0 0 25px #39ff14;
    transform: scale(1.3) rotate(15deg);
}

@keyframes neonGreenPulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px #00ff00)
                drop-shadow(0 0 15px #39ff14)
                brightness(0) saturate(100%) invert(100%) sepia(100%) saturate(10000%) hue-rotate(90deg);
    }
    50% {
        filter: drop-shadow(0 0 12px #00ff00)
                drop-shadow(0 0 20px #39ff14)
                brightness(0) saturate(100%) invert(100%) sepia(100%) saturate(10000%) hue-rotate(90deg);
    }
}

.mystical-element.sparkle {
    font-size: 2rem;
    animation: float 5s ease-in-out infinite, twinkle 1.5s ease-in-out infinite;
}

.mystical-element.crystal {
    font-size: 2.3rem;
    animation: float 6s ease-in-out infinite, pulse 2s ease-in-out infinite;
}

.mystical-element.moon {
    font-size: 2.8rem;
    animation: float 8s ease-in-out infinite, glow 3s ease-in-out infinite;
}

.mystical-element.goblin {
    font-size: 3.5rem;
    animation: float 5s ease-in-out infinite, pulse 1s ease-in-out infinite, spin 6s linear infinite;
    filter: drop-shadow(0 0 15px rgba(255, 69, 0, 0.8));
}

.mystical-element.goblin:hover {
    filter: drop-shadow(0 0 30px rgba(255, 0, 0, 1));
    transform: scale(1.4) rotate(5deg);
}

.mystical-element.character {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    animation: float 8s ease-in-out infinite, pulse 3s ease-in-out infinite;
}

/* Floating animations */
@keyframes float {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    25% { transform: translateY(-20px) translateX(10px); }
    50% { transform: translateY(-40px) translateX(-10px); }
    75% { transform: translateY(-20px) translateX(5px); }
}

@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(147, 51, 234, 0.6)); }
    50% { filter: drop-shadow(0 0 25px rgba(236, 72, 153, 0.9)); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

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

/* Appearing animation */
@keyframes appearFade {
    0% { opacity: 0; transform: scale(0.5) translateY(50px); }
    10% { opacity: 1; transform: scale(1) translateY(0); }
    90% { opacity: 1; transform: scale(1) translateY(0); }
    100% { opacity: 0; transform: scale(0.5) translateY(-50px); }
}

.mystical-element.appearing {
    animation: appearFade 8s ease-in-out forwards;
}

/* Collected animation */
@keyframes collect {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5) rotate(180deg); opacity: 0.8; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

.mystical-element.collecting {
    animation: collect 0.6s ease-out forwards;
    pointer-events: none;
}

/* Radio Player Card */
.radio-player {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.player-header {
    text-align: center;
    margin-bottom: 30px;
}

.radio-title {
    font-size: 2.5rem;
    margin: 0;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.radio-subtitle {
    font-size: 1rem;
    color: #666;
    margin: 10px 0 0 0;
}

/* Album Art */
.album-art-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.album-art {
    position: relative;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
    transition: transform 0.3s ease;
}

.album-art.playing {
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.vinyl-record {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, #333 30%, #111 70%);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.album-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.album-art.playing .album-glow {
    opacity: 1;
    animation: glow-pulse 2s ease-in-out infinite;
}

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

/* Now Playing */
.now-playing {
    margin: 30px 0;
}

.track-info {
    text-align: center;
    margin-bottom: 20px;
}

.track-info h2 {
    font-size: 1.5rem;
    margin: 0 0 10px 0;
    color: #333;
}

.track-info p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.progress-bar {
    position: relative;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    cursor: pointer;
    overflow: visible;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #667eea;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.6);
    left: 0%;
    transition: left 0.1s linear;
    cursor: grab;
}

.progress-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
}

.control-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #667eea;
}

.control-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.control-btn:active {
    transform: scale(0.95);
}

.play-btn {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
}

.play-btn:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: scale(1.15);
}

.control-btn.active {
    background: #667eea;
    color: white;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.volume-icon {
    font-size: 1.5rem;
}

.volume-slider {
    width: 150px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.6);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.6);
    border: none;
}

#volumeValue {
    font-size: 0.9rem;
    color: #666;
    min-width: 40px;
}

/* Sound Toggle Button */
.sound-toggle-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid #667eea;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

.sound-toggle-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.1);
}

.sound-toggle-btn:active {
    transform: scale(0.95);
}

/* Playlist Mode Selector */
.playlist-mode {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.mode-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-family: 'AnimeAce', Arial, sans-serif;
}

.mode-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.mode-btn.active {
    background: #667eea;
    color: white;
}

/* Playlist Panel */
.playlist-panel {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    max-height: 500px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.playlist-header {
    margin-bottom: 20px;
}

.playlist-header h3 {
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    color: #333;
}

.playlist-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    font-family: 'AnimeAce', Arial, sans-serif;
}

.filter-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.filter-btn.active {
    background: #667eea;
    color: white;
}

.playlist-items {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 10px;
}

.playlist-items::-webkit-scrollbar {
    width: 8px;
}

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

.playlist-items::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.playlist-item:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateX(5px);
}

.playlist-item.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border-left: 4px solid #667eea;
}

.playlist-item.hidden {
    display: none;
}

.playlist-item-number {
    font-size: 0.9rem;
    color: #999;
    min-width: 30px;
    text-align: center;
}

.playlist-item.active .playlist-item-number {
    color: #667eea;
    font-weight: bold;
}

.playlist-item-info {
    flex: 1;
}

.playlist-item-title {
    font-size: 1rem;
    color: #333;
    margin-bottom: 4px;
}

.playlist-item-meta {
    font-size: 0.8rem;
    color: #666;
}

.playlist-item-duration {
    font-size: 0.9rem;
    color: #999;
}

.playlist-item-favorite {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ccc;
}

.playlist-item-favorite:hover {
    color: #e74c3c;
    transform: scale(1.2);
}

.playlist-item-favorite.favorited {
    color: #e74c3c;
}

/* Game Stats - Now at the top */
.game-stats {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 15px 30px;
    width: 90%;
    max-width: 800px;
    display: flex;
    justify-content: space-around;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.stat-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Neon green horseshoe in scoreboard */
.game-stats .stat-item:nth-child(3) .stat-icon {
    filter: drop-shadow(0 0 6px #00ff00)
            drop-shadow(0 0 12px #39ff14)
            brightness(0) saturate(100%) invert(100%) sepia(100%) saturate(10000%) hue-rotate(90deg) !important;
    animation: neonGreenPulse 2s ease-in-out infinite !important;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 30px;
    text-align: center;
}

.stat-item.magic-level {
    padding-left: 20px;
    border-left: 2px solid rgba(102, 126, 234, 0.3);
    margin-left: 10px;
}

.stat-item.magic-level .stat-value {
    font-size: 1.8rem;
}

.stat-item.total-points {
    padding-left: 20px;
    border-left: 2px solid rgba(255, 215, 0, 0.5);
    margin-left: 10px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.15));
    padding: 8px 16px;
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    min-width: 140px; /* Prevent truncation */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-item.total-points .stat-label {
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    white-space: nowrap;
    font-size: 0.85rem;
}

.stat-item.total-points .stat-value {
    font-size: 1.6rem;
    font-weight: bold;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    white-space: nowrap;
    overflow: visible;
    min-width: fit-content;
}

.stat-item.rare-item {
    background: linear-gradient(135deg, rgba(255, 69, 0, 0.1), rgba(255, 0, 0, 0.1));
    padding: 8px 12px;
    border-radius: 15px;
    border: 2px solid rgba(255, 69, 0, 0.3);
    box-shadow: 0 0 10px rgba(255, 69, 0, 0.2);
}

.stat-item.rare-item .stat-icon {
    animation: pulse 2s ease-in-out infinite;
}

.stat-item.rare-item .stat-value {
    background: linear-gradient(135deg, #ff4500, #ff0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Episode Info Section */
.episode-info-section {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.character-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.character-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    object-fit: cover;
}

.character-badge:hover {
    transform: scale(1.2) rotate(5deg);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    border-color: #764ba2;
}

.episode-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.episode-action-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white !important;
    text-decoration: none;
    border-radius: 20px;
    font-family: 'AnimeAce', Arial, sans-serif;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    display: inline-block;
}

.episode-action-btn:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Hide mobile expand button on desktop - MUST come before mobile media query */
.mobile-expand-btn {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Maximize game canvas space on mobile */
    .radio-container {
        padding: 5px;
        gap: 5px;
    }

    /* Make radio player compact and stick to bottom */
    .radio-player {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        padding: 10px;
        margin: 0;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
        z-index: 100;
        max-height: 30vh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        transition: max-height 0.3s ease;
    }

    /* Expanded state for mobile player */
    .radio-player.expanded {
        max-height: 85vh;
        overflow-y: scroll;
    }

    /* Mobile expand button - Make it very visible */
    .mobile-expand-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: calc(100% - 20px);
        max-width: 200px;
        height: 40px;
        margin: 0 auto 15px;
        padding: 8px 16px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 25px;
        font-size: 0.85rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        cursor: pointer;
        box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
        transition: all 0.3s ease;
        z-index: 102;
    }

    .mobile-expand-btn::before {
        content: '⬆️ Expand Player';
    }

    .mobile-expand-btn:active {
        transform: scale(0.98);
    }

    .radio-player.expanded .mobile-expand-btn {
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
        box-shadow: 0 6px 25px rgba(245, 87, 108, 0.5);
    }

    .radio-player.expanded .mobile-expand-btn::before {
        content: '⬇️ Collapse Player';
    }

    /* Show hidden elements when expanded */
    .radio-player.expanded .playlist-panel {
        display: block !important;
    }

    .radio-player.expanded .volume-control {
        display: flex !important;
    }

    .radio-player.expanded .playlist-mode {
        display: flex !important;
    }

    .radio-title {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }

    /* Hide album art on mobile to save space */
    .album-art {
        display: none;
    }

    /* Make controls more compact */
    .controls {
        gap: 8px;
        margin: 5px 0;
    }

    .control-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    /* Hide mode selector on mobile - too much space */
    .playlist-mode {
        display: none;
    }

    /* Hide full playlist on mobile - show only current track */
    .playlist-panel {
        display: none;
    }

    /* Hide volume control to save space */
    .volume-control {
        display: none;
    }

    /* Show current track info compactly */
    .track-info {
        font-size: 0.85rem;
        padding: 5px;
        max-height: 40px;
        overflow: hidden;
    }

    .progress-bar-container {
        margin: 5px 0;
    }

    /* Compact game stats at top of screen */
    .game-stats {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        padding: 8px 5px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        z-index: 100;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 5px;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .stat-item {
        flex: 0 0 auto;
        min-width: 45px;
        padding: 4px 6px;
        font-size: 0.75rem;
    }

    .stat-icon {
        font-size: 1.3rem;
    }

    .stat-value {
        font-size: 0.9rem;
    }

    /* Adjust total points on mobile */
    .stat-item.total-points {
        min-width: 110px;
        padding: 6px 10px;
    }

    .stat-item.total-points .stat-label {
        font-size: 0.7rem;
    }

    .stat-item.total-points .stat-value {
        font-size: 1.3rem;
    }

    /* Hide magic level stat on mobile to save space */
    .stat-item.magic-level {
        display: none;
    }

    /* Make collectibles MUCH larger and easier to tap on mobile */
    .mystical-element {
        font-size: 4rem !important;
        min-width: 80px;
        min-height: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        touch-action: manipulation;
    }

    /* Increase tap target size for better mobile usability */
    .mystical-element::before {
        content: '';
        position: absolute;
        top: -15px;
        left: -15px;
        right: -15px;
        bottom: -15px;
        z-index: -1;
    }

    /* Hide background gallery on mobile to reduce visual clutter */
    .background-gallery {
        opacity: 0.3 !important;
    }

    /* Reduce playlist item height on mobile */
    .playlist-item {
        padding: 12px;
        font-size: 0.85rem;
    }

    .playlist-item-title {
        font-size: 0.9rem;
    }

    /* Stack volume control vertically on very small screens */
    .volume-control {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Hide episode info section on mobile to maximize game space */
    .episode-info-section {
        display: none;
    }

    /* Add padding to bottom of canvas so collectibles don't hide behind player */
    .mystical-canvas {
        padding-bottom: 35vh;
        padding-top: 120px;
    }

    /* Add padding to body for fixed elements */
    .radio-player-body {
        padding-top: 120px;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   SCREEN SAVER MODE
   =================================== */

.screensaver-toggle-container {
    margin: 20px 0 10px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
}

.screensaver-toggle-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.screensaver-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    border-color: rgba(255, 255, 255, 0.5);
}

.screensaver-toggle-btn:active {
    transform: translateY(0);
}

/* Screen Saver Overlay */
.screensaver-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    overflow: hidden;
}

.screensaver-overlay.active {
    display: block;
    opacity: 1;
}

/* Screen Saver Gallery */
.screensaver-gallery {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Fog Effects Overlay - Balanced Version */
.screensaver-gallery::before,
.screensaver-gallery::after {
    content: '';
    position: absolute;
    width: 220%;
    height: 220%;
    top: -60%;
    left: -60%;
    z-index: 10;
    pointer-events: none;
}

.screensaver-gallery::before {
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.08) 30%, transparent 60%),
        radial-gradient(circle at 80% 70%, rgba(200, 220, 255, 0.2) 0%, rgba(180, 210, 255, 0.06) 28%, transparent 55%),
        radial-gradient(circle at 40% 80%, rgba(255, 240, 255, 0.18) 0%, rgba(240, 220, 250, 0.05) 32%, transparent 58%),
        radial-gradient(circle at 60% 20%, rgba(230, 255, 250, 0.21) 0%, rgba(210, 245, 240, 0.07) 30%, transparent 62%);
    animation: fogDrift1 55s ease-in-out infinite;
    opacity: 0.5;
    filter: blur(40px);
}

.screensaver-gallery::after {
    background: 
        radial-gradient(circle at 70% 40%, rgba(255, 255, 255, 0.2) 0%, rgba(245, 245, 255, 0.07) 28%, transparent 58%),
        radial-gradient(circle at 30% 60%, rgba(210, 230, 255, 0.23) 0%, rgba(190, 220, 250, 0.08) 30%, transparent 62%),
        radial-gradient(circle at 50% 90%, rgba(255, 250, 240, 0.19) 0%, rgba(240, 235, 230, 0.06) 32%, transparent 60%),
        radial-gradient(circle at 90% 10%, rgba(240, 255, 255, 0.21) 0%, rgba(220, 245, 250, 0.07) 29%, transparent 56%);
    animation: fogDrift2 75s ease-in-out infinite reverse;
    opacity: 0.45;
    filter: blur(35px);
}

@keyframes fogDrift1 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.5;
    }
    25% {
        transform: translate(-12%, 6%) rotate(6deg) scale(1.05);
        opacity: 0.6;
    }
    50% {
        transform: translate(8%, -10%) rotate(-5deg) scale(0.97);
        opacity: 0.4;
    }
    75% {
        transform: translate(-6%, 8%) rotate(5deg) scale(1.03);
        opacity: 0.55;
    }
}

@keyframes fogDrift2 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.45;
    }
    25% {
        transform: translate(10%, -8%) rotate(-6deg) scale(1.04);
        opacity: 0.55;
    }
    50% {
        transform: translate(-11%, 7%) rotate(7deg) scale(0.96);
        opacity: 0.35;
    }
    75% {
        transform: translate(7%, -9%) rotate(-5deg) scale(1.03);
        opacity: 0.5;
    }
}

.screensaver-gallery img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 3s ease-in-out, transform 3s ease-in-out;
    animation: warpFilterNoTransform 45s ease-in-out infinite;
}

/* Exit hint styling */

.screensaver-gallery img.active {
    opacity: 1;
    z-index: 2;
}

.screensaver-gallery img.fading-out {
    opacity: 0;
    z-index: 1;
}

/* Transition Effects - Can coexist with filter animation */

/* Disable animation when user turns it off */
.screensaver-gallery img.no-animation {
    animation: none !important;
}

.screensaver-gallery img.transition-fade {
    transition: opacity 3s ease-in-out, transform 3s ease-in-out !important;
}

/* Slide Left: Current slides left, Next enters from right */
.screensaver-gallery img.transition-slide-left {
    transition: opacity 2.5s ease-in-out, transform 2.5s ease-in-out !important;
}

.screensaver-gallery img.transition-slide-left:not(.active):not(.fading-out) {
    transform: translateX(100%);
}

.screensaver-gallery img.transition-slide-left.active {
    transform: translateX(0) !important;
}

.screensaver-gallery img.transition-slide-left.fading-out {
    transform: translateX(-100%) !important;
}

/* Slide Right: Current slides right, Next enters from left */
.screensaver-gallery img.transition-slide-right {
    transition: opacity 2.5s ease-in-out, transform 2.5s ease-in-out;
}

.screensaver-gallery img.transition-slide-right:not(.active):not(.fading-out) {
    transform: translateX(-100%);
}

.screensaver-gallery img.transition-slide-right.active {
    transform: translateX(0) !important;
}

.screensaver-gallery img.transition-slide-right.fading-out {
    transform: translateX(100%) !important;
}

/* Slide Up: Current slides up, Next enters from bottom */
.screensaver-gallery img.transition-slide-up {
    transition: opacity 2.5s ease-in-out, transform 2.5s ease-in-out;
}

.screensaver-gallery img.transition-slide-up:not(.active):not(.fading-out) {
    transform: translateY(100%);
}

.screensaver-gallery img.transition-slide-up.active {
    transform: translateY(0) !important;
}

.screensaver-gallery img.transition-slide-up.fading-out {
    transform: translateY(-100%) !important;
}

/* Slide Down: Current slides down, Next enters from top */
.screensaver-gallery img.transition-slide-down {
    transition: opacity 2.5s ease-in-out, transform 2.5s ease-in-out;
}

.screensaver-gallery img.transition-slide-down:not(.active):not(.fading-out) {
    transform: translateY(-100%);
}

.screensaver-gallery img.transition-slide-down.active {
    transform: translateY(0) !important;
}

.screensaver-gallery img.transition-slide-down.fading-out {
    transform: translateY(100%) !important;
}

/* Zoom In: Next zooms in from small */
.screensaver-gallery img.transition-zoom-in {
    transition: opacity 3s ease-in-out, transform 3s ease-in-out;
}

.screensaver-gallery img.transition-zoom-in:not(.active):not(.fading-out) {
    transform: scale(0.5);
}

.screensaver-gallery img.transition-zoom-in.active {
    transform: scale(1) !important;
}

.screensaver-gallery img.transition-zoom-in.fading-out {
    transform: scale(1.5) !important;
}

/* Zoom Out: Next zooms out from large */
.screensaver-gallery img.transition-zoom-out {
    transition: opacity 3s ease-in-out, transform 3s ease-in-out;
}

.screensaver-gallery img.transition-zoom-out:not(.active):not(.fading-out) {
    transform: scale(1.5);
}

.screensaver-gallery img.transition-zoom-out.active {
    transform: scale(1) !important;
}

.screensaver-gallery img.transition-zoom-out.fading-out {
    transform: scale(0.5) !important;
}

/* Rotate Left */
.screensaver-gallery img.transition-rotate-left {
    transition: opacity 2.5s ease-in-out, transform 2.5s ease-in-out;
}

.screensaver-gallery img.transition-rotate-left:not(.active):not(.fading-out) {
    transform: rotate(90deg) scale(0.5);
}

.screensaver-gallery img.transition-rotate-left.active {
    transform: rotate(0deg) scale(1) !important;
}

.screensaver-gallery img.transition-rotate-left.fading-out {
    transform: rotate(-90deg) scale(0.5) !important;
}

/* Rotate Right */
.screensaver-gallery img.transition-rotate-right {
    transition: opacity 2.5s ease-in-out, transform 2.5s ease-in-out;
}

.screensaver-gallery img.transition-rotate-right:not(.active):not(.fading-out) {
    transform: rotate(-90deg) scale(0.5);
}

.screensaver-gallery img.transition-rotate-right.active {
    transform: rotate(0deg) scale(1) !important;
}

.screensaver-gallery img.transition-rotate-right.fading-out {
    transform: rotate(90deg) scale(0.5) !important;
}

/* Blur transition */
.screensaver-gallery img.transition-blur {
    transition: opacity 2.5s ease-in-out, filter 2.5s ease-in-out;
}

.screensaver-gallery img.transition-blur:not(.active):not(.fading-out) {
    filter: blur(20px);
}

.screensaver-gallery img.transition-blur.active {
    filter: blur(0px) !important;
}

.screensaver-gallery img.transition-blur.fading-out {
    filter: blur(20px) !important;
}

/* Diagonal Top-Left */
.screensaver-gallery img.transition-diagonal-tl {
    transition: opacity 2.5s ease-in-out, transform 2.5s ease-in-out;
}

.screensaver-gallery img.transition-diagonal-tl:not(.active):not(.fading-out) {
    transform: translate(100%, 100%);
}

.screensaver-gallery img.transition-diagonal-tl.active {
    transform: translate(0, 0) !important;
}

.screensaver-gallery img.transition-diagonal-tl.fading-out {
    transform: translate(-100%, -100%) !important;
}

/* Diagonal Bottom-Right */
.screensaver-gallery img.transition-diagonal-br {
    transition: opacity 2.5s ease-in-out, transform 2.5s ease-in-out;
}

.screensaver-gallery img.transition-diagonal-br:not(.active):not(.fading-out) {
    transform: translate(-100%, -100%);
}

.screensaver-gallery img.transition-diagonal-br.active {
    transform: translate(0, 0) !important;
}

.screensaver-gallery img.transition-diagonal-br.fading-out {
    transform: translate(100%, 100%) !important;
}

/* Warping CSS Filter Animation - Very slow, gentle zooms for image quality */
@keyframes warpFilter {
    0% {
        filter: hue-rotate(0deg) saturate(1) brightness(1) contrast(1);
        transform: scale(1) rotate(0deg);
    }
    12.5% {
        filter: hue-rotate(45deg) saturate(1.3) brightness(1.1) contrast(1.1);
        transform: scale(1.08) rotate(2deg);
    }
    25% {
        filter: hue-rotate(90deg) saturate(1.6) brightness(1.2) contrast(1.2);
        transform: scale(1.15) rotate(-2deg);
    }
    37.5% {
        filter: hue-rotate(135deg) saturate(1.8) brightness(1.15) contrast(1.3);
        transform: scale(1.2) rotate(3deg);
    }
    50% {
        filter: hue-rotate(180deg) saturate(2) brightness(0.95) contrast(1.35);
        transform: scale(1.25) rotate(0deg);
    }
    62.5% {
        filter: hue-rotate(225deg) saturate(1.8) brightness(0.9) contrast(1.3);
        transform: scale(1.2) rotate(-3deg);
    }
    75% {
        filter: hue-rotate(270deg) saturate(1.6) brightness(1.1) contrast(1.2);
        transform: scale(1.15) rotate(2deg);
    }
    87.5% {
        filter: hue-rotate(315deg) saturate(1.3) brightness(1.15) contrast(1.1);
        transform: scale(1.08) rotate(-2deg);
    }
    100% {
        filter: hue-rotate(360deg) saturate(1) brightness(1) contrast(1);
        transform: scale(1) rotate(0deg);
    }
}

/* Warping Filter Animation - No Transform (for use with transitions) */
@keyframes warpFilterNoTransform {
    0% {
        filter: hue-rotate(0deg) saturate(1) brightness(1) contrast(1);
    }
    12.5% {
        filter: hue-rotate(45deg) saturate(1.3) brightness(1.1) contrast(1.1);
    }
    25% {
        filter: hue-rotate(90deg) saturate(1.6) brightness(1.2) contrast(1.2);
    }
    37.5% {
        filter: hue-rotate(135deg) saturate(1.8) brightness(1.15) contrast(1.3);
    }
    50% {
        filter: hue-rotate(180deg) saturate(2) brightness(0.95) contrast(1.35);
    }
    62.5% {
        filter: hue-rotate(225deg) saturate(1.8) brightness(0.9) contrast(1.3);
    }
    75% {
        filter: hue-rotate(270deg) saturate(1.6) brightness(1.1) contrast(1.2);
    }
    87.5% {
        filter: hue-rotate(315deg) saturate(1.3) brightness(1.15) contrast(1.1);
    }
    100% {
        filter: hue-rotate(360deg) saturate(1) brightness(1) contrast(1);
    }
}

/* Weather effects layer */
.weather-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 12;
    pointer-events: none;
    overflow: hidden;
}

.weather-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.lightning-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
}

.lightning-flash.active {
    animation: lightningFlash 0.4s ease-out;
}

@keyframes lightningFlash {
    0% { opacity: 0; }
    10% { opacity: 0.8; }
    20% { opacity: 0; }
    30% { opacity: 0.9; }
    40% { opacity: 0; }
    100% { opacity: 0; }
}

/* Floating Character Badges in Screensaver */
.screensaver-badges-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 14;
    pointer-events: none;
    overflow: hidden;
}

.screensaver-floating-badge-wrapper {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    pointer-events: auto;
    cursor: pointer;
    animation: floatBadgeIn 2s ease-out forwards;
}

.screensaver-floating-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(255, 255, 255, 0.3);
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.screensaver-badge-title {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    transition: background 0.3s ease;
}

.screensaver-floating-badge-wrapper:hover .screensaver-floating-badge {
    transform: scale(1.15);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.7),
                0 0 40px rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 1);
}

.screensaver-floating-badge-wrapper:hover .screensaver-badge-title {
    background: rgba(0, 123, 255, 0.9);
}

.screensaver-floating-badge-wrapper.fading-out {
    animation: floatBadgeOut 2s ease-in forwards;
}

@keyframes floatBadgeIn {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(50px);
    }
    50% {
        opacity: 0.9;
    }
    100% {
        opacity: 0.85;
        transform: scale(1) translateY(0);
    }
}

@keyframes floatBadgeOut {
    0% {
        opacity: 0.85;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) translateY(-50px);
    }
}

/* Exit Hint */
.screensaver-exit-hint {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 0.9rem;
    opacity: 0.8;
    z-index: 20;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Screensaver Customization Panel */
.screensaver-customization {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
}

.customization-toggle {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.customization-toggle:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.customization-panel {
    position: absolute;
    top: 50px;
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(15px);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    min-width: 350px;
}

.customization-panel.expanded {
    max-height: 70vh;
    opacity: 1;
    margin-top: 10px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for customization panel */
.customization-panel::-webkit-scrollbar {
    width: 8px;
}

.customization-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.customization-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.customization-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.customization-section {
    margin-bottom: 12px;
}

.customization-section:last-child {
    margin-bottom: 0;
}

.customization-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.section-title {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
}

.customization-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.custom-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.custom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.custom-btn.active {
    background: rgba(138, 43, 226, 0.6);
    border-color: rgba(138, 43, 226, 0.8);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
}

/* Game Stats Display */
.customization-panel .game-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'AnimeAce', Arial, sans-serif;
}

.game-score, .game-timer {
    display: flex;
    align-items: center;
    gap: 5px;
}

#gameScore, #gameTimer {
    color: rgba(138, 43, 226, 1);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

/* Floating Game Icons */
.floating-game-icons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 14;
    pointer-events: none;
    overflow: hidden;
}

.floating-icon {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.7;
    pointer-events: none;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
    animation: floatAndBob 8s ease-in-out infinite;
    transition: all 0.3s ease;
}

.floating-icon.clickable {
    pointer-events: auto;
    cursor: pointer;
    opacity: 0.9;
}

.floating-icon.clickable:hover {
    transform: scale(1.3);
    filter: drop-shadow(0 0 20px rgba(138, 43, 226, 0.8));
    opacity: 1;
}

.floating-icon.collecting {
    animation: collectPulse 0.3s ease-out;
    pointer-events: none;
}

@keyframes collectPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

@keyframes floatAndBob {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.7;
    }
    25% {
        transform: translate(30px, -40px) rotate(10deg) scale(1.1);
        opacity: 0.8;
    }
    50% {
        transform: translate(-20px, -80px) rotate(-5deg) scale(0.95);
        opacity: 0.75;
    }
    75% {
        transform: translate(40px, -60px) rotate(15deg) scale(1.05);
        opacity: 0.85;
    }
    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.7;
    }
}

/* Individual icon variations for different animation offsets */
.floating-icon:nth-child(2n) {
    animation-duration: 10s;
    animation-delay: -2s;
}

.floating-icon:nth-child(3n) {
    animation-duration: 12s;
    animation-delay: -4s;
}

.floating-icon:nth-child(4n) {
    animation-duration: 9s;
    animation-delay: -1s;
}

.floating-icon:nth-child(5n) {
    animation-duration: 11s;
    animation-delay: -3s;
}

/* Song Title Overlay */
.screensaver-title-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    text-align: center;
    z-index: 16;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.screensaver-title-overlay.visible {
    opacity: 1;
}

.screensaver-title-overlay.fade-out {
    opacity: 0;
}

.title-content {
    font-family: 'AnimeAce', Arial, sans-serif;
    font-size: 48px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.95),
                 0 0 40px rgba(255, 255, 255, 0.3),
                 0 0 60px rgba(138, 43, 226, 0.5);
    letter-spacing: 2px;
    padding: 30px;
    background: linear-gradient(135deg, 
                rgba(138, 43, 226, 0.3) 0%, 
                rgba(75, 0, 130, 0.3) 50%, 
                rgba(138, 43, 226, 0.3) 100%);
    border: 3px solid rgba(138, 43, 226, 0.5);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Episode Summary Overlay */
.screensaver-summary-overlay {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;
    text-align: left;
    z-index: 16;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.screensaver-summary-overlay.visible {
    opacity: 1;
}

.screensaver-summary-overlay.fade-out {
    opacity: 0;
}

.summary-content {
    font-family: 'AnimeAce', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95),
                 0 0 20px rgba(0, 0, 0, 0.8);
    padding: 25px 30px;
    background: linear-gradient(135deg,
                rgba(0, 0, 0, 0.75) 0%,
                rgba(30, 30, 60, 0.7) 50%,
                rgba(0, 0, 0, 0.75) 100%);
    border: 2px solid rgba(138, 43, 226, 0.4);
    border-radius: 15px;
    backdrop-filter: blur(15px);
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
}

.summary-content::-webkit-scrollbar {
    width: 6px;
}

.summary-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.summary-content::-webkit-scrollbar-thumb {
    background: rgba(138, 43, 226, 0.5);
    border-radius: 10px;
}

.summary-content::-webkit-scrollbar-thumb:hover {
    background: rgba(138, 43, 226, 0.7);
}

/* Game HUD Overlay */
.game-hud {
    position: absolute;
    top: 20px;
    right: 20px;
    display: none;
    flex-direction: column;
    gap: 15px;
    z-index: 17;
    pointer-events: none;
}

.game-hud.visible {
    display: flex;
}

.hud-score, .hud-timer {
    background: linear-gradient(135deg, 
                rgba(138, 43, 226, 0.4) 0%, 
                rgba(75, 0, 130, 0.4) 100%);
    border: 2px solid rgba(138, 43, 226, 0.6);
    border-radius: 15px;
    padding: 12px 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.hud-label {
    display: block;
    font-family: 'AnimeAce', Arial, sans-serif;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 2px;
    margin-bottom: 3px;
}

.hud-value {
    display: block;
    font-family: 'AnimeAce', Arial, sans-serif;
    font-size: 1.8rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 0 20px rgba(138, 43, 226, 0.8),
                 0 2px 10px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

.hud-combo {
    position: absolute;
    top: 150px;
    right: 0;
    pointer-events: none;
}

.combo-text {
    display: inline-block;
    font-family: 'AnimeAce', Arial, sans-serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: rgba(255, 215, 0, 1);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8),
                 0 0 15px rgba(255, 165, 0, 0.6),
                 0 4px 15px rgba(0, 0, 0, 0.9);
    animation: comboPulse 0.5s ease-out;
    opacity: 0;
}

.combo-text.show {
    opacity: 1;
}

@keyframes comboPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scrolling Lyrics */
.screensaver-lyrics {
    position: absolute;
    bottom: 110px;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    display: none;
    align-items: center;
    overflow: hidden;
    z-index: 15;
    padding: 15px 40px;
    pointer-events: none;
}

.screensaver-lyrics.visible {
    display: flex;
}

.lyrics-content {
    color: rgba(255, 255, 255, 0.95);
    font-size: 18px;
    font-weight: 500;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.9),
                 0 0 25px rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    font-family: 'AnimeAce', Arial, sans-serif;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.lyrics-content.scrolling {
    animation: scrollLyrics 25s linear infinite;
    animation-delay: 0s;
}

.lyrics-content.static {
    animation: none;
    white-space: normal;
    text-align: center;
    width: 100%;
    line-height: 1.5;
    max-height: 80px;
    overflow-y: auto;
    padding-right: 10px;
}

@keyframes scrollLyrics {
    0% {
        transform: translateX(50vw);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Minimal Controls in Screen Saver */
.screensaver-minimal-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.screensaver-minimal-controls:hover {
    opacity: 1;
}

.screensaver-control {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screensaver-control:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.4);
}

.screensaver-control:active {
    transform: scale(0.95);
}

/* Hide radio player and other elements when screen saver is active */
body.screensaver-active {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

body.screensaver-active .radio-player,
body.screensaver-active .game-stats,
body.screensaver-active .mystical-canvas {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

/* Mobile Screen Saver Adjustments */
@media (max-width: 768px) {
    .screensaver-exit-hint {
        bottom: 120px;
        font-size: 0.8rem;
        padding: 10px 20px;
    }

    .screensaver-minimal-controls {
        gap: 15px;
    }

    .screensaver-control {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .screensaver-toggle-btn {
        font-size: 0.9rem;
        padding: 10px 20px;
    }

    .screensaver-summary-overlay {
        top: 60px;
        width: 95%;
        padding: 0 5px;
    }

    .summary-content {
        font-size: 13px;
        line-height: 1.5;
        padding: 15px 18px;
        max-height: 150px;
        border-radius: 10px;
    }

    .summary-content strong {
        font-size: 14px;
        display: block;
        margin-bottom: 8px;
    }

    .lyrics-content {
        font-size: 14px;
        letter-spacing: 0.3px;
        line-height: 1.3;
    }

    .screensaver-lyrics {
        padding: 10px 20px;
        height: 80px;
    }
}
