/* ============================================================
   RADIO CONEXIÓN LAMBARÉ — estilos
   Tema moderno claro/oscuro
   ============================================================ */

:root {
  --accent-1: #7c3aed;   /* violeta */
  --accent-2: #ec4899;   /* fucsia */
  --accent-3: #22d3ee;   /* cian */
  --grad: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  --grad-soft: linear-gradient(135deg, rgba(124,58,237,.18), rgba(236,72,153,.18));

  --radius: 22px;
  --radius-sm: 14px;
}

/* ---- Tema oscuro (por defecto) ---- */
html[data-theme="dark"] {
  --bg: #0b0f1a;
  --bg-glow-1: rgba(124, 58, 237, .35);
  --bg-glow-2: rgba(236, 72, 153, .28);
  --surface: rgba(255, 255, 255, .06);
  --surface-strong: rgba(255, 255, 255, .09);
  --border: rgba(255, 255, 255, .10);
  --text: #f3f4f6;
  --text-dim: #a1a1b5;
  --text-faint: #6b7280;
  --shadow: 0 20px 50px rgba(0, 0, 0, .45);
  --track: rgba(255, 255, 255, .16);
}

/* ---- Tema claro ---- */
html[data-theme="light"] {
  --bg: #f4f5fb;
  --bg-glow-1: rgba(124, 58, 237, .16);
  --bg-glow-2: rgba(236, 72, 153, .14);
  --surface: rgba(255, 255, 255, .82);
  --surface-strong: #ffffff;
  --border: rgba(15, 23, 42, .08);
  --text: #111827;
  --text-dim: #4b5563;
  --text-faint: #9ca3af;
  --shadow: 0 18px 40px rgba(30, 27, 75, .10);
  --track: rgba(15, 23, 42, .14);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(60% 45% at 15% 0%, var(--bg-glow-1), transparent 60%),
    radial-gradient(55% 40% at 90% 12%, var(--bg-glow-2), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 30px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Cabecera ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
  width: 46px; height: 46px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.35));
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-size: 17px; font-weight: 800; letter-spacing: .5px; line-height: 1.1;
  white-space: nowrap;
}
.brand-tag {
  font-size: 11px; font-weight: 600; letter-spacing: 2px;
  color: transparent;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  margin-top: 3px;
}

.icon-btn {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; flex-shrink: 0;
  transition: transform .15s ease, background-color .3s ease;
}
.icon-btn:hover { transform: scale(1.06); }
.icon-btn:active { transform: scale(.94); }

/* mostrar icono sol/luna según tema */
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: block; }

/* ---------- Tarjeta portada ---------- */
.now-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
}
.now-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 120px;
  background: var(--grad-soft); pointer-events: none;
}

.art-wrap { position: relative; }
.art {
  width: 200px; height: 200px; border-radius: 18px;
  object-fit: cover;
  display: block;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  border: 1px solid var(--border);
}
/* animación suave mientras reproduce */
.art.playing { animation: floaty 5s ease-in-out infinite; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.live-badge {
  position: absolute; top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(220, 38, 38, .92); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  padding: 5px 10px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(220,38,38,.4);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.7); }
}

.now-meta { text-align: center; }
.song-title {
  font-size: 21px; font-weight: 800; line-height: 1.2;
  overflow-wrap: anywhere;
}
.song-artist {
  font-size: 14px; font-weight: 500; color: var(--text-dim);
  margin-top: 6px; overflow-wrap: anywhere;
}

.stats { display: flex; gap: 10px; width: 100%; }
.stat {
  flex: 1; text-align: center;
  background: var(--surface-strong); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 6px;
}
.stat-val { display: block; font-size: 16px; font-weight: 800; }
.stat-label {
  display: block; font-size: 10.5px; color: var(--text-faint);
  letter-spacing: 1px; text-transform: uppercase; margin-top: 2px;
}

/* ---------- Reproductor ---------- */
.player-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.play-btn {
  width: 78px; height: 78px; border-radius: 50%;
  border: none; cursor: pointer; color: #fff;
  background: var(--grad);
  display: grid; place-items: center;
  box-shadow: 0 12px 30px rgba(236, 72, 153, .45);
  transition: transform .12s ease, box-shadow .3s ease;
}
.play-btn:hover { transform: scale(1.05); }
.play-btn:active { transform: scale(.94); }
.play-btn svg { margin-left: 3px; }
.play-btn .icon-pause { display: none; margin-left: 0; }
.play-btn.playing .icon-play { display: none; }
.play-btn.playing .icon-pause { display: block; }

.volume { display: flex; align-items: center; gap: 12px; width: 100%; }
.volume .icon-btn { width: 40px; height: 40px; }
.volume .icon-mute { display: none; }
.volume.muted .icon-vol { display: none; }
.volume.muted .icon-mute { display: block; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 6px; border-radius: 999px;
  background: var(--track); outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--grad); border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.3); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--grad); border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.3); cursor: pointer;
}

.status-text { font-size: 12.5px; color: var(--text-faint); font-weight: 600; letter-spacing: .3px; }
.status-text.error { color: #ef4444; }

/* ---------- Tarjetas genéricas ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.card-title {
  font-size: 13px; font-weight: 800; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 14px;
}

/* ---------- Historial ---------- */
.history-list { list-style: none; display: flex; flex-direction: column; }
.history-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 4px; font-size: 13.5px; color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.history-list li:last-child { border-bottom: none; }
.history-list .h-num {
  font-size: 11px; font-weight: 800; color: var(--text-faint);
  min-width: 22px; text-align: right;
}
.history-empty { color: var(--text-faint); font-style: italic; }

/* ---------- Compartir ---------- */
.share-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
.share-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px; border-radius: var(--radius-sm);
  text-decoration: none; color: #fff; font-size: 11px; font-weight: 700;
  border: none; cursor: pointer; font-family: inherit;
  transition: transform .12s ease, filter .2s ease;
}
.share-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.share-btn:active { transform: scale(.95); }
.share-btn.wa  { background: #25d366; }
.share-btn.fb  { background: #1877f2; }
.share-btn.x   { background: #111; }
.share-btn.tg  { background: #229ed9; }
.share-btn.copy{ background: var(--surface-strong); color: var(--text); border: 1px solid var(--border); }

/* ---------- Instalar ---------- */
.install { display: flex; align-items: center; gap: 14px; }
.install-text { flex: 1; }
.install-text strong { font-size: 14.5px; }
.install-text p { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.install-btn {
  background: var(--grad); color: #fff; border: none; cursor: pointer;
  font-weight: 800; font-size: 14px; padding: 12px 18px;
  border-radius: 999px; font-family: inherit;
  box-shadow: 0 8px 20px rgba(236,72,153,.35);
  transition: transform .12s ease;
}
.install-btn:hover { transform: scale(1.04); }
.install-btn:active { transform: scale(.95); }

/* ---------- Pie ---------- */
.footer { text-align: center; color: var(--text-faint); font-size: 12px; line-height: 1.7; }
.footer-small { font-size: 11px; opacity: .75; }

/* ---------- Utilidades ---------- */
.hidden { display: none !important; }

@media (max-width: 380px) {
  .art { width: 168px; height: 168px; }
  .share-row { grid-template-columns: repeat(3, 1fr); }
}
