/* Import fonts globally for the whole app */
@import url("https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&display=swap");
@import url("https://fonts.cdnfonts.com/css/iciel-pacifico");
@import url("https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;500;600;700&family=Roboto:wght@300;400;900;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #fffde7;
  font-family: "Roboto Condensed", "iCiel Pacifico", Arial, sans-serif;
  color: #222;
  height: 100vh;
  row-gap: -10px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: 393px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1.5% 2%;
  box-sizing: border-box;
  overflow: visible; /* ✅ this fixes drink clipping */
}

.cd-wrapper {
  width: 160px;
  position: absolute;
  top: -90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2; /* ← FIXED: Above other elements */
  cursor: pointer; /* ← ADDED: Visual feedback */
}

.spin {
  animation: spin 10s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.cd-img {
  width: 160px;
  pointer-events: auto; /* ← FIXED: Can be clicked */
  animation: spin 8s linear infinite;
  cursor: pointer; /* ← ADDED: Visual feedback */
}
.cd-button {
  width: 160px;
  cursor: pointer;
  position: relative;
  border: none;
  background: transparent;
  padding: 0;
}
img {
  max-width: 100%;
  height: auto;
}

/* Header Section */
.header {
  text-align: center;
  margin-bottom: 15px;
  pointer-events: none;
  position: relative;
  z-index: 3;
}

.happy-birthday {
  font-family: "iCiel Pacifico", cursive;
  font-size: 3rem; /* fixed typo: removed space from "3 rem" */
  color: #6c6452;
  font-weight: 500;
  margin-bottom: -8px;
  pointer-events: none;
  /* 👇 Add this for floating animation */
  animation: floatText 3s ease-in-out infinite;
}

@keyframes floatText {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1, 1);
  }
  50% {
    transform: translateY(20px) scale(1.02, 1.03);
  }
}

.name {
  font-family: "Roboto Condensed", sans-serif;
  font-size: 5rem;
  font-weight: 900;
  color: #f87777;
  letter-spacing: 1px;
  animation: nameStretch 2.5s ease-in-out infinite;
  transform-origin: center;
  transition: all 0.4s ease;
  transition: opacity 0.3s ease;
}

@keyframes nameStretch {
  0%,
  100% {
    transform: scaleX(1);
  }
  50% {
    transform: scaleX(1.2);
  }
}

/* Top Polaroids */
.top-polaroids {
  display: flex;
  justify-content: space-between;
  gap: 27px;
  width: 100%;
  height: auto;
  margin-top: -75%;
}

.polaroid {
  width: 100%;
  height: auto;
  cursor: pointer;
  transition: transform 0.3s ease !important;
}

.polaroid:nth-child(1) {
  transform: rotate(-25deg) !important;
}

.polaroid:nth-child(2) {
  transform: rotate(25deg) !important;
}

.polaroid:nth-child(3) {
  transform: rotate(-25deg) !important;
}

.polaroid:hover {
  transform: rotate(0deg) scale(1.1) !important;
}
.cake-section {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0 1rem;
  margin-top: -1rem; /* Slight upward pull if needed */
  overflow: visible; /* ✨ This is key */
}

/* Cake Section */
.cake-section {
  display: flex;
  margin-top: -85%;
  justify-content: center;
  align-items: flex-end;
  position: relative;
}

.drink {
  cursor: pointer;
  margin-left: -30px;
  margin-right: -30px;
  z-index: 2;
  transition: transform 0.3s ease !important;
}

.drink:hover {
  transform: scale(1.1) !important;
}

/* Bottom Letters */
.bottom-letters {
  display: flex;
  justify-content: center;
  width: 100%;
  gap: 10%;
  max-width: 350px;
  margin-top: -70%;
  position: relative;
}

.letter {
  cursor: pointer !important;
  z-index: 6;
  transition: transform 0.3s ease !important;
}

.letter:nth-child(1) {
  transform: rotate(-20deg) !important;
}

