body {
  --width-evelope: 160px;
  --heght-evelope: 240px;
  --heght-evelope-flap: 100px;
  --jump-voucher: calc(var(--heght-evelope) * -0.8);
}

.envelope {
  width: var(--width-evelope);
  height: var(--heght-evelope);
  margin-top: 54px;
  background-size: var(--width-evelope) var(--heght-evelope);
  position: relative;

  .envelope-cape {
    z-index: 1000;
    position: absolute;
    width: inherit;
    height: inherit;
  }

  .envelope-flap,
  &:after {
    content: '';
    position: relative;
    top: var(--heght-evelope-flap);
    width: calc(var(--width-evelope) * 2);
    border-top: solid var(--heght-evelope-flap) #5f0707;
    border-left: solid calc(var(--width-evelope) / 2) transparent;
    border-right: solid calc(var(--width-evelope) / 2) transparent;
    width: inherit;
  }

  .envelope:after {
    transform-origin: top;
  }

  .envelope-flap.is-open  {
    animation: open-envelope 0.1s forwards;
  }

  .voucher {
    background-size: inherit;
    background-repeat: no-repeat;
    position: absolute;
    width: inherit;
    height: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 1s 0.4s, transform 1s 0.6s;
    z-index: 2 !important;
  }

  .voucher.is-visible {
    transform: translateY(0);
    opacity: 1;
    animation: ticket-rise-and-rotate 2s forwards;

  }

  .text_color {
    color: black;
    font-weight: 900;
    font-family: Verdana, Geneva, Tahoma, sans-serif;

  }

}

@keyframes open-envelope {
  0% {
    transform: rotateX(0);
  }

  100% {
    transform: rotateX(180deg);
    top: 5px;

  }
}

@keyframes ticket-rise-and-rotate {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }

  50% {
    transform: translateY(var(--jump-voucher)) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(var(--jump-voucher)) rotate(-90deg);
    opacity: 1;
  }
}

@keyframes swing {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(3deg);
  }

  75% {
    transform: rotate(-3deg);
  }
}

.swing-fast {
  animation-name: swing;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-duration: 0.2s;
}

.swing-slow {
  animation-name: swing;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-duration: 1s;
}
