:root {
  --bg: #0f1020;
  --surface: #181a30;
  --surface-2: #202340;
  --line: #2c3054;
  --text: #f3f4ff;
  --muted: #a3a7cf;
  --accent: #ff3b5c;
  --rainbow: linear-gradient(90deg, #ff3b5c, #ff9f1c, #ffd60a, #2ec27e, #2f9bff, #7c5cff, #c04dff);
  --rainbow-loop: linear-gradient(90deg, #ff3b5c, #ff9f1c, #ffd60a, #2ec27e, #2f9bff, #7c5cff, #c04dff,
                                         #ff3b5c, #ff9f1c, #ffd60a, #2ec27e, #2f9bff, #7c5cff, #c04dff, #ff3b5c);
  --rainbow-conic: conic-gradient(#ff3b5c, #ff9f1c, #ffd60a, #2ec27e, #2f9bff, #7c5cff, #c04dff, #ff3b5c);
  --radius: 20px;
  --gutter: 16px;
  --max: 1120px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { position: relative; isolation: isolate; overflow-x: clip; }
body::before { /* franja arcoíris superior, en movimiento continuo */
  content: ""; position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 30;
  background: var(--rainbow-loop) 0 0 / 200% 100%;
  animation: flow 8s linear infinite;
}

/* Propiedades animables (ángulo del borde y amplitud de las ondas) */
@property --a   { syntax: "<angle>";  inherits: true; initial-value: 0deg; }
@property --amp { syntax: "<number>"; inherits: true; initial-value: .22; }

/* ---------- Fondo aurora ---------- */
.aurora {
  position: absolute; inset: 0 0 auto 0; height: min(110vh, 900px); z-index: -1; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .42; will-change: transform;
  translate: calc(var(--mx, 0) * var(--k, 30px)) calc(var(--my, 0) * var(--k, 30px));
  transition: opacity .8s, translate .8s ease-out;
}
body.is-playing .blob { opacity: .68; }
.b1 { width: 520px; height: 520px; background: #ff3b5c; left: -140px; top: -180px; animation: drift-a 19s ease-in-out infinite alternate; --k: 40px; }
.b2 { width: 460px; height: 460px; background: #ff9f1c; left: 28%;    top: -220px; animation: drift-b 23s ease-in-out infinite alternate; --k: -30px; }
.b3 { width: 560px; height: 560px; background: #2f9bff; right: -180px; top: -120px; animation: drift-c 21s ease-in-out infinite alternate; --k: 55px; }
.b4 { width: 420px; height: 420px; background: #7c5cff; right: 22%;   top: 200px;  animation: drift-a 26s ease-in-out infinite alternate-reverse; --k: -45px; }
.b5 { width: 380px; height: 380px; background: #2ec27e; left: 6%;     top: 320px;  animation: drift-b 24s ease-in-out infinite alternate-reverse; --k: 25px; }
h1, h2 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #7fb8ff; outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }

/* ---------- Estructura de una sola pantalla ---------- */
.stage { min-height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.stage-main {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: center; justify-items: center;
  width: 100%; max-width: 1560px; margin-inline: auto; padding: 12px 24px 20px;
}
.stage-main > *, .col-left > * { width: 100%; max-width: 520px; }
.col-left { display: flex; flex-direction: column; justify-content: center; gap: 18px; min-width: 0; }

/* Apilado (móvil/tablet): titular → reproductor → hora y clima → Facebook */
@media (max-width: 1279px) {
  .col-left { display: contents; }
  .hero-copy { order: 1; } .player { order: 2; } .info-card { order: 3; } .fb-panel { order: 4; }
}

/* Escritorio: texto | reproductor | Facebook, todo visible sin bajar */
@media (min-width: 1280px) {
  .stage { height: 100dvh; min-height: 720px; }
  .stage-main { grid-template-columns: minmax(0, 1fr) 430px 340px; gap: 36px; justify-items: stretch; padding-block: 8px 12px; }
  .stage-main.no-fb { grid-template-columns: minmax(0, 1fr) 430px; }
  .stage-main > *, .col-left > * { max-width: none; }
  .fb-panel { align-self: stretch; min-height: 0; }
}

/* ---------- Header ---------- */
.site-header {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px;
  padding: 20px 24px 8px;
}
.header-links { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(10px);
  color: var(--text); text-decoration: none; font-weight: 700; font-size: .92rem;
  transition: background .2s, transform .15s;
}
.chip:hover { background: rgba(255,255,255,.16); transform: translateY(-2px); }
.chip svg { width: 18px; height: 18px; fill: currentColor; }
.chip.fb { background: #1877f2; border-color: transparent; }
.chip.fb:hover { background: #3b8bf5; }
.chip.wa { background: #128c5a; border-color: transparent; }
.chip.wa:hover { background: #17a86c; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand-name {
  background: var(--rainbow-loop) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: flow 10s linear infinite;
}
/* Arcos del logo: se dibujan al cargar y "respiran" cuando suena la radio */
.brand svg path {
  stroke-dasharray: 70; stroke-dashoffset: 70;
  animation: draw .9s cubic-bezier(.3,.8,.3,1) forwards;
  transform-box: view-box; transform-origin: 24px 28px;
}
.brand svg path:nth-child(2) { animation-delay: .12s; }
.brand svg path:nth-child(3) { animation-delay: .24s; }
.brand svg path:nth-child(4) { animation-delay: .36s; }
body.is-playing .brand svg path { animation: draw .9s forwards, breathe 1.6s ease-in-out 1s infinite; }
body.is-playing .brand svg path:nth-child(2) { animation-delay: .12s, 1.15s; }
body.is-playing .brand svg path:nth-child(3) { animation-delay: .24s, 1.3s; }
body.is-playing .brand svg path:nth-child(4) { animation-delay: .36s, 1.45s; }

/* ---------- Titular / reproductor ---------- */
@media (max-width: 1279px) {
  .hero-copy { text-align: center; }
  .hero-copy .lead, .hero-copy .wave { margin-inline: auto; }
}

.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(255,59,92,.6); animation: pulse 2s infinite; }
.hero-copy h1 { font-size: clamp(2.2rem, 8vw, 3.6rem); font-weight: 800; }
@media (min-width: 1280px) { .hero-copy h1 { font-size: clamp(2.4rem, 3.7vw, 3.6rem); } }
.hero-copy h1 em {
  font-style: normal; color: transparent;
  background: var(--rainbow-loop) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text;
  animation: flow 7s linear infinite;
}
.lead { margin-top: 16px; font-size: 1.15rem; color: var(--muted); max-width: 46ch; }

/* Ondas de sonido bajo el titular: suaves en reposo, intensas cuando suena */
.wave {
  --amp: .22; display: flex; align-items: center; gap: 4px; height: 44px; margin-top: 16px; width: min(100%, 460px);
  transition: --amp .7s ease;
}
body.is-playing .wave { --amp: 1; }
.wave i {
  flex: 1; height: 100%; max-width: 8px; border-radius: 4px;
  background: hsl(calc(var(--i) * 8.6), 92%, 62%);
  transform: scaleY(.1); transform-origin: center;
  animation: wave var(--d, 1.2s) ease-in-out var(--o, 0s) infinite;
}

.player {
  position: relative; padding: 10px; border-radius: var(--radius); border: 2px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              conic-gradient(from var(--a), #ff3b5c, #ff9f1c, #ffd60a, #2ec27e, #2f9bff, #7c5cff, #c04dff, #ff3b5c) border-box;
  box-shadow: 0 24px 60px -24px rgba(0,0,0,.6);
  animation: spin-angle 7s linear infinite; animation-play-state: paused;
}
.player::before { /* resplandor arcoíris detrás de la tarjeta */
  content: ""; position: absolute; inset: 6px; z-index: -1; border-radius: inherit;
  background: conic-gradient(from var(--a), #ff3b5c, #ff9f1c, #ffd60a, #2ec27e, #2f9bff, #7c5cff, #c04dff, #ff3b5c);
  filter: blur(34px); opacity: .18; transition: opacity .8s;
}
body.is-playing .player { animation-play-state: running; }
body.is-playing .player::before { opacity: .5; }
.player-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg); padding: 5px; border-radius: 14px; }
.player-tabs button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700;
}
.player-tabs svg { width: 20px; height: 20px; fill: currentColor; }
.player-tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--text); }

.panel { padding: 18px 12px 8px; }
.panel-audio { display: grid; justify-items: center; gap: 16px; text-align: center; }
.panel-video { padding: 12px 0 0; }

.cover { position: relative; width: min(220px, 62vw, 27vh); aspect-ratio: 1; display: grid; place-items: center; }
.cover .disc { position: absolute; inset: 0; border-radius: 50%; background: var(--rainbow-conic); }
.cover .disc::after { content: ""; position: absolute; inset: 24%; border-radius: 50%; background: var(--surface); }
.cover.is-playing .disc { animation: spin 10s linear infinite; }
.eq { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 34px; }
.eq i { width: 5px; height: 6px; border-radius: 3px; background: #fff; opacity: .9; }
.cover.is-playing .eq i { animation: bar 1s ease-in-out infinite; }
.eq i:nth-child(1) { animation-delay: -.9s !important; } .eq i:nth-child(2) { animation-delay: -.6s !important; }
.eq i:nth-child(3) { animation-delay: -.3s !important; } .eq i:nth-child(4) { animation-delay: -.75s !important; }
.eq i:nth-child(5) { animation-delay: -.45s !important; }

.live-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.np h2 { font-size: 1.5rem; margin-top: 10px; overflow-wrap: anywhere; }
.np p { color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.on-air { font-size: .9rem; }
.on-air b { color: var(--text); }

.controls { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.play-btn {
  position: relative; display: grid; place-items: center; flex: none;
  width: 72px; height: 72px; border: 0; border-radius: 50%; color: #fff;
  background: linear-gradient(135deg, #ff3b5c, #ff9f1c);
  box-shadow: 0 10px 28px -8px rgba(255,59,92,.7);
  transition: transform .15s;
}
.play-btn:hover { transform: scale(1.06); }
.play-btn:active { transform: scale(.96); }
.play-btn svg { width: 34px; height: 34px; fill: currentColor; }
.play-btn .i-pause, .play-btn .spinner { display: none; }
.play-btn[data-state="playing"] .i-play, .play-btn[data-state="loading"] .i-play { display: none; }
.play-btn[data-state="playing"] .i-pause { display: block; }
.play-btn[data-state="loading"] .spinner { display: block; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 4px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }

.volume { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn .i-muted { display: none; }
.icon-btn.is-muted .i-muted { display: block; }
.icon-btn.is-muted .i-vol { display: none; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 120px; height: 6px; border-radius: 3px; background: var(--line); outline-offset: 6px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; }

.status { min-height: 1.4em; font-size: .92rem; color: var(--muted); text-align: center; }
.status.is-error { color: #ff8a9b; }

.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; }
.video-frame video, .video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.video-start {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px;
  border: 0; background: center / cover no-repeat, radial-gradient(circle at 30% 20%, #2a2d5a, #0f1020);
  font-weight: 700;
}
.video-start .play-btn { width: 64px; height: 64px; pointer-events: none; }
.video-start:hover .play-btn { transform: scale(1.08); }
.panel-video .status { margin-top: 12px; padding-bottom: 6px; }

/* ---------- Secciones ---------- */
.section { max-width: var(--max); margin-inline: auto; padding: 56px var(--gutter); border-top: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.section-head p { color: var(--muted); }

.day-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; scrollbar-width: thin; }
.day-tabs button { flex: none; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-weight: 700; }
.day-tabs button[aria-selected="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.day-tabs button.is-today::after { content: " •"; color: var(--accent); }

.schedule { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.slot {
  display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 16px;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.slot time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); }
.slot h3 { margin: 0; font-size: 1.05rem; }
.slot p { color: var(--muted); font-size: .92rem; }
.slot.is-now { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--rainbow) border-box; border: 2px solid transparent; }
.slot .now-tag { padding: 3px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.empty { color: var(--muted); padding: 20px 0; }
@media (max-width: 520px) { .slot { grid-template-columns: 1fr auto; } .slot time { grid-column: 1 / -1; } }

/* ---------- Hora y clima ---------- */
.info-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; align-items: center; padding: 16px 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(10px); box-shadow: 0 24px 60px -24px rgba(0,0,0,.6);
}
.info-place { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 700; }
.info-place svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.info-place small { color: var(--muted); font-size: .85rem; font-weight: 500; }
.clock { display: block; font-size: clamp(2.3rem, 3.4vw, 3rem); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.clock .secs { margin-left: 3px; font-size: .5em; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.date { margin-top: 2px; color: var(--muted); font-size: .95rem; }
.info-weather { display: grid; justify-items: end; gap: 2px; }
.wx-main { display: flex; align-items: center; gap: 10px; }
.wx-icon svg { display: block; width: 46px; height: 46px; }
.wx-icon[data-kind="sun"]   { color: #ffd60a; } .wx-icon[data-kind="moon"]  { color: #c9d1ff; }
.wx-icon[data-kind="cloud-sun"] { color: #ffb020; } .wx-icon[data-kind="cloud-moon"] { color: #b7b3ff; }
.wx-icon[data-kind="cloud"] { color: #b9c0e6; } .wx-icon[data-kind="fog"]   { color: #b9c0e6; }
.wx-icon[data-kind="rain"]  { color: #4dabff; } .wx-icon[data-kind="snow"]  { color: #e4f1ff; }
.wx-icon[data-kind="storm"] { color: #ffd60a; }
.wx-temp { font-size: 2.4rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.wx-desc { max-width: 170px; color: var(--muted); font-size: .9rem; line-height: 1.35; text-align: right; }
.wx-desc.is-error { color: #ff8a9b; }
.wx-stats {
  grid-column: 1 / -1; list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
}
.wx-stats li { display: flex; flex-direction: column; color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.wx-stats b { margin-top: 2px; color: var(--text); font-size: .98rem; letter-spacing: 0; text-transform: none; white-space: nowrap; }

.wx-forecast {
  grid-column: 1 / -1; list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; text-align: center;
}
.wx-forecast li { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; background: rgba(255,255,255,.04); }
.wx-forecast .wx-icon svg { width: 28px; height: 28px; }
.wx-day { color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.wx-temps { font-size: .85rem; font-weight: 700; white-space: nowrap; }
.wx-temps span { color: var(--muted); font-weight: 600; }

/* ---------- Facebook (columna derecha) ---------- */
.fb-panel {
  display: flex; flex-direction: column; gap: 10px; min-height: 560px; padding: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(10px); box-shadow: 0 24px 60px -24px rgba(0,0,0,.6);
}
.fb-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px; }
.fb-head svg { width: 22px; height: 22px; fill: #1877f2; flex: none; }
.fb-embed { position: relative; flex: 1; min-height: 0; overflow: hidden; border-radius: 12px; background: var(--surface); }
.fb-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.fb-fallback { position: absolute; inset: 0; display: grid; place-content: center; padding: 24px; text-align: center; color: var(--muted); }
.fb-fallback small { display: block; margin-top: 10px; font-size: .82rem; }

.site-footer { padding: 6px 24px 16px; text-align: center; color: var(--muted); font-size: .85rem; }

/* ---------- Mini reproductor ---------- */
.mini {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 25;
  width: min(560px, calc(100% - 2 * var(--gutter)));
  display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.7);
}
.mini .play-btn { width: 48px; height: 48px; }
.mini .play-btn svg { width: 24px; height: 24px; }
.mini .spinner { width: 22px; height: 22px; border-width: 3px; }
.mini-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.mini-text strong { font-size: .95rem; }
.mini-text span { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-up { font-size: .85rem; font-weight: 700; color: var(--muted); padding: 8px 10px; }
@media (max-width: 420px) { .mini-up { display: none; } }

/* ---------- Animaciones ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flow { to { background-position: 100% 0; } }
@keyframes spin-angle { to { --a: 360deg; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); } }
@keyframes wave {
  0%, 100% { transform: scaleY(calc(.08 + var(--amp) * .12)); }
  50%      { transform: scaleY(calc(.12 + var(--amp) * var(--h, .8) * .88)); }
}
@keyframes drift-a { from { transform: translate(0, 0) scale(1); }   to { transform: translate(160px, 90px) scale(1.18); } }
@keyframes drift-b { from { transform: translate(0, 0) scale(1.1); } to { transform: translate(-140px, 130px) scale(.9); } }
@keyframes drift-c { from { transform: translate(0, 0) scale(.95); } to { transform: translate(-120px, -40px) scale(1.2); } }
@keyframes bar { 0%, 100% { height: 6px; } 50% { height: 32px; } }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(255,59,92,0); } 100% { box-shadow: 0 0 0 0 rgba(255,59,92,0); } }
@media (prefers-reduced-motion: reduce) {
  .blob, .wave i, .player { animation: none !important; }
  .wave i { transform: scaleY(.3); }
  .brand svg path { stroke-dashoffset: 0; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
