* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    background: #000;
    color: #fff;
    -webkit-user-select: none;
    user-select: none;
    /* Support for safe areas on notched devices */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#app {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #000;
}

/* Visualization Container */
#visualization-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#visualization-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Player Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.overlay.hidden {
    opacity: 0;
}

.overlay > * {
    pointer-events: auto;
}

/* Track Info */
.track-info {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    max-width: 90%;
    filter: drop-shadow(0 0 30px rgba(102, 126, 234, 0.6));
    /* Safe area support */
    top: max(40px, env(safe-area-inset-top) + 10px);
}

.track-info h1 {
    font-size: clamp(32px, 6vw, 64px);
    font-weight: 900;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    color: #ffffff;
    white-space: nowrap;
    overflow: visible;
    max-width: 100%;
    position: relative;
    animation: glow-pulse 2s ease-in-out infinite;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 2px rgba(255, 255, 255, 0.8);
}

.track-info h1::before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(25px);
    opacity: 0.9;
    animation: shimmer 3s ease-in-out infinite;
}

.track-info h1.scrolling {
    animation: scroll-text 10s linear infinite, glow-pulse 2s ease-in-out infinite;
}

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

@keyframes glow-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 30px rgba(102, 126, 234, 0.8))
                drop-shadow(0 0 50px rgba(118, 75, 162, 0.6))
                drop-shadow(0 0 70px rgba(240, 147, 251, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 50px rgba(102, 126, 234, 1))
                drop-shadow(0 0 100px rgba(118, 75, 162, 0.9))
                drop-shadow(0 0 150px rgba(240, 147, 251, 0.7));
    }
}

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

.track-info p {
    font-size: clamp(16px, 3vw, 24px);
    font-weight: 500;
    background: linear-gradient(90deg, #ffffff 0%, #c7d2fe 50%, #ffffff 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer-subtle 4s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

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

/* Radio Metadata Ticker */
.metadata-ticker {
    position: fixed;
    bottom: 300px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    z-index: 15;
    pointer-events: none;
}

.ticker-wrapper {
    background: linear-gradient(135deg,
        rgba(102, 126, 234, 0.25) 0%,
        rgba(118, 75, 162, 0.25) 50%,
        rgba(240, 147, 251, 0.25) 100%);
    backdrop-filter: blur(20px);
    border-radius: 50px;
    padding: 15px 30px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 8px 32px rgba(102, 126, 234, 0.4),
        0 0 60px rgba(118, 75, 162, 0.3),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
}

.ticker-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%);
    animation: shimmer-sweep 3s ease-in-out infinite;
}

@keyframes shimmer-sweep {
    0% { left: -100%; }
    100% { left: 200%; }
}

.ticker-content {
    overflow: hidden;
    white-space: nowrap;
}

#ticker-text {
    display: inline-block;
    font-size: clamp(18px, 3vw, 28px);
    font-weight: 700;
    background: linear-gradient(90deg,
        #ffffff 0%,
        #667eea 25%,
        #764ba2 50%,
        #f093fb 75%,
        #ffffff 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: ticker-scroll 20s linear infinite, gradient-flow 5s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.8);
    letter-spacing: 0.05em;
    padding: 0 50px;
}

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

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

/* Now Playing Display Box (Bottom Left) */
.metadata-box {
    position: fixed;
    bottom: 100px;
    left: 20px;
    width: 450px;
    height: 500px;
    background: linear-gradient(135deg,
        rgba(102, 126, 234, 0.25) 0%,
        rgba(118, 75, 162, 0.25) 50%,
        rgba(240, 147, 251, 0.2) 100%);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(102, 126, 234, 0.4),
        inset 0 0 40px rgba(255, 255, 255, 0.05);
    z-index: 20;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    display: flex;
    flex-direction: column;
}

.metadata-box.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Now Playing Box - Large Mode (for Metadata Only visualization) */
/* Completamente trasparente, focus sul contenuto */
.metadata-box.large-mode {
    left: 50%;
    top: 160px;
    transform: translateX(-50%);
    width: min(900px, 90vw);
    height: auto;
    max-height: calc(100vh - 420px);
    padding: 20px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    animation: none;
    overflow-y: auto;
}

.metadata-box.large-mode.hidden {
    transform: translateX(-50%) scale(0.95);
    opacity: 0;
}

.metadata-box.large-mode .metadata-content {
    font-size: clamp(16px, 2.2vw, 20px);
    line-height: 2;
    padding: 0;
    overflow-y: visible;
    text-shadow:
        0 0 20px rgba(0, 0, 0, 0.9),
        0 0 40px rgba(0, 0, 0, 0.7),
        0 2px 8px rgba(0, 0, 0, 0.8);
}

.metadata-box.large-mode .metadata-header {
    display: none;
}

/* Scrollbar for large mode if content overflows */
.metadata-box.large-mode::-webkit-scrollbar {
    width: 8px;
}

