:root {
  --purple: #8a4fff;
  --purple-dark: #5b1d9e;
  --pink: #ff8ce6;
  --light: #f7f1ff;
  --text: #2a153d;
  --shadow: rgba(106, 32, 183, 0.18);
}

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

body {
  min-height: 100vh;
  background: radial-gradient(circle at top left, #f9e8ff 0%, #d3b6ff 30%, #8a4fff 70%);
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.page-wrapper {
  width: min(1000px, 100%);
}

.card {
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 32px;
  box-shadow: 0 24px 60px var(--shadow);
  padding: 40px;
  overflow: hidden;
}

.balloons {
  position: absolute;
  top: 16px;
  right: 24px;
  display: flex;
  gap: 18px;
}

.balloon {
  width: 50px;
  height: 70px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  position: relative;
  animation: float 4s ease-in-out infinite;
}

.balloon::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: 50%;
  width: 2px;
  height: 20px;
  background: rgba(106, 32, 183, 0.8);
  transform: translateX(-50%);
}

.balloon-1 {
  background: #c68cff;
  animation-delay: 0s;
}

.balloon-2 {
  background: #9856f8;
  animation-delay: 0.8s;
}

.balloon-3 {
  background: #ff88e1;
  animation-delay: 1.5s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-18px) scale(1.03);
  }
}

.hero {
  text-align: center;
  padding: 12px 0 24px;
}

.hero h1 {
  font-size: clamp(2rem, 3vw, 3.5rem);
  color: var(--purple-dark);
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #4a2b62;
}

.photo-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(138, 79, 255, 0.16);
  border-radius: 28px;
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 18px 36px rgba(138, 79, 255, 0.08);
}

.photo-frame {
  border: 4px solid rgba(138, 79, 255, 0.18);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(138, 79, 255, 0.12);
}

.photo-frame img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.photo-text h2 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--purple-dark);
}

.photo-text p {
  color: #5f3b82;
  line-height: 1.8;
}

.message-card,
.countdown-section {
  background: linear-gradient(180deg, rgba(138, 79, 255, 0.14), rgba(248, 232, 255, 0.84));
  border: 1px solid rgba(138, 79, 255, 0.16);
  border-radius: 24px;
  padding: 28px;
  margin-bottom: 24px;
}

.message-card h2 {
  font-size: 1.5rem;
  margin-bottom: 14px;
  color: var(--purple);
}

.message-card p {
  line-height: 1.8;
}

.countdown-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(80px, 1fr));
  gap: 18px;
}

.countdown-card div {
  background: white;
  border-radius: 20px;
  padding: 18px 12px;
  text-align: center;
  box-shadow: 0 14px 32px rgba(138, 79, 255, 0.12);
}

.countdown-card span {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--purple-dark);
}

.countdown-card small {
  display: block;
  margin-top: 6px;
  color: #8867b6;
}

.wish-button {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--purple), #ff76d8);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.wish-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 28px rgba(138, 79, 255, 0.25);
}

.wish-message {
  margin-top: 18px;
  min-height: 36px;
  font-size: 1rem;
  text-align: center;
  color: #5d2f83;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(18, 5, 49, 0.72);
  padding: 20px;
  z-index: 50;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  position: relative;
  width: min(560px, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #f8efff);
  border-radius: 32px;
  padding: 28px 28px 24px;
  box-shadow: 0 40px 90px rgba(14, 8, 43, 0.32);
  text-align: center;
  animation: popIn 0.35s ease;
}

.modal::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 32px;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.6), transparent 45%);
  pointer-events: none;
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(138, 79, 255, 0.12);
  color: var(--purple-dark);
  font-size: 1.3rem;
  cursor: pointer;
}

.modal-photo {
  border-radius: 28px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 18px 44px rgba(138, 79, 255, 0.16);
  position: relative;
}

.modal-photo::after {
  content: "✨";
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.75rem;
  opacity: 0.8;
  animation: sparkle 2.5s ease-in-out infinite;
}

.modal-photo img {
  width: 100%;
  display: block;
}

.modal h2 {
  margin-bottom: 12px;
  color: var(--purple-dark);
}

.modal p {
  margin-bottom: 18px;
  color: #624a84;
  line-height: 1.9;
}

.popup-note {
  margin: 0 auto 18px;
  max-width: 470px;
  font-size: 0.98rem;
  color: #7a549f;
  line-height: 1.75;
}

.gift-button {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  margin-bottom: 12px;
  background: rgba(138, 79, 255, 0.18);
  color: var(--purple-dark);
  font-size: 1rem;
  font-weight: 700;
  cursor: not-allowed;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.gift-button.ready {
  background: linear-gradient(135deg, #c36bff, #ff8ce6);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 16px 28px rgba(138, 79, 255, 0.2);
}

.gift-button.ready:hover {
  transform: translateY(-2px);
}

.gift-status {
  margin-bottom: 18px;
  font-size: 0.98rem;
  color: #472963;
}

.modal-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-badges span {
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--purple-dark);
  box-shadow: 0 10px 24px rgba(138, 79, 255, 0.12);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sparkle {
  0%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-6px) scale(1.15);
    opacity: 1;
  }
}

.not-ready-modal {
  width: min(400px, 90%);
  padding: 32px 24px;
  text-align: center;
}

.not-ready-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.8;
}

.not-ready-modal h2 {
  margin-bottom: 12px;
  color: var(--purple-dark);
  font-size: 1.5rem;
}

.not-ready-modal p {
  margin-bottom: 16px;
  color: #624a84;
  line-height: 1.7;
}

.not-ready-note {
  font-size: 0.95rem;
  color: #7a549f;
  margin: 0;
}

@media (max-width: 640px) {
  body {
    padding: 16px;
  }

  .card {
    padding: 28px 20px;
  }

  .photo-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .photo-frame {
    width: 120px;
    margin: 0 auto;
  }

  .countdown-card {
    grid-template-columns: repeat(2, minmax(80px, 1fr));
  }

  .modal {
    padding: 24px 20px;
  }

  .modal-photo {
    margin-bottom: 16px;
  }

  .modal h2 {
    font-size: 1.4rem;
  }

  .modal p {
    font-size: 0.95rem;
  }

  .gift-button {
    padding: 12px 18px;
    font-size: 0.95rem;
  }
}
