/* Syne = fuente de marca (titulos/logo, organica y fluida). Sora = UI/cuerpo. */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=Sora:wght@300;400;500;600;700&display=swap');

:root {
  --accent: #7c5cff;
  --accent-hover: #8b6dff;
  --accent-rgb: 124, 92, 255; /* coma: para rgba(var(--accent-rgb), x) existentes */
  --accent2-rgb: 210, 75, 255;
  --accent3-rgb: 77, 214, 255;
  /* Espacios: para Tailwind rgb(var(--c-...) / <alpha-value>) */
  --c-accent: 124 92 255;
  --c-accent-hover: 139 109 255;
  --c-accent2: 210 75 255;
  --c-accent3: 77 214 255;
  /* Paleta fluida: violeta -> fucsia -> cian */
  --accent2: #d24bff;
  --accent3: #4dd6ff;
  --grad-accent: linear-gradient(120deg, #7c5cff 0%, #d24bff 50%, #4dd6ff 100%);
  --base: #0d0d12;
  --surface: #16161f;
  --surface2: #20202b;
  /* Tipografía (Customización Premium): cambiar estas 2 vars reviste TODA la app. */
  --font-body: 'Sora', system-ui, -apple-system, sans-serif;
  --font-display: 'Syne', sans-serif;
  --display-spacing: -0.02em;
}

/* El cuerpo manda la fuente a TODO por herencia (botones/inputs heredan vía Tailwind). */
body {
  font-family: var(--font-body);
  position: relative;
}
/* Refuerzo: cualquier control que no herede toma también la fuente del cuerpo
   (se excluyen los íconos de Font Awesome para no romperlos). */
button, input, select, textarea, .font-body { font-family: var(--font-body); }

/* Titulos con la fuente de marca */
h1, h2, h3, .section-title {
  font-family: var(--font-display);
  letter-spacing: var(--display-spacing);
}

/* Wordmark de la marca (NamuLi Music) */
.brand-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: var(--display-spacing);
}

/* Glow neon para el acento (logo, boton de play, tarjetas activas) */
.glow-accent {
  box-shadow: 0 0 28px -6px rgba(var(--accent-rgb), 0.6);
}

/* ---- Aurora de fondo (color fluido que se mueve lentisimo) ---- */
#aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  /* Degradado base que TIÑE el fondo con el color del tema (como en Android): malla de
     varias manchas de color de la paleta sobre el negro base. Estático (barato en GPU)
     y cambia solo al cambiar la paleta (usa las vars del tema). */
  background:
    radial-gradient(130% 95% at 50% -15%, rgba(var(--accent-rgb), 0.42), transparent 55%),
    radial-gradient(110% 85% at 100% 6%, rgba(var(--accent2-rgb), 0.32), transparent 55%),
    radial-gradient(120% 95% at 0% 100%, rgba(var(--accent3-rgb), 0.30), transparent 58%),
    radial-gradient(100% 80% at 88% 108%, rgba(var(--accent2-rgb), 0.24), transparent 60%),
    var(--base);
  transition: background 0.6s ease;
}
/* Manchas pre-desenfocadas que SOLO se trasladan: la GPU cachea la capa
   borrosa y solo la recompone (barato). Nada de animar scale/blur. */
/* Sin filter:blur (carisimo en GPU integrada). El degradado radial que se
   desvanece a transparent ya se ve difuso, y solo se traslada (composited). */
#aurora::before,
#aurora::after {
  content: '';
  position: absolute;
  width: 85vw;
  height: 85vw;
  border-radius: 50%;
  opacity: 0.65;
  will-change: transform;
  transform: translateZ(0);
}
#aurora::before {
  top: -25vw;
  left: -18vw;
  background: radial-gradient(circle at center, rgba(var(--accent-rgb), 0.5), transparent 70%);
  animation: auroraA 30s ease-in-out infinite;
}
#aurora::after {
  bottom: -28vw;
  right: -18vw;
  background: radial-gradient(circle at center, rgba(var(--accent3-rgb), 0.38), transparent 70%);
  animation: auroraB 36s ease-in-out infinite;
}
/* Tercera mancha fucsia (mas viva cuando suena musica) */
#aurora .blob {
  position: absolute;
  top: 22%;
  left: 28%;
  width: 64vw;
  height: 64vw;
  border-radius: 50%;
  opacity: 0.5;
  background: radial-gradient(circle at center, rgba(var(--accent2-rgb), 0.55), transparent 70%);
  animation: auroraC 26s ease-in-out infinite;
  will-change: transform;
  transform: translateZ(0);
}
.player-playing #aurora .blob { opacity: 0.62; }
@keyframes auroraA {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(16vw, 11vw, 0); }
}
@keyframes auroraB {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-15vw, -9vw, 0); }
}
@keyframes auroraC {
  0%, 100% { transform: translate3d(0, 0, 0); }
  33% { transform: translate3d(-13vw, 9vw, 0); }
  66% { transform: translate3d(11vw, -11vw, 0); }
}
@media (prefers-reduced-motion: reduce) {
  #aurora::before, #aurora::after, #aurora .blob { animation: none; }
}

/* Color de la canción: pulse.js lo fija en <body> via --pulse-rgb. */
:root { --pulse-rgb: 124, 92, 255; }

/* Tinte de página: toda la app se tiñe MUY tenue del color de la canción
   mientras suena. Es ESTÁTICO (sin latido): aparece/desaparece con una
   transición larga via la clase body.player-playing. Viñeta: centro casi
   limpio (texto legible), bordes con algo más de color. */
#pulse-overlay {
  position: fixed;
  inset: 0;
  z-index: 60; /* sobre el contenido y la barra (z-50); bajo modales/dialogos */
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.6s ease;
  background: radial-gradient(135% 125% at 50% 42%,
              rgba(var(--pulse-rgb), 0.02) 0%,
              rgba(var(--pulse-rgb), 0.06) 46%,
              rgba(var(--pulse-rgb), 0.13) 78%,
              rgba(var(--pulse-rgb), 0.20) 100%);
}
body.player-playing #pulse-overlay { opacity: 1; }
body.pulse-disabled #pulse-overlay { display: none; }

/* Latido en el reproductor: domo de luz que nace del borde superior de la
   barra y late con los graves (luz emitida desde el player, no un filtro
   encima del contenido). Solo se animan opacidad/transform de esta capa
   (compositor puro = barato hasta en equipos lentos). */
#player-glow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 120px;
  pointer-events: none;
  opacity: 0;
  will-change: opacity, transform;
  transform: translateZ(0);
  transform-origin: 50% 100%;
  background:
    radial-gradient(55% 32% at 50% 100%,
                rgba(var(--pulse-rgb), 0.38) 0%,
                rgba(var(--pulse-rgb), 0) 70%),
    radial-gradient(125% 100% at 50% 100%,
                rgba(var(--pulse-rgb), 0.18) 0%,
                rgba(var(--pulse-rgb), 0.07) 45%,
                rgba(var(--pulse-rgb), 0) 72%);
}

