:root {
    --accent: #97b0f2;
    --bg-primary: #000;
    --bg-secondary: #1a1a1a;
    --text-primary: #fff;
    --text-secondary: #ccc;
}

/* Modo oscuro */
body.light-mode {
    --bg-primary: #f5f5f5;
    --bg-secondary: #fff;
    --text-primary: #222;
    --text-secondary: #555;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    position: relative;
}

.app::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 100%);
    z-index: 0;
}

body.light-mode .app::after {
    background: linear-gradient(0deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.3) 100%);
}

.volver-sitio-btn {
    position: absolute;
    top: 30px;
    right: 20px;
    z-index: 10;
    background: rgba(0,0,0,0.6);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    backdrop-filter: blur(5px);
}

body.light-mode .volver-sitio-btn {
    background: rgba(255,255,255,0.8);
    color: #222;
}

.minimize-btn {
    position: absolute;
    top: 30px;
    z-index: 10;
    background: rgba(0,0,0,0.6);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    border: none;
    cursor: pointer;
    backdrop-filter: blur(5px);
    font-size: 16px;
}

body.light-mode .minimize-btn {
    background: rgba(255,255,255,0.8);
    color: #222;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20,20,20,0.94);
    color: #fff;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 14px;
    max-width: 85%;
    text-align: center;
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

body.light-mode .toast {
    background: rgba(255,255,255,0.96);
    color: #222;
}

.menu-btn {
    position: absolute;
    top: 30px;
    left: 20px;
    z-index: 10;
    background: rgba(0,0,0,0.6);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(5px);
    color: white;
    font-size: 20px;
}

body.light-mode .menu-btn {
    background: rgba(255,255,255,0.8);
    color: #222;
}

.logo-circle {
    width: 180px;
    height: 180px;
    margin: 0 auto 30px;
    border-radius: 50%;
    position: relative;
    border: 4px solid rgba(255,255,255,0.1);
    z-index: 1;
    cursor: pointer;
}

body.light-mode .logo-circle {
    border-color: rgba(0,0,0,0.1);
}

#logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.audio-loader {
    position: absolute;
    inset: -4px;
    border: 4px solid transparent;
    border-top-color: #97b0f2;
    border-radius: 50%;
    display: none;
    animation: spin 1s linear infinite;
}

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

.logo-circle.playing::before,
.logo-circle.playing::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #97b0f2;
    animation: pulso-anillo 2.2s ease-out infinite;
    pointer-events: none;
}
.logo-circle.playing::after { animation-delay: 1.1s; }

@keyframes pulso-anillo {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.45); opacity: 0; }
}

.logo-circle.playing {
    animation: logo-respira 2.4s ease-in-out infinite;
}
@keyframes logo-respira {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.035); }
}

.player { position: relative; z-index: 2; text-align: center; width: 85%; }

/* Álbum Art */
.album-art-container {
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
    border-radius: 12px;
    overflow: hidden;
    z-index: 1;
    position: relative;
    display: none;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.album-art-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#play {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    border: none;
    font-size: 30px;
    background: white;
    color: black;
    cursor: pointer;
    transition: transform 0.2s ease;
}
#play:active { transform: scale(0.93); }

body.light-mode #play {
    background: #97b0f2;
    color: white;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

#status {
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.equalizer {
    display: none;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
}
.equalizer.active { display: flex; }
.equalizer span {
    width: 3px;
    background: #97b0f2;
    border-radius: 2px;
    animation: eq-bar 1s ease-in-out infinite;
}
.equalizer span:nth-child(1) { animation-delay: -0.9s; }
.equalizer span:nth-child(2) { animation-delay: -0.6s; }
.equalizer span:nth-child(3) { animation-delay: -0.3s; }
.equalizer span:nth-child(4) { animation-delay: 0s; }
@keyframes eq-bar {
    0%, 100% { height: 3px; }
    50% { height: 16px; }
}

.vol-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 20px;
    border-radius: 40px;
    backdrop-filter: blur(10px);
    margin-top: 20px;
}

body.light-mode .vol-container {
    background: rgba(0, 0, 0, 0.08);
}

#volume { flex: 1; accent-color: white; cursor: pointer; }

body.light-mode #volume { accent-color: #97b0f2; }

.menu {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.menu.active { display: flex; }

body.light-mode .menu {
    background: rgba(255,255,255,0.95);
}

.menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: var(--text-primary);
}

#menuItems {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 80%;
    max-width: 300px;
}

.menu-link {
    color: #97b0f2;
    text-decoration: none;
    font-size: 18px;
    padding: 12px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 40px;
    width: 100%;
    text-align: center;
    transition: all 0.3s ease;
}

