@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&family=Quicksand:wght@400;600;700&family=Noto+Nastaliq+Urdu:wght@400;600;700&display=swap');

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

:root {
  --lilac-deep: #9b6fd1;
  --lilac: #b98ee8;
  --lilac-mid: #d3b3f0;
  --lilac-light: #ede0fb;
  --lilac-pale: #f7f1fd;
  --white: #ffffff;
  --gold: #e8b64a;
  --pink: #f6a6c1;
  --text: #4a3768;
}

body {
  font-family: 'Quicksand', sans-serif;
  background: linear-gradient(180deg, var(--lilac-pale) 0%, var(--lilac-light) 45%, var(--lilac-mid) 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.hidden { display: none !important; }

/* ---------- floating balloons background ---------- */
.balloon-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.balloon {
  position: absolute;
  bottom: -220px;
  width: 70px;
  height: 90px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: float-up linear infinite;
  opacity: 0.9;
}

.balloon::after {
  content: '';
  position: absolute;
  bottom: -46px;
  left: 50%;
  width: 1px;
  height: 46px;
  background: rgba(90, 60, 120, 0.35);
}

.balloon::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 16px;
  width: 16px;
  height: 22px;
  background: rgba(255,255,255,0.45);
  border-radius: 50%;
  transform: rotate(-20deg);
}

@keyframes float-up {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); }
  25%  { transform: translateY(-30vh) translateX(20px) rotate(4deg); }
  50%  { transform: translateY(-60vh) translateX(-20px) rotate(-4deg); }
  75%  { transform: translateY(-90vh) translateX(15px) rotate(3deg); }
  100% { transform: translateY(-125vh) translateX(0) rotate(0deg); }
}

/* ---------- header ---------- */
.page { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 32px 16px 80px; }

.title {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 6vw, 46px);
  color: var(--lilac-deep);
  text-shadow: 2px 2px 0 var(--white), 4px 4px 0 var(--pink);
  text-align: center;
  margin-top: 20px;
  letter-spacing: 1px;
}

.subtitle {
  font-family: 'Baloo 2', sans-serif;
  font-size: clamp(14px, 3vw, 18px);
  color: var(--lilac-deep);
  opacity: 0.8;
  margin-top: 8px;
  text-align: center;
}

/* ---------- decorative rows ---------- */
.deco-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: clamp(30px, 6vw, 46px);
  margin: 18px 0;
  flex-wrap: wrap;
}

.deco-row span {
  display: inline-block;
  animation: bob 2.6s ease-in-out infinite;
}
.deco-row span:nth-child(2n) { animation-delay: 0.4s; }
.deco-row span:nth-child(3n) { animation-delay: 0.8s; }

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

/* ---------- cake centerpiece ---------- */
.cake-wrap {
  margin: 22px 0 10px;
  text-align: center;
}
.cake-emoji {
  font-size: clamp(70px, 14vw, 120px);
  display: inline-block;
  filter: drop-shadow(0 10px 12px rgba(120, 80, 160, 0.35));
  animation: bob 3s ease-in-out infinite;
}

/* ---------- open button ---------- */
.open-btn {
  margin-top: 26px;
  padding: 16px 40px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--white);
  background: linear-gradient(135deg, var(--lilac), var(--lilac-deep));
  border: 3px solid var(--white);
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 0 var(--lilac-deep), 0 14px 20px rgba(120, 80, 160, 0.4);
  transition: transform 0.15s ease;
}
.open-btn:hover { transform: translateY(-3px); }
.open-btn:active { transform: translateY(4px); box-shadow: 0 4px 0 var(--lilac-deep); }

/* ---------- overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 55, 104, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

/* cloud card */
.cloud-card {
  position: relative;
  background: var(--white);
  border-radius: 46px;
  padding: 46px 34px 38px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(90, 60, 120, 0.4);
  animation: pop-in 0.35s cubic-bezier(.2,1.3,.4,1);
}

