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

/* Responsive envelope sizing */
@media (max-width: 576px) {
  body {
    --width-evelope: 140px;
    --heght-evelope: 210px;
    --heght-evelope-flap: 90px;
  }
}

@media (max-width: 400px) {
  body {
    --width-evelope: 120px;
    --heght-evelope: 180px;
    --heght-evelope-flap: 75px;
  }
}

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

  .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;
}

/* =========================================================
   Prize card on winner screen — guarantee readable text
   ========================================================= */
.prize-card {
  background: linear-gradient(180deg, #fffaf0 0%, #ffe9c2 100%);
  border: 2px solid #d97f31;
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 0 0 4px rgba(255,255,255,.45);
  color: #1a1305 !important;
  text-align: left;
  position: relative;
  z-index: 2;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
}
.prize-card__row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
}
.prize-card__row--highlight { padding-top: 12px; }
.prize-card__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  color: #7a4a10 !important;
  text-transform: uppercase;
}
.prize-card__value {
  font-size: 20px;
  font-weight: 700;
  color: #1a1305 !important;
  word-break: break-word;
}
.prize-card__prize {
  font-size: 30px;
  font-weight: 900;
  color: #c14f00 !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
  word-break: break-word;
  letter-spacing: .02em;
}
.prize-card__divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(122,74,16,.4), transparent);
  margin: 6px 0;
}
@media (max-width: 480px) {
  .prize-card__prize { font-size: 24px; }
  .prize-card__value { font-size: 17px; }
}
