/* ===== Fuentes autoalojadas (sin pedidos a terceros) ===== */
@font-face { font-family: "Shrikhand"; src: url("../fonts/shrikhand-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ===== Paleta ===== */
:root {
  --color-1: #F7EBD3;
  --color-2: #C8553D;
  --color-3: #F28F3B;
  --color-4: #588B8B;
  --color-5: #2D3047;
  --paper: #FFFFFF;          /* base blanca */
  --ink: var(--color-5);     /* texto */
  --shadow: 8px 8px 0 var(--color-5);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  /* trama de puntos retro, muy suave */
  background-image: radial-gradient(var(--color-1) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  line-height: 1.5;
}

/* ===== Rayos de sol retro (fondo) ===== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: repeating-conic-gradient(from 0deg at 50% 0, rgba(242, 143, 59, .16) 0 5deg, transparent 5deg 10deg);
  -webkit-mask-image: linear-gradient(#000, transparent 80%);
  mask-image: linear-gradient(#000, transparent 80%);
}

/* ===== Franjas setentosas ===== */
.stripes {
  height: 36px;
  background: linear-gradient(var(--color-2) 0 12px, var(--color-3) 12px 24px, var(--color-4) 24px 36px);
}

/* ===== Marca ===== */
.brand { text-align: center; padding: 2.5rem 1rem 1.5rem; }
.brand__name {
  margin: 0;
  font: 400 clamp(3rem, 11vw, 6rem)/1 "Shrikhand", serif;
  color: var(--color-3);
  /* sombra dura en dos capas: estilo cartel */
  text-shadow: 3px 3px 0 var(--color-5), 6px 6px 0 var(--color-2);
}
.brand__tagline { margin: 1.5rem 0 0; font-size: 1.1rem; font-weight: 700; }
.brand__tagline::before, .brand__tagline::after { content: "★"; color: var(--color-3); margin: 0 .6rem; }

/* Texto de presentación */
.intro { max-width: 560px; margin: 0 auto 2rem; padding: 0 1rem; text-align: center; font-size: 1.1rem; }
.intro strong { color: var(--color-2); }

/* ===== Radio ===== */
main { max-width: 880px; margin: 0 auto; padding: 0 1rem 3rem; }

.radio {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  padding: 1.75rem;
  background: var(--color-1);
  border: 3px solid var(--color-5);
  border-radius: 28px;
  box-shadow: var(--shadow), 0 28px 40px rgba(45, 48, 71, .2), inset 0 3px 0 rgba(255, 255, 255, .7);
}

/* Parlante: anillos concéntricos alrededor de la tapa */
.speaker {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, var(--color-5) 0 3px, transparent 3px 11px), var(--color-4);
  box-shadow: inset 0 8px 16px rgba(45, 48, 71, .5);
  border: 3px solid var(--color-5);
}
.speaker__cover {
  width: 66%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 6px solid var(--color-3);
  background: var(--color-2);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 4px var(--color-5);
}
.speaker__cover { position: relative; }
.speaker__cover::after {
  content: "";
  position: absolute;
  inset: 42%;
  border-radius: 50%;
  background: var(--color-1);
  border: 3px solid var(--color-5);
  box-shadow: 0 0 0 6px rgba(45, 48, 71, .35);
}
.is-playing .speaker__cover { animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.speaker__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.speaker__mono { font: 400 3rem/1 "Shrikhand", serif; color: var(--color-1); }

.console { display: flex; flex-direction: column; min-width: 0; }

/* Estado */
.status { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.live {
  padding: .15rem .7rem;
  border-radius: 99px;
  background: var(--color-5);
  color: var(--color-1);
  font-weight: 700;
  font-size: .9rem;
}
.live.is-on { background: var(--color-2); color: #fff; }
.listeners { font-size: .9rem; }

/* Ecualizador: se anima solo al reproducir */
.eq { margin-left: auto; display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.eq i { width: 5px; height: 4px; background: var(--color-4); border-radius: 2px; }
.is-playing .eq i { animation: eq 900ms ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -300ms; }
.eq i:nth-child(3) { animation-delay: -600ms; }
.eq i:nth-child(4) { animation-delay: -150ms; }
.eq i:nth-child(5) { animation-delay: -450ms; }
@keyframes eq { from { height: 4px; } to { height: 22px; } }

/* Dial: la aguja marca el avance del tema */
.dial {
  position: relative;
  height: 76px;
  background: var(--color-5);
  border: 3px solid var(--color-5);
  border-radius: 14px;
  box-shadow: inset 0 0 0 3px var(--color-4);
  overflow: hidden;
}
.dial__scale {
  position: absolute;
  inset: 14px 14px auto;
  height: 34px;
  /* marcas finas cada 2% y marcas largas cada 10% */
  background:
    repeating-linear-gradient(90deg, var(--color-1) 0 2px, transparent 2px 10%) bottom / 100% 100% no-repeat,
    repeating-linear-gradient(90deg, var(--color-1) 0 1px, transparent 1px 2%) bottom / 100% 45% no-repeat;
  opacity: .85;
}
.dial__needle {
  position: absolute;
  top: 6px; bottom: 6px;
  left: calc(14px + (100% - 28px) * var(--progress, 0));
  width: 4px;
  margin-left: -2px;
  background: var(--color-3);
  border-radius: 2px;
  transition: left 1s linear;
}
.times { display: flex; justify-content: space-between; font-size: .85rem; margin: .35rem .25rem 0; }

/* Tema */
.track { margin: 1rem 0 0; font: 700 clamp(1.3rem, 3.5vw, 1.8rem)/1.2 "DM Sans", sans-serif; overflow-wrap: anywhere; }
.artist { margin: .2rem 0 0; font-size: 1.1rem; color: var(--color-2); font-weight: 700; overflow-wrap: anywhere; }

/* Controles */
.controls { display: flex; align-items: center; gap: 1.25rem; margin-top: auto; padding-top: 1.25rem; }
.play {
  flex: none;
  width: 72px; height: 72px;
  display: grid; place-items: center;
  border: 3px solid var(--color-5);
  border-radius: 50%;
  background: var(--color-3);
  color: var(--color-5);
  box-shadow: 4px 4px 0 var(--color-5), 0 0 0 7px rgba(242, 143, 59, .3);
  cursor: pointer;
}
.play:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--color-5); }
.play svg { fill: currentColor; }
.pause__icon { display: none; }
.is-playing .play__icon { display: none; }
.is-playing .pause__icon { display: inline; }

.volume { display: flex; flex-direction: column; gap: .2rem; flex: 1; font-size: .9rem; }
.volume input { width: 100%; accent-color: var(--color-2); }

.msg { min-height: 1.4em; margin: .75rem 0 0; font-size: .9rem; color: var(--color-2); font-weight: 700; }

/* Foco visible para teclado */
:focus-visible { outline: 3px solid var(--color-2); outline-offset: 3px; }

/* ===== Historial ===== */
.history { margin-top: 2.5rem; }
.history h2 { margin: 0 0 1rem; font: 400 1.8rem/1.1 "Shrikhand", serif; color: var(--color-2); }
.history ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.history li {
  padding: .6rem 1rem;
  background: var(--paper);
  border: 2px solid var(--color-5);
  border-left: 10px solid var(--color-4);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--color-1);
}
.history li b { display: block; overflow-wrap: anywhere; }
.history li span { font-size: .9rem; }

.foot { text-align: center; padding: 0 1rem 2rem; font-size: .9rem; }
.foot p { margin: 0; }

/* ===== Móvil ===== */
@media (max-width: 720px) {
  .radio { grid-template-columns: 1fr; padding: 1.25rem; }
  .speaker { width: min(260px, 80%); margin: 0 auto; }
}

/* Respeta a quien pide menos movimiento */
@media (prefers-reduced-motion: reduce) {
  .is-playing .eq i { animation: none; height: 14px; }
  .dial__needle { transition: none; }
  .is-playing .speaker__cover { animation: none; }
}
