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

html, body {
  height: 100vh;
  width: 100vw;
  font-family: 'Lora', serif;
  overflow-x: hidden;
}

body {
  background: linear-gradient(135deg, #f7f3f0 0%, #e8ddd4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}


.container {
  perspective: 1000px;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(50px); }
  to { opacity: 1; transform: translateY(0); }
}

.birthday-card {
  background: #fdfcfa;
  border: 3px solid #8b5a3c;
  border-radius: 8px;
  padding: 35px;
  box-shadow: 0 8px 24px rgba(139, 90, 60, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  text-align: center;
  width: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}


.birthday-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.main-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: #8b5a3c;
  margin-bottom: 18px;
  animation: titleFadeIn 1.2s ease-out 0.5s both;
  text-shadow: 1px 1px 2px rgba(139, 90, 60, 0.1);
  letter-spacing: 2px;
}

@keyframes titleFadeIn {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.balloons {
  margin: 20px 0;
  height: 60px;
  position: relative;
}

.balloon {
  font-size: 1.8rem;
  display: inline-block;
  margin: 0 6px;
  cursor: pointer;
  transition: transform 0.2s ease;
  opacity: 0.9;
}

.balloon:hover {
  transform: scale(1.2);
}


.balloon-1 { animation-delay: 0s; }
.balloon-2 { animation-delay: 0.5s; }
.balloon-3 { animation-delay: 1s; }
.balloon-4 { animation-delay: 1.5s; }
.balloon-5 { animation-delay: 2s; }

.wish-text {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  color: #5d4037;
  line-height: 1.6;
  margin: 25px 0;
  animation: textSlide 1.5s ease-out 1.5s both;
  font-weight: 400;
  text-align: center;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

@keyframes textSlide {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.cake {
  font-size: 2.2rem;
  margin: 25px 0;
  animation: cakeAppear 1.8s ease-out 2s both;
  cursor: pointer;
  transition: transform 0.2s ease;
  opacity: 0.95;
}

.cake:hover {
  transform: scale(1.1);
}

@keyframes cakeAppear {
  0% { opacity: 0; transform: translateY(15px); }
  100% { opacity: 0.95; transform: translateY(0px); }
}


.confetti {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  background: linear-gradient(45deg, #daa520, #8b4513, #a0522d, #cd853f);
  animation: confettiFall 4s linear infinite;
  opacity: 0.7;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

.confetti-piece:nth-child(1) { left: 10%; animation-delay: 0s; background: #daa520; }
.confetti-piece:nth-child(2) { left: 20%; animation-delay: 1s; background: #8b4513; }
.confetti-piece:nth-child(3) { left: 30%; animation-delay: 2s; background: #a0522d; }
.confetti-piece:nth-child(4) { left: 40%; animation-delay: 3s; background: #cd853f; }
.confetti-piece:nth-child(5) { left: 50%; animation-delay: 4s; background: #daa520; }
.confetti-piece:nth-child(6) { left: 60%; animation-delay: 5s; background: #8b4513; }
.confetti-piece:nth-child(7) { left: 70%; animation-delay: 6s; background: #a0522d; }
.confetti-piece:nth-child(8) { left: 80%; animation-delay: 7s; background: #cd853f; }

/* Memories Section Styling */
.memories-section {
  margin: 25px 0;
  animation: memoriesSlideIn 2s ease-out 2.5s both;
}

.memories-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 400;
  color: #8b5a3c;
  margin-bottom: 18px;
  text-shadow: 1px 1px 2px rgba(139, 90, 60, 0.1);
  font-style: italic;
}


.memory-frame {
  position: relative;
  display: inline-block;
  background: #fdfcfa;
  border: 2px solid #8b5a3c;
  padding: 12px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(139, 90, 60, 0.2);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.memory-frame:hover {
  transform: scale(1.05);
  box-shadow: 
    0 12px 25px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}


.memory-photo {
  max-width: 200px;
  max-height: 150px;
  width: 100%;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
  animation: photoReveal 1.5s ease-out 3s both;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  transition: filter 0.3s ease;
}

.memory-photo:hover {
  filter: brightness(1.1) contrast(1.05);
}

@keyframes photoReveal {
  0% {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0px);
  }
}

.memory-caption {
  margin-top: 10px;
  font-family: 'Lora', serif;
  font-size: 0.9rem;
  color: #5d4037;
  font-style: italic;
  animation: captionFadeIn 1s ease-out 3.5s both;
  text-shadow: none;
}

@keyframes captionFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.memory-hearts {
  position: absolute;
  top: -8px;
  right: -8px;
  animation: heartsAppear 1s ease-out 4s both;
}

.heart {
  font-size: 1.2rem;
  display: inline-block;
  animation: heartBeat 2s ease-in-out infinite;
  margin: 0 1px;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
}

@keyframes heartsAppear {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.3) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.heart-1 { animation-delay: 0s; }
.heart-2 { animation-delay: 0.3s; }
.heart-3 { animation-delay: 0.6s; }

@keyframes memoriesSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-50px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Name styling for KHUSHI PRIYA */
.name-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 400;
  color: #a0522d;
  margin-bottom: 25px;
  animation: nameFadeIn 1.5s ease-out 1s both;
  text-shadow: 1px 1px 3px rgba(160, 82, 45, 0.15);
  letter-spacing: 3px;
  font-style: italic;
}

@keyframes nameFadeIn {
  0% { opacity: 0; transform: translateY(15px); }
  100% { opacity: 1; transform: translateY(0); }
}


/* Gift Box Styles */
.gift-box-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: giftBoxEntrance 2s ease-out;
}

.gift-box-container.exploded {
  opacity: 0;
  pointer-events: none;
  animation: giftBoxExit 0.8s ease-out;
}

@keyframes giftBoxEntrance {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(50px) scale(0.5);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0) scale(1);
  }
}

@keyframes giftBoxExit {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5);
  }
}

.gift-box {
  position: relative;
  width: 150px;
  height: 150px;
  cursor: pointer;
  transition: transform 0.2s ease;
  animation: giftGentle 4s ease-in-out infinite;
}

.gift-box:hover {
  transform: scale(1.05);
}

@keyframes giftGentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

.gift-box-bottom {
  width: 150px;
  height: 105px;
  background: linear-gradient(135deg, #8b4513, #654321);
  border-radius: 6px;
  position: absolute;
  bottom: 0;
  box-shadow: 0 6px 12px rgba(139, 69, 19, 0.3);
}

.gift-box-top {
  width: 165px;
  height: 60px;
  background: linear-gradient(135deg, #8b4513, #654321);
  border-radius: 8px 8px 6px 6px;
  position: absolute;
  top: 0;
  left: -7.5px;
  box-shadow: 0 3px 8px rgba(139, 69, 19, 0.2);
  animation: lidGentle 3s ease-in-out infinite;
}

@keyframes lidGentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-1px); }
}

.gift-ribbon-h {
  width: 22px;
  height: 150px;
  background: linear-gradient(90deg, #daa520, #b8860b);
  position: absolute;
  left: 64px;
  top: 0;
  box-shadow: inset -2px 0 6px rgba(218, 165, 32, 0.3);
}

.gift-ribbon-v {
  width: 165px;
  height: 22px;
  background: linear-gradient(180deg, #daa520, #b8860b);
  position: absolute;
  left: -7.5px;
  top: 26px;
  box-shadow: inset 0 -2px 6px rgba(218, 165, 32, 0.3);
}

.gift-bow {
  position: absolute;
  top: -8px;
  left: 67px;
  font-size: 3rem;
  animation: bowGentle 6s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(139, 90, 60, 0.2));
  opacity: 0.9;
}

@keyframes bowGentle {
  0%, 100% { transform: rotate(-1deg); }
  50% { transform: rotate(1deg); }
}

.gift-sparkles {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  font-size: 1.2rem;
  animation: sparkleMove 2s ease-in-out infinite;
}

@keyframes sparkleMove {
  0%, 100% { transform: scale(0.9) rotate(0deg); opacity: 0.6; }
  50% { transform: scale(1.1) rotate(90deg); opacity: 0.8; }
}

.sparkle-1 { top: -15px; left: -15px; animation-delay: 0s; }
.sparkle-2 { top: -15px; right: -15px; animation-delay: 0.5s; }
.sparkle-3 { bottom: -8px; left: -15px; animation-delay: 1s; }
.sparkle-4 { bottom: -8px; right: -15px; animation-delay: 1.5s; }

.click-instruction {
  margin-top: 25px;
  font-family: 'Lora', serif;
  font-size: 0.95rem;
  color: #8b5a3c;
  font-style: italic;
  border: 1px solid #8b5a3c;
  padding: 8px 16px;
  border-radius: 4px;
  background: rgba(253, 252, 250, 0.9);
  animation: instructionFade 3s ease-in-out infinite alternate;
  text-shadow: none;
}

@keyframes instructionFade {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* Birthday card reveal animations */
.birthday-card.revealed {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  animation: cardReveal 1s ease-out;
}

@keyframes cardReveal {
  0% {
    opacity: 0;
    transform: scale(0) rotate(180deg);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.1) rotate(90deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Explosion effect */
@keyframes explode {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(2) rotate(180deg); opacity: 0.5; }
  100% { transform: scale(4) rotate(360deg); opacity: 0; }
}

.gift-box.exploding .gift-box-top {
  animation: topExplode 0.8s ease-out forwards;
}

.gift-box.exploding .gift-box-bottom {
  animation: bottomShake 0.8s ease-out forwards;
}

@keyframes topExplode {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-200px) rotate(720deg) scale(0.5); opacity: 0; }
}

@keyframes bottomShake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-10px); }
  20% { transform: translateX(10px); }
  30% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  50% { transform: translateX(0); }
}

@media (max-width: 768px) {
  
  .container {
    max-width: 350px;
  }
  
  .birthday-card {
    padding: 20px 15px;
  }
  
  .main-title {
    font-size: 2rem;
  }
  
  .name-title {
    font-size: 1.5rem;
    letter-spacing: 1px;
  }
  
  .balloon {
    font-size: 1.5rem;
    margin: 0 6px;
  }
  
  .wish-text {
    font-size: 0.9rem;
  }
  
  .cake {
    font-size: 2rem;
  }
  
  .memories-title {
    font-size: 1.1rem;
  }
  
  .memory-photo {
    max-width: 180px;
    max-height: 130px;
  }
  
  .memory-frame {
    padding: 8px;
  }
  
  .memory-caption {
    font-size: 0.8rem;
  }
  
  .heart {
    font-size: 1rem;
  }
  
  .gift-box {
    width: 120px;
    height: 120px;
  }
  
  .gift-box-bottom {
    width: 120px;
    height: 84px;
  }
  
  .gift-box-top {
    width: 132px;
    height: 48px;
    left: -6px;
  }
  
  .gift-ribbon-h {
    width: 18px;
    height: 120px;
    left: 51px;
  }
  
  .gift-ribbon-v {
    width: 132px;
    height: 18px;
    left: -6px;
    top: 21px;
  }
  
  .gift-bow {
    top: -6px;
    left: 54px;
    font-size: 2.5rem;
  }
  
  .click-instruction {
    font-size: 0.9rem;
    padding: 10px 16px;
  }
}

@media (max-width: 480px) {
  .container {
    max-width: 300px;
  }
  
  .birthday-card {
    padding: 18px 12px;
  }
  
  .main-title {
    font-size: 1.8rem;
  }
  
  .name-title {
    font-size: 1.3rem;
  }
  
  .balloon {
    font-size: 1.3rem;
    margin: 0 4px;
  }
  
  .memories-section {
    margin: 15px 0;
  }
  
  .memory-photo {
    max-width: 160px;
    max-height: 120px;
  }
}