.metadata-box.large-mode::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.metadata-box.large-mode::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.6);
    border-radius: 4px;
}

.metadata-box.large-mode::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

/* Enhanced visibility for content boxes in large mode */
.metadata-box.large-mode .metadata-content > div {
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(102, 126, 234, 0.4) !important;
}

.metadata-box.large-mode .metadata-content img {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(255, 100, 100, 0.5) !important;
}

.metadata-header {
    padding: 15px 20px;
    background: linear-gradient(135deg,
        rgba(102, 126, 234, 0.4) 0%,
        rgba(118, 75, 162, 0.4) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px 20px 0 0;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
}

.metadata-header-buttons {
    display: flex;
    gap: 8px;
}

.metadata-header-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 0;
}

.metadata-header-btn:hover {
    background: rgba(102, 126, 234, 0.4);
    border-color: #667eea;
    transform: scale(1.1);
}

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

/* Pin button - specific styles */
#metadata-pin-btn.pinned {
    background: rgba(102, 126, 234, 0.5);
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

#metadata-pin-btn.pinned svg {
    transform: rotate(45deg);
}

/* Refresh button - specific styles */
#metadata-refresh-btn:hover {
    transform: rotate(180deg) scale(1.1);
}

#metadata-refresh-btn:active {
    transform: rotate(360deg) scale(0.95);
}

#metadata-refresh-btn.refreshing {
    animation: spin-refresh 1s linear infinite;
    pointer-events: none;
    opacity: 0.6;
}

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

.metadata-content {
    padding: 20px 25px;
    font-size: 14px;
    line-height: 1.8;
    flex: 1;
    overflow-y: auto;
    color: rgba(255, 255, 255, 0.95);
    word-wrap: break-word;
    font-weight: 400;
}

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

.metadata-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.metadata-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 3px;
}

.metadata-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* Ticker icons/separators */
#ticker-text::before,
#ticker-text::after {
    content: '♫';
    color: rgba(102, 126, 234, 0.8);
    margin: 0 20px;
    font-size: 1.2em;
    animation: pulse-icon 2s ease-in-out infinite;
}

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

/* Controls */
.controls {
    position: absolute;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    align-items: center;
    z-index: 50;
    /* Safe area support */
    bottom: max(140px, env(safe-area-inset-bottom) + 100px);
}

.control-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    position: relative;
    overflow: visible;
    box-shadow:
        0 0 20px rgba(102, 126, 234, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    /* Touch-friendly */
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
    user-select: none;
    /* Minimum touch target size already met (70px > 44px) */
}

.control-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.control-btn::after {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.5);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.2) rotate(5deg);
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow:
        0 0 40px rgba(102, 126, 234, 0.8),
        0 0 80px rgba(118, 75, 162, 0.6),
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
}

.control-btn:hover::before {
    opacity: 1;
    animation: ripple 1s ease-out infinite;
}

.control-btn:hover::after {
    opacity: 1;
    transform: scale(1.2);
    animation: ring-pulse 1.5s ease-out infinite;
}

.control-btn:active {
    transform: scale(0.95) rotate(0deg);
    animation: explode 0.5s ease-out;
}

.control-btn svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.7));
    transition: all 0.3s ease;
}

.control-btn:hover svg {
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1));
    transform: scale(1.1);
}

.play-btn {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    border: 3px solid rgba(255, 255, 255, 0.4);
    animation: gradient-shift 3s ease infinite;
    box-shadow:
        0 0 40px rgba(102, 126, 234, 0.6),
        0 0 80px rgba(118, 75, 162, 0.4),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
}

.play-btn svg {
    width: 44px;
    height: 44px;
}