/* Borde superior de la barra teñido del color de la canción mientras suena */
.player-inner { transition: border-color 1.2s ease; }
body.player-playing .player-inner { border-top-color: rgba(var(--pulse-rgb), 0.50); }

@media (prefers-reduced-motion: reduce) {
  #player-glow { display: none; }
}

/* ===== Estilos de latido (Premium) — pulse.js fija --pulse-amp (0..1) por frame =====
   Todos son AMBIENTALES: cambian el FONDO con cada golpe, sin formas superpuestas. */
:root { --pulse-amp: 0; }

/* 'domo' (defecto): luz que sube desde la barra del reproductor (#player-glow). */

/* 'fondo': el tinte de color del fondo se intensifica con cada golpe (gamma más
   fuerte en los bordes). Reusa el vignette de #pulse-overlay, pero su opacidad
   sigue al golpe en tiempo real (sin transición, para que "lata"). */
body.pulse-style-fondo #player-glow { display: none; }
body.player-playing.pulse-style-fondo #pulse-overlay {
  opacity: calc(0.45 + var(--pulse-amp) * 0.55);
  transition: none;
}

/* 'aurora': la propia aurora del fondo se aviva (brillo + saturación) con el golpe.
   Es un filtro sobre la capa de fondo, así que late TODO el ambiente, no una figura. */
body.pulse-style-aurora #player-glow { display: none; }
body.player-playing.pulse-style-aurora #aurora {
  filter: brightness(calc(1 + var(--pulse-amp) * 0.6)) saturate(calc(1 + var(--pulse-amp) * 0.8));
}
body.player-playing.pulse-style-aurora #pulse-overlay {
  opacity: calc(0.35 + var(--pulse-amp) * 0.4);
  transition: none;
}

/* ===== Tipografías (Premium): cada tema cambia --font-display + --font-body =====
   Como body y los títulos usan estas vars, el tema reviste TODA la app. */
/* NamuLi (defecto): fuente de marca Syne con un toque más expresivo (interletra abierta). */
html[data-font="default"], html:not([data-font]) { --display-spacing: 0.01em; }
html[data-font="editorial"] { --font-display: 'Playfair Display', Georgia, serif; --font-body: 'Lora', Georgia, serif; --display-spacing: 0; }
html[data-font="geometrica"] { --font-display: 'Space Grotesk', system-ui, sans-serif; --font-body: 'Space Grotesk', system-ui, sans-serif; --display-spacing: -0.02em; }
html[data-font="redonda"] { --font-display: 'Quicksand', system-ui, sans-serif; --font-body: 'Nunito', system-ui, sans-serif; --display-spacing: 0; }
html[data-font="tech"] { --font-display: 'Chivo Mono', ui-monospace, monospace; --font-body: 'Inter', system-ui, sans-serif; --display-spacing: -0.03em; }
html[data-font="audaz"] { --font-display: 'Anton', Impact, sans-serif; --font-body: 'Inter', system-ui, sans-serif; --display-spacing: 0.01em; }
html[data-font="elegante"] { --font-display: 'Cormorant Garamond', Georgia, serif; --font-body: 'Inter', system-ui, sans-serif; --display-spacing: 0; }
html[data-font="retro"] { --font-display: 'Righteous', system-ui, sans-serif; --font-body: 'Nunito', system-ui, sans-serif; --display-spacing: 0; }
/* ===== MODO NEÓN (independiente de la fuente): los TÍTULOS son letreros de neón que
   SOLO se encienden con el golpe de graves (--pulse-amp). Sin golpe → apagados (tenues),
   sin glow. Funciona con cualquier tipografía. ===== */
body.neon-titles h1,
body.neon-titles h2,
body.neon-titles h3,
body.neon-titles .section-title,
body.neon-titles .brand-wordmark {
  color: rgb(var(--c-accent));
  /* "Apagado" sin golpe = tenue pero legible (no negro); se enciende SUAVE con el golpe.
     Rango estrecho (≈0.7→1.2) como el neón de Android para que no prenda brusco. */
  filter: brightness(calc(0.7 + var(--pulse-amp) * 0.5));
  text-shadow:
    0 0 calc(6px + var(--pulse-amp) * 12px) rgba(var(--accent-rgb), calc(0.12 + var(--pulse-amp) * 0.6)),
    0 0 calc(10px + var(--pulse-amp) * 26px) rgba(var(--accent2-rgb), calc(var(--pulse-amp) * 0.5)),
    0 0 calc(16px + var(--pulse-amp) * 40px) rgba(var(--accent3-rgb), calc(var(--pulse-amp) * 0.3));
  /* Transición más larga = el encendido respira en vez de parpadear de golpe. */
  transition: filter 0.28s ease-out, text-shadow 0.28s ease-out, color 0.5s ease;
}

/* Vista previa del gradiente de la paleta seleccionada */
.palette-preview { width: 100%; height: 34px; border-radius: 10px; box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset; }

/* Desplegable PROPIO de paletas (reemplaza al <select> nativo de barra blanca) */
.palette-dd { position: relative; }
.palette-dd-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--surface3); border-radius: 10px;
  padding: 10px 14px; font-size: 0.92rem; color: #fff; cursor: pointer;
}
.palette-dd-btn:hover { border-color: rgba(var(--accent-rgb), 0.5); }
.palette-dd-grad { width: 30px; height: 18px; border-radius: 5px; flex-shrink: 0; }
.palette-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 80;
  background: #1c1c26; border: 1px solid var(--surface3); border-radius: 12px;
  padding: 6px; max-height: 300px; overflow-y: auto;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.palette-menu::-webkit-scrollbar { width: 8px; }
