:root {
  --accent: #ff5a36;
  --bg: #0e0f13;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f4f4f6;
  --muted: #a3a6b1;
  --radius: 20px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Fondo difuminado con la carátula */
.bg {
  position: fixed;
  inset: -10%;
  background-size: cover;
  background-position: center;
  filter: blur(60px) saturate(1.4);
  opacity: 0.35;
  transition: background-image 1s ease;
  z-index: -1;
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14,15,19,.3), var(--bg) 85%);
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* Encabezado */
.top {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  font-size: 1.8rem;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
}
.brand h1 { margin: 0; font-size: 1.4rem; font-weight: 800; }
.brand p { margin: 2px 0 0; font-size: 0.9rem; }

.status { display: flex; gap: 8px; }
.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  letter-spacing: 0.04em;
}
.badge.soft { background: var(--card); border: 1px solid var(--border); color: var(--muted); }
.badge.ok { color: #57e38a; }
#liveBadge { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* Contenido */
.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
}
.card h3 {
  margin: 0 0 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Reproductor */
.player {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: center;
}
.art-wrap { position: relative; }
.art {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
  background: #1c1e25;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  display: block;
}

.eq {
  position: absolute;
  right: 12px; bottom: 12px;
  display: flex; gap: 3px; align-items: flex-end;
  height: 22px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0,0,0,.55);
  opacity: 0;
  transition: opacity .3s;
}
.eq i {
  width: 3px; height: 100%;
  background: var(--accent);
  border-radius: 2px;
  animation: eq 0.9s ease-in-out infinite;
  transform-origin: bottom;
}
.eq i:nth-child(2) { animation-delay: -.2s; }
.eq i:nth-child(3) { animation-delay: -.5s; }
.eq i:nth-child(4) { animation-delay: -.3s; }
.eq i:nth-child(5) { animation-delay: -.7s; }
@keyframes eq { 0%,100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
body.playing .eq { opacity: 1; }

.label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.title { margin: 6px 0 4px; font-size: 1.9rem; line-height: 1.15; font-weight: 800; overflow-wrap: anywhere; }
.artist { margin: 0; font-size: 1.1rem; }

.progress { margin: 20px 0 16px; }
.bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--accent); transition: width 1s linear; }
.times { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

.controls { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

.play {
  position: relative;
  width: 68px; height: 68px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 45%, transparent);
  transition: transform .15s;
}
.play:hover { transform: scale(1.05); }
.play:active { transform: scale(.97); }
.play:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.play svg { width: 30px; height: 30px; fill: currentColor; }
.spinner {
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.volume { display: flex; align-items: center; gap: 8px; }
.icon-btn { background: none; border: 0; color: var(--text); cursor: pointer; padding: 4px; display: grid; }
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
input[type="range"] { accent-color: var(--accent); width: 110px; }

.message { min-height: 1.2em; margin: 12px 0 0; font-size: 0.9rem; color: #ffb4a3; }

/* Próximo e historial */
.grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin-top: 16px; }

.track-row { display: flex; gap: 12px; align-items: center; }
.track-row img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #1c1e25; flex: none; }
.track-row .t { font-weight: 600; overflow-wrap: anywhere; }
.track-row .a { font-size: 0.88rem; color: var(--muted); }
.track-row .when { margin-left: auto; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.empty { color: var(--muted); }

.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

/* Pie */
.foot { text-align: center; padding: 28px 0 40px; }
.social { display: flex; justify-content: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.social a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
}
.social a:hover { border-color: var(--accent); }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }

/* Celular */
@media (max-width: 720px) {
  .player { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .art-wrap { max-width: 280px; margin: 0 auto; width: 100%; }
  .controls { justify-content: center; }
  .grid { grid-template-columns: 1fr; }
  .title { font-size: 1.5rem; }
}