@keyframes pop-in {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.cloud-card .puff {
  position: absolute;
  background: var(--white);
  border-radius: 50%;
}
.cloud-card .p1 { width: 90px; height: 90px; top: -40px; left: 30px; }
.cloud-card .p2 { width: 120px; height: 120px; top: -60px; left: 110px; }
.cloud-card .p3 { width: 80px; height: 80px; top: -34px; right: 40px; }
.cloud-card .p4 { width: 60px; height: 60px; bottom: -22px; left: 40px; }
.cloud-card .p5 { width: 70px; height: 70px; bottom: -26px; right: 30px; }

.close-x {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 22px;
  color: var(--lilac-deep);
  cursor: pointer;
  background: none;
  border: none;
  z-index: 2;
}

.happy-text {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(24px, 6vw, 32px);
  color: var(--lilac-deep);
  position: relative;
  z-index: 2;
  line-height: 1.3;
}

.happy-text .beya {
  color: var(--pink);
}

.lock-icon { font-size: 34px; margin-top: 6px; display: block; }

.pass-form {
  margin-top: 20px;
  position: relative;
  z-index: 2;
}

.pass-form input {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 6px;
  text-align: center;
  width: 160px;
  padding: 10px 14px;
  border: 2px solid var(--lilac-mid);
  border-radius: 16px;
  outline: none;
  color: var(--lilac-deep);
  background: var(--lilac-pale);
}
.pass-form input:focus { border-color: var(--lilac-deep); }

.pass-form button {
  display: block;
  margin: 16px auto 0;
  padding: 10px 30px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--white);
  background: var(--lilac-deep);
  border: none;
  border-radius: 30px;
  cursor: pointer;
}
.pass-form button:hover { background: var(--lilac); }

.hint {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text);
  opacity: 0.75;
  position: relative;
  z-index: 2;
}

/* wrong password character popup */
.oops-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.oops-card {
  background: var(--white);
  border: 4px dashed var(--pink);
  border-radius: 30px;
  padding: 30px 26px;
  text-align: center;
  max-width: 320px;
  animation: shake 0.5s ease;
  box-shadow: 0 14px 30px rgba(90,60,120,0.4);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px) rotate(-3deg); }
  40% { transform: translateX(10px) rotate(3deg); }
  60% { transform: translateX(-8px) rotate(-2deg); }
  80% { transform: translateX(8px) rotate(2deg); }
}

.oops-face { font-size: 56px; display: block; margin-bottom: 10px; }
.oops-text {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--lilac-deep);
}
.oops-card button {
  margin-top: 16px;
  padding: 8px 24px;
  border: none;
  border-radius: 30px;
  background: var(--pink);
  color: var(--white);
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- letter page ---------- */
.letter-page { display: flex; flex-direction: column; align-items: center; width: 100%; }

.hanging-pics {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.hang {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hang .string {
  width: 2px;
  height: 40px;
  background: rgba(90,60,120,0.4);
}

.hang .balloon-mini {
  width: 34px;
  height: 44px;
  border-radius: 50%;
  margin-bottom: -4px;
}

.pic-frame {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 6px solid var(--white);
  outline: 3px solid var(--lilac-mid);
  box-shadow: 0 10px 24px rgba(90,60,120,0.35);
  overflow: hidden;
  animation: sway 3.4s ease-in-out infinite;
  transform-origin: top center;
}
.pic-frame img { width: 100%; height: 100%; object-fit: cover; }
.hang:nth-child(2) .pic-frame { animation-delay: 0.6s; }

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

.letter-card {
  background: var(--white);
  border-radius: 30px;
  padding: 36px 26px;
  max-width: 560px;
  width: 100%;
  margin: 30px 0 20px;
  box-shadow: 0 18px 40px rgba(90,60,120,0.35);
  border: 2px solid var(--lilac-mid);
}

.letter-text {
  font-family: 'Noto Nastaliq Urdu', serif;
  direction: rtl;
  text-align: center;
  font-size: clamp(18px, 3.6vw, 24px);
  line-height: 2.4;
  color: var(--text);
  white-space: pre-line;
}

.music-btn {
  margin-top: 4px;
  padding: 12px 28px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--white);
  background: linear-gradient(135deg, var(--pink), var(--lilac-deep));
  border: none;
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(90,60,120,0.35);
}

footer.credit {
  margin-top: 24px;
  font-size: 12px;
  opacity: 0.6;
  text-align: center;
  position: relative;
  z-index: 1;
}

@media (max-width: 420px) {
  .hanging-pics { gap: 30px; }
  .pic-frame { width: 100px; height: 100px; }
}
