/* Radio La Esquina Azul — estilos mobile-first.
   Identidad: azul #1f3a93 + verde #16a34a, system-ui. */

:root {
  --azul: #1f3a93;
  --azul-claro: #3b5bd1;
  --verde: #16a34a;
  --verde-claro: #22c55e;
  --fondo: #0b1437;
  --fondo-2: #121c47;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-borde: rgba(255, 255, 255, 0.12);
  --texto: #eef2ff;
  --texto-tenue: #aab4e0;
  --sombra: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radio: 18px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(59, 91, 209, 0.35), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(22, 163, 74, 0.22), transparent 55%),
    linear-gradient(160deg, var(--fondo), var(--fondo-2));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.envoltorio {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* --- Encabezado --- */
.cabecera {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--azul-claro), var(--verde));
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: var(--sombra);
  flex: 0 0 auto;
}
.cabecera h1 {
  font-size: 1.15rem;
  margin: 0;
  line-height: 1.1;
}
.cabecera .sub {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--texto-tenue);
}

/* --- Aviso de modo demo --- */
.aviso-demo {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: rgba(22, 163, 74, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #d7ffe6;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.35;
  margin-bottom: 16px;
}
.aviso-demo a { color: #b9f6cc; }
.aviso-demo.oculto { display: none; }

/* --- Panel principal (lo que suena) --- */
.ahora {
  background: var(--panel);
  border: 1px solid var(--panel-borde);
  border-radius: var(--radio);
  padding: 20px 18px;
  box-shadow: var(--sombra);
  text-align: center;
}
.ahora .franja-emoji {
  font-size: 46px;
  line-height: 1;
  margin-bottom: 8px;
}
.ahora .franja-nombre {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
}
.ahora .franja-desc {
  color: var(--texto-tenue);
  font-size: 0.85rem;
  margin: 4px 0 14px;
}
.pista {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 auto;
}
.pista .titulo {
  font-weight: 600;
  font-size: 1rem;
}
.pista .artista {
  color: var(--texto-tenue);
  font-size: 0.82rem;
  margin-top: 2px;
}
.pista .tiempo {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: var(--texto-tenue);
}
.barra {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.barra > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--azul-claro), var(--verde));
  transition: width 0.4s linear;
}

/* --- Botón de encendido grande --- */
.encender {
  margin: 18px auto 0;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--azul-claro), var(--verde));
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 16px 22px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--sombra);
  transition: transform 0.08s ease, filter 0.15s ease;
}
.encender:hover { filter: brightness(1.06); }
.encender:active { transform: scale(0.98); }
.encender .punto {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  animation: latido 1.8s infinite;
}
@keyframes latido {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* --- Controles (play / mute / volumen) --- */
.controles {
  display: none;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}
.controles.visible { display: flex; }
.btn-redondo {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--panel-borde);
  background: var(--panel);
  color: var(--texto);
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn-redondo:hover { background: rgba(255, 255, 255, 0.12); }
.btn-redondo:active { transform: scale(0.95); }
.btn-redondo.primario {
  width: 60px;
  height: 60px;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--azul-claro), var(--verde));
  border: none;
  color: #fff;
}
.volumen {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.volumen input[type="range"] {
  flex: 1;
  accent-color: var(--verde);
  height: 4px;
}

/* --- Línea de tiempo de 24 h --- */
.grilla {
  margin-top: 26px;
}
.grilla h2 {
  font-size: 0.95rem;
  margin: 0 0 10px;
}
.linea {
  position: relative;
  display: flex;
  width: 100%;
  height: 46px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--panel-borde);
}
.segmento {
  position: relative;
  display: grid;
  place-items: center;
  font-size: 18px;
  opacity: 0.55;
  transition: opacity 0.3s ease;
  border-right: 1px solid rgba(0, 0, 0, 0.25);
}
.segmento:last-child { border-right: none; }
.segmento.activo { opacity: 1; }
.segmento .etq {
  position: absolute;
  bottom: 2px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.85);
}
.marcador-ahora {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
  transform: translateX(-1px);
  pointer-events: none;
}
.marcador-ahora::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}
.leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--texto-tenue);
}
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda .punto-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

/* --- Créditos de la música --- */
.creditos {
  margin-top: 26px;
}
.creditos h2 {
  font-size: 0.95rem;
  margin: 0 0 6px;
}
.creditos-intro {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--texto-tenue);
}
.creditos ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.creditos li {
  background: var(--panel);
  border: 1px solid var(--panel-borde);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.8rem;
  line-height: 1.4;
}
.creditos a {
  color: var(--verde-claro);
  text-decoration: none;
}
.creditos a:hover { text-decoration: underline; }

/* --- Pie --- */
.pie {
  margin-top: 28px;
  font-size: 0.72rem;
  color: var(--texto-tenue);
  line-height: 1.5;
  text-align: center;
}
.pie a { color: var(--texto-tenue); }

/* --- Escritorio --- */
@media (min-width: 620px) {
  .envoltorio { padding-top: 34px; }
  .cabecera h1 { font-size: 1.3rem; }
  .ahora .franja-nombre { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .encender .punto { animation: none; }
  .barra > span { transition: none; }
}
