/* Birthday unlock overlay + Happy Birthday reveal. */

.countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  color: #f7f2ff;
  background:
    radial-gradient(circle at 50% 38%, rgba(88, 28, 135, 0.34), transparent 54%),
    radial-gradient(circle at 18% 82%, rgba(192, 132, 252, 0.12), transparent 44%),
    #06040a;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.countdown-overlay.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.countdown-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.countdown-stars span {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  color: #d9c2ef;
  font-size: var(--sz, 0.8rem);
  opacity: 0.5;
  animation: countdownTwinkle 3.4s var(--d, 0s) ease-in-out infinite;
}

@keyframes countdownTwinkle {
  0%, 100% { opacity: 0.24; transform: scale(0.9) rotate(0deg); }
  50% { opacity: 0.8; transform: scale(1.2) rotate(8deg); }
}

.countdown-card {
  position: relative;
  width: min(92vw, 430px);
  padding: 34px 26px 26px;
  text-align: center;
  background: linear-gradient(180deg, rgba(33, 22, 54, 0.99) 0%, rgba(15, 10, 26, 0.99) 100%);
  border: 2px solid rgba(216, 180, 254, 0.38);
  border-radius: 26px;
  box-shadow:
    0 6px 0 var(--garden-rim, #2a1b40),
    0 30px 80px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: countdownCardIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: opacity 0.4s ease, transform 0.5s ease;
}

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

.countdown-overlay.is-zero .countdown-card {
  animation: none;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.92);
  pointer-events: none;
}

.countdown-kicker,
.birthday-kicker {
  display: inline-block;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f3e8ff;
  background: rgba(192, 132, 252, 0.16);
  border: 1px solid rgba(216, 180, 254, 0.3);
  border-radius: 999px;
}

.countdown-title {
  margin: 14px 0 4px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 7vw, 2.2rem);
  line-height: 1.15;
  color: #ffffff;
}

.countdown-sub {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a996c7;
}

.countdown-clock {
  margin: 10px 0 0;
  font-size: clamp(3.4rem, 18vw, 5.4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  color: #f3e8ff;
  filter: drop-shadow(0 4px 0 rgba(88, 28, 135, 0.45));
}

.countdown-track {
  height: 10px;
  margin: 20px auto 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(216, 180, 254, 0.18);
  border-radius: 999px;
}

#countdownBar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7e22ce 0%, #c084fc 55%, #e9d5ff 100%);
  box-shadow: 0 0 16px rgba(192, 132, 252, 0.4);
  transition: width 0.25s linear;
}

.birthday-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.88);
  pointer-events: none;
  transition:
    opacity 0.55s ease,
    transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0s linear 0.55s;
}

.countdown-overlay.is-zero .birthday-reveal {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition-delay: 0s;
}

.birthday-title {
  margin: 18px 0 0;
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 13vw, 4.8rem);
  line-height: 1.04;
  color: #ffffff;
}

.countdown-overlay.is-zero .birthday-title {
  animation: birthdayPop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.birthday-title span {
  background: linear-gradient(120deg, #e9d5ff 0%, #c084fc 45%, #f4eefa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fdf4ff;
  filter: drop-shadow(0 3px 0 rgba(88, 28, 135, 0.55));
}

@keyframes birthdayPop {
  0% { opacity: 0; transform: scale(0.7) translateY(20px); }
  60% { opacity: 1; transform: scale(1.04) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.birthday-line {
  margin: 16px 0 0;
  font-size: 1.05rem;
  color: #e7dcf7;
}

.birthday-sparkles {
  margin-top: 18px;
  font-size: 1.4rem;
  letter-spacing: 0.45em;
  animation: birthdaySparkle 1.8s ease-in-out infinite alternate;
}

@keyframes birthdaySparkle {
  from { opacity: 0.55; transform: translateY(0); }
  to { opacity: 1; transform: translateY(-4px); }
}

@media (max-width: 380px) {
  .countdown-overlay { padding: 16px; }
  .countdown-card { padding: 28px 18px 22px; }
  .birthday-title { font-size: clamp(2.2rem, 13vw, 3.4rem); }
}

@media (prefers-reduced-motion: reduce) {
  .countdown-overlay,
  .countdown-card,
  .birthday-reveal,
  .birthday-title,
  .birthday-sparkles,
  .countdown-stars span,
  #countdownBar {
    animation: none !important;
    transition: none !important;
  }
}