body.light-mode .menu-link {
    background: rgba(0,0,0,0.05);
}

.menu-link:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

body.light-mode .menu-link:hover {
    background: rgba(0,0,0,0.1);
}

/* Toggle modo oscuro en menú */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 40px;
    color: var(--text-primary);
    font-size: 18px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.light-mode .menu-toggle {
    background: rgba(0,0,0,0.05);
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.2);
}

body.light-mode .menu-toggle:hover {
    background: rgba(0,0,0,0.1);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: #97b0f2;
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
}

#menuItems h2 {
    color: var(--text-primary);
    margin-bottom: 5px;
    text-align: center;
}
#menuItems p {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    margin-bottom: 20px;
}
#menuItems hr {
    width: 50%;
    border-color: #97b0f2;
    margin: 10px 0;
}

/* Ahora suena en el menú */
.ahora-suena {
    color: var(--text-primary);
    font-size: 14px;
    text-align: center;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    width: 100%;
}

body.light-mode .ahora-suena {
    background: rgba(0,0,0,0.05);
}

.ahora-suena .titulo {
    font-weight: bold;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.ahora-suena .cancion {
    font-size: 16px;
    font-weight: 600;
}
.ahora-suena .artista {
    font-size: 13px;
    color: var(--text-secondary);
}

.splash-screen {
    position: fixed; inset: 0; z-index: 999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #000; transition: opacity 0.5s;
}
.splash-hidden { opacity: 0; visibility: hidden; }
#splash-logo { width: 120px; margin-bottom: 20px; }
.loader { width: 30px; height: 30px; border: 3px solid #333; border-top: 3px solid #fff; border-radius: 50%; animation: spin 1s linear infinite; }

.live-banner {
    position: fixed;
    top: 30px;
    right: 20px;
    background: linear-gradient(135deg, #ff0000, #cc0000);
    border-radius: 40px;
    padding: 8px 16px;
    cursor: pointer;
    z-index: 15;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    animation: pulse-live 1.5s infinite;
}

.live-banner-content { display: flex; align-items: center; gap: 8px; color: white; font-weight: bold; font-size: 12px; }
.live-indicator { font-size: 14px; animation: blink 1s infinite; }

@keyframes pulse-live {
    0% { box-shadow: 0 4px 15px rgba(255,0,0,0.3); }
    50% { box-shadow: 0 4px 25px rgba(255,0,0,0.7); }
    100% { box-shadow: 0 4px 15px rgba(255,0,0,0.3); }
}

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

.video-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 30px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    position: relative;
    z-index: 2;
}

.video-container video { width: 100%; height: auto; display: block; border-radius: 12px; }

.close-video-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
}

/* Panel de estadísticas (5 taps) */
.stats-panel {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}
.stats-panel.active { display: flex; }

body.light-mode .stats-panel {
    background: rgba(255,255,255,0.85);
}

.stats-box {
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    color: var(--text-primary);
    font-family: 'Segoe UI', Arial, sans-serif;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

body.light-mode .stats-box {
    border-color: rgba(0,0,0,0.1);
}

.stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

body.light-mode .stats-header {
    border-bottom-color: rgba(0,0,0,0.1);
}

.stats-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
}

.stats-content {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 14px;
}

.stats-item {
    padding: 10px 12px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.light-mode .stats-item {
    background: rgba(0,0,0,0.05);
}

.stats-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stats-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.stats-loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

.stats-btn {
    background: #97b0f2;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: opacity 0.3s;
}
.stats-btn:active { opacity: 0.85; }
.stats-btn:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 768px) {
    .live-banner { top: 20px; right: 15px; padding: 6px 12px; }
    .video-container { max-width: 320px; }
    .logo-circle { width: 140px; height: 140px; }
    .album-art-container { width: 140px; height: 140px; }
    #play { width: 70px; height: 70px; font-size: 24px; }
}

@media (min-width: 1024px) {
    body { overflow: auto; }
    .app { height: 100vh; flex-direction: row; justify-content: center; align-items: center; gap: 60px; }
    .player { width: 400px; flex-shrink: 0; }
    .logo-circle { width: 240px; height: 240px; }
    .album-art-container { width: 240px; height: 240px; }
    #play { width: 100px; height: 100px; font-size: 38px; }
    #status { font-size: 18px; }
    .video-container { max-width: 720px; flex: 1; margin: 0; }
    .video-container video { width: 100%; height: auto; max-height: 80vh; border-radius: 16px; }
    .menu-btn { top: 40px; left: 40px; width: 55px; height: 55px; font-size: 22px; }
    .live-banner { top: 40px; right: 40px; font-size: 14px; padding: 10px 20px; }
}