.play-btn:hover {
    background: linear-gradient(135deg, #7c8fef 0%, #8b5db8 50%, #faa4fb 100%);
    background-size: 200% 200%;
    transform: scale(1.3) rotate(10deg);
    box-shadow:
        0 0 60px rgba(102, 126, 234, 1),
        0 0 120px rgba(118, 75, 162, 0.8),
        0 0 180px rgba(240, 147, 251, 0.6),
        0 10px 40px rgba(0, 0, 0, 0.5),
        inset 0 0 50px rgba(255, 255, 255, 0.3);
}

.play-btn:active {
    transform: scale(1.1);
    animation: play-explode 0.6s ease-out;
}

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

@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes ring-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes explode {
    0% { transform: scale(0.95); }
    50% {
        transform: scale(1.3);
        box-shadow:
            0 0 80px rgba(102, 126, 234, 1),
            0 0 160px rgba(118, 75, 162, 1);
    }
    100% { transform: scale(1); }
}

@keyframes play-explode {
    0% { transform: scale(1.1); }
    30% {
        transform: scale(1.5) rotate(15deg);
        box-shadow:
            0 0 100px rgba(102, 126, 234, 1),
            0 0 200px rgba(118, 75, 162, 1),
            0 0 300px rgba(240, 147, 251, 0.8);
    }
    100% { transform: scale(1.3) rotate(10deg); }
}

/* Progress Bar */
.progress-container {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 50;
    /* Safe area support */
    bottom: max(60px, env(safe-area-inset-bottom) + 20px);
}

.time-label {
    font-size: 14px;
    font-weight: 500;
    min-width: 45px;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

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

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    left: 0%;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

/* Volume Control */
.volume-container {
    position: absolute;
    bottom: 150px;
    right: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 50;
    /* Safe area support */
    bottom: max(150px, env(safe-area-inset-bottom) + 110px);
    right: max(40px, env(safe-area-inset-right) + 10px);
}

.volume-container .control-btn {
    width: 50px;
    height: 50px;
}

.volume-container .control-btn svg {
    width: 24px;
    height: 24px;
}

.volume-slider {
    width: 0;
    opacity: 0;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    backdrop-filter: blur(10px);
}

.volume-container:hover .volume-slider {
    width: 100px;
    opacity: 1;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Settings Button */
.settings-btn {
    position: absolute;
    top: 40px;
    right: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    /* Touch-friendly */
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
    user-select: none;
    /* Minimum touch target size */
    min-width: 44px;
    min-height: 44px;
    /* Safe area support for notched devices */
    top: max(40px, env(safe-area-inset-top) + 10px);
    right: max(40px, env(safe-area-inset-right) + 10px);
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.settings-btn svg {
    width: 24px;
    height: 24px;
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 100%;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(100%);
    transition: transform 0.4s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.settings-panel.open {
    transform: translateX(0);
}

/* Panels that open from LEFT side */
.panel-left {
    left: 0;
    right: auto;
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
}

.panel-left.open {
    transform: translateX(0);
}

.settings-header {
    padding: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-header h2 {
    font-size: 24px;
    font-weight: 600;
}

/* Library Tabs */
.library-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.library-tab {
    flex: 1;
    padding: 18px 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
}

.library-tab svg {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.library-tab:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.library-tab:hover svg {
    opacity: 1;
}

.library-tab.active {
    color: #fff;
    background: rgba(102, 126, 234, 0.15);
    border-bottom-color: #667eea;
}

.library-tab.active svg {
    opacity: 1;
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    /* Smooth scrolling for touch devices */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    /* Firefox scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.6) rgba(0, 0, 0, 0.2);
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar for Tab Content */
.tab-content::-webkit-scrollbar {
    width: 8px;
}

.tab-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.tab-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg,
        rgba(102, 126, 234, 0.6) 0%,
        rgba(118, 75, 162, 0.6) 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg,
        rgba(102, 126, 234, 0.8) 0%,
        rgba(118, 75, 162, 0.8) 100%);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.close-btn:hover {
    transform: rotate(90deg);
}

.settings-content {
    padding: 30px;
}

/* Scrolling for settings panels (not in tabs) */
.settings-panel:not(#library-panel) .settings-content {
    flex: 1;
    overflow-y: auto;
    /* Smooth scrolling for touch devices */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    /* Firefox scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.6) rgba(0, 0, 0, 0.2);
}

/* Custom Scrollbar for Webkit browsers (non-tab panels) */
.settings-panel:not(#library-panel) .settings-content::-webkit-scrollbar {
    width: 8px;
}

.settings-panel:not(#library-panel) .settings-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.settings-panel:not(#library-panel) .settings-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg,
        rgba(102, 126, 234, 0.6) 0%,
        rgba(118, 75, 162, 0.6) 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.settings-panel:not(#library-panel) .settings-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg,
        rgba(102, 126, 234, 0.8) 0%,
        rgba(118, 75, 162, 0.8) 100%);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.setting-group {
    margin-bottom: 30px;
}

.setting-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.8;
}

.setting-group select,
.setting-group input[type="range"] {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.setting-group select:focus,
.setting-group input[type="range"]:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
}

.setting-group select {
    cursor: pointer;
}

.setting-group select option {
    background: #1a1a1a;
    color: #999;
    padding: 8px;
}

.setting-group select option:checked {
    background: #667eea;
    color: #fff;
}

.setting-group input[type="range"] {
    -webkit-appearance: none;
    height: 6px;
    padding: 0;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.setting-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.setting-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    cursor: pointer;
}

.setting-group input[type="checkbox"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.setting-group label:has(input[type="checkbox"]:disabled) {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    /* Touch-friendly */
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
    user-select: none;
    /* Minimum touch target size */
    min-height: 44px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .track-info {
        top: 20px;
        padding: 0 15px;
        /* Safe area support on mobile */
        top: max(20px, env(safe-area-inset-top) + 10px);
    }

    .controls {
        bottom: 120px;
        gap: 15px;
        /* Safe area support on mobile */
        bottom: max(120px, env(safe-area-inset-bottom) + 80px);
    }

    .control-btn {
        width: 55px;
        height: 55px;
        /* Larger touch targets for mobile */
        min-width: 44px;
        min-height: 44px;
    }

    .control-btn svg {
        width: 26px;
        height: 26px;
    }

    .play-btn {
        width: 75px;
        height: 75px;
    }

    .play-btn svg {
        width: 36px;
        height: 36px;
    }

    .progress-container {
        bottom: 50px;
        width: 85%;
        /* Safe area support on mobile */
        bottom: max(50px, env(safe-area-inset-bottom) + 10px);
    }

    .progress-bar {
        height: 8px;
        /* Larger touch target for progress bar */
    }

    .progress-handle {
        width: 20px;
        height: 20px;
    }

    .time-label {
        font-size: 12px;
        min-width: 40px;
    }

    .volume-container {
        bottom: 130px;
        right: 20px;
        /* Safe area support on mobile */
        bottom: max(130px, env(safe-area-inset-bottom) + 90px);
        right: max(20px, env(safe-area-inset-right) + 10px);
    }

    .settings-btn {
        top: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        /* Ensure minimum touch target size */
        min-width: 44px;
        min-height: 44px;
        /* Safe area support on mobile */
        top: max(20px, env(safe-area-inset-top) + 10px);
        right: max(20px, env(safe-area-inset-right) + 10px);
    }

    .settings-btn svg {
        width: 26px;
        height: 26px;
    }

    .settings-panel {
        width: 100%;
        max-width: 100vw;
        /* Enable smooth scrolling on touch devices */
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }

    .settings-content {
        /* Add padding at bottom for safe scrolling */
        padding-bottom: 80px;
        /* Enable smooth touch scrolling */
        -webkit-overflow-scrolling: touch;
    }

    /* Queue, Radio and Manual panel mobile optimizations */
    #queue-panel, #radio-panel, #manual-panel {
        width: 100%;
        max-width: 100vw;
        -webkit-overflow-scrolling: touch;
    }

    #queue-list {
        /* Ensure scrollable on mobile */
        max-height: calc(100vh - 350px) !important;
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }

    .queue-item {
        /* Larger touch targets */
        padding: 16px 12px;
        min-height: 60px;
    }

    .queue-item-remove {
        width: 32px;
        height: 32px;
        font-size: 18px;
        /* Always visible on mobile for easier interaction */
        opacity: 0.7;
    }

    /* Metadata ticker mobile */
    .metadata-ticker {
        bottom: 270px;
        width: 95%;
        bottom: max(270px, env(safe-area-inset-bottom) + 230px);
    }

    .ticker-wrapper {
        padding: 12px 20px;
    }

    #ticker-text {
        font-size: clamp(14px, 4vw, 20px);
    }
}

@media (max-width: 480px) {
    .controls {
        gap: 12px;
    }

    .control-btn {
        width: 50px;
        height: 50px;
    }

    .play-btn {
        width: 65px;
        height: 65px;
    }

    .volume-container {
        /* Show volume control but simplified */
        bottom: 20px;
        right: 20px;
        flex-direction: column;
        gap: 5px;
    }

    .volume-slider {
        width: 100px;
        opacity: 1;
        transform: rotate(-90deg);
        transform-origin: left top;
        position: absolute;
        bottom: 60px;
        left: 10px;
    }

    .volume-container:not(:hover) .volume-slider {
        opacity: 0;
        pointer-events: none;
    }

    /* Adjust button positions for smaller screens */
    .settings-btn {
        top: 15px;
        right: 15px;
        /* Safe area support on very small screens */
        top: max(15px, env(safe-area-inset-top) + 5px);
        right: max(15px, env(safe-area-inset-right) + 5px);
    }

    #queue-btn {
        top: 15px !important;
        left: 15px !important;
        /* Safe area support */
        top: max(15px, env(safe-area-inset-top) + 5px) !important;
        left: max(15px, env(safe-area-inset-left) + 5px) !important;
    }

    #radio-btn {
        top: 15px !important;
        left: 70px !important;
        /* Safe area support */
        top: max(15px, env(safe-area-inset-top) + 5px) !important;
        left: max(70px, env(safe-area-inset-left) + 60px) !important;
    }

    #fullscreen-btn {
        right: 70px !important;
        /* Safe area support */
        right: max(70px, env(safe-area-inset-right) + 60px) !important;
    }

    #manual-btn {
        bottom: 20px !important;
        left: 20px !important;
        /* Safe area support */
        bottom: max(20px, env(safe-area-inset-bottom) + 10px) !important;
        left: max(20px, env(safe-area-inset-left) + 10px) !important;
    }

    #credits-btn {
        bottom: 20px !important;
        right: 20px !important;
        /* Safe area support */
        bottom: max(20px, env(safe-area-inset-bottom) + 10px) !important;
        right: max(20px, env(safe-area-inset-right) + 10px) !important;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

.playing .play-btn {
    animation: pulse 2s ease-in-out infinite;
}

/* Queue Panel - opens from left */
#queue-panel {
    left: 0;
    right: auto;
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
}

#queue-panel.open {
    transform: translateX(0);
}

/* Queue List Items */
.queue-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.queue-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.queue-item.playing {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    border-left: 3px solid #667eea;
}

.queue-item-number {
    font-size: 12px;
    opacity: 0.5;
    min-width: 24px;
    text-align: center;
}

.queue-item-info {
    flex: 1;
    overflow: hidden;
}

.queue-item-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-artist {
    font-size: 12px;
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-duration {
    font-size: 12px;
    opacity: 0.5;
}

.queue-item-remove {
    background: rgba(231, 76, 60, 0.2);
    border: none;
    border-radius: 4px;
    color: #e74c3c;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.queue-item:hover .queue-item-remove {
    opacity: 1;
}

.queue-item-remove:hover {
    background: rgba(231, 76, 60, 0.4);
    transform: scale(1.1);
}

.queue-empty {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.5;
}

.queue-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ===========================
   Particle Explosion Effects
   =========================== */

.click-particle {
    transform-origin: center;
}

@keyframes particle-explode {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(
            calc(var(--end-x) - 50vw),
            calc(var(--end-y) - 50vh)
        ) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(
            calc(var(--end-x) - 50vw + (var(--end-x) - 50vw) * 0.3),
            calc(var(--end-y) - 50vh + (var(--end-y) - 50vh) * 0.3)
        ) scale(0);
    }
}

/* ===========================
   Credits Button & Modal Animations
   =========================== */

/* Credits Button Pulse Animation */
.credits-pulse {
    animation: credits-pulse 2s ease-in-out infinite !important;
}

@keyframes credits-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.6), 0 0 40px rgba(118, 75, 162, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.9), 0 0 60px rgba(118, 75, 162, 0.7), 0 0 80px rgba(240, 147, 251, 0.5);
        transform: scale(1.1);
    }
}

