/* ════════════════════════════════════════════════════════════
   eventos_fx.css — Animaciones y efectos para torneos y desafíos
   Cargar DESPUÉS de main.css. Sin dependencias.
   ════════════════════════════════════════════════════════════ */

/* ── Entrada escalonada de cards ─────────────────────────────
   Se aplica a los hijos directos de un contenedor .fx-stagger.
   Respeta prefers-reduced-motion. */
@keyframes fx-card-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fx-stagger > * {
  opacity: 0;
  animation: fx-card-up .5s cubic-bezier(.22,.61,.36,1) forwards;
}
.fx-stagger > *:nth-child(1)  { animation-delay: .04s; }
.fx-stagger > *:nth-child(2)  { animation-delay: .10s; }
.fx-stagger > *:nth-child(3)  { animation-delay: .16s; }
.fx-stagger > *:nth-child(4)  { animation-delay: .22s; }
.fx-stagger > *:nth-child(5)  { animation-delay: .28s; }
.fx-stagger > *:nth-child(6)  { animation-delay: .34s; }
.fx-stagger > *:nth-child(7)  { animation-delay: .40s; }
.fx-stagger > *:nth-child(8)  { animation-delay: .46s; }
.fx-stagger > *:nth-child(n+9){ animation-delay: .52s; }

/* ── Shimmer en barras de progreso ───────────────────────────
   Añadir la clase .fx-shimmer al .torneo-progress-fill. */
@keyframes fx-shimmer {
  0%   { background-position: -180% 0; }
  100% { background-position: 180% 0; }
}
.fx-shimmer {
  position: relative;
  overflow: hidden;
}
.fx-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    transparent 20%,
    rgba(255,255,255,0.35) 50%,
    transparent 80%);
  background-size: 200% 100%;
  animation: fx-shimmer 2.4s linear infinite;
  pointer-events: none;
}

/* ── Countdown crítico (<10 min): pulso rosa ─────────────────
   La clase .cd-critico la añade el JS del contador. */
@keyframes fx-cd-pulse {
  0%, 100% { color: #ff4e8a; text-shadow: 0 0 6px rgba(255,78,138,.5); }
  50%      { color: #ff86b3; text-shadow: 0 0 14px rgba(255,78,138,.85); }
}
.cd-critico {
  animation: fx-cd-pulse 1s ease-in-out infinite;
}

/* ── Podio de desafío finalizado ─────────────────────────────
   Top 3 con entrada animada + glow por medalla. */
@keyframes fx-podio-in {
  from { opacity: 0; transform: translateY(24px) scale(.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dl-podio {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0 8px;
}
.dl-podio-item {
  flex: 1 1 96px;
  max-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  opacity: 0;
  animation: fx-podio-in .55s cubic-bezier(.22,.61,.36,1) forwards;
}
.dl-podio-item .dl-podio-medal { font-size: 30px; line-height: 1; }
.dl-podio-item .dl-podio-name  { font-family: var(--font-head); font-weight: 700; font-size: 14px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.dl-podio-item .dl-podio-val   { font-family: var(--font-mono); font-size: 12px; }

/* 1º más alto y dorado, en el centro */
.dl-podio-1 { order: 2; transform-origin: bottom; padding-top: 24px;
  border-color: rgba(255,215,0,.55); box-shadow: 0 0 26px rgba(255,215,0,.14);
  animation-delay: .05s; }
.dl-podio-1 .dl-podio-name { color: #ffd700; }
.dl-podio-1 .dl-podio-val  { color: #ffd700; }
.dl-podio-2 { order: 1; border-color: rgba(192,200,212,.5); animation-delay: .18s; }
.dl-podio-2 .dl-podio-name, .dl-podio-2 .dl-podio-val { color: #c0c8d4; }
.dl-podio-3 { order: 3; border-color: rgba(192,124,58,.45); animation-delay: .30s; }
.dl-podio-3 .dl-podio-name, .dl-podio-3 .dl-podio-val { color: var(--bronze-light); }

/* ── Reacciones de noticias ──────────────────────────────────*/
.nt-reacciones { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nt-react-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 14px;
  font-family: var(--font-head); transition: all .15s ease; user-select: none;
}
.nt-react-btn:hover { transform: translateY(-2px); border-color: var(--cyan-border); }
.nt-react-btn .nt-emoji { font-size: 16px; line-height: 1; }
.nt-react-btn .nt-count { font-family: var(--font-mono); font-size: 12px; font-weight: 700; min-width: 8px; }
.nt-react-btn.mia {
  background: var(--cyan-glow); border-color: var(--cyan-border); color: var(--cyan);
}
.nt-react-btn.pop { animation: fx-react-pop .3s ease; }
@keyframes fx-react-pop {
  0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); }
}

/* ── Accesibilidad: desactivar animaciones si el usuario lo pide */
@media (prefers-reduced-motion: reduce) {
  .fx-stagger > *, .fx-shimmer::after, .cd-critico,
  .dl-podio-item, .nt-react-btn.pop {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
