@import './black-background';

@mixin winnerMixin {
  .animated.winner {
    @include blackBackgroundMixin;

    .winner_container {
      scale: 0;
      animation-name: winner_container_animation;
      animation-delay: var(--animation-delay, 0);
      animation-duration: 10s;
      animation-timing-function: ease-in-out;
      animation-fill-mode: forwards;
      animation-iteration-count: 1;
      transform-origin: 4000px 3700px;
    }

    .black-background {
      animation-iteration-count: 1;
      animation-fill-mode: forwards;
    }

    #winner_spark_1,
    #winner_spark_2,
    #winner_spark_3,
    #winner_spark_4,
    #winner_spark_5,
    #winner_spark_6,
    #winner_cloud_1,
    #winner_cloud_2,
    #winner_cloud_3,
    #winner_cloud_4,
    #winner_star_1,
    #winner_star_2,
    #winner_star_3,
    #winner_star_4,
    #winner_star_5,
    #winner_star_6,
    #winner_star_7,
    #winner_star_8,
    #winner_star_9,
    #winner_main {
      scale: 0;
      animation-name: winner_details_animation;
      animation-delay: var(--animation-delay, 0);
      animation-duration: 5s;
      animation-timing-function: ease-in-out;
      animation-iteration-count: infinite;
      animation-direction: alternate;
      transform-origin: 4000px 3700px;
    }

    #winner_spark_1,
    #winner_spark_3,
    #winner_spark_5,
    #winner_cloud_1,
    #winner_cloud_3,
    #winner_star_1,
    #winner_star_3,
    #winner_star_5,
    #winner_star_7 {
      animation-duration: 3s;
    }

    #winner_star_9 {
      animation-duration: 1s;
      transform-origin: 3130px 3090px;
    }

    #winner_title > * {
      &:nth-child(1) {
        animation-delay: -0.5s;
        transform-origin: 2680px 4000px;
      }
      &:nth-child(2) {
        animation-delay: -0.3s;
        transform-origin: 3300px 3800px;
      }
      &:nth-child(3) {
        animation-delay: -0.7s;
        transform-origin: 4050px 3700px;
      }
      &:nth-child(4) {
        animation-delay: -0.1s;
        transform-origin: 3580px 4000px;
      }
      &:nth-child(5) {
        animation-delay: -0.9s;
        transform-origin: 4580px 3800px;
      }
      &:nth-child(6) {
        animation-delay: -0.2s;
        transform-origin: 5020px 3500px;
      }
      &:nth-child(7),
      &:nth-child(8) {
        animation-delay: -0.8s;
        transform-origin: 5474px 3600px;
      }

      scale: 0;
      animation-name: winner_title_animation;
      animation-delay: var(--animation-delay, 0);
      animation-duration: 1s;
      animation-timing-function: ease-in-out;
      animation-iteration-count: infinite;
      animation-direction: alternate;
      transform-origin: 4000px 3700px;
    }

    use.d-none.use-winner {
      display: block;
    }
  }

  @keyframes winner_container_animation {
    0% {
      scale: 0;
    }
    5% {
      scale: 1;
    }
    100% {
      scale: 1.1;
    }
  }

  @keyframes winner_details_animation {
    0% {
      scale: 0.95;
    }
    100% {
      scale: 1.2;
    }
  }

  @keyframes winner_title_animation {
    0% {
      scale: 0.7;
      rotate: 1deg;
    }
    10% {
      rotate: 3deg;
      scale: 1.1;
    }
    20% {
      translate: -10 0px;
      scale: 1;
    }
    30% {
      rotate: -3deg;
      scale: 0.9;
    }
    40% {
      translate: 10 0px;
      scale: 1;
    }
    50% {
      rotate: 3deg;
      scale: 0.8;
    }
    60% {
      rotate: -3deg;
      scale: 1;
    }
    70% {
      translate: 0 50px;
      scale: 1.1;
    }
    80% {
      translate: 0 -50px;
      scale: 1;
    }
    90% {
      translate: 0 25px;
      scale: 0.9;
    }
    100% {
      translate: 0 0;
      rotate: 0;
      scale: 1;
    }
  }
}