.letter:nth-child(2) {
  transform: rotate(15deg) !important;
  margin-top: -5px !important;
}

.letter:nth-child(3) {
  transform: rotate(-12deg) !important;
  margin-top: 8px !important;
}

.letter:hover {
  transform: rotate(0deg) scale(1.1) !important;
  z-index: 10 !important  ;
}
/* Squash & Stretch Animation */
@keyframes cakeBounce {
  0% {
    transform: scale(1, 1);
  }
  10% {
    transform: scale(1.1, 0.9);
  }
  30% {
    transform: scale(0.9, 1.1) translateY(-25px);
  }
  50% {
    transform: scale(1.05, 0.95);
  }
  70% {
    transform: scale(0.98, 1.02) translateY(-10px);
  }
  100% {
    transform: scale(1, 1) translateY(0);
  }
}

.animate-bounce {
  animation: cakeBounce 0.6s cubic-bezier(0.25, 1.5, 0.5, 1) forwards;
}

@keyframes squashIn {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(1.4, 0.6);
  }
  50% {
    opacity: 1;
    transform: translateY(-10px) scale(0.8, 1.2);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1, 1);
  }
}

.animate-in {
  animation: squashIn 0.6s ease-out forwards;
  opacity: 0; /* This will animate to visible due to "forwards" */
  animation-fill-mode: forwards; /* <== this line ensures the final state is kept */
}

/* Delayed animation per element */
.animate-title {
  animation-delay: 0.1s;
}
.animate-name {
  animation-delay: 0.3s;
}
.animate-polaroid-1 {
  animation-delay: 0.5s;
}
.animate-polaroid-2 {
  animation-delay: 0.7s;
}
.animate-polaroid-3 {
  animation-delay: 0.9s;
}
.animate-drink-left {
  animation-delay: 1.1s;
}
.animate-cake {
  animation-delay: 1.3s;
}
.animate-drink-right {
  animation-delay: 1.5s;
}
.animate-letter-1 {
  animation-delay: 1.7s;
}
.animate-letter-2 {
  animation-delay: 1.9s;
}
.animate-letter-3 {
  animation-delay: 2.1s;
}

/* Cake bounce on click */
@keyframes cakeBounce {
  0% {
    transform: scale(1);
  }
  20% {
    transform: scale(1.1, 0.9);
  }
  40% {
    transform: scale(0.9, 1.1) translateY(-20px);
  }
  60% {
    transform: scale(1.05, 0.95);
  }
  80% {
    transform: scale(0.98, 1.02) translateY(-8px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

.animate-bounce {
  animation: cakeBounce 0.6s cubic-bezier(0.25, 1.5, 0.5, 1) forwards;
}

#notes-wrapper {
  position: fixed;
  inset: 0; /* top:0 right:0 bottom:0 left:0 shorthand */
  pointer-events: none;
  z-index: 5; /* above background, below UI if needed */
}

.notes {
  position: fixed; /* falls relative to viewport          */
  width: 32px;
  height: 32px;
  pointer-events: none;
  opacity: 0.9;
  animation: driftDown 2s ease-out forwards;
}

/* straight-down with a slight X drift (set by JS via --xShift) */
@keyframes driftDown {
  0% {
    transform: translate(0, 0);
    opacity: 0.9;
  }
  100% {
    transform: translate(var(--drift), 50px);
    opacity: 0;
  }
}

/* Confetti base */
.confetti {
  position: fixed;
  top: -10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.8;
  animation: fall 4s linear infinite;
  z-index: -2;
}
@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
  }
}
.cake {
  width: 313px; /* or whatever fixed width you want */
  height: 247.44px;
  max-width: 100%;
  transition: transform 0.3s ease;
  object-fit: contain;
}

/* Optional new animation for final cake pop */
@keyframes pop {
  0% {
    transform: scale(0.8);
    opacity: 0.4;
  }
  60% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

.animate-pop {
  animation: pop 0.5s ease-in-out;
}
