.coin {
  position: relative;
  margin: 0 auto;
  width: 80px;
  height: 80px;
  perspective: 1000px; /* Add perspective to the parent element */
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  transition: -webkit-transform 1s ease-in;
  transition: transform 1s ease-in;
}

.coin div {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: inset 0 0 45px rgba(255, 255, 255, 0.3), 0 12px 20px -10px rgba(0, 0, 0, 0.4);
  background-size: contain;
  position: absolute;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.side-a {
  background-image: url('/images/coin-void.svg');
  z-index: 100;
}

.side-b {
  background-image: url('/images/coin-dollar-sign.svg');
  transform: rotateY(180deg); /* Rotate the back side */
}

.side-b-not-rotated {
  background-image: url('/images/coin-dollar-sign.svg');
}

.coin {
  transform-style: preserve-3d; /* Ensure 3D transformation */
  transition: transform 1s ease-in;
}

.coin.heads {
  animation: flipHeads 3s ease-out forwards;
}

.coin.tails {
  animation: flipTails 3s ease-out forwards;
}

@-webkit-keyframes flipHeads {
  0% {
    -webkit-transform: rotateY(0) scale(1);
            transform: rotateY(0) scale(1);
  }
  50% {
    -webkit-transform: rotateY(900deg) scale(1.2);
            transform: rotateY(900deg) scale(1.2);
  }
  100% {
    -webkit-transform: rotateY(1800deg) scale(1);
            transform: rotateY(1800deg) scale(1);
  }
}

@keyframes flipHeads {
  0% {
    -webkit-transform: rotateY(0) scale(1);
            transform: rotateY(0) scale(1);
  }
  50% {
    -webkit-transform: rotateY(900deg) scale(1.2);
            transform: rotateY(900deg) scale(1.2);
  }
  100% {
    -webkit-transform: rotateY(1800deg) scale(1);
            transform: rotateY(1800deg) scale(1);
  }
}

@-webkit-keyframes flipTails {
  0% {
    -webkit-transform: rotateY(0) scale(1);
            transform: rotateY(0) scale(1);
  }
  50% {
    -webkit-transform: rotateY(900deg) scale(1.2);
            transform: rotateY(900deg) scale(1.2);
  }
  100% {
    -webkit-transform: rotateY(1980deg) scale(1);
            transform: rotateY(1980deg) scale(1);
  }
}

@keyframes flipTails {
  0% {
    -webkit-transform: rotateY(0) scale(1);
            transform: rotateY(0) scale(1);
  }
  50% {
    -webkit-transform: rotateY(900deg) scale(1.2);
            transform: rotateY(900deg) scale(1.2);
  }
  100% {
    -webkit-transform: rotateY(1980deg) scale(1);
            transform: rotateY(1980deg) scale(1);
  }
}

@keyframes countdownAnimation {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  90% {
    transform: scale(1.125);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.countdown-animation {
  animation: countdownAnimation infinite 1s ease-in-out;
}

.gray-overlay::after {
  content: '';
  position: absolute;
  @apply rounded-md;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3); /* Gray color with 50% opacity */
  z-index: 1;
}