.credits-pulse:hover {
    animation: credits-hover 0.6s ease-in-out infinite !important;
    transform: scale(1.15) rotate(5deg) !important;
}

@keyframes credits-hover {
    0%, 100% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 1), 0 0 80px rgba(118, 75, 162, 0.8);
    }
    50% {
        box-shadow: 0 0 60px rgba(102, 126, 234, 1), 0 0 120px rgba(118, 75, 162, 1), 0 0 180px rgba(240, 147, 251, 0.8);
    }
}

/* Credits Modal Animations */
.credits-modal {
    animation: fadeIn 0.4s ease;
}

@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    70% {
        transform: scale(1.05) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.2);
    }
    20%, 40% {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Starfield Background for Credits */
.credits-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.credits-stars::before,
.credits-stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

.credits-stars::before {
    top: 20%;
    left: 30%;
    box-shadow:
        100px 100px white,
        200px 50px white,
        300px 150px white,
        -100px 200px white,
        150px 250px white,
        400px 80px white,
        -50px 100px white,
        250px 200px white;
}

.credits-stars::after {
    top: 40%;
    right: 30%;
    animation-delay: 1.5s;
    box-shadow:
        -150px -50px white,
        -250px 100px white,
        -350px 0px white,
        100px -100px white,
        -200px 150px white,
        -400px -80px white,
        50px -150px white,
        -100px 50px white;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* Coffee Button Hover Effect */
.coffee-btn:hover {
    transform: scale(1.1) rotate(-5deg) !important;
    box-shadow: 0 15px 60px rgba(255, 221, 0, 0.6), 0 0 100px rgba(255, 221, 0, 0.4) !important;
}

.coffee-btn:active {
    transform: scale(0.95) !important;
}

/* Close Button Hover Effect */
#close-credits:hover {
    transform: rotate(90deg) scale(1.2);
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Mobile-specific styles for better touch experience */
@media (max-width: 768px) {
    /* Credits Modal Mobile Optimizations */
    .credits-modal {
        /* Enable vertical scrolling */
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        /* Prevent horizontal scroll */
        overflow-x: hidden;
    }

    .credits-container {
        /* Change from absolute centering to normal flow for scrolling */
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        margin: 20px auto !important;
        max-width: 95% !important;
        padding: 30px 20px !important;
        /* Ensure it can scroll if content is tall */
        min-height: auto;
        max-height: none;
    }

    /* Adjust close button for mobile */
    #close-credits {
        position: fixed !important;
        top: 10px !important;
        right: 10px !important;
        z-index: 201;
        width: 40px !important;
        height: 40px !important;
        font-size: 24px !important;
    }

    /* Touch-friendly action buttons */
    .action-btn, .coffee-btn {
        min-height: 50px !important;
        padding: 16px 30px !important;
        font-size: clamp(15px, 2.5vw, 17px) !important;
    }
}

@media (max-width: 480px) {
    .credits-container {
        margin: 15px auto !important;
        padding: 25px 15px !important;
    }

    /* Reduce spacing on very small screens */
    .credits-container > div {
        margin: 15px 0 !important;
    }
}

/* Radio Station Buttons */
/* Radio Station Item Container */
.radio-station-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    /* Allow touch scrolling while maintaining button clicks */
    touch-action: pan-y;
}

.radio-station-btn {
    flex: 1;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    /* Touch-friendly */
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
    user-select: none;
}

/* Favorite Star Button */
.favorite-star-btn {
    width: 45px;
    height: 45px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* Touch-friendly */
    -webkit-tap-highlight-color: rgba(240, 147, 251, 0.3);
    user-select: none;
    /* Minimum touch target size */
    min-width: 44px;
    min-height: 44px;
}

.favorite-star-btn:hover {
    background: rgba(240, 147, 251, 0.15);
    border-color: rgba(240, 147, 251, 0.5);
    color: #f093fb;
    transform: scale(1.1) rotate(10deg);
}

.favorite-star-btn.favorited {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.3) 0%, rgba(102, 126, 234, 0.3) 100%);
    border-color: #f093fb;
    color: #f093fb;
    animation: star-glow 2s ease-in-out infinite;
}

@keyframes star-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(240, 147, 251, 0.5);
        text-shadow: 0 0 10px rgba(240, 147, 251, 0.8);
    }
    50% {
        box-shadow: 0 0 20px rgba(240, 147, 251, 0.8), 0 0 30px rgba(240, 147, 251, 0.4);
        text-shadow: 0 0 20px rgba(240, 147, 251, 1);
    }
}

/* Favorite Remove Button */
.favorite-remove-btn {
    width: 45px;
    height: 45px;
    padding: 0;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 10px;
    color: rgba(231, 76, 60, 0.7);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* Touch-friendly */
    -webkit-tap-highlight-color: rgba(231, 76, 60, 0.3);
    user-select: none;
    /* Minimum touch target size */
    min-width: 44px;
    min-height: 44px;
}

.favorite-remove-btn:hover {
    background: rgba(231, 76, 60, 0.25);
    border-color: #e74c3c;
    color: #e74c3c;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.5);
}

.radio-station-btn:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: rgba(231, 76, 60, 0.5);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.radio-station-btn:active {
    transform: translateX(3px) scale(0.98);
}

.radio-station-btn.playing {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.3) 0%, rgba(192, 57, 43, 0.3) 100%);
    border-color: #e74c3c;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
    animation: radio-pulse 2s ease-in-out infinite;
}

@keyframes radio-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(231, 76, 60, 0.8), 0 0 50px rgba(231, 76, 60, 0.4);
    }
}

/* Radio Panel */
#radio-panel {
    left: 0;
    right: auto;
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
}

#radio-panel.open {
    transform: translateX(0);
}

/* Manual Panel */
#manual-panel {
    right: 0;
    left: auto;
    width: 600px;
    max-width: 90vw;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: none;
    transform: translateX(100%);
    transition: transform 0.4s ease;
}

#manual-panel.open {
    transform: translateX(0);
}

.manual-content {
    padding: 20px 30px 80px;
}

.manual-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.manual-section:last-child {
    border-bottom: none;
}

.manual-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #27ae60;
    display: flex;
    align-items: center;
    gap: 8px;
}

.manual-section h4 {
    font-size: 16px;
    font-weight: 500;
    margin: 15px 0 10px;
    color: #3498db;
}

.manual-section p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 12px;
    opacity: 0.9;
}

.manual-section ul,
.manual-section ol {
    margin: 10px 0;
    padding-left: 25px;
}

.manual-section li {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 8px;
    opacity: 0.85;
}

.manual-section strong {
    color: #fff;
    font-weight: 600;
}

/* ===========================
   Splash Screen & Magnificent Logo
   =========================== */

.splash-screen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: #000 !important;
    z-index: 9999 !important;
}

.splash-screen.hidden {
    display: none !important;
}

.splash-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(231, 76, 60, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(39, 174, 96, 0.1) 0%, transparent 70%);
    animation: splash-bg-pulse 8s ease-in-out infinite;
    pointer-events: none;
}

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

.splash-content {
    position: relative;
    z-index: 4;
    max-width: 900px;
    width: 90%;
    text-align: center;
    flex-shrink: 0;
    pointer-events: auto;
    animation: splash-content-enter 1s ease-out;
}

@keyframes splash-content-enter {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Magnificent Tempest Logo */
.tempest-logo {
    position: relative;
    margin: 0 auto 60px;
    padding: 60px 0;
}

.logo-storm-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
    animation: storm-rotate 20s linear infinite, storm-pulse 3s ease-in-out infinite;
    /* Reduced blur from 40px to 20px for better performance */
    filter: blur(20px);
}

@keyframes storm-rotate {
    0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.2); }
    100% { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}

@keyframes storm-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Realistic Lightning SVG */
.lightning-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none !important;
    z-index: 1;
}

.lightning-bolt {
    opacity: 0;
}

/* Yellow lightning glow */
.lightning-bolt.lightning-color-yellow {
    filter: drop-shadow(0 0 10px rgba(255, 235, 59, 0.9))
            drop-shadow(0 0 20px rgba(255, 235, 59, 0.6))
            drop-shadow(0 0 35px rgba(255, 215, 0, 0.5));
}

/* Red lightning glow */
.lightning-bolt.lightning-color-red {
    filter: drop-shadow(0 0 10px rgba(255, 59, 59, 0.9))
            drop-shadow(0 0 20px rgba(255, 0, 0, 0.6))
            drop-shadow(0 0 35px rgba(255, 50, 50, 0.5));
}

/* Blue lightning glow */
.lightning-bolt.lightning-color-blue {
    filter: drop-shadow(0 0 10px rgba(59, 159, 255, 0.9))
            drop-shadow(0 0 20px rgba(0, 128, 255, 0.6))
            drop-shadow(0 0 35px rgba(50, 150, 255, 0.5));
}

/* Different timing for each lightning bolt */
.lightning-1 {
    animation: lightning-flash 5s ease-in-out infinite;
    animation-delay: 0s;
}

.lightning-2 {
    animation: lightning-flash 6s ease-in-out infinite;
    animation-delay: 1.2s;
}

.lightning-3 {
    animation: lightning-flash 4s ease-in-out infinite;
    animation-delay: 2s;
    stroke-width: 5;
}

.lightning-4 {
    animation: lightning-flash 7s ease-in-out infinite;
    animation-delay: 3.5s;
}

.lightning-5 {
    animation: lightning-flash 5.5s ease-in-out infinite;
    animation-delay: 4s;
}

@keyframes lightning-flash {
    0%, 89%, 100% {
        opacity: 0;
    }
    90% {
        opacity: 1;
    }
    91% {
        opacity: 0.3;
    }
    92% {
        opacity: 1;
    }
    93% {
        opacity: 0.5;
    }
    94% {
        opacity: 1;
    }
    95% {
        opacity: 0;
    }
}

.logo-wave-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    animation: wave-expand 3s ease-out infinite;
}

@keyframes wave-expand {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
        border-color: rgba(102, 126, 234, 0.8);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
        border-color: rgba(102, 126, 234, 0);
    }
}

.logo-text {
    position: relative;
    font-size: clamp(60px, 12vw, 120px);
    font-weight: 900;
    letter-spacing: 0.1em;
    display: flex;
    justify-content: center;
    gap: 0.05em;
    margin-bottom: 20px;
    /* Reduced shadow for better performance - individual letters already have glow */
    filter: drop-shadow(0 0 15px rgba(102, 126, 234, 0.5));
}

.logo-letter {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #e74c3c 50%, #27ae60 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Simplified glow - only 2 shadow layers instead of 4 for better performance */
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8))
            drop-shadow(0 0 12px rgba(255, 255, 255, 0.4));
    animation:
        logo-letter-appear 0.8s ease-out backwards,
        logo-shimmer 6s ease-in-out infinite,
        logo-float 3s ease-in-out infinite,
        electric-pulse 2s ease-in-out infinite,
        electric-flicker 4s ease-in-out infinite;
    animation-delay:
        calc(var(--i) * 0.1s),
        calc(var(--i) * 0.3s),
        calc(var(--i) * 0.15s),
        calc(var(--i) * 0.2s),
        calc(var(--i) * 0.4s);
}

@keyframes logo-letter-appear {
    0% {
        opacity: 0;
        transform: translateY(-50px) rotateX(90deg);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
        filter: blur(0);
    }
}

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

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

@keyframes electric-pulse {
    0%, 100% {
        /* Simplified - only 2 shadows for better performance on mobile */
        filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8))
                drop-shadow(0 0 12px rgba(255, 255, 255, 0.4));
    }
    50% {
        /* Peak glow - subtle increase with only 3 shadows */
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 1))
                drop-shadow(0 0 16px rgba(255, 255, 255, 0.7))
                drop-shadow(0 0 24px rgba(255, 255, 255, 0.4));
    }
}

@keyframes electric-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        opacity: 1;
    }
    20%, 24%, 55% {
        opacity: 0.85;
    }
    22% {
        opacity: 0.7;
    }
}

.logo-subtitle {
    font-size: clamp(14px, 2.5vw, 20px);
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    opacity: 0;
    animation: subtitle-fade-in 1s ease-out 0.8s forwards;
}

