@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Poppins:wght@300;400;600;700&display=swap');

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

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
  padding: 20px;
  position: relative;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

/* ===== PAGES ===== */
.page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.page.active {
  opacity: 1;
  visibility: visible;
}

/* ===== PAGE 1: GREETING ===== */
.greeting-container {
  text-align: center;
  position: relative;
  padding: 40px;
}

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

.star {
  position: absolute;
  color: #fbbf24;
  font-size: 1.2rem;
  animation: twinkle 2s ease-in-out infinite;
  opacity: 0.5;
}

.s1  { top: 3%;   left: 8%;   animation-delay: 0s;     font-size: 1.3rem; }
.s2  { top: 12%;  right: 5%;  animation-delay: 0.3s;   font-size: 0.9rem; color: #c084fc; }
.s3  { top: 22%;  left: 3%;   animation-delay: 0.6s;   font-size: 1.6rem; }
.s4  { top: 30%;  right: 10%; animation-delay: 0.9s;   font-size: 0.8rem; color: #f472b6; }
.s5  { top: 42%;  left: 7%;   animation-delay: 1.2s;   font-size: 1.1rem; }
.s6  { top: 50%;  right: 3%;  animation-delay: 1.5s;   font-size: 1.4rem; color: #67e8f9; }
.s7  { top: 58%;  left: 12%;  animation-delay: 1.8s;   font-size: 0.7rem; }
.s8  { top: 65%;  right: 15%; animation-delay: 2.1s;   font-size: 1rem;   color: #fbbf24; }
.s9  { top: 72%;  left: 5%;   animation-delay: 2.4s;   font-size: 1.2rem; }
.s10 { top: 78%;  right: 7%;  animation-delay: 2.7s;   font-size: 0.8rem; color: #f472b6; }
.s11 { top: 85%;  left: 15%;  animation-delay: 3s;     font-size: 0.6rem; }
.s12 { top: 18%;  left: 50%;  animation-delay: 0.5s;   font-size: 0.7rem; color: #c084fc; }
.s13 { top: 48%;  left: 85%;  animation-delay: 1.1s;   font-size: 0.9rem; }
.s14 { top: 90%;  right: 20%; animation-delay: 2.3s;   font-size: 0.7rem; color: #67e8f9; }
.s15 { top: 35%;  left: 92%;  animation-delay: 1.7s;   font-size: 0.6rem; }

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.2); }
}

.greeting-sub {
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.greeting-title {
  font-family: 'Great Vibes', cursive;
  font-size: 3.2rem;
  font-weight: 400;
  background: linear-gradient(135deg, #fbbf24, #f472b6, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.greeting-name {
  font-size: 4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 5px;
  text-shadow: 0 0 40px rgba(192, 132, 252, 0.6), 0 0 80px rgba(251, 191, 36, 0.3);
  margin-bottom: 10px;
  animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { text-shadow: 0 0 40px rgba(192, 132, 252, 0.6), 0 0 80px rgba(251, 191, 36, 0.3); }
  50%      { text-shadow: 0 0 60px rgba(192, 132, 252, 0.9), 0 0 120px rgba(251, 191, 36, 0.5); }
}

.greeting-date {
  color: rgba(255,255,255,0.5);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.greeting-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #f472b6, transparent);
  margin: 0 auto 24px;
}

.greeting-msg {
  color: rgba(255,255,255,0.7);
  font-size: 1.05rem;
  font-weight: 300;
  margin-bottom: 36px;
}

.open-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #f472b6, #c084fc);
  color: #fff;
  border: none;
  padding: 16px 40px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 8px 30px rgba(192, 132, 252, 0.4);
  position: relative;
  overflow: hidden;
}

.open-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: 0.5s;
}

.open-btn:hover::before {
  opacity: 1;
}

.open-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(192, 132, 252, 0.6);
}

.open-btn:active {
  transform: scale(0.95);
}

.btn-icon {
  font-size: 1.3rem;
  animation: bounceIcon 2s ease-in-out infinite;
}

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

/* ===== PAGE 2: WISH CARD ===== */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
}

.balloons {
  position: absolute;
  top: -80px;
  left: 0;
  width: 100%;
  height: 0;
  pointer-events: none;
}

.balloon {
  width: 50px;
  height: 62px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  position: absolute;
  animation: float 3s ease-in-out infinite;
  opacity: 0.85;
}

.balloon::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 30px;
  background: rgba(255,255,255,0.4);
}

.b1 { left: 5%;  background: #ff6b9d; animation-delay: 0s; }
.b2 { left: 20%; background: #c084fc; animation-delay: 0.5s; }
.b3 { left: 40%; background: #fbbf24; animation-delay: 1s; }
.b4 { left: 60%; background: #67e8f9; animation-delay: 1.5s; }
.b5 { left: 75%; background: #fb923c; animation-delay: 2s; }
.b6 { left: 90%; background: #f472b6; animation-delay: 2.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-20px) rotate(3deg); }
}

.card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5), 0 0 80px rgba(192, 132, 252, 0.15);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.card-header h1 {
  font-family: 'Great Vibes', cursive;
  font-size: 2.8rem;
  font-weight: 400;
  background: linear-gradient(135deg, #fbbf24, #f472b6, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sparkle {
  font-size: 1.8rem;
  animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.2); }
}

.name {
  font-size: 2.8rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 3px;
  margin-bottom: 20px;
  text-shadow: 0 0 30px rgba(192, 132, 252, 0.5);
}

.photo-frame {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  margin: 0 auto 24px;
  padding: 4px;
  background: linear-gradient(135deg, #fbbf24, #f472b6, #c084fc);
  box-shadow: 0 0 40px rgba(192, 132, 252, 0.3);
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s;
  border: 2px dashed rgba(255,255,255,0.2);
}

.photo-placeholder:hover {
  background: rgba(255,255,255,0.1);
}

.photo-icon {
  font-size: 2.8rem;
  margin-bottom: 4px;
}

.profile-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.message {
  margin-bottom: 24px;
}

.message p {
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  line-height: 1.8;
  font-weight: 300;
}

.signature {
  font-family: 'Great Vibes', cursive;
  font-size: 1.4rem !important;
  color: #fbbf24 !important;
  margin-top: 12px;
}

.birthday-dates {
  margin-bottom: 20px;
}

.date-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  padding: 8px 20px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.1);
}

.label {
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
}

.value {
  color: #fbbf24;
  font-weight: 600;
  font-size: 0.95rem;
}

.candle-btn {
  background: linear-gradient(135deg, #f472b6, #c084fc);
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 16px;
}

.candle-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(192, 132, 252, 0.4);
}

.candle-btn:active {
  transform: scale(0.95);
}

.candle-container {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.candle {
  width: 30px;
  height: 60px;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  border-radius: 3px 3px 6px 6px;
  position: relative;
}

.candle::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 6px;
  background: #1e1b4b;
  border-radius: 2px;
}

.flame {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 24px;
  background: radial-gradient(ellipse at center, #fef08a 0%, #f59e0b 40%, #dc2626 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 0.3s ease-in-out infinite alternate;
  box-shadow: 0 0 30px 8px rgba(251, 191, 36, 0.4);
}

@keyframes flicker {
  0%   { transform: translateX(-50%) scaleY(1) scaleX(1); }
  100% { transform: translateX(-50%) scaleY(1.1) scaleX(0.9); }
}

.flame.out {
  display: none;
}

.wish-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: 0.5s;
  padding: 20px;
}

.wish-popup.show {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  background: linear-gradient(135deg, #1e1b4b, #312e81, #1e1b4b);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 30px;
  padding: 40px 35px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6), 0 0 100px rgba(192,132,252,0.2);
  transform: scale(0.8);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wish-popup.show .popup-content {
  transform: scale(1);
}

.popup-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.popup-title {
  font-family: 'Great Vibes', cursive;
  font-size: 2.4rem;
  font-weight: 400;
  background: linear-gradient(135deg, #fbbf24, #f472b6, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.popup-name {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 3px;
  margin-bottom: 12px;
  text-shadow: 0 0 30px rgba(192,132,252,0.5);
}

.popup-divider {
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #f472b6, transparent);
  margin: 0 auto 16px;
}

.popup-from {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.popup-msg {
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 8px;
}

.popup-thanks {
  color: #fbbf24;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 12px;
  font-style: italic;
}

.popup-hearts {
  font-size: 1.8rem;
  animation: pulseHeart 1.5s ease-in-out infinite;
}

@keyframes pulseHeart {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.2); }
}

.music-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  font-size: 1.4rem;
  transition: 0.3s;
}

.music-toggle:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.1);
}

@media (max-width: 480px) {
  .card { padding: 30px 20px; }
  .card-header h1 { font-size: 2.2rem; }
  .name { font-size: 2rem; }
  .photo-frame { width: 130px; height: 130px; }
  .balloon { width: 38px; height: 48px; }
  .greeting-title { font-size: 2.5rem; }
  .greeting-name { font-size: 3rem; }
}