.palette-menu::-webkit-scrollbar-track { background: transparent; }
.palette-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); border-radius: 8px; }
.palette-group { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); padding: 8px 10px 4px; font-weight: 800; }
.palette-opt { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; color: #e0e0e0; background: transparent; text-align: left; }
.palette-opt:hover { background: var(--surface2); }
.palette-opt.selected { background: rgba(var(--accent-rgb), 0.18); color: #fff; }

/* ===== Splash de entrada ===== */
#splash {
  position: fixed; inset: 0; z-index: 500; background: var(--base);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .55s ease;
}
#splash.splash-hide { opacity: 0; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; animation: splashIn .7s cubic-bezier(.2,.8,.2,1); }
.splash-orb { width: 88px; height: 88px; animation: splashPulse 1.8s ease-in-out infinite; box-shadow: 0 0 60px -6px rgba(var(--accent-rgb), .6); }
.splash-word { font-size: 1.55rem; letter-spacing: -.5px; }
.splash-dots { display: flex; gap: 7px; }
.splash-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: block; animation: splashDot 1s ease-in-out infinite; }
.splash-dots i:nth-child(2) { animation-delay: .15s; }
.splash-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes splashIn { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes splashPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes splashDot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

/* ===== Bienvenida a la v2.0 (una sola vez) ===== */
#welcome-v2 {
  position: fixed; inset: 0; z-index: 520; padding: 24px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(var(--accent-rgb), .18), var(--base) 60%);
  display: flex; align-items: center; justify-content: center; transition: opacity .4s ease;
}
#welcome-v2.hidden { display: none; } /* el id gana a .hidden de Tailwind: forzar oculto */
#welcome-v2.wv2-hide { opacity: 0; pointer-events: none; }
.wv2-card { max-width: 420px; width: 100%; text-align: center; animation: splashIn .6s cubic-bezier(.2,.8,.2,1); }
.wv2-badge { display: inline-block; background: var(--grad-accent); color: #fff; font-weight: 800; font-size: .72rem; padding: 4px 12px; border-radius: 9999px; letter-spacing: 1.5px; margin-bottom: 16px; }
.wv2-orb { width: 76px; height: 76px; margin: 0 auto 16px; }
.wv2-title { font-family: 'Syne', sans-serif; font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.wv2-sub { color: #b3b3b3; font-size: .9rem; margin: 6px 0 22px; }
.wv2-feats { text-align: left; display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.wv2-feat { display: flex; align-items: flex-start; gap: 14px; opacity: 0; animation: wv2In .5s ease forwards; }
.wv2-feat:nth-child(1) { animation-delay: .15s; }
.wv2-feat:nth-child(2) { animation-delay: .3s; }
.wv2-feat:nth-child(3) { animation-delay: .45s; }
.wv2-feat i { color: var(--accent); font-size: 1.2rem; width: 26px; text-align: center; margin-top: 2px; }
.wv2-feat b { display: block; font-size: .95rem; }
.wv2-feat span { display: block; color: #b3b3b3; font-size: .82rem; }
.wv2-gift { display: flex; gap: 12px; align-items: center; text-align: left; background: rgba(var(--accent-rgb), .14); border: 1px solid rgba(var(--accent-rgb), .35); border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; font-size: .9rem; line-height: 1.35; opacity: 0; animation: wv2In .5s ease .6s forwards; }
.wv2-gift i { color: var(--accent); font-size: 1.4rem; }
.wv2-btn { width: 100%; background: var(--grad-accent); color: #fff; font-weight: 800; padding: 13px; border-radius: 9999px; font-size: 1rem; transition: transform .12s ease; }
.wv2-btn:hover { transform: translateY(-1px); }
@keyframes wv2In { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* ===== Esqueletos de carga (shimmer) ===== */
.skeleton { position: relative; overflow: hidden; background: var(--surface2); border-radius: 8px; }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); animation: skelShimmer 1.3s infinite; }
@keyframes skelShimmer { 100% { transform: translateX(100%); } }
.skel-card { width: 10rem; flex-shrink: 0; }
.skel-card .skeleton-img { width: 100%; aspect-ratio: 1 / 1; border-radius: 8px; }
.skel-line { height: 10px; border-radius: 6px; margin-top: 8px; }
.skel-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; }

/* Cualquier barra de scroll de la app: oscura y sutil (nunca blanca por defecto) */
* { scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 9px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* ===== Banner del perfil (Premium) ===== */
.profile-banner {
  position: relative; width: 100%; height: 140px; border-radius: 14px; overflow: hidden;
  background: var(--grad-accent, linear-gradient(120deg, #7c5cff, #d24bff, #4dd6ff));
  margin-bottom: -44px;
}
.profile-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 768px) { .profile-banner { height: 200px; margin-bottom: -56px; } }

/* Swatch de paleta en el panel de Customización */
.palette-swatch { width: 100%; height: 40px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; transition: transform .12s ease, border-color .12s ease; }
.palette-swatch:hover { transform: translateY(-2px); }
.palette-swatch.selected { border-color: #fff; }
.cust-chip { cursor: pointer; border: 1px solid var(--surface3, #2a2a37); border-radius: 9999px; padding: 6px 14px; font-size: 0.85rem; transition: all .12s ease; }
.cust-chip.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
/* Cada chip de tipografía se previsualiza en SU propia fuente */
.cust-chip[data-font="default"] { font-family: 'Syne', sans-serif; }
.cust-chip[data-font="editorial"] { font-family: 'Playfair Display', serif; }
.cust-chip[data-font="geometrica"] { font-family: 'Space Grotesk', sans-serif; }
.cust-chip[data-font="elegante"] { font-family: 'Cormorant Garamond', serif; font-size: 0.95rem; }
.cust-chip[data-font="audaz"] { font-family: 'Anton', sans-serif; letter-spacing: .02em; }
.cust-chip[data-font="tech"] { font-family: 'Chivo Mono', monospace; }
.cust-chip[data-font="redonda"] { font-family: 'Quicksand', sans-serif; font-weight: 600; }
.cust-chip[data-font="retro"] { font-family: 'Righteous', sans-serif; }
/* Modo ligero: se activa por JS si el dispositivo va lento (FPS bajos).
   Congela la aurora (queda estatica, costo cero) y deja una sola mancha. */
.lite #aurora::before,
.lite #aurora::after,
.lite #aurora .blob { animation: none !important; }
.lite #aurora .blob { display: none; }

/* La app va por encima de la aurora; paneles centrales semi-translucidos
   para que el color fluido se asome sutilmente detras del contenido */
.app-root {
  position: relative;
  z-index: 1;
  height: 100vh;  /* fallback navegadores viejos */
  height: 100dvh; /* viewport REAL en moviles (descuenta barras del navegador) */
}

/* En movil, las pantallas completas tambien usan el alto real para no quedar
   detras de la barra del navegador / barra de gestos */
@media (max-width: 767px) {
  #sidebar,
  #lyrics-panel,
  #login-overlay {
    height: 100vh;
    height: 100dvh;
  }
}
.app-main {
  /* Velo SEMITRANSPARENTE sobre el aurora: antes era 0.72-0.88 (casi opaco) y tapaba
     el color del fondo. Ahora deja pasar bastante más el degradado del tema, manteniendo
     legibilidad (arriba más claro para que los títulos respiren). */
  background: linear-gradient(180deg, rgba(13, 13, 18, 0.40) 0%, rgba(13, 13, 18, 0.66) 100%) !important;
}
.app-content-bg { background: transparent !important; }

/* ---- Logo: orbe con onda liquida ---- */
.logo-orb {
  position: relative;
  border-radius: 13px;
  background: var(--grad-accent);
  overflow: hidden;
}
.logo-orb svg { display: block; width: 100%; height: 100%; }
.logo-wave {
  /* fluye siempre lento; al sonar musica va mas rapido + onda mas alta */
  animation: waveFlow 7s linear infinite;
  transform-box: view-box;
}
.player-playing .logo-wave {
  animation-duration: 2.2s;
}
.logo-orb .wave-amp {
  transition: transform 0.5s ease;
  transform-box: view-box;
  transform-origin: center;
}
.player-playing .logo-orb .wave-amp {
  animation: waveAmp 0.9s ease-in-out infinite;
}
@keyframes waveFlow {
  from { transform: translateX(0); }
  to { transform: translateX(-24px); }
}
@keyframes waveAmp {
  0%, 100% { transform: scaleY(0.7); }
  50% { transform: scaleY(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-wave, .logo-orb { animation: none; }
}

.spotify-green {
  color: var(--accent);
}

.bg-spotify-green {
  background-color: var(--accent);
}

/* Acento como degradado fluido (botones, chips). Estatico = sin repaint continuo */
.bg-accent {
  background-image: var(--grad-accent);
}
.hover\:bg-accent-hover:hover {
  background-image: var(--grad-accent);
  filter: brightness(1.12);
}

.spotify-bg {
  background-color: var(--base);
}

.spotify-card {
  background-color: var(--surface);
  transition: background-color 0.2s ease;
}

.spotify-card:hover {
  background-color: var(--surface2);
}

.sidebar-item {
  transition: background-color 0.1s ease;
}

.sidebar-item:hover {
  background-color: var(--surface2);
}

.sidebar-item.active {
  background-color: var(--surface2);
  color: white;
}

.nav-link {
  color: #b3b3b3;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: white;
}

.nav-link.active {
  color: white;
  font-weight: 600;
}

.track-row {
  transition: background-color 0.1s ease;
}

.track-row:hover {
  background-color: var(--surface2);
}

.track-row.playing {
  background-color: var(--surface2);
}

/* Selección múltiple en la playlist */
.track-row.is-selected {
  background-color: rgba(var(--accent-rgb), 0.16);
}
.track-row.is-selected:hover {
  background-color: rgba(var(--accent-rgb), 0.22);
}
.pl-check i { font-size: 16px; }

/* Botones de acción en bloque (barra de selección) */
.pl-bulk-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface2);
  color: #fff;
  transition: background-color 0.12s ease, opacity 0.12s ease;
}
.pl-bulk-btn:hover { background: #383838; }
.pl-bulk-danger:hover { background: #5b1f1f; color: #ff8a8a; }

.section-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.playlist-card {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.playlist-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px -15px rgb(0 0 0 / 0.4);
}

.play-button {
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  box-shadow: 0 8px 25px -5px rgb(0 0 0 / 0.3);
}

.playlist-card:hover .play-button,
.playlist-card:focus-within .play-button {
  opacity: 1;
  transform: translateY(0);
}

.main-content {
  scrollbar-width: thin;
  scrollbar-color: #535353 var(--base);
}

.main-content::-webkit-scrollbar {
  width: 8px;
}

.main-content::-webkit-scrollbar-track {
  background: var(--base);
}

.main-content::-webkit-scrollbar-thumb {
  background: #535353;
  border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: #6a6a6a;
}

.progress-bar {
  height: 4px;
  background: #535353;
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  touch-action: none; /* permite arrastrar con el dedo sin hacer scroll de la página */
}

.progress-bar .progress {
  height: 100%;
  background-image: var(--grad-accent);
  border-radius: 9999px;
  position: relative;
  transition: width 0.05s linear;
}

.progress-bar .progress::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 9999px;
  opacity: 0;
  transition: opacity 0.1s ease;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.2);
}

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

.volume-bar {
  height: 4px;
  background: #535353;
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  touch-action: none; /* permite arrastrar con el dedo sin hacer scroll de la página */
}

.volume-bar .volume {
  height: 100%;
  background: white;
  border-radius: 9999px;
  position: relative;
}

.now-playing {
  transition: all 0.2s ease;
}

.mini-cover {
  transition: transform 0.3s ease;
}

.player-controls button {
  transition: transform 0.1s ease, color 0.1s ease;
}

.player-controls button:hover {
  transform: scale(1.05);
}

.player-controls button:active {
  transform: scale(0.95);
}

.track-list {
  font-size: 14px;
}

.spotify-table-header {
  color: #b3b3b3;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.modal {
  animation: modalPop 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.nav-active {
  color: white;
  background-color: var(--surface2);
}

html {
  scroll-behavior: smooth;
}

/* ---- Entrada de vistas ---- */
@keyframes viewEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.view-enter {
  animation: viewEnter 0.38s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---- Ecualizador animado (cancion sonando) ---- */
.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.eq i {
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent3), var(--accent2), var(--accent));
  border-radius: 1px;
  transform-origin: bottom;
  animation: eqbar 0.9s ease-in-out infinite;
}
.eq i:nth-child(1) { animation-delay: -0.2s; }
.eq i:nth-child(2) { animation-delay: -0.55s; }
.eq i:nth-child(3) { animation-delay: -0.85s; }
@keyframes eqbar {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

/* ---- Tarjetas de playlist: zoom de portada ---- */
.playlist-card .card-img-wrap {
  overflow: hidden;
  border-radius: 6px;
}
.playlist-card .card-img {
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.playlist-card:hover .card-img {
  transform: scale(1.06);
}

/* ---- Portada del reproductor cuando suena ---- */
#player-cover img {
  transition: transform 0.3s ease;
}
.player-playing #player-cover img {
  animation: coverPulse 4s ease-in-out infinite;
}
@keyframes coverPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
  50% { box-shadow: 0 8px 24px -6px rgba(var(--accent-rgb), 0.45); }
}

/* ---- Filas con miniatura: revelar play al hover ---- */
.thumb-wrap {
  position: relative;
}
.thumb-wrap .thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.18s ease;
  border-radius: inherit;
}
.track-row:hover .thumb-wrap .thumb-play,
.group:hover .thumb-wrap .thumb-play {
  opacity: 1;
}

/* ---- Indicador "sonando ahora": barritas tipo ecualizador sobre la portada ---- */
.np-bars {
  position: absolute;
  inset: 0;
  display: none; /* solo visible en la miniatura de la canción activa */
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 22% 0;
  background: rgba(0, 0, 0, 0.5);
  border-radius: inherit;
  z-index: 2;
}
.np-bars span {
  display: block;
  width: 3px;
  height: 100%; /* ocupa el alto disponible; la altura visible se controla con scaleY */
  border-radius: 2px;
  background: var(--accent, #7c5cff);
  transform: scaleY(0.35);
  transform-origin: bottom center;
}
/* Canción activa: oculta el play de hover y muestra las barritas */
.thumb-wrap.is-playing .np-bars,
.thumb-wrap.is-paused .np-bars {
  display: flex;
}
.thumb-wrap.is-playing .thumb-play,
.thumb-wrap.is-paused .thumb-play {
  display: none;
}
/* Animación de las barras (escalonada). Usa scaleY: acelerada por GPU, sin reflow. */
.thumb-wrap.is-playing .np-bars span {
  animation: npEq 0.9s ease-in-out infinite;
}
.thumb-wrap.is-playing .np-bars span:nth-child(2) {
  animation-duration: 0.7s;
  animation-delay: -0.35s;
}
.thumb-wrap.is-playing .np-bars span:nth-child(3) {
  animation-duration: 1.1s;
  animation-delay: -0.6s;
}
.thumb-wrap.is-paused .np-bars span {
  transform: scaleY(0.5);
}
@keyframes npEq {
  0%, 100% { transform: scaleY(0.25); }
  50% { transform: scaleY(1); }
}
/* Solo si el usuario pidió reducir movimiento (preferencia explícita del SO) las dejamos quietas. */
@media (prefers-reduced-motion: reduce) {
  .thumb-wrap.is-playing .np-bars span { animation: none; transform: scaleY(0.55); }
}

/* ---- Insignia OFFLINE (solo escritorio): esquina inferior derecha de la portada ---- */
.offline-badge {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: none; /* oculta hasta que la canción esté descargada o bajándose */
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
  z-index: 3;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.6);
}
.offline-badge.done {
  display: flex;
  background: #1db954;
  color: #fff;
}
.offline-badge.done::before {
  content: "\f00c"; /* check (Font Awesome) */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}
.offline-badge.downloading {
  display: flex;
  background: rgba(0, 0, 0, 0.7);
  color: var(--accent, #7c5cff);
}
.offline-badge.downloading::before {
  content: "\f019"; /* download */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  animation: offPulse 1s ease-in-out infinite;
}
@keyframes offPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ---- Aviso fijo de "Sin conexión" (modo offline en escritorio) ---- */
.offline-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(20, 20, 24, 0.95);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.offline-banner i { color: #f0a500; }

/* ---- Letra: lineas ---- */
.lyric-line {
  color: #6f6f78;
  font-size: 1.25rem;
  line-height: 1.45;
  opacity: 0.55;
  transform-origin: left center;
  transition: color 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
}
@media (min-width: 768px) {
  .lyric-line { font-size: 1.35rem; }
}
/* Línea activa: degradado de marca + leve zoom (transform = barato en GPU) */
.lyric-line.active {
  opacity: 1;
  transform: scale(1.06);
  font-weight: 800;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
/* Desvanecido arriba/abajo del cuerpo de la letra */
#lyrics-body {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 46px, #000 calc(100% - 46px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 46px, #000 calc(100% - 46px), transparent 100%);
}
/* En pantalla completa la letra es mas grande */
.lyrics-fullscreen .lyric-line { font-size: 1.75rem; }
@media (min-width: 768px) {
  .lyrics-fullscreen .lyric-line { font-size: 2.25rem; }
}

/* ---- Panel de letra: scrollbar sutil (ya no blanca) ---- */
.lyrics-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.lyrics-scroll::-webkit-scrollbar { width: 6px; }
.lyrics-scroll::-webkit-scrollbar-track { background: transparent; }
.lyrics-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 3px;
}
.lyrics-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ---- Panel de letra acoplado (desktop) / pantalla completa (movil) ---- */
.lyrics-panel { animation: lyricsIn 0.3s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes lyricsIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: none; }
}
/* Boton de expandir a pantalla completa */
.lyrics-panel.lyrics-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  z-index: 130;
}
@media (prefers-reduced-motion: reduce) {
  .lyrics-panel { animation: none; }
}

/* ---- Skeleton shimmer ---- */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, #232323 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* Botones con respuesta tactil */
button {
  transition: transform 0.08s ease;
}
button:active {
  transform: scale(0.96);
}

/* ============ Toasts (avisos no bloqueantes) ============ */
#toast-container {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}
.toast {
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 92vw;
  background: var(--surface2);
  color: #fff;
  border: 1px solid var(--surface3);
  border-radius: 11px;
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.toast.toast-show { opacity: 1; transform: translateY(0); }
.toast i { font-size: 16px; flex-shrink: 0; }
.toast-success i { color: #34d399; }
.toast-error { border-color: rgba(248, 113, 113, 0.45); }
.toast-error i { color: #f87171; }
.toast-info i { color: var(--accent); }

/* ============ Dialogos (confirmar / pedir texto / codigo) ============ */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 410;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: viewEnter 0.2s ease;
}
.dialog {
  background: var(--surface);
  border: 1px solid var(--surface3);
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  padding: 22px;
}
.dialog-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 6px;
}
.dialog-msg {
  color: #b3b3b3;
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.5;
}
.dlg-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--surface3);
  border-radius: 10px;
  padding: 11px 14px;
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.dlg-input:focus { outline: none; border-color: var(--accent); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.dialog-btn {
  padding: 9px 18px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background-color 0.15s ease, filter 0.15s ease;
}
.dialog-btn.dialog-ok { background-image: var(--grad-accent); color: #fff; }
.dialog-btn.dialog-ok:hover { filter: brightness(1.1); }
.dialog-btn.dialog-danger { background: #dc2626; color: #fff; }
.dialog-btn.dialog-danger:hover { background: #ef4444; }
.dialog-btn.dlg-cancel { background: var(--surface2); color: #e0e0e0; }
.dialog-btn.dlg-cancel:hover { background: var(--surface3); }
.secret-box {
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--surface2);
  border: 1px solid var(--surface3);
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0 14px;
  color: #fff;
  user-select: all;
  word-break: break-all;
}
.code-big {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2.4rem;
  letter-spacing: 0.25em;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 10px 0 14px;
  padding-left: 0.25em;
}

/* ============ Ecualizador ============ */
.eq-dialog { max-width: 560px; }
input[type='range'] { accent-color: var(--accent); }
.eq-chip {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface2);
  color: #e0e0e0;
  border: 1px solid var(--surface3);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.eq-chip:hover { background: var(--surface3); color: #fff; }
.eq-chip.active { background-image: var(--grad-accent); color: #fff; border-color: transparent; }
.eq-output { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.eq-hint { font-size: 11px; color: #8a8a93; margin-bottom: 12px; min-height: 0; line-height: 1.4; }
.eq-hint:empty { margin-bottom: 0; }
.eq-link { color: var(--accent); font-weight: 600; }
.eq-link:hover { text-decoration: underline; }
.eq-select {
  flex: 1;
  min-width: 0;
  background: var(--surface2);
  color: #fff;
  border: 1px solid var(--surface3);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 12px;
}
.eq-select:focus { outline: none; border-color: var(--accent); }
.eq-select:disabled { color: #777; }
.eq-icon-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--surface2);
  border: 1px solid var(--surface3);
  color: #b3b3b3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.eq-icon-btn:hover { background: var(--surface3); color: #fff; }
.eq-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.eq-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.eq-row-label { width: 60px; font-size: 12px; color: #b3b3b3; }
.eq-row input[type='range'] { flex: 1; }
.eq-row-val {
  width: 56px;
  text-align: right;
  font-size: 12px;
  color: #b3b3b3;
  font-variant-numeric: tabular-nums;
}
.eq-bands { display: flex; justify-content: space-between; gap: 2px; padding-top: 8px; }
.eq-band {
  flex: 1;
  min-width: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #8a8a93;
}
.eq-db {
  font-size: 10px;
  color: #b3b3b3;
  font-variant-numeric: tabular-nums;
  min-height: 14px;
}
/* Slider vertical: input rotado dentro de un contenedor con medidas invertidas */
.eq-vwrap { position: relative; width: 24px; height: 130px; }
.eq-vwrap input[type='range'] {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130px;
  height: 24px;
  transform: translate(-50%, -50%) rotate(-90deg);
}

/* ============ Scrollbar invisible (sidebar) ============ */
.no-scrollbar {
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE/Edge viejo */
}
.no-scrollbar::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* ============ Ocultar / mostrar la barra de reproduccion ============ */
.player-inner {
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}
body.player-collapsed .player-inner {
  height: 0 !important;
  opacity: 0;
}
/* Tirador siempre visible (oculta/muestra el reproductor).
   El centrado usa translateX(-50%); fijamos el transform para que el
   "button:active { scale }" global NO pise el centrado y lo haga saltar. */
#player-handle {
  transition: color 0.2s ease, background-color 0.2s ease;
  transform: translateX(-50%);
}
#player-handle:active {
  transform: translateX(-50%) scale(0.94);
}

/* ============ Micro-animaciones de botones ============ */
/* Like: latido + brillo violeta que se desvanece */
@keyframes heartPop {
  0%   { transform: scale(1);    filter: drop-shadow(0 0 0 rgba(var(--accent-rgb), 0)); }
  25%  { transform: scale(1.4);  filter: drop-shadow(0 0 9px rgba(var(--accent-rgb), 0.9)); }
  45%  { transform: scale(0.85); }
  65%  { transform: scale(1.18); }
  100% { transform: scale(1);    filter: drop-shadow(0 0 0 rgba(var(--accent-rgb), 0)); }
}
.anim-heart { animation: heartPop 0.55s ease; }

/* Aleatorio: las flechas giran con un pequeno rebote */
@keyframes spinPop {
  0%   { transform: rotate(0) scale(1); }
  50%  { transform: rotate(180deg) scale(1.25); }
  100% { transform: rotate(360deg) scale(1); }
}
.anim-spin { animation: spinPop 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }

/* Repetir: giro completo del icono circular */
@keyframes rotate360 {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}
.anim-rotate { animation: rotate360 0.5s ease; }

/* Play/Pausa: pequeno pop */
@keyframes btnPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.82); }
  100% { transform: scale(1); }
}
.anim-pop { animation: btnPop 0.32s ease; }

/* Anterior/Siguiente: empujoncito en la direccion */
@keyframes nudgeR { 0% { transform: translateX(0); } 45% { transform: translateX(5px); } 100% { transform: translateX(0); } }
@keyframes nudgeL { 0% { transform: translateX(0); } 45% { transform: translateX(-5px); } 100% { transform: translateX(0); } }
.anim-nudge-r { animation: nudgeR 0.32s ease; }
.anim-nudge-l { animation: nudgeL 0.32s ease; }

@media (prefers-reduced-motion: reduce) {
  .anim-heart, .anim-spin, .anim-rotate, .anim-pop, .anim-nudge-r, .anim-nudge-l {
    animation: none;
  }
}

/* Carruseles horizontales (secciones de inicio) */
.row-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;      /* Firefox: sin barra (se usan las flechas) */
  -ms-overflow-style: none;   /* IE/Edge viejo */
}
.row-scroll > * {
  scroll-snap-align: start;
}
/* Barra oculta: el desplazamiento se hace con las flechas ‹ › (.hscroll-arrow) */
.row-scroll::-webkit-scrollbar {
  height: 0;
  display: none;
}

/* Cualquier scroll horizontal lateral: sin barra visible (se ve más limpio) */
.hscroll, .overflow-x-auto {
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE/Edge viejo */
}
.hscroll::-webkit-scrollbar, .overflow-x-auto::-webkit-scrollbar {
  height: 0;
  display: none;
}

/* ============ Flechas para scroll horizontal (PC) ============ */
.hscroll-wrap {
  position: relative;
}
.hscroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  display: none; /* oculto por defecto (móvil/táctil: se usa el swipe nativo) */
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(18, 18, 20, 0.88);
  color: #fff;
  border: 1px solid var(--surface3, #2a2a2a);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}
.hscroll-left { left: 2px; }
.hscroll-right { right: 2px; }
.hscroll-arrow:hover {
  background: var(--accent, #7c5cff);
}
.hscroll-arrow:active {
  transform: translateY(-50%) scale(0.92);
}
.hscroll-arrow.hidden-arrow {
  opacity: 0 !important;
  pointer-events: none;
}
/* Solo en dispositivos con mouse fino (PC): mostrar flechas y revelarlas al pasar el cursor. */
@media (hover: hover) and (pointer: fine) {
  .hscroll-arrow { display: flex; }
  .hscroll-wrap:hover .hscroll-arrow { opacity: 1; }
}

/* ============ Vista "Ahora suena" (modal mas rico) ============ */
.np-card { position: relative; overflow: hidden; }
#modal-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(120% 75% at 50% 0%, rgba(124, 92, 255, 0.55), rgba(124, 92, 255, 0.12) 45%, transparent 75%);
  transition: background 0.7s ease;
}
.np-content { position: relative; z-index: 1; }
#modal-cover { transition: transform 0.4s ease; }
.player-playing #now-playing-modal #modal-cover {
  animation: npFloat 5s ease-in-out infinite;
}
@keyframes npFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-9px) scale(1.015); }
}
@media (prefers-reduced-motion: reduce) {
  .player-playing #now-playing-modal #modal-cover { animation: none; }
}

/* ============ Inicio mas vivo ============ */
/* Saludo: icono con degradado de marca */
.home-greet-icon {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Tiles de acceso rapido (recientes) */
.quick-tile { transition: background-color 0.15s ease; }
.quick-tile .quick-play {
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.quick-tile:hover .quick-play {
  opacity: 1;
  transform: translateX(0);
}

/* Tarjeta de cancion con badge de play flotante (degradado) */
.song-card { position: relative; }
.song-card .card-play {
  position: absolute;
  right: 10px;
  bottom: 64px;
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-accent);
  color: #0d0d12;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
  box-shadow: 0 10px 22px -8px rgba(var(--accent-rgb), 0.7);
}
.song-card:hover .card-play {
  opacity: 1;
  transform: translateY(0);
}

/* ============ Cola de reproducción (pulida) ============ */
.queue-ghost {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #b3b3b3;
  padding: 0.42rem 0.7rem;
  border-radius: 9999px;
  transition: color 0.18s ease, background-color 0.18s ease;
}
.queue-ghost:hover { color: #fff; background: var(--surface2); }

.queue-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 12px;
  position: relative;
  transition: background-color 0.18s ease;
}
@media (hover: hover) {
  .queue-row:not(.is-current):hover { background: var(--surface2); }
}
.queue-row.is-current { background: rgba(var(--accent-rgb), 0.12); }

.queue-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.queue-title { font-size: 0.9rem; font-weight: 600; color: #fff; line-height: 1.3; }
.queue-row.is-current .queue-title { color: var(--accent); }
.queue-sub { font-size: 0.78rem; color: #b3b3b3; line-height: 1.3; margin-top: 1px; }
.queue-dur { font-size: 0.78rem; color: #8a8a93; padding-right: 0.15rem; flex-shrink: 0; }

/* Handle de arrastre: solo desktop con mouse (en táctil no hay drag nativo) */
.queue-grip {
  color: #5a5a63;
  cursor: grab;
  padding: 0 0.15rem;
  opacity: 0;
  transition: opacity 0.18s ease;
}
@media (hover: hover) { .queue-row:hover .queue-grip { opacity: 0.7; } }
@media (hover: none) { .queue-grip { display: none; } }
.queue-grip:active { cursor: grabbing; }

/* Quitar: aparece al hover en desktop, siempre visible en táctil */
.queue-remove {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a8a93;
  border-radius: 9999px;
  flex-shrink: 0;
  transition: color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}
.queue-remove:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
@media (hover: hover) {
  .queue-remove { opacity: 0; }
  .queue-row:hover .queue-remove { opacity: 1; }
}

/* Indicador "sonando" */
.queue-now {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  padding-right: 0.4rem;
  flex-shrink: 0;
}

/* Estados de arrastre (transform/opacity, sin blur) */
.queue-row.dragging { opacity: 0.45; }
.queue-row.drag-over::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* Switch de reproducción automática */
.np-switch {
  width: 42px;
  height: 24px;
  border-radius: 9999px;
  flex-shrink: 0;
  background: #3a3a44;
  position: relative;
  transition: background-color 0.2s ease;
}
.np-switch.on { background: var(--accent); }
.np-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: #fff;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.np-switch.on .np-knob { transform: translateX(18px); }

@media (prefers-reduced-motion: reduce) {
  .queue-row, .queue-remove, .queue-grip, .queue-ghost, .np-switch, .np-knob { transition: none; }
}

/* ==================== MEZCLA ALEATORIA ==================== */

/* Botón de inicio (Home): se estira en móvil, compacto en PC */
.mix-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 540px;
  padding: 12px 16px;
  border-radius: 16px;
  color: #fff;
  background-image: var(--grad-accent);
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.25);
  transition: transform 0.15s ease, filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.mix-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.mix-cta:active { transform: scale(0.99); }
.mix-cta-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.mix-cta-play {
  margin-left: auto;
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  background: #fff;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* Botón redondo de mezcla (apartados que ya tienen shuffle): se distingue con tinte accent */
.mix-round {
  background-image: var(--grad-accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.35);
}
.mix-round:hover { filter: brightness(1.08); }
.mix-round:active { transform: scale(0.96); }
/* ===== Premium: animación de celebración ===== */
.premium-celebrate {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55); overflow: hidden;
  animation: pcFade 0.25s ease;
}
.premium-celebrate.hide { animation: pcFade 0.45s ease reverse forwards; }
@keyframes pcFade { from { opacity: 0 } to { opacity: 1 } }
.pc-card { text-align: center; animation: pcPop 0.5s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes pcPop { 0% { transform: scale(.6); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }
.pc-badge {
  width: 92px; height: 92px; margin: 0 auto 16px; border-radius: 9999px;
  background-image: var(--grad-accent); display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: #fff; box-shadow: 0 12px 40px rgba(var(--accent-rgb), 0.55);
  animation: pcBadge 0.7s ease both;
}
@keyframes pcBadge { 0% { transform: scale(0) rotate(-30deg) } 60% { transform: scale(1.15) rotate(8deg) } 100% { transform: scale(1) rotate(0) } }
.pc-title { font-size: 1.6rem; font-weight: 800; color: #fff; }
.pc-sub { color: #cfcfd6; margin-top: 4px; }
.pc-confetti {
  position: absolute; top: -16px; width: 9px; height: 14px; border-radius: 2px; opacity: .9;
  animation: pcFall 2.4s linear forwards;
}
@keyframes pcFall {
  0% { transform: translateY(-20px) rotate(0); opacity: 1 }
  100% { transform: translateY(105vh) rotate(540deg); opacity: .85 }
}
/* ===== Premium (muro de pago) ===== */
.premium-promo {
  background-image: var(--grad-accent);
  color: #fff;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 10px 28px rgba(var(--accent-rgb), 0.35);
}
.premium-plan {
  border: 1.5px solid var(--surface3, #2a2a33);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.premium-plan.selected { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.10); }
.premium-plan-best { position: relative; }
.premium-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  color: #fff;
  background-image: var(--grad-accent);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.premium-banner:hover { filter: brightness(1.08); transform: translateY(-1px); }
.premium-banner-badge {
  background: rgba(0, 0, 0, 0.28);
  border-radius: 9999px;
  padding: 4px 12px;
  font-weight: 800;
  font-size: 0.8rem;
  white-space: nowrap;
}
/* Insignia Premium junto al logo (corona) */
.premium-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: var(--accent, #7c5cff);
  color: #fff;
  font-size: 0.62rem;
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.55);
  flex-shrink: 0;
}
.premium-logo-badge.hidden { display: none; }

/* Swipe a la derecha en la cola → rojo "no me interesa" */
.queue-row.qrow-ban {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.55), rgba(220, 38, 38, 0.08)) !important;
}
.queue-row.qrow-ban .queue-title,
.queue-row.qrow-ban .queue-sub { color: #fff; }

/* Chip "Nueva" en la cola (recomendación que no está en tu biblioteca) */
.mix-chip {
  display: inline-block;
  vertical-align: 1px;
  margin-right: 7px;
  padding: 1px 7px;
  border-radius: 9999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  background-image: var(--grad-accent);
}

/* ==================== UI MÓVIL ==================== */

/* ---- Nav inferior (solo móvil): Inicio / Buscar / Biblioteca / Favoritas / Más ---- */
#bottom-nav {
  display: flex;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
  background: #101018;
  border-top: 1px solid var(--surface3);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 768px) {
  #bottom-nav { display: none; }
}
.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0 9px;
  font-size: 10px;
  font-weight: 600;
  color: #8f8f9b;
  -webkit-tap-highlight-color: transparent;
}
.bnav-item i { font-size: 1.05rem; }
.bnav-item.active { color: #fff; }
.bnav-item.active i {
  background-image: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Progreso fino sobre la barra del reproductor (solo móvil) ---- */
#mini-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 10;
}
@media (min-width: 768px) {
  #mini-progress { display: none; }
}
#mini-progress-fill {
  height: 100%;
  width: 0;
  background-image: var(--grad-accent);
  border-radius: 0 2px 2px 0;
}
body.player-collapsed #mini-progress { display: none; }

/* ---- Táctil: acciones que en PC aparecen con hover, aquí SIEMPRE visibles
   (menú ⋮ de canción, quitar de playlist/favoritas, eliminar...) ---- */
@media (hover: none) {
  [class*='group-hover:opacity-100'] { opacity: 1 !important; }
  /* Avatar del perfil: en vez de oscurecerlo todo, una insignia de cámara */
  label[for='avatar-input'] {
    opacity: 1 !important;
    background: transparent !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
  }
  label[for='avatar-input'] i {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
  }
}

/* ---- Cola en táctil: sin drag&drop; flechas subir/bajar ---- */
.queue-movers { display: none; }
@media (hover: none) {
  .queue-movers {
    display: flex;
    flex-direction: column;
    margin-right: 2px;
  }
  .queue-movers button {
    width: 26px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8f8f9b;
    font-size: 10px;
  }
  .queue-movers button:disabled { opacity: 0.25; }
}

/* ---- Diálogos en pantallas chicas: nunca más altos que la pantalla ---- */
.dialog {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

/* ---- Modal "Reproduciendo ahora" a pantalla completa en móvil ---- */
@media (max-width: 767px) {
  #now-playing-modal { align-items: stretch; background: #000; }
  #now-playing-modal .np-card {
    max-width: none;
    width: 100%;
    height: 100dvh;
    margin: 0;
    border: none;
    border-radius: 0;
  }
  #now-playing-modal .np-content {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  /* Bloque superior (header + portada + título/acciones) crece... */
  #now-playing-modal .np-content > div:first-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  /* ...y la portada se centra en el espacio sobrante, más grande */
  #now-playing-modal .np-content > div:first-child > div:nth-child(2) {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    min-height: 0;
  }
  #modal-cover {
    width: min(78vw, 340px);
    height: min(78vw, 340px);
  }
  /* Título arriba, fila de acciones debajo (no se pelean por el ancho) */
  #now-playing-modal .np-content > div:first-child > div:nth-child(3) {
    flex-direction: column;
    align-items: stretch;
  }
  #now-playing-modal .np-content > div:first-child > div:nth-child(3) > div:last-child {
    justify-content: space-between;
    padding-top: 10px;
  }
  /* Controles con aire + zona segura abajo */
  #now-playing-modal .np-content > div:last-child {
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
}

/* ============ Micro-animaciones (transform GPU; se omiten en .lite) ============ */
button, .song-card, .quick-tile, .track-row, .eq-chip, .preview-btn, .np-switch {
  transition: transform 0.12s ease;
}
button:active, .eq-chip:active, .preview-btn:active { transform: scale(0.94); }
.song-card:active, .quick-tile:active, .track-row:active { transform: scale(0.975); }
body.lite button:active,
body.lite .eq-chip:active,
body.lite .preview-btn:active,
body.lite .song-card:active,
body.lite .quick-tile:active,
body.lite .track-row:active { transform: none; }

/* ============ Enlace de artista clicable dentro de filas/listas ============ */
.artist-link {
  cursor: pointer;
  transition: color 0.12s ease;
}
.artist-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* ============ Scroll rápido móvil (agarradera lateral arrastrable) ============ */
#fast-scroll {
  position: fixed;
  right: 5px;
  width: 34px;
  height: 46px;
  z-index: 130;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.12s ease;
  touch-action: none;
  color: #fff;
}
#fast-scroll.on {
  display: flex;
}
#fast-scroll.on.vis {
  opacity: 1;
  pointer-events: auto;
}
#fast-scroll i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 40px;
  font-size: 13px;
  border-radius: 12px;
  background: rgba(20, 20, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
#fast-scroll.drag {
  transform: scale(1.08);
}
#fast-scroll.drag i {
  background: var(--accent, #1db954);
  border-color: rgba(255, 255, 255, 0.35);
}
/* En el modo .lite (laptops débiles) sin blur ni sombras pesadas */
body.lite #fast-scroll i {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(20, 20, 22, 0.92);
  box-shadow: none;
}

/* ============ Tablilla pequeña de canción (Buscar) ============ */
.song-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: songCardFade 0.15s ease;
}
@media (min-width: 640px) {
  .song-card-overlay { align-items: center; }
}
.song-card-sheet {
  width: 100%;
  max-width: 440px;
  background: var(--surface, #181818);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px 18px 0 0;
  padding: 18px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
  animation: songCardUp 0.18s ease;
}
@media (min-width: 640px) {
  .song-card-sheet { border-radius: 18px; }
}
.song-card-act {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border-radius: 10px;
  color: #fff;
  transition: background 0.12s ease;
}
.song-card-act:hover { background: var(--surface2, #282828); }
@keyframes songCardFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes songCardUp { from { transform: translateY(16px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
body.lite .song-card-overlay,
body.lite .song-card-sheet { animation: none; }

/* ==================== Modo offline (app de escritorio) ==================== */
/* Insignia opcional para marcar canciones disponibles sin conexión. */
.offline-badge { display: inline-block; width: 14px; height: 14px; }
.offline-badge.done::before { content: "\f058"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: #34d399; font-size: 12px; }
.offline-badge.downloading::before { content: "\f019"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: #1db954; font-size: 11px; animation: offPulse 1s ease-in-out infinite; }
@keyframes offPulse { 0%,100% { opacity: .4; } 50% { opacity: 1; } }
