/* StreamHype · efeitos visuais (spec: client/site/specs/effects.md). Depende de brand/tokens.css.
   Tudo prefixado .fx-*. Só anima transform, translate, opacity (compositor). Tremor usa a
   propriedade `translate` para não brigar com o `transform` das revelações do motion.css. */

/* Pausa fora da tela ou com a aba oculta (classe posta pelo effects.js) */
.fx-paused .fx-anim,
.fx-paused.fx-anim { animation-play-state: paused !important; }

/* ---------------------------------------------------------------- explosões (palco) */
.fx-burst-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.fx-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  border-radius: inherit;
  background: radial-gradient(70% 60% at 50% 70%, rgb(255 244 220 / .9), rgb(255 194 58 / .45) 45%, transparent 80%);
}
/* um único clarão, < 400 ms, nunca em sequência (o JS segura 600 ms entre dois) */
.fx-flash.is-on { animation: fx-flash 260ms ease-out 1 both; }
@keyframes fx-flash {
  0% { opacity: 0; }
  18% { opacity: .55; }
  100% { opacity: 0; }
}

.fx-shake { animation: fx-shake 340ms cubic-bezier(.36, .07, .19, .97) 1; }
@keyframes fx-shake {
  0%   { translate: 0 0; }
  12%  { translate: -7px 3px; }
  26%  { translate: 6px -4px; }
  40%  { translate: -5px 2px; }
  55%  { translate: 4px -2px; }
  70%  { translate: -2px 1px; }
  85%  { translate: 1px 0; }
  100% { translate: 0 0; }
}

/* versão reduced-motion do impacto: a borda acende e apaga, nada se move */
.fx-hit-still { animation: fx-hit-still 520ms ease-out 1; }
@keyframes fx-hit-still {
  0%, 100% { box-shadow: 0 0 0 0 rgb(255 194 58 / 0); }
  25% { box-shadow: 0 0 0 3px var(--c-ouro), 0 0 40px rgb(255 194 58 / .35); }
}

/* ---------------------------------------------------------------- luz de palco */
.fx-light-host { isolation: isolate; }
.fx-light {
  position: absolute;
  inset: -14% -18%;
  z-index: -1;
  pointer-events: none;
}
.fx-light > i {
  position: absolute;
  border-radius: 50%;
  will-change: transform, opacity;
}
.fx-light__a {
  left: 0; bottom: 0;
  width: 70%; height: 70%;
  background: radial-gradient(closest-side, rgb(255 90 31 / .7), rgb(255 90 31 / .22) 55%, transparent);
  animation: fx-drift-a 13s ease-in-out infinite alternate;
}
.fx-light__b {
  right: 0; top: 0;
  width: 64%; height: 64%;
  background: radial-gradient(closest-side, rgb(91 156 255 / .55), rgb(91 156 255 / .18) 55%, transparent);
  animation: fx-drift-b 17s ease-in-out infinite alternate;
}
.fx-light--quiet .fx-light__a { opacity: .6; }
.fx-light--quiet .fx-light__b { opacity: .6; }
@keyframes fx-drift-a {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(8%, -6%) scale(1.12); }
}
@keyframes fx-drift-b {
  from { transform: translate(0, 0) scale(1.05); }
  to   { transform: translate(-7%, 8%) scale(.95); }
}
.fx-light__hit {
  inset: 10% 14%;
  background: radial-gradient(closest-side, rgb(255 194 58 / .75), rgb(255 90 31 / .3) 55%, transparent);
  opacity: 0;
}
.fx-light__hit.is-on { animation: fx-light-hit 700ms ease-out 1; }
@keyframes fx-light-hit {
  0%   { opacity: 0; transform: scale(.9); }
  20%  { opacity: var(--fx-hit, .6); transform: scale(1.06); }
  100% { opacity: 0; transform: scale(1.12); }
}

/* ---------------------------------------------------------------- grão de transmissão */
.fx-grain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
  border-radius: inherit;
}
.fx-grain__noise {
  position: absolute;
  inset: -50%;
  background-image: var(--fx-grain-tile);
  background-size: 128px 128px;
  opacity: .07;
  animation: fx-grain 640ms steps(1) infinite;
}
.fx-grain--scan::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgb(13 19 48 / .16) 0 1px, transparent 1px 3px);
  opacity: .5;
}
@keyframes fx-grain {
  0%     { transform: translate(0, 0); }
  12.5%  { transform: translate(-6%, 4%); }
  25%    { transform: translate(5%, -7%); }
  37.5%  { transform: translate(-3%, -4%); }
  50%    { transform: translate(7%, 5%); }
  62.5%  { transform: translate(-7%, -2%); }
  75%    { transform: translate(3%, 7%); }
  87.5%  { transform: translate(-2%, -6%); }
}

/* ---------------------------------------------------------------- selo ao vivo */
.fx-live {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  padding: .4em .8em .4em .65em;
  border-radius: var(--r-pill);
  background: rgb(13 19 48 / .72);
  border: 2px solid rgb(255 90 31 / .55);
  color: var(--c-holofote);
  font: 700 var(--fs-label)/1 var(--f-mono);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}
.fx-live__dot {
  position: relative;
  width: .62em;
  height: .62em;
  border-radius: 50%;
  background: var(--c-brasa);
  flex: none;
}
.fx-live__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--c-brasa);
  animation: fx-live-ring 1.6s cubic-bezier(.2, .6, .3, 1) infinite;
}
@keyframes fx-live-ring {
  0%   { transform: scale(1); opacity: .9; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* ---------------------------------------------------------------- cards de momentos */
.fx-card {
  position: relative;
  transition: box-shadow 220ms ease, border-color 220ms ease;
}
.fx-card.is-fx-active {
  border-color: var(--c-brasa);
  box-shadow: var(--shadow-glow);
}
.fx-card__sheen {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
}
.fx-card__sheen::before {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgb(255 244 220 / .22), transparent);
  transform: translateX(-120%) skewX(-12deg);
}
.fx-card.is-fx-active .fx-card__sheen::before {
  animation: fx-sheen 700ms cubic-bezier(.3, .7, .3, 1) 1 both;
}
@keyframes fx-sheen {
  to { transform: translateX(330%) skewX(-12deg); }
}

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fx-anim,
  .fx-light__a,
  .fx-light__b,
  .fx-grain__noise,
  .fx-live__ring { animation: none !important; }
  .fx-live__ring { opacity: 0; }
  .fx-shake,
  .fx-flash.is-on,
  .fx-light__hit.is-on,
  .fx-card.is-fx-active .fx-card__sheen::before { animation: none !important; }
  .fx-burst-canvas { display: none; }
}
