/* FOUR / SIX / WICKET — from X11-4-6-Wicket-Animations.html (81% scale). No neon X sweep on boundary bar. */

.match-moment {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
  z-index: 60;
  pointer-events: none;
  overflow: visible;
  --moment-scale: 0.81;
}

.match-moment__scale {
  transform-box: view-box;
  transform-origin: 960px 535px;
  /* Artwork is drawn around y=535 — nudge 5px so FOUR / SIX / WICKET sit on the exact canvas centre (960, 540) */
  transform: translate(0, 5px) scale(var(--moment-scale, 0.81));
}

.match-moment .label,
.match-moment__label {
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 12px;
  fill: white;
}

.match-moment .fragment {
  transform-box: view-box;
  transform-origin: 960px 535px;
  animation: mmAssemble var(--duration) cubic-bezier(0.2, 0.8, 0.25, 1) both;
  animation-delay: var(--delay);
}

.match-moment .linework {
  stroke-dasharray: 4000;
  stroke-dashoffset: 4000;
  animation: mmTrace var(--duration) ease both;
}

.match-moment .settled {
  opacity: 0;
  animation: mmSettle var(--duration) ease both;
}

.match-moment .accent {
  transform-origin: 960px 535px;
  animation: mmAccent var(--duration) ease both;
}

.match-moment .caption {
  opacity: 0;
  animation: mmCaption var(--duration) ease both;
}

.match-moment .exit-group {
  transform-origin: 960px 535px;
  animation: mmExit var(--duration) cubic-bezier(0.65, 0, 0.8, 0.4) both;
}

.match-moment .wipe {
  animation: mmWipe var(--duration) ease both;
}

.match-moment .feather {
  animation: mmFeather var(--duration) ease both;
  transform-origin: 960px 535px;
}

@keyframes mmAssemble {
  0%,
  4% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.65);
  }
  18% {
    opacity: 1;
  }
  32%,
  81% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes mmTrace {
  0% {
    opacity: 0;
    stroke-dashoffset: 4000;
  }
  7% {
    opacity: 1;
  }
  32% {
    stroke-dashoffset: 0;
    opacity: 0.8;
  }
  45%,
  100% {
    stroke-dashoffset: 0;
    opacity: 0;
  }
}

@keyframes mmSettle {
  0%,
  30% {
    opacity: 0;
  }
  43%,
  100% {
    opacity: 1;
  }
}

@keyframes mmAccent {
  0%,
  5% {
    opacity: 0;
    transform: scaleX(0.05);
  }
  22%,
  72% {
    opacity: 1;
    transform: scaleX(1);
  }
  86%,
  100% {
    opacity: 0;
    transform: scaleX(1.25);
  }
}

@keyframes mmCaption {
  0%,
  31% {
    opacity: 0;
    transform: translateY(16px);
  }
  43%,
  78% {
    opacity: 1;
    transform: translateY(0);
  }
  88%,
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes mmExit {
  0%,
  82% {
    opacity: 1;
    transform: scale(1);
  }
  91% {
    opacity: 1;
    transform: scale(1.025);
  }
  100% {
    opacity: 0;
    transform: scale(0.03);
  }
}

@keyframes mmWipe {
  0%,
  31% {
    transform: translateX(-1700px);
  }
  58%,
  100% {
    transform: translateX(1700px);
  }
}

@keyframes mmFeather {
  0% {
    opacity: 0;
    transform: rotate(-24deg) scale(0.5);
  }
  30%,
  70% {
    opacity: 0.5;
    transform: rotate(0) scale(1);
  }
  92%,
  100% {
    opacity: 0;
    transform: rotate(14deg) scale(1.08);
  }
}

body.match-moment-on-air #neonTrailsHost {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.match-moment-on-air .last-balls-stats,
body.match-moment-on-air .to-win-strip,
body.match-moment-on-air .versus-live-bar .this-over-strip {
  visibility: hidden !important;
  opacity: 0 !important;
}

body.match-moment-on-air:not(.match-moment-live-bar-sync) .versus-live-bar__boundary {
  visibility: hidden !important;
}

body.match-moment-on-air:not(.match-moment-live-bar-sync) .wicket-strip-overlay {
  visibility: hidden !important;
  opacity: 0 !important;
}

body.match-moment-live-bar-sync .versus-live-bar__boundary,
body.match-moment-live-bar-sync.live-bar-boundary-on-air .versus-live-bar__boundary {
  visibility: visible !important;
}

body.match-moment-live-bar-sync .wicket-strip-overlay.wicket-strip-overlay--visible {
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 71 !important;
}

body.match-moment-live-bar-sync .versus-live-bar {
  z-index: 70 !important;
}

/* Demo page bookends: fade last frame without re-running slice assemble */
.match-moment--outro .fragment,
.match-moment--outro .linework,
.match-moment--outro .feather,
.match-moment--outro .accent {
  animation: none !important;
  opacity: 0 !important;
}

.match-moment--outro .settled,
.match-moment--outro .caption {
  animation: none !important;
  opacity: 1 !important;
}

.match-moment--outro .exit-group {
  animation: none !important;
  opacity: 1;
  transform: scale(1);
}

.match-moment--outro .match-moment__scale {
  animation: mmOutroFade var(--duration) ease both;
}

@keyframes mmOutroFade {
  0%,
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
