:root {
  /* same palette as the rest of the site */
  --primary-color: #ff6b9d;
  --secondary-color: #ffd93d;
  --accent-color: #6bcf7f;
  --text-dark: #2c3e50;
  --text-light: #ffffff;
  --bg-light: #ffeef5;
  --bg-white: #ffffff;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
  --border-radius: 15px;
  --transition: all 0.3s ease;

  --font-display: "Lato", sans-serif;
  --font-body: "Open Sans", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--text-dark);
  background: linear-gradient(135deg, #ffeef5 0%, #e8f4fd 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* playful birthday emoji pattern, same motif as the home page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="bp" patternUnits="userSpaceOnUse" width="50" height="50"><text x="25" y="25" text-anchor="middle" font-size="20" fill="rgba(255,107,157,0.10)">🎂</text><text x="12.5" y="37.5" text-anchor="middle" font-size="15" fill="rgba(255,107,157,0.08)">🎉</text><text x="37.5" y="12.5" text-anchor="middle" font-size="15" fill="rgba(255,107,157,0.08)">🎈</text></pattern></defs><rect width="100" height="100" fill="url(%23bp)"/></svg>');
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.is-hidden,
[hidden] {
  display: none !important;
}

/* ---------- Stage ---------- */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 16px
    max(20px, env(safe-area-inset-bottom));
  gap: clamp(6px, 1.6vh, 16px);
}

/* floating hearts / sparkle ambiance */
.stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Eyebrow ---------- */
.eyebrow {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 540px;
  margin-top: 4px;
}

.eyebrow-line {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-color),
    transparent
  );
  opacity: 0.6;
}

.eyebrow-text {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-size: clamp(9px, 2.6vw, 12px);
  color: var(--primary-color);
  white-space: nowrap;
}

/* ---------- Cake ---------- */
.cake-wrap {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  width: 100%;
  max-width: 880px;
  max-height: 66vh; /* keep the canvas ~cake-shaped so the cake fills it big */
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.cake {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
}

/* ---------- Panel ---------- */
.panel {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  text-align: center;
}

.panel-card {
  animation: rise 0.7s var(--ease) both;
}

.headline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 8vw, 46px);
  line-height: 1.05;
  color: var(--primary-color);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.08);
}

.headline em {
  font-style: normal;
  background: linear-gradient(
    120deg,
    var(--primary-color),
    var(--accent-color)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subhead {
  margin: 12px auto 22px;
  max-width: 36ch;
  font-size: clamp(13px, 3.6vw, 16px);
  line-height: 1.6;
  color: var(--text-dark);
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(14px, 3.8vw, 16px);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 16px 34px;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 3px;
}

.btn-primary {
  color: var(--text-light);
  background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
  box-shadow: var(--shadow);
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s ease;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-spark {
  font-size: 0.9em;
  animation: twinkle 2.4s ease-in-out infinite;
}

.btn-ghost,
.btn-soft {
  color: var(--primary-color);
  background: var(--bg-white);
  border: 2px solid rgba(255, 107, 157, 0.4);
  padding: 12px 26px;
  font-size: clamp(12.5px, 3.4vw, 14px);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.btn-ghost:hover,
.btn-soft:hover {
  transform: translateY(-2px);
  background: var(--bg-light);
  box-shadow: var(--shadow-hover);
}

/* Blow card */
.blow-cue {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(22px, 6.4vw, 32px);
  color: var(--primary-color);
  margin-bottom: 14px;
}

.blow-cue.is-strong {
  color: var(--accent-color);
  animation: pulse 0.5s var(--ease);
}

.meter {
  position: relative;
  width: min(300px, 80vw);
  height: 16px;
  margin: 0 auto 14px;
  border-radius: 50px;
  background: var(--bg-white);
  overflow: hidden;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 107, 157, 0.2);
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 50px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  box-shadow: 0 0 12px rgba(255, 169, 60, 0.55);
  transition: width 0.08s linear;
}

.count-label {
  font-size: clamp(12px, 3.4vw, 14px);
  color: var(--text-dark);
  margin-bottom: 18px;
}

.count-label span {
  color: var(--primary-color);
  font-weight: 700;
}

.mic-note {
  margin-top: 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-color);
  min-height: 1em;
}

/* ---------- Countdown gate ---------- */
.countdown-screen {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 22px;
  text-align: center;
  background: linear-gradient(
    135deg,
    rgba(255, 238, 245, 0.82),
    rgba(232, 244, 253, 0.82)
  );
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.7s var(--ease) both;
}

.countdown-screen.is-leaving {
  animation: fadeOut 0.8s var(--ease) forwards;
}

.cd-inner {
  max-width: 620px;
}

.cd-eyebrow {
  font-size: clamp(10px, 2.8vw, 12px);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 12px;
}

.cd-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, 9vw, 54px);
  line-height: 1.05;
  color: var(--primary-color);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.08);
  margin-bottom: clamp(20px, 5vw, 32px);
}