@keyframes subtitle-fade-in {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes subtitle-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 200% 50%; }
}

/* Quick Start Guide */
.quick-guide {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
    animation: guide-appear 0.8s ease-out 1.2s backwards;
}

@keyframes guide-appear {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.quick-guide h3 {
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 600;
    margin-bottom: 25px;
    color: #fff;
}

.guide-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.guide-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.guide-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.guide-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.guide-text {
    text-align: left;
    flex: 1;
}

.guide-text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #fff;
}

.guide-text p {
    font-size: 13px;
    opacity: 0.7;
    margin: 0;
}

.splash-tip {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.2) 0%, rgba(39, 174, 96, 0.05) 100%);
    border: 1px solid rgba(39, 174, 96, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
}

.splash-tip p {
    margin: 0;
    font-size: 14px;
    color: #fff;
}

/* Start Button */
.splash-start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow:
        0 10px 40px rgba(102, 126, 234, 0.4),
        inset 0 -3px 10px rgba(0, 0, 0, 0.2);
    animation: button-pulse 2s ease-in-out infinite;
}

@keyframes button-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 60px rgba(102, 126, 234, 0.6);
    }
}

.splash-start-btn:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow:
        0 20px 60px rgba(102, 126, 234, 0.6),
        inset 0 -3px 10px rgba(0, 0, 0, 0.2);
}

.splash-start-btn:active {
    transform: scale(1.05) translateY(0);
}

.splash-footer {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.splash-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.7;
}

.splash-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.splash-info {
    text-align: center;
    opacity: 0.8;
}

.splash-version {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #667eea;
}

.splash-author {
    font-size: 14px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.splash-link {
    background: transparent;
    border: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 25px;
    padding: 10px 25px;
    font-size: 14px;
    font-weight: 500;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.splash-link:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .splash-content {
        width: 95%;
        padding: 20px 0;
    }

    .tempest-logo {
        padding: 40px 0;
        margin-bottom: 40px;
    }

    .logo-storm-circle {
        width: 200px;
        height: 200px;
    }

    .logo-wave-circle {
        width: 250px;
        height: 250px;
    }

    .quick-guide {
        padding: 20px;
    }

    .guide-buttons {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .guide-item {
        padding: 12px;
    }

    .splash-start-btn {
        padding: 16px 40px;
        font-size: 16px;
    }

    /* Update notice mobile optimizations */
    .update-notice {
        width: 90% !important;
        max-width: 350px !important;
        padding: 18px 20px !important;
        margin: 15px auto !important;
    }

    .update-notice div:first-child {
        font-size: 15px !important;
    }

    .update-notice div:nth-child(2) {
        font-size: 13px !important;
    }

    .update-notice button {
        padding: 12px 24px !important;
        font-size: 15px !important;
        min-height: 44px !important;
        width: 100%;
        touch-action: manipulation;
    }
}

/* Touch-friendly improvements for all interactive elements */
@media (hover: none) and (pointer: coarse) {
    /* This targets touch devices specifically */

    /* Larger touch targets */
    button, a, input[type="range"], .control-btn, .settings-btn {
        min-width: 44px;
        min-height: 44px;
    }

    /* Remove hover effects on touch devices */
    .control-btn:hover,
    .settings-btn:hover,
    .action-btn:hover {
        /* Keep some feedback but less aggressive */
        transform: scale(1.05);
    }

    /* Disable glow effects on mobile for better performance */
    .track-info {
        filter: none !important;
    }

    #track-title {
        animation: none !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
    }

    #track-artist {
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    }

    .control-btn {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    }

    .control-btn:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    }

    .control-btn svg {
        filter: none !important;
    }

    .control-btn::before,
    .control-btn::after {
        display: none !important;
    }

    .settings-btn {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    }

    .ticker-wrapper {
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    }

    /* Make scrollable areas more obvious */
    .settings-content,
    #queue-list,
    .credits-modal {
        /* Add subtle scroll indicator */
        scrollbar-width: thin;
        scrollbar-color: rgba(102, 126, 234, 0.5) transparent;
    }

    /* Webkit scrollbar styling for touch devices */
    .settings-content::-webkit-scrollbar,
    #queue-list::-webkit-scrollbar,
    .credits-modal::-webkit-scrollbar {
        width: 6px;
    }

    .settings-content::-webkit-scrollbar-track,
    #queue-list::-webkit-scrollbar-track,
    .credits-modal::-webkit-scrollbar-track {
        background: transparent;
    }

    .settings-content::-webkit-scrollbar-thumb,
    #queue-list::-webkit-scrollbar-thumb,
    .credits-modal::-webkit-scrollbar-thumb {
        background: rgba(102, 126, 234, 0.5);
        border-radius: 3px;
    }

    /* Prevent double-tap zoom on buttons */
    button, a, .control-btn, .settings-btn {
        touch-action: manipulation;
    }
}
