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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 0, 255, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(0, 255, 255, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(255, 255, 0, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(255, 0, 0, 0.25) 0%, transparent 50%);
    /* Fondo estático para que la UI principal no parezca moverse */
    animation: none;
    z-index: -1;
}

.background-layers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.bg-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    mix-blend-mode: screen;
    opacity: 0.6;
    transition: filter 0.8s ease, opacity 0.8s ease, transform 0.8s ease, background-position 0.8s ease, background-size 0.8s ease;
}

.layer-1 {
    background: 
        conic-gradient(from 0deg at 30% 40%, #ff0080, #8000ff, #0080ff, #00ff80, #ff8000, #ff0080);
    animation: spin 4s linear infinite;
}

.layer-2 {
    background: 
        conic-gradient(from 90deg at 70% 60%, #00ffff, #ff00ff, #ffff00, #00ffff);
    animation: spin 6s linear infinite reverse;
}

.layer-3 {
    background: 
        radial-gradient(circle at 20% 80%, #ff006e 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, #06ffa5 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, #fbff00 0%, transparent 50%);
    animation: pulse 2s ease-in-out infinite;
}

.layer-4 {
    background: 
        repeating-linear-gradient(45deg, #ff0080, #ff0080 10px, transparent 10px, transparent 20px),
        repeating-linear-gradient(-45deg, #00ff80, #00ff80 10px, transparent 10px, transparent 20px);
    animation: shift 3s ease-in-out infinite;
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.3) rotate(180deg); }
}

@keyframes shift {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-20px) translateY(-10px); }
    50% { transform: translateX(20px) translateY(-20px); }
    75% { transform: translateX(-10px) translateY(10px); }
}

.container {
    padding: 20px;
}

.radio-unit {
    position: relative;
    background: linear-gradient(145deg, #151720, #11141d 40%, #090b11 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 22px 45px rgba(0, 0, 0, 0.9),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 255, 136, 0.3);
    max-width: 400px;
    width: 100%;
    overflow: hidden;
}

/* THEME OVERRIDES PER TRACK STYLE */
body[data-theme="theme-0"] .radio-unit {
    border-color: rgba(0, 255, 136, 0.5);
    box-shadow:
        0 22px 45px rgba(0, 0, 0, 0.9),
        0 0 18px rgba(0, 255, 136, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
body[data-theme="theme-0"] .display-info {
    color: #00ff88;
}

body[data-theme="theme-1"] .radio-unit {
    border-color: rgba(0, 255, 255, 0.5);
    box-shadow:
        0 22px 45px rgba(0, 0, 0, 0.9),
        0 0 18px rgba(0, 255, 255, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
body[data-theme="theme-1"] .display-info {
    color: #00f7ff;
}

body[data-theme="theme-2"] .radio-unit {
    border-color: rgba(255, 0, 200, 0.5);
    box-shadow:
        0 22px 45px rgba(0, 0, 0, 0.9),
        0 0 18px rgba(255, 0, 200, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
body[data-theme="theme-2"] .display-info {
    color: #ff44ff;
}

body[data-theme="theme-3"] .radio-unit {
    border-color: rgba(255, 200, 0, 0.6);
    box-shadow:
        0 22px 45px rgba(0, 0, 0, 0.9),
        0 0 18px rgba(255, 200, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
body[data-theme="theme-3"] .display-info {
    color: #ffd44a;
}

body[data-theme="theme-4"] .radio-unit {
    border-color: rgba(255, 80, 0, 0.6);
    box-shadow:
        0 22px 45px rgba(0, 0, 0, 0.9),
        0 0 18px rgba(255, 80, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
body[data-theme="theme-4"] .display-info {
    color: #ff9140;
}

body[data-theme="theme-5"] .radio-unit {
    border-color: rgba(180, 0, 255, 0.6);
    box-shadow:
        0 22px 45px rgba(0, 0, 0, 0.9),
        0 0 18px rgba(180, 0, 255, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
body[data-theme="theme-5"] .display-info {
    color: #d470ff;
}

body[data-theme="theme-6"] .radio-unit {
    border-color: rgba(0, 180, 255, 0.6);
    box-shadow:
        0 22px 45px rgba(0, 0, 0, 0.9),
        0 0 18px rgba(0, 180, 255, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
body[data-theme="theme-6"] .display-info {
    color: #5ecbff;
}

body[data-theme="theme-7"] .radio-unit {
    border-color: rgba(0, 255, 160, 0.6);
    box-shadow:
        0 22px 45px rgba(0, 0, 0, 0.9),
        0 0 18px rgba(0, 255, 160, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
body[data-theme="theme-7"] .display-info {
    color: #66ffc2;
}

body[data-theme="theme-8"] .radio-unit {
    border-color: rgba(255, 0, 120, 0.6);
    box-shadow:
        0 22px 45px rgba(0, 0, 0, 0.9),
        0 0 18px rgba(255, 0, 120, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
body[data-theme="theme-8"] .display-info {
    color: #ff4f9a;
}

body[data-theme="theme-9"] .radio-unit {
    border-color: rgba(160, 220, 255, 0.7);
    box-shadow:
        0 22px 45px rgba(0, 0, 0, 0.9),
        0 0 18px rgba(160, 220, 255, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
body[data-theme="theme-9"] .display-info {
    color: #c0e4ff;
}

.radio-unit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.18), transparent 45%, rgba(0, 255, 255, 0.1));
    opacity: 0.35;
    mix-blend-mode: screen;
    pointer-events: none;
}

.radio-unit::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 18px;
    background: radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.12), transparent 55%),
                radial-gradient(circle at 80% 100%, rgba(0, 255, 136, 0.18), transparent 55%);
    mix-blend-mode: soft-light;
    pointer-events: none;
}

.screen-section {
    background: radial-gradient(circle at 10% 0%, #07110b 0%, #020405 45%, #000 100%);
    border-radius: 14px;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.9),
                0 0 0 1px rgba(0, 255, 136, 0.15);
}

.visualizer-canvas {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.7;
}

#audioVisualizer {
    width: 100%;
    height: 100%;
    display: block;
}

.display-info {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.track-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-name {
    font-size: 12px;
    color: #88ffcc;
    margin-bottom: 10px;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(6, 10, 18, 0.95), rgba(14, 20, 32, 0.9));
    box-shadow: inset 0 0 0 1px rgba(0, 255, 136, 0.08);
}

.volume-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #e0ffe0;
}

.volume-control label {
    font-size: 10px;
    margin-bottom: 5px;
}

#volumeSlider {
    width: 60px;
    margin-bottom: 5px;
}

#volumeValue {
    font-size: 10px;
}

.main-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    background: radial-gradient(circle at 30% 20%, #4cffb5 0%, #1f3a34 30%, #090c11 100%);
    border: 2px solid rgba(110, 255, 195, 0.8);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: #e9fff6;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.6),
        0 0 12px rgba(0, 255, 136, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.control-btn:hover {
    background: radial-gradient(circle at 30% 20%, #72ffd0 0%, #274743 30%, #05070b 100%);
    transform: translateY(-1px) scale(1.04);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.7),
        0 0 18px rgba(0, 255, 170, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.control-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.6),
        0 0 8px rgba(0, 255, 136, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.play-pause {
    width: 60px;
    height: 60px;
    font-size: 24px;
}

.track-display {
    color: #00ff88;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.playlist-section {
    margin-bottom: 20px;
    padding: 10px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(8, 12, 20, 0.95), rgba(16, 20, 30, 0.95));
    box-shadow: inset 0 0 0 1px rgba(0, 255, 136, 0.07);
}

#trackSelector {
    width: 100%;
    background: radial-gradient(circle at 0% 0%, #060a10 0%, #05070b 40%, #040509 100%);
    color: #b8ffe0;
    border: 1px solid rgba(0, 255, 136, 0.35);
    border-radius: 7px;
    padding: 10px;
    font-size: 12px;
    outline: none;
}

#trackSelector option {
    padding: 5px;
    cursor: pointer;
    background-color: #05070b;
}

#trackSelector option:hover {
    background: #10141f;
}

.equalizer-section {
    display: flex;
    justify-content: space-between;
    height: 40px;
    align-items: flex-end;
    padding: 8px 10px 0;
    border-radius: 10px;
    background: radial-gradient(circle at 50% 0%, rgba(0, 255, 136, 0.18), transparent 55%);
    box-shadow: inset 0 0 0 1px rgba(0, 255, 136, 0.12);
}

.eq-bar {
    width: 8px;
    background: linear-gradient(to top, #00ff88, #d6ffe8);
    border-radius: 4px;
    transition: height 0.08s ease;
    box-shadow: 
        0 0 10px rgba(0, 255, 136, 0.6),
        0 0 4px rgba(0, 255, 136, 0.9);
}

@media (max-width: 480px) {
    .radio-unit {
        padding: 20px;
        margin: 10px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .play-pause {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    /* Soften heavy background effects on mobile to reduce flashing */
    body::before {
        animation: none;
        opacity: 0.25;
    }

    .bg-layer {
        opacity: 0.35;
        transition: filter 0.5s ease, opacity 0.5s ease, transform 0.5s ease;
    }

    .layer-1,
    .layer-2,
    .layer-3,
    .layer-4 {
        animation-duration: 2x;
        animation-iteration-count: infinite;
    }
}

