* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: linear-gradient(160deg, #ffd6e8 0%, #ffe9f3 50%, #d6ecff 100%);
  overflow: hidden;
  font-family: "Comic Sans MS", "Chalkboard SE", "Marker Felt", cursive;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* floating hearts background */
.hearts-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.floaty {
  position: absolute;
  bottom: -10vh;
  animation: floatUp linear forwards;
  user-select: none;
}

@keyframes floatUp {
  from {
    transform: translateY(0) rotate(-10deg);
    opacity: 1;
  }
  to {
    transform: translateY(-120vh) rotate(15deg);
    opacity: 0;
  }
}

/* popup */
.popup-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.flyer {
  will-change: transform;
}

.flyer.returning {
  transition: transform 0.65s cubic-bezier(0.34, 1.8, 0.5, 1);
}

.polaroid {
  background: #fff;
  padding: 18px 18px 26px;
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(180, 60, 120, 0.35);
  transform: rotate(-4deg);
  animation: popIn 0.9s cubic-bezier(0.34, 1.8, 0.5, 1) 0.4s backwards;
  cursor: pointer;
  position: relative;
  max-width: min(78vw, 460px);
  user-select: none;
}

.polaroid.wiggling {
  animation: wiggle 0.5s ease-in-out;
}

@keyframes popIn {
  from {
    transform: rotate(-4deg) scale(0);
  }
  to {
    transform: rotate(-4deg) scale(1);
  }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-4deg) scale(1); }
  20% { transform: rotate(4deg) scale(1.06); }
  40% { transform: rotate(-6deg) scale(1.04); }
  60% { transform: rotate(3deg) scale(1.06); }
  80% { transform: rotate(-2deg) scale(1.02); }
}

.tape {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(3deg);
  width: 110px;
  height: 30px;
  background: rgba(255, 235, 150, 0.85);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

.polaroid img {
  display: block;
  width: 100%;
  max-height: 55vh;
  object-fit: cover;
  border-radius: 3px;
  -webkit-user-drag: none;
}

.photo-missing {
  width: min(70vw, 420px);
  height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: repeating-linear-gradient(45deg, #ffeef6, #ffeef6 14px, #fff5fa 14px, #fff5fa 28px);
  border: 3px dashed #ff9ec6;
  border-radius: 3px;
  font-size: 26px;
  text-align: center;
  color: #d4508a;
}

.caption {
  margin-top: 16px;
  text-align: center;
  font-size: clamp(20px, 4.5vw, 34px);
  font-weight: bold;
  color: #ff2d78;
  text-shadow: 2px 2px 0 #ffd6e8;
  letter-spacing: 1px;
  min-height: 1.2em;
  white-space: nowrap;
}

.caption span {
  display: inline-block;
  animation: bounceLetter 1.6s ease-in-out infinite;
}

@keyframes bounceLetter {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-9px) rotate(4deg); }
}

.hint {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  color: #c2447e;
  opacity: 0;
  animation: hintIn 0.6s ease 2s forwards;
  z-index: 3;
  pointer-events: none;
}

@keyframes hintIn {
  to { opacity: 0.8; }
}

/* confetti burst pieces */
.confetti {
  position: fixed;
  width: 12px;
  height: 12px;
  z-index: 4;
  pointer-events: none;
}
