
/* --- ESTILOS PROGRAMA (ESCRITORIO) --- */ .radio-header-card { display: flex; align-items: center; gap: 12px; padding: 5px; max-width: 450px; }.radio-photo-section { width: 110px; height: 110px; border: 3px solid #1a237e; border-radius: 8px; overflow: hidden; flex-shrink: 0; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }.radio-programa-img { width: 100% !important; height: 100% !important; object-fit: cover !important; }.radio-programa-titulo { color: #1a237e; font-size: 14px; font-weight: 800; margin: 0 0 2px 0; line-height: 1.2; }.radio-live-tag { background: #ff0000; color: white; font-size: 10px; font-weight: 900; padding: 2px 8px; border-radius: 4px; display: inline-block; margin-bottom: 4px; animation: blinker 1.5s linear infinite; cursor: pointer; }@keyframes blinker { 50% { opacity: 0; } }.radio-schedule-row, .radio-conductor-row { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #444; font-weight: 700; }/* --- AJUSTES PARA MÓVIL --- */ @media (max-width: 768px) { .radio-header-card { margin-left: -10px !important; gap: 8px !important; } .radio-photo-section { width: 65px !important; height: 65px !important; min-width: 65px; border-width: 2px; } .radio-programa-titulo { font-size: 11px !important; } .radio-live-tag { font-size: 8px !important; padding: 1px 6px !important; } .radio-schedule-row, .radio-conductor-row { font-size: 10px !important; } }
(function() { const t12 = (h24) => { if (!h24 || h24 === "null") return "--"; let [hrs, min] = h24.split(':'); hrs = parseInt(hrs); const ampm = hrs >= 12 ? ' PM' : ' AM'; hrs = hrs % 12 || 12; return (min === "00") ? `${hrs}${ampm}` : `${hrs}:${min}${ampm}`; };const updateRadio = () => { fetch("https://radiosuperamor.pe/api/programa_actual.php?t=" + Date.now()) .then(res => res.json()) .then(data => { if(data && data.active) { const p = data.program; // Actualizar Título e Imagen document.querySelectorAll(".radio-programa-titulo").forEach(el => el.innerText = p.title); document.querySelectorAll(".radio-programa-img").forEach(el => el.src = p.image_url); // Actualizar Horario const horarioStr = `${t12(p.start_time)} - ${t12(p.end_time)}`; document.querySelectorAll(".radio-programa-hora").forEach(el => el.innerText = horarioStr);// Lógica del Conductor const conductor = (p.conductor && p.conductor !== "null" && p.conductor !== "-") ? p.conductor : ""; document.querySelectorAll(".radio-conductor-row").forEach(row => { const nameEl = row.querySelector(".radio-conductor-name"); if (conductor !== "" && nameEl) { row.style.display = "flex"; nameEl.innerText = conductor; } else { row.style.display = "none"; } }); } }).catch(e => console.error("Error Radio API:", e)); };updateRadio(); setInterval(updateRadio, 45000); })();