.cd-clock {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(8px, 2.4vw, 16px);
}

.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: clamp(60px, 18vw, 104px);
  padding: clamp(12px, 2.6vw, 20px) clamp(8px, 2vw, 16px);
  border-radius: var(--border-radius);
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: var(--text-light);
  box-shadow: var(--shadow);
}

.cd-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 8.5vw, 52px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cd-lbl {
  margin-top: 8px;
  font-size: clamp(9px, 2.4vw, 12px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.92;
}

.cd-colon {
  display: none;
}

.cd-sub {
  margin: clamp(20px, 5vw, 30px) auto 0;
  max-width: 34ch;
  font-size: clamp(13px, 3.5vw, 16px);
  line-height: 1.6;
  color: var(--text-dark);
}

.cd-sub strong {
  color: var(--primary-color);
  font-weight: 700;
}

/* ---------- Celebration ---------- */
.celebrate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(
    135deg,
    rgba(255, 238, 245, 0.95),
    rgba(232, 244, 253, 0.95)
  );
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.8s var(--ease) both;
}

.confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.celebrate-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  text-align: center;
}

.celebrate-eyebrow {
  font-size: clamp(10px, 2.8vw, 12px);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: 14px;
  animation: rise 0.9s 0.2s var(--ease) both;
}

.celebrate-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 12vw, 76px);
  line-height: 1.02;
  color: var(--primary-color);
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.1);
  animation: rise 0.9s 0.32s var(--ease) both;
}

.celebrate-title span {
  display: inline-block;
  background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.08em;
}

.celebrate-sub {
  margin: 16px auto 26px;
  max-width: 38ch;
  font-size: clamp(13px, 3.6vw, 16px);
  line-height: 1.6;
  color: var(--text-dark);
  animation: rise 0.9s 0.44s var(--ease) both;
}

.video-frame {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-hover);
  border: 3px solid var(--bg-white);
  animation: rise 0.9s 0.56s var(--ease) both;
}

.bday-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: var(--text-dark);
  background: linear-gradient(135deg, #fff0f6, #eef6ff);
}

.video-fallback p {
  max-width: 24ch;
  font-size: clamp(13px, 3.4vw, 15px);
  line-height: 1.5;
  color: var(--text-dark);
  text-wrap: balance;
}

.video-fallback-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
  box-shadow: var(--shadow);
}

.celebrate-home {
  margin-top: 24px;
  animation: rise 0.9s 0.7s var(--ease) both;
}

/* ---------- Animations ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

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

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

/* ---------- Responsive ---------- */
@media (min-width: 768px) {
  .stage {
    padding: 30px 24px 34px;
    gap: 16px;
  }
  .cake-wrap {
    max-width: 680px;
  }
  .panel {
    max-width: 540px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .stage {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
  }
  .eyebrow {
    order: -1;
    max-width: 100%;
  }
  .cake-wrap {
    flex: 1 1 50%;
    max-width: 52vh;
  }
  .panel {
    flex: 1 1 40%;
  }
  .subhead {
    margin-bottom: 14px;
  }
  .cd-clock {
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .cd-unit {
    min-width: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
