/* THBN channel-surf static. ~400ms scanline + snow transition.
   Trigger with window.rerunStatic(). No libraries. */

.rerun-static-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  background: #0b0b0c;
}
.rerun-static-overlay.is-on {
  opacity: 1;
}
.rerun-static-overlay canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.rerun-static-scan,
.rerun-static-roll {
  position: absolute;
  inset: 0;
}
.rerun-static-scan {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.38) 3px
  );
  mix-blend-mode: multiply;
  pointer-events: none;
}
.rerun-static-roll {
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0) 12%,
    rgba(0, 0, 0, 0) 88%,
    rgba(0, 0, 0, 0.45) 100%
  );
  mix-blend-mode: screen;
  opacity: 0.65;
  animation: none;
}
.rerun-static-overlay.is-on .rerun-static-roll {
  animation: rerun-static-roll var(--rerun-static-ms, 400ms) linear forwards;
}
@keyframes rerun-static-roll {
  0%   { transform: translateY(-18%); opacity: 0.9; }
  70%  { transform: translateY(8%);   opacity: 0.5; }
  100% { transform: translateY(28%);  opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .rerun-static-overlay.is-on .rerun-static-roll { animation: none; opacity: 0; }
  .rerun-static-scan { display: none; }
}

/* Optional helpers for the player frame. */
.rerun-bug {
  position: absolute;
  right: 10px;
  bottom: 10px;
  height: 48px;
  width: auto;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.75));
}
.rerun-standby {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b0b0c;
  z-index: 3;
}
