/* Custom CSS for 3D Transformations and Coin Flip */
@keyframes flipToHeads {
  0% {
    transform: rotateY(0);
  }
  100% {
    transform: rotateY(1800deg); /* End with heads facing up (even number of Y rotations) */
  }
}

@keyframes flipToTails {
  0% {
    transform: rotateY(0);
  }
  100% {
    transform: rotateY(1980deg); /* End with tails facing up (odd number of Y rotations) */
  }
}

.coin-container {
  width: 180px;
  height: 180px;
  perspective: 1000px;
  margin: 20px auto;
}

.coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.01s;
  transform: rotateY(0deg);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
}

.coin-side {
  width: 100%;
  height: 100%;
  position: absolute;
  backface-visibility: hidden;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 24px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.2);
  border: 8px solid rgba(255, 255, 255, 0.2);
}

.front {
  background: linear-gradient(45deg, #ffd700, #ffb700);
  color: #333;
  z-index: 2;
  transform: rotateY(0);
}

.back {
  background: linear-gradient(45deg, #5a5a5a, #333333);
  color: white;
  z-index: 1;
  transform: rotateY(180deg);
}

/* We apply transform directly to the SVG element in HTML */

/* Text for both sides */
.coin-text {
  /* Ensure text is readable */
  user-select: none;
  pointer-events: none;
}

/* Animation classes */
.coin.animate-to-heads {
  animation: flipToHeads 1s ease-in-out forwards;
}

.coin.animate-to-tails {
  animation: flipToTails 1s ease-in-out forwards;
}

/* Make the buttons more responsive */
button:not([disabled]) {
  cursor: pointer;
  transition: all 0.2s ease;
}

button:not([disabled]):hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

button:not([disabled]):active {
  transform: translateY(1px);
}

/* Animation for results */
@keyframes popIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  70% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.result-text {
  animation: popIn 0.5s ease-out forwards;
}
