.flip-card {
  background-color: transparent;
  width: 100%;
  max-width: 550px;
  height: auto;
  perspective: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.3s;
  transform-style: preserve-3d;
}

/* Only enable hover flip on devices that support hover */
@media (hover: hover) and (pointer: fine) {
  .flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
  }

  .flip-card:hover .flip-card-front .flip-hint {
    display: none;
  }
}

.flip-card-inner.flipped {
  transform: rotateY(180deg);
}

.flip-card-inner.flipped .flip-card-front .flip-hint {
  display: none;
}

.flip-card-front,
.flip-card-back {
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flip-card-front {
  background-color: #bbb;
  color: black;
}

.flip-card-back {
  position: absolute;
  top: 0;
  background-color: #fff;
  color: black;
  transform: rotateY(180deg);
  flex-direction: column;
  background-size: cover;
  background-position: center;
}

.invitation-content {
  background-color: rgba(255, 255, 255, 0.8);
  padding: 20px;
  border-radius: 10px;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.flip-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFD600;
  color: #333;
  padding: 6px 18px;
  border-radius: 16px;
  font-size: 1rem;
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: flipPulse 1.2s infinite alternate;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

@keyframes flipPulse {
  0% { opacity: 0.7; transform: translateX(-50%) scale(1);}
  100% { opacity: 1; transform: translateX(-50%) scale(1.08);}
}

.flip-icon {
  font-size: 1.2em;
  display: inline-block;
  animation: flipRotate 1.2s infinite alternate;
  color: #333;
}

@keyframes flipRotate {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(20deg);}
}

/* Responsive styles */
@media (max-width: 768px) {
  .flip-card {
    max-width: 90%;
    height: auto;
  }

  .flip-card-inner {
    height: auto;
  }

  .flip-card-front,
  .flip-card-back {
    height: auto;
  }
}