/* Carga de imagenes de la TV (6.8.48) - ver js/carga-imagenes.js */

/* Fotos de tarjetas: fondo de carga y fundido al terminar. */
.foto-cargando {
  opacity: 0;
}

.foto-cargando.foto-lista {
  opacity: 1;
  transition: opacity .35s ease-out;
}

.card-art:has(> img.foto-cargando:not(.foto-lista)),
.sport-tile:has(img.foto-cargando:not(.foto-lista)) {
  background-color: #1b1c21;
  background-image: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .05) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: cargaBarrido 1.4s linear infinite;
}

@keyframes cargaBarrido {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

/* Portada grande: indicador discreto mientras baja la foto. */
.intro.foto-cargando-fondo::after {
  content: '';
  position: absolute;
  right: 28px;
  top: 24px;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cargaGiro .8s linear infinite;
  z-index: 5;
  pointer-events: none;
}

/* Pantalla de carga al abrir la TV. */
#carga-inicial {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #0b0b0d;
  color: #c9cbd1;
  font: 600 15px/1 Arial, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: opacity .35s ease-out;
}

#carga-inicial.carga-fin {
  opacity: 0;
  pointer-events: none;
}

.carga-anillo {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255, 255, 255, .18);
  border-top-color: #e11d48;
  border-radius: 50%;
  animation: cargaGiro .8s linear infinite;
}

@keyframes cargaGiro {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .carga-anillo,
  .intro.foto-cargando-fondo::after,
  .card-art,
  .sport-tile {
    animation: none !important;
  }
}
