/* fx.css — capa de movimiento y juego de GTAFriki.
   Solo anima transform y opacity (no provoca reflujo). Todo queda desactivado
   con prefers-reduced-motion. Si fx.js no carga, la web se ve igual que antes:
   los estados ocultos solo existen bajo html.fx-js. */

/* ---------- Aparicion al hacer scroll ---------- */
html.fx-js .fx-reveal {
  opacity: 0;
  transform: translateY(26px) scale(.985);
  transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--fx-d, 0ms);
}
html.fx-js .fx-reveal.fx-in { opacity: 1; transform: none; }
/* Una vez entrada, la tarjeta recupera su hover normal sin el retraso */
html.fx-js .fx-reveal.fx-done { transition-delay: 0ms; transition: border-color .2s, transform .2s, box-shadow .2s; }

/* ---------- Brillo que sigue al cursor ---------- */
.fx-glow { position: relative; }
.fx-glow::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255,61,127,.20), rgba(51,224,255,.08) 45%, transparent 70%);
}
.fx-glow:hover::after { opacity: 1; }
.card:hover { box-shadow: 0 14px 34px rgba(255,61,127,.18); }
.card .card-thumb img, .card .thumb-photo { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-thumb img, .card:hover .thumb-photo { transform: scale(1.06); }

/* ---------- Portada: entrada escalonada y brillo del VI ---------- */
/* Solo translateY, sin opacity: el texto se ve desde el primer pintado (LCP) */
@keyframes fx-up { from { transform: translateY(22px); } to { transform: none; } }
.hero-contenido > * { animation: fx-up .8s cubic-bezier(.2,.7,.2,1) both; }
.hero-contenido > *:nth-child(2) { animation-delay: .08s; }
.hero-contenido > *:nth-child(3) { animation-delay: .16s; }
.hero-contenido > *:nth-child(4) { animation-delay: .24s; }
.hero-contenido > *:nth-child(5) { animation-delay: .32s; }
.hero-contenido > *:nth-child(6) { animation-delay: .40s; }

@keyframes fx-vi {
  0%   { filter: hue-rotate(0deg)   drop-shadow(0 0 18px rgba(255,61,127,.35)); }
  50%  { filter: hue-rotate(-28deg) drop-shadow(0 0 38px rgba(166,59,255,.55)); }
  100% { filter: hue-rotate(0deg)   drop-shadow(0 0 18px rgba(255,61,127,.35)); }
}
.hero-vi { animation: fx-vi 7s ease-in-out infinite; }

@keyframes fx-tick { 0%,100% { transform: scale(1); } 50% { transform: scale(1.09); color: var(--accent-2); } }
.countdown-unit:last-child .value { animation: fx-tick 1s ease-in-out infinite; display: inline-block; }

.hero-etiqueta .punto-vivo { animation: fx-ping 1.6s ease-out infinite; }
@keyframes fx-ping { 0% { box-shadow: 0 0 0 0 rgba(255,61,127,.7); } 100% { box-shadow: 0 0 0 12px rgba(255,61,127,0); } }

/* ---------- Botones con destello ---------- */
.btn-primario { position: relative; overflow: hidden; }
.btn-primario::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg);
  transition: left .7s ease;
  pointer-events: none;
}
.btn-primario:hover::before { left: 130%; }

