* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: white;
  min-height: 100vh;
  min-height: 100dvh; /* alto visible real en móviles (evita el scroll del 100vh en iOS) */
  overflow-y: auto;
  overscroll-behavior-y: none; /* reduce el rebote elástico de iOS */
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 50%, #16213e 100%);
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.bg-fade {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: #1a1a2e;
  -webkit-transition: opacity 2s ease-in-out;
  transition: opacity 2s ease-in-out;
  z-index: 0;
}

/* Overlay oscuro sobre el fondo */
.bg-fade::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

main {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1rem;
  /* Deja lugar para el zócalo de noticias fijo ARRIBA + safe-area iOS/Android */
  padding-top: calc(50px + env(safe-area-inset-top));
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh; /* alto visible real en móviles (sin scroll ni huecos por la barra iOS) */
}

/* Panel glassmorphism */
.panel {
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 20px 16px;
  width: 100%;
  max-width: 520px;
}

#lunaradio {
  width: 100%;
  height: 480px;
  margin: 0 auto;
  z-index: 10;
}

/* Redes sociales */
.social-wrap {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 10px 20px;
  display: inline-flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 16px;
}

.social-icons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.social-icons a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 1.7rem;
  -webkit-transition: transform 0.2s ease, color 0.2s ease;
  transition: transform 0.2s ease, color 0.2s ease;
}

.social-icons a:hover { transform: scale(1.2); }

.social-icons a.fb:hover    { color: #1877f2; }
.social-icons a.ig:hover    { color: #e1306c; }
.social-icons a.wa:hover    { color: #25d366; }
.social-icons a.tt:hover    { color: #ff0050; }
.social-icons a.tw:hover    { color: #9146ff; }
.social-icons a.yt:hover    { color: #ff0000; }
.social-icons a.tw-x:hover  { color: #aaaaaa; }

/* Footer */
.powered {
  margin-top: 14px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
}

.powered a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  -webkit-transition: color 0.2s ease;
  transition: color 0.2s ease;
}

.powered a:hover { color: #fff; }

/* LunaRadio overrides */
#lunaradiobuttonanalyzer  { display: none; }
#lunaradioiconlive        { display: none; }
#lunaradiocoverwrapper    { border-radius: 50%; overflow: hidden; border: none !important; outline: none !important; box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.4), 0 0 18px 4px rgba(239, 68, 68, 0.15); }
#lunaradioname            { margin-top: 6px !important; margin-bottom: 4px !important; font-size: 1.1rem !important; letter-spacing: 1px !important; }

/* ArgentinaStream */
.powered {
  margin-top: 18px;
  margin-bottom: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
}

/* Responsive — Tablet / iPad */
@media (min-width: 768px) {
  #lunaradio { height: 520px; }
  .social-icons a { font-size: 2rem; }
}

/* Responsive — Móvil estándar */
@media (max-width: 480px) {
  main { padding: calc(50px + env(safe-area-inset-top)) 0.6rem calc(1rem + env(safe-area-inset-bottom)); }
  .panel { padding: 14px 10px; border-radius: 14px; }

  #lunaradio {
    width: 95vw;
    /* Alto proporcional a la pantalla: llena más en iPhones altos y entra en los chicos */
    height: clamp(360px, 56dvh, 540px);
  }

  .social-icons a { font-size: 1.5rem; }
  .powered        { font-size: 0.78rem; }
}

/* Responsive — Móvil chico */
@media (max-width: 360px) {
  #lunaradio    { height: clamp(340px, 52dvh, 460px); }
  .powered      { font-size: 0.72rem; }
  .social-wrap  { padding: 8px 14px; gap: 0.7rem; }
}

/* ============================================================
   Marquesina de noticias (zócalo fijo estilo noticiero)
   ============================================================ */
#news-ticker {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  isolation: isolate; /* el iframe de lunaradio crea su propio stacking context */
  display: flex;
  align-items: center;
  height: 38px;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: env(safe-area-inset-top); /* no quedar bajo el notch/barra de estado */
  box-sizing: content-box;
}

.ticker-label {
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0 14px;
}

.ticker-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  animation: ticker 30s linear infinite;
}

#news-ticker:hover .ticker-track,
#news-ticker.is-paused .ticker-track {
  animation-play-state: paused;
}

.ticker-item {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  padding: 0 6px;
}

.ticker-sep {
  color: #ef4444;
  padding: 0 10px;
}

/* Badge de clima arriba del player */
.weather-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 12px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  color: #fff;
}

.weather-badge:empty { display: none; }
.weather-badge .wx-icon { font-size: 1.5rem; line-height: 1; }
.weather-badge .wx-temp { font-size: 1.25rem; font-weight: 700; }
.weather-badge .wx-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}
.weather-badge .wx-city { font-size: 0.8rem; font-weight: 600; }
.weather-badge .wx-cond { font-size: 0.72rem; color: rgba(255, 255, 255, 0.6); }

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (max-width: 480px) {
  .ticker-label   { font-size: 0.66rem; padding: 0 10px; }
  .ticker-item    { font-size: 0.78rem; }
}

/* Celulares muy chicos (iPhone SE, etc.) */
@media (max-width: 360px) {
  #news-ticker  { height: 34px; }
  .ticker-label { font-size: 0.6rem; letter-spacing: 1px; padding: 0 8px; }
  .ticker-item  { font-size: 0.74rem; padding: 0 4px; }
  .ticker-sep   { padding: 0 7px; }
  .weather-badge .wx-icon { font-size: 1.3rem; }
  .weather-badge .wx-temp { font-size: 1.1rem; }
}
