* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg-dark: #05050a;
  --bg-card: rgba(15, 20, 35, 0.85);
  --primary: #3b82f6;
  --accent: #a855f7;
  --neon-blue: #00d4ff;
  --neon-purple: #a855f7;
  --neon-red: #ef4444;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
}

/* === FONDO DE ESTUDIO PROFESIONAL === */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  min-height: 100dvh; /* dynamic viewport height para móviles */
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 0;
  margin: 0;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  
  background: 
    radial-gradient(ellipse at top left, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at top right, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(0, 212, 255, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, #05050a 0%, #0a0a1a 50%, #05050a 100%);
  background-attachment: fixed;
}

/* Luces LED de estudio */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.25) 0%, transparent 25%),
    radial-gradient(circle at 85% 80%, rgba(168, 85, 247, 0.25) 0%, transparent 25%),
    radial-gradient(circle at 50% 50%, rgba(0, 212, 255, 0.08) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
  animation: studioLights 8s ease-in-out infinite alternate;
}

@keyframes studioLights {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

/* Textura de grano */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
}

/* Ondas de sonido */
.sound-waves {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 3px;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sound-wave-bar {
  width: 3px;
  background: linear-gradient(to top, var(--neon-blue), var(--neon-purple));
  border-radius: 3px;
  animation: wave 1.5s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% { height: 15px; opacity: 0.3; }
  50% { height: 60px; opacity: 0.8; }
}

.sound-wave-bar:nth-child(1) { animation-delay: 0s; }
.sound-wave-bar:nth-child(2) { animation-delay: 0.1s; }
.sound-wave-bar:nth-child(3) { animation-delay: 0.2s; }
.sound-wave-bar:nth-child(4) { animation-delay: 0.3s; }
.sound-wave-bar:nth-child(5) { animation-delay: 0.4s; }
.sound-wave-bar:nth-child(6) { animation-delay: 0.5s; }
.sound-wave-bar:nth-child(7) { animation-delay: 0.6s; }
.sound-wave-bar:nth-child(8) { animation-delay: 0.7s; }
.sound-wave-bar:nth-child(9) { animation-delay: 0.8s; }
.sound-wave-bar:nth-child(10) { animation-delay: 0.9s; }
.sound-wave-bar:nth-child(11) { animation-delay: 1.0s; }
.sound-wave-bar:nth-child(12) { animation-delay: 1.1s; }
.sound-wave-bar:nth-child(13) { animation-delay: 1.2s; }
.sound-wave-bar:nth-child(14) { animation-delay: 1.3s; }
.sound-wave-bar:nth-child(15) { animation-delay: 1.4s; }
.sound-wave-bar:nth-child(16) { animation-delay: 1.3s; }
.sound-wave-bar:nth-child(17) { animation-delay: 1.2s; }
.sound-wave-bar:nth-child(18) { animation-delay: 1.1s; }
.sound-wave-bar:nth-child(19) { animation-delay: 1.0s; }
.sound-wave-bar:nth-child(20) { animation-delay: 0.9s; }

/* === APP CONTENEDOR === */
.app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0.75rem 1rem; /* Padding reducido */
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}

/* Header más compacto */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  flex-shrink: 0;
}

.header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, var(--neon-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.install-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.install-btn:active { transform: scale(0.95); }
.hidden { display: none !important; }

/* Player compacto */
.player {
  background: var(--bg-card);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border-radius: 24px;
  padding: 1.25rem 1rem; /* Padding reducido */
  margin-top: 0.5rem;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255,255,255,0.1);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Distribuye el espacio */
  position: relative;
}

/* Borde neón */
.player::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 24px;
  padding: 1px;
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.3), 
    rgba(168, 85, 247, 0.3), 
    rgba(0, 212, 255, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.5;
}

/* Logo más pequeño */
.cover {
  position: relative;
  width: 140px; /* Reducido de 220px */
  height: 140px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  overflow: visible;
  flex-shrink: 0;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 
    0 15px 30px rgba(0,0,0,0.6),
    0 0 40px rgba(59, 130, 246, 0.3);
  transition: transform 0.3s;
  border: 2px solid rgba(255,255,255,0.1);
}

.cover.playing img {
  animation: rotate 15s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.pulse {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid var(--neon-blue);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 15px var(--neon-blue);
}

.cover.playing .pulse {
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* Info compacta */
.info h2 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, var(--neon-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.status {
  color: var(--text-dim);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 1.2em;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}

.status.live { 
  color: var(--success); 
  font-weight: 700;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}
.status.live::before {
  content: '●';
  font-size: 0.6rem;
  animation: blink 1.5s infinite;
  color: var(--neon-red);
  text-shadow: 0 0 8px var(--neon-red);
}
.status.connecting { color: var(--warning); }
.status.error { color: var(--error); }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Controles más compactos */
.controls {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0;
  flex-shrink: 0;
}

.play-btn {
  width: 65px; /* Reducido de 85px */
  height: 65px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border: none;
  color: white;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 
    0 8px 20px rgba(59, 130, 246, 0.5),
    0 0 30px rgba(168, 85, 247, 0.3),
    inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.play-btn::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  opacity: 0.4;
  filter: blur(8px);
  z-index: -1;
}

.play-btn:active { 
  transform: scale(0.92); 
  box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

/* Volumen compacto */
.volume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.volume input {
  flex: 1;
  -webkit-appearance: none;
  height: 5px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  outline: none;
}

.volume input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.5);
}

/* Redes sociales compactas */
.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; /* Reducido de 52px */
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.social-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.social-btn:hover {
  transform: translateY(-3px);
  color: white;
}

.social-btn:hover svg {
  transform: scale(1.1);
}

.social-btn.facebook:hover { 
  background: #1877F2; 
  border-color: #1877F2; 
  box-shadow: 0 6px 20px rgba(24, 119, 242, 0.5);
}
.social-btn.instagram:hover { 
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); 
  border-color: transparent; 
  box-shadow: 0 6px 20px rgba(220, 39, 67, 0.5);
}
.social-btn.whatsapp:hover { 
  background: #25D366; 
  border-color: #25D366; 
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* Footer compacto */
.footer {
  text-align: center;
  padding: 0.75rem 0 0.5rem;
  color: var(--text-dim);
  font-size: 0.7rem;
  opacity: 0.7;
  letter-spacing: 1px;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* BANNER iOS */
.ios-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(0, 212, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
  animation: slideUp 0.5s ease-out;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 16px 16px 0 0;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.ios-install-banner p {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.3;
}

.ios-install-banner strong {
  color: var(--neon-blue);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.close-ios-banner {
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* === AJUSTES PARA PANTALLAS MUY PEQUEÑAS === */
@media (max-height: 650px) {
  .cover {
    width: 120px;
    height: 120px;
  }
  
  .play-btn {
    width: 55px;
    height: 55px;
    font-size: 1.4rem;
  }
  
  .info h2 {
    font-size: 1.1rem;
  }
  
  .social-btn {
    width: 40px;
    height: 40px;
  }
  
  .social-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* === AJUSTES PARA PC === */
@media (min-width: 768px) {
  .app {
    padding: 2rem;
  }
  
  .cover {
    width: 200px;
    height: 200px;
  }
  
  .play-btn {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }
}