/* ---------- Ticker de ultima hora (portada) ---------- */
.fx-ticker {
  display: flex; align-items: stretch;
  margin: 18px 0 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-alt);
  overflow: hidden;
}
.fx-ticker-tag {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  font-weight: 800; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #ff7a52);
}
.fx-ticker-tag i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: fx-blink 1s steps(2) infinite; }
@keyframes fx-blink { 50% { opacity: .15; } }
.fx-ticker-view { flex: 1; overflow: hidden; position: relative; min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.fx-ticker-track { display: inline-flex; white-space: nowrap; padding: 10px 0; animation: fx-marquee var(--fx-dur, 60s) linear infinite; }
.fx-ticker:hover .fx-ticker-track, .fx-ticker:focus-within .fx-ticker-track { animation-play-state: paused; }
.fx-ticker-track a { color: var(--text); font-size: .92rem; padding: 0 22px; position: relative; }
.fx-ticker-track a::after { content: "\2605"; position: absolute; right: -6px; color: var(--accent-2); font-size: .8rem; }
.fx-ticker-track a:hover { color: var(--accent); text-decoration: none; }
@keyframes fx-marquee { to { transform: translateX(-50%); } }

/* ---------- Nivel de busqueda: estrellas que se encienden al bajar ---------- */
.fx-wanted {
  position: fixed; left: 14px; bottom: 14px; z-index: 40;
  display: flex; gap: 3px;
  padding: 6px 10px;
  border-radius: 99px;
  background: rgba(13,13,18,.72);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  font-size: 15px; line-height: 1;
  pointer-events: none;
  opacity: 0; transform: translateY(10px);
  transition: opacity .3s, transform .3s;
}
.fx-wanted.fx-on { opacity: 1; transform: none; }
.fx-wanted span { color: #3a3a4c; transition: color .25s, transform .25s, text-shadow .25s; }
.fx-wanted span.lit { color: #ffd36a; text-shadow: 0 0 8px rgba(255,211,106,.8); transform: scale(1.15); }
.fx-wanted.fx-six { animation: fx-cops .55s steps(2) infinite; }
@keyframes fx-cops {
  0%   { box-shadow: 0 0 0 2px #2f6bff, 0 0 22px rgba(47,107,255,.8); }
  100% { box-shadow: 0 0 0 2px #ff3b4d, 0 0 22px rgba(255,59,77,.8); }
}

/* ---------- Volver arriba ----------
   Es el boton de la pagina (.to-top), no uno propio: antes esta capa creaba un
   segundo boton en la misma esquina y asomaba por detras del original. Aqui
   solo se le da el aspecto de degradado y brillo. */
.to-top {
  background: linear-gradient(135deg, var(--accent), #a63bff);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(255,61,127,.4);
}
.to-top:hover { transform: translateY(-3px) scale(1.06); border-color: transparent; background: linear-gradient(135deg, var(--accent), #a63bff); }

/* ---------- Huevo de Pascua: mision superada + lluvia de billetes ---------- */
.fx-pass {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center; text-align: center;
  background: rgba(0,0,0,.55);
  animation: fx-fade .3s ease both;
  pointer-events: none;
}
.fx-pass b {
  display: block;
  font: italic 900 clamp(2.4rem, 9vw, 6rem)/1 Impact, "Arial Black", sans-serif;
  letter-spacing: .02em;
  color: #ffd36a;
  text-shadow: 0 0 0 #000, 3px 3px 0 #000, -2px -2px 0 #000, 0 0 40px rgba(255,211,106,.6);
  animation: fx-pop .6s cubic-bezier(.2,1.6,.4,1) both;
}
.fx-pass small { display: block; margin-top: 10px; color: #fff; font-size: 1.1rem; letter-spacing: .2em; text-transform: uppercase; }
@keyframes fx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fx-pop { from { transform: scale(.4) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.fx-bill {
  position: fixed; top: -50px; z-index: 10000; pointer-events: none;
  font-size: 28px;
  animation: fx-fall var(--fx-t, 3s) linear forwards;
}
@keyframes fx-fall { to { transform: translate3d(var(--fx-x, 0), 112vh, 0) rotate(var(--fx-r, 360deg)); } }

/* ---------- Movil y accesibilidad ---------- */
@media (max-width: 700px) {
  .fx-ticker-tag { padding: 8px 10px; font-size: .68rem; }
  .fx-wanted { left: 8px; bottom: 8px; font-size: 12px; padding: 5px 8px; }
  .hero-vi { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  html.fx-js .fx-reveal { opacity: 1; transform: none; transition: none; }
  .hero-contenido > *, .hero-vi, .countdown-unit:last-child .value,
  .hero-etiqueta .punto-vivo, .fx-ticker-track, .fx-ticker-tag i, .fx-wanted.fx-six { animation: none !important; }
  .fx-ticker-track { overflow-x: auto; }
  .card:hover .card-thumb img, .card:hover .thumb-photo { transform: none; }
}
