/* style.css - romantic, clean, and mobile-optimized */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Quicksand', sans-serif;
  background: linear-gradient(145deg, #ffd9e0 0%, #ffecf0 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1rem;
  touch-action: manipulation;
}

/* card container */
.card {
  width: 100%;
  max-width: 380px;
  height: auto;
  min-height: 500px;
  background-color: #ffffff;
  border-radius: 36px;
  box-shadow: 0 25px 40px -12px rgba(220, 80, 120, 0.3), 0 8px 18px rgba(0, 0, 0, 0.05);
  position: relative;
  cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  aspect-ratio: 3 / 4;
}

.card:hover {
  transform: scale(1.01);
  box-shadow: 0 30px 50px -12px rgba(210, 70, 110, 0.4);
}

/* front & inside share dimensions */
.card-front,
.card-inside {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 36px;
  background: #ffffff;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s cubic-bezier(0.23, 1, 0.32, 1), transform 0.4s ease;
  backface-visibility: hidden;
  will-change: opacity, transform;
  text-align: center;
}

.card-front {
  opacity: 1;
  transform: scale(1);
  background: white;
  border: 2px solid #ffc0cb;
}

.card-inside {
  opacity: 0;
  transform: scale(0.95);
  background: white;
  border: 2px solid #ffb6c1;
  box-shadow: inset 0 0 30px #ffe4ec;
}

/* open state */
.card.open .card-front {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

.card.open .card-inside {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* front content */
.heart-icon {
  font-size: 5rem;
  margin-bottom: 0.5rem;
  animation: softBeat 2s infinite ease-in-out;
}

.greeting {
  font-family: 'Dancing Script', cursive;
  font-size: 2.8rem;
  font-weight: 600;
  color: #d44e6c;
  line-height: 1.2;
  margin-bottom: 0.25rem;
  text-shadow: 0 2px 10px rgba(220, 80, 120, 0.2);
}

.to-name {
  font-family: 'Quicksand', sans-serif;
  font-weight: 300;
  font-size: 2rem;
  color: #7f4a5a;
  letter-spacing: 2px;
  margin-top: 0.5rem;
}

.open-hint {
  font-size: 1rem;
  color: #b18b8b;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2rem;
  opacity: 0.8;
  animation: pulseHint 2s infinite ease-in-out;
}

.cue-hand {
  font-size: 2rem;
  margin-top: 0.5rem;
  opacity: 0.7;
  animation: handMove 1.5s infinite alternate;
}

/* inside content */
.message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
}

.princess-crown {
  font-size: 2.8rem;
  filter: drop-shadow(0 4px 6px #fec5d9);
  animation: crownFloat 3s infinite alternate;
}

.princess-title {
  font-family: 'Dancing Script', cursive;
  font-size: 3rem;
  font-weight: 600;
  color: #b13e5c;
  margin: 0.25rem 0;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(210, 70, 100, 0.2);
}

.cute-message {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.4rem;
  font-weight: 300;
  color: #6f4b4b;
  line-height: 1.5;
  margin: 0.8rem 0;
  background: #fff4f7;
  padding: 1rem 1.5rem;
  border-radius: 40px;
  box-shadow: 0 4px 12px rgba(250, 200, 210, 0.3);
  width: 100%;
  max-width: 280px;
}

.signature {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.3rem;
  color: #a75c6f;
  font-weight: 300;
  margin-top: 0.5rem;
  line-height: 1.6;
  font-style: italic;
  border-top: 1px dashed #ffc0cb;
  padding-top: 1rem;
  width: 80%;
}

.close-hint {
  font-size: 0.8rem;
  color: #cc9a9a;
  margin-top: 1rem;
  opacity: 0.6;
  letter-spacing: 1px;
  transition: opacity 0.2s;
  text-transform: uppercase;
}

.close-hint:hover {
  opacity: 1;
}

/* floating hearts container */
.hearts-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.heart-float {
  position: absolute;
  color: #ffa5b9;
  font-size: 2rem;
  opacity: 0;
  user-select: none;
  animation: floatUp 6s linear forwards;
  bottom: -10%;
  filter: drop-shadow(0 4px 8px rgba(255, 140, 170, 0.5));
}

/* animations */
@keyframes softBeat {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes pulseHint {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }

  100% {
    opacity: 0.6;
    transform: scale(1);
  }
}

@keyframes handMove {
  0% {
    transform: translateY(0) rotate(-5deg);
  }

  100% {
    transform: translateY(-6px) rotate(5deg);
  }
}

@keyframes crownFloat {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-8px);
  }
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg);
  }

  10% {
    opacity: 0.8;
  }

  90% {
    opacity: 0.6;
  }

  100% {
    opacity: 0;
    transform: translateY(-110vh) rotate(15deg);
  }
}

/* mobile adjustments */
@media (max-width: 400px) {
  .card {
    max-width: 340px;
    min-height: 460px;
  }

  .greeting {
    font-size: 2.2rem;
  }

  .to-name {
    font-size: 1.8rem;
  }

  .heart-icon {
    font-size: 4.2rem;
  }

  .open-hint {
    font-size: 0.9rem;
    margin-top: 1.5rem;
  }

  .cue-hand {
    font-size: 1.8rem;
  }

  .princess-title {
    font-size: 2.5rem;
  }

  .cute-message {
    font-size: 1.2rem;
    padding: 0.8rem 1rem;
  }

  .princess-crown {
    font-size: 2.2rem;
  }

  .signature {
    font-size: 1.1rem;
  }
}

/* touch-friendly */
.card,
.card-front,
.card-inside {
  touch-action: manipulation;
}