/* ============================================
   GLOBAL RESET & BASE
   ============================================ */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

:root {
  --gold:        #f5c842;
  --gold-light:  #fde98a;
  --gold-dark:   #d4a017;
  --rose:        #f28baa;
  --rose-light:  #ffc2d4;
  --deep:        #080814;
  --deep2:       #0e0e22;
  --purple:      #6c3fc5;
  --purple-mid:  #8b5cf6;
  --purple-light:#a78bfa;
  --green:       #4ade80;
  --red:         #f87171;
  --glass:       rgba(255,255,255,0.06);
  --glass-b:     rgba(255,255,255,0.12);
  --text-main:   rgba(255,255,255,0.92);
  --text-soft:   rgba(255,255,255,0.55);
  --text-faint:  rgba(255,255,255,0.28);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  background: var(--deep);
  color: var(--text-main);
  /* Prevent text size adjustment on orientation change (iOS) */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Smooth momentum scrolling where needed */
  -webkit-tap-highlight-color: transparent;
}

/* ============================================
   PAGE SYSTEM — FULL SCREEN SLIDES
   ============================================ */
.page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1),
              transform 0.7s cubic-bezier(0.4,0,0.2,1);
  transform: translateY(40px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.page.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
  z-index: 10;
}

.page.exit-up {
  opacity: 0;
  transform: translateY(-50px);
  pointer-events: none;
  z-index: 5;
}

.page-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 680px;
  padding: 40px 28px;
  margin: auto;
}

.page-inner.center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh; /* dynamic viewport height — accounts for mobile browser chrome */
}

/* Gradient backgrounds per page */
#page-landing  { background: radial-gradient(ellipse at 25% 60%, #1a0533 0%, var(--deep) 65%), radial-gradient(ellipse at 75% 20%, #0a1530 0%, transparent 55%); }
#page-intro    { background: radial-gradient(ellipse at 50% 40%, #130d30 0%, var(--deep) 70%); }
#page-q1       { background: radial-gradient(ellipse at 30% 50%, #0d1f0f 0%, var(--deep) 65%); }
#page-q2       { background: radial-gradient(ellipse at 60% 40%, #0d1a2a 0%, var(--deep) 65%); }
#page-q3       { background: radial-gradient(ellipse at 40% 50%, #1f0d0d 0%, var(--deep) 65%); }
#page-q4       { background: radial-gradient(ellipse at 55% 40%, #0d1020 0%, var(--deep) 65%); }
#page-q5       { background: radial-gradient(ellipse at 40% 60%, #1a0a20 0%, var(--deep) 65%); }
#page-confirmed{ background: radial-gradient(ellipse at 50% 50%, #0f1f0a 0%, var(--deep) 65%); }
#page-birthday {
  background: radial-gradient(ellipse at 30% 40%, #1a0533 0%, var(--deep) 55%), radial-gradient(ellipse at 70% 65%, #0a1a0a 0%, transparent 50%);
  overflow-y: auto;
  align-items: flex-start;
  display: block;
}
#page-notjahn  { background: var(--deep2); }

/* ============================================
   PARTICLES
   ============================================ */
.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.particle {
  position: absolute;
  border-radius: 50%;
  animation: floatUp linear infinite;
  opacity: 0;
}
@keyframes floatUp {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 0.5; }
  100% { transform: translateY(-8vh) scale(1.2); opacity: 0; }
}

/* ============================================
   BADGE
   ============================================ */
.badge {
  display: inline-block;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  color: var(--gold);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 7px 18px;
  border-radius: 100px;
  margin-bottom: 32px;
  backdrop-filter: blur(10px);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.headline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.22;
  color: var(--text-main);
  margin-bottom: 20px;
}
.headline em {
  font-style: italic;
  color: var(--gold);
}

.sub {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-soft);
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: 44px;
  max-width: 480px;
}
.sub strong {
  color: var(--text-main);
  font-weight: 600;
}
.sub em {
  color: var(--rose-light);
  font-style: italic;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--purple-mid));
  color: #fff;
  border: none;
  padding: 16px 40px;
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 32px rgba(108,63,197,0.45);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 0 55px rgba(108,63,197,0.75);
}

.btn-ghost {
  background: transparent;
  color: var(--text-faint);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 16px 30px;
  border-radius: 100px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.btn-ghost:hover {
  color: var(--text-soft);
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.04);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #1a0800;
  border: none;
  padding: 18px 52px;
  border-radius: 100px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.35s ease;
  box-shadow: 0 0 40px rgba(245,200,66,0.4);
  letter-spacing: 0.02em;
}
.btn-gold:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 0 65px rgba(245,200,66,0.65);
}

/* ============================================
   NO MESSAGE (landing wrong person)
   ============================================ */
.no-msg {
  margin-top: 28px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: 20px;
  padding: 22px 28px;
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.7;
  animation: fadeUp 0.5s ease forwards;
  max-width: 420px;
}
.no-msg em { color: var(--rose-light); font-style: italic; }

/* ============================================
   QUESTION PAGES
   ============================================ */
.q-counter {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.q-counter span { color: var(--purple-light); }

.q-progress {
  width: 200px;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  margin: 0 auto 44px;
  overflow: hidden;
}
.q-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--purple-light));
  border-radius: 100px;
  transition: width 0.6s ease;
}

.q-icon {
  font-size: 3.2rem;
  margin-bottom: 24px;
  line-height: 1;
  filter: drop-shadow(0 0 20px rgba(255,255,255,0.2));
}

.q-question {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 14px;
  color: var(--text-main);
}

.q-subtext {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.75;
  margin-bottom: 10px;
  max-width: 440px;
}
.q-subtext em { color: var(--rose-light); font-style: italic; }

.q-hint {
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

/* ============================================
   ANSWER INPUT
   ============================================ */
.answer-wrap {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.answer-input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 16px 20px;
  color: #fff;
  font-size: 1rem; /* kept ≥16px so iOS doesn't zoom on focus */
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.3s ease;
  -webkit-appearance: none; /* remove iOS inset shadow */
  appearance: none;
}
.answer-input:focus {
  border-color: var(--purple-light);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.18);
}
.answer-input::placeholder { color: var(--text-faint); }

.btn-submit {
  background: linear-gradient(135deg, var(--purple), var(--purple-mid));
  color: #fff;
  border: none;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(108,63,197,0.35);
}
.btn-submit:hover {
  transform: scale(1.08);
  box-shadow: 0 0 35px rgba(108,63,197,0.6);
}

/* Feedback text */
.feedback {
  min-height: 22px;
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--red);
  transition: all 0.3s ease;
  line-height: 1.5;
}
.feedback.correct { color: var(--green); }

/* ============================================
   TRICK QUESTION BOX
   ============================================ */
.trick-box {
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: 20px;
  padding: 28px 32px;
  margin: 0 auto 24px;
  max-width: 420px;
  backdrop-filter: blur(12px);
}
.trick-q {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--text-main);
  line-height: 1.7;
}

/* ============================================
   Q5 — SELFIE + MESSAGE (two cards)
   ============================================ */
.q5-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: 100%;
  max-width: 560px;
  margin: 24px auto 0;
}
@media (max-width: 540px) {
  .q5-grid { grid-template-columns: 1fr; }
}

.q5-card {
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: 22px;
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(12px);
  transition: border-color 0.4s, box-shadow 0.4s;
}
.q5-card.done {
  border-color: rgba(74,222,128,0.45);
  box-shadow: 0 0 28px rgba(74,222,128,0.1);
}

.q5-card-icon { font-size: 2rem; }

.q5-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.q5-card-hint {
  font-size: 0.8rem;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.5;
}

/* Selfie upload button */
.selfie-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--purple), var(--purple-mid));
  color: #fff;
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 20px rgba(108,63,197,0.3);
  margin-top: 4px;
}
.selfie-upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(108,63,197,0.55);
}

/* Selfie preview */
.selfie-preview-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.selfie-preview {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid rgba(74,222,128,0.45);
  box-shadow: 0 0 20px rgba(74,222,128,0.15);
}
.selfie-check {
  font-size: 0.78rem;
  color: var(--green);
  font-weight: 600;
}

/* Message textarea */
.msg-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 13px 15px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 1rem; /* ≥16px prevents iOS auto-zoom */
  resize: none;
  outline: none;
  line-height: 1.65;
  transition: all 0.3s;
  margin-top: 4px;
  -webkit-appearance: none;
  appearance: none;
}
.msg-input:focus {
  border-color: var(--purple-light);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.15);
}
.msg-input::placeholder { color: var(--text-faint); }

.msg-input-full {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 16px 18px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  resize: none;
  outline: none;
  line-height: 1.7;
  transition: all 0.3s;
  text-align: center;
}
.msg-input-full:focus {
  border-color: var(--purple-light);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.18);
}
.msg-input-full::placeholder { color: var(--text-faint); }

/* ============================================
   IDENTITY CONFIRMED
   ============================================ */
.confirmed-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.confirmed-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a3d1a, #2d6e2d);
  border: 2px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: var(--green);
  margin-bottom: 28px;
  box-shadow: 0 0 50px rgba(74,222,128,0.3);
  animation: pulseGreen 2s ease infinite;
}

@keyframes pulseGreen {
  0%, 100% { box-shadow: 0 0 50px rgba(74,222,128,0.3); }
  50%       { box-shadow: 0 0 80px rgba(74,222,128,0.55); }
}

.confirmed-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 14px;
  margin-top: 0;
}
.confirmed-title em {
  font-style: italic;
  color: var(--gold);
}

.confirmed-sub {
  font-size: 1rem;
  color: var(--text-soft);
  margin-bottom: 36px;
}

/* ============================================
   BIRTHDAY PAGE
   ============================================ */
#page-birthday {
  background: radial-gradient(ellipse at 30% 40%, #1a0533 0%, var(--deep) 55%),
              radial-gradient(ellipse at 70% 65%, #0a1a0a 0%, transparent 50%);
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
}

.bday-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 28px 40px;
  margin: 0 auto;
  max-width: 680px;
  width: 100%;
  gap: 0;
}

.bday-date {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeUp 1s ease 0.3s forwards;
}

.bday-hb {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 400;
  font-style: italic;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.08em;
  margin-bottom: 2px;
  opacity: 0;
  animation: fadeUp 1s ease 0.6s forwards;
}

.bday-name {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(3.8rem, 12vw, 8rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.05;
  min-height: 80px;
  margin-bottom: 10px;
}

.bday-tagline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text-soft);
  font-style: italic;
  max-width: 480px;
  line-height: 1.6;
  margin: 0 auto 16px;
  opacity: 0;
}

/* ── Jahnavi's photo frame ── */
.bday-photo-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 8px auto 20px;
  flex-shrink: 0;
  opacity: 0;
  animation: fadeUp 1s ease 1.2s forwards;
}

.bday-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  display: block;
}

/* Spinning gold gradient ring */
.bday-photo-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    var(--gold-light), var(--gold), var(--rose), var(--purple-light), var(--gold-light)
  );
  z-index: 1;
  animation: photoRingSpin 6s linear infinite;
}
@keyframes photoRingSpin {
  to { transform: rotate(360deg); }
}

/* White gap between ring and photo */
.bday-photo-wrap::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: var(--deep);
  z-index: 1;
  padding: 3px;
}
.bday-photo-wrap::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--deep);
  z-index: 1;
}
.bday-photo {
  z-index: 3;
}
.bday-photo-ring {
  z-index: 0;
}

/* Gold glow underneath */
.bday-photo-shine {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(245,200,66,0.25) 0%,
    rgba(242,139,170,0.12) 50%,
    transparent 70%
  );
  z-index: 0;
  animation: photoGlow 3s ease-in-out infinite;
}
@keyframes photoGlow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.08); }
}

.bday-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto 16px;
  opacity: 0;
}

.bday-message {
  font-size: clamp(0.88rem, 1.8vw, 1rem);
  color: var(--text-soft);
  line-height: 1.75;
  max-width: 460px;
  margin: 0 auto 20px;
  opacity: 0;
}

.bday-continue {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.bounce {
  display: block;
  color: var(--text-faint);
  font-size: 1rem;
  animation: bounceY 1.6s ease-in-out infinite;
}

@keyframes bounceY {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(7px); }
}

/* ============================================
   MUSIC BUTTON
   ============================================ */
.music-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  color: var(--gold);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  z-index: 999;
  transition: all 0.3s;
  opacity: 0;
  pointer-events: none;
}
.music-btn.visible {
  opacity: 1;
  pointer-events: all;
}
.music-btn:hover {
  background: rgba(255,255,255,0.12);
  transform: scale(1.1);
}

/* ============================================
   CONFETTI CANVAS
   ============================================ */
#confetti-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* ============================================
   SHAKE ANIMATION
   ============================================ */
.shake {
  animation: shake 0.45s ease !important;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-9px); }
  40%      { transform: translateX(9px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(6px); }
}

/* ============================================
   SURPRISE BUTTON
   ============================================ */
.btn-surprise {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1a0533 0%, #2d1060 50%, #1a0533 100%);
  border: 1.5px solid rgba(245,200,66,0.45);
  color: var(--gold-light);
  padding: 18px 40px 18px 32px;
  border-radius: 100px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  box-shadow: 0 0 45px rgba(245,200,66,0.2), 0 0 90px rgba(108,63,197,0.2);
  letter-spacing: 0.02em;
  transition: all 0.4s ease;
  margin-top: 10px;
  overflow: visible;
}
.btn-surprise:hover {
  transform: translateY(-4px) scale(1.04);
  border-color: rgba(245,200,66,0.75);
  box-shadow: 0 0 65px rgba(245,200,66,0.35), 0 0 120px rgba(108,63,197,0.3);
}
.surprise-gift-icon {
  font-size: 1.6rem;
  animation: gentleFloat 2.2s ease-in-out infinite;
  display: inline-block;
}
@keyframes gentleFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50%       { transform: translateY(-6px) rotate(5deg); }
}
.surprise-pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 100px;
  border: 2px solid rgba(245,200,66,0.35);
  animation: pulseRing 2s ease-out infinite;
  pointer-events: none;
}
@keyframes pulseRing {
  0%   { transform: scale(1);    opacity: 0.8; }
  100% { transform: scale(1.12); opacity: 0; }
}

/* ============================================
   MODALS — BASE
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,8,20,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  padding: 20px;
  overflow-y: auto;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: linear-gradient(160deg, #110824 0%, #0d0d1f 60%, #0a1a10 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 28px;
  padding: 44px 36px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 30px 100px rgba(0,0,0,0.7), 0 0 80px rgba(108,63,197,0.12);
  animation: modalPop 0.45s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes modalPop {
  from { transform: scale(0.88) translateY(30px); opacity: 0; }
  to   { transform: scale(1) translateY(0);      opacity: 1; }
}

.modal-badge {
  display: inline-block;
  background: rgba(108,63,197,0.15);
  border: 1px solid rgba(108,63,197,0.35);
  color: var(--purple-light);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 7px 18px;
  border-radius: 100px;
  margin-bottom: 22px;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 10px;
}
.modal-title em {
  color: var(--gold);
  font-style: italic;
}

.modal-sub {
  font-size: 0.92rem;
  color: var(--text-soft);
  line-height: 1.75;
  margin-bottom: 28px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* Wheel modal specific title tweaks */
.wheel-modal-title {
  font-size: clamp(1.55rem, 4vw, 2.1rem);
  background: linear-gradient(135deg, #fff 30%, rgba(245,200,66,0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.wheel-modal-title em {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: italic;
}
.wheel-modal-sub {
  font-style: italic;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.03em;
  margin-bottom: 22px;
}

/* ============================================
   SPIN WHEEL
   ============================================ */
.wheel-modal-box {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(108,63,197,0.18) 0%, transparent 60%),
    linear-gradient(160deg, #0e0620 0%, #090918 60%, #080f14 100%);
  border-color: rgba(108,63,197,0.25);
  overflow: hidden;
}

/* Subtle star-dust shimmer behind the whole modal */
.wheel-modal-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 18%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 72%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 10% 65%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 55%, rgba(255,255,255,0.28) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}
.wheel-modal-box > * { position: relative; z-index: 1; }

.wheel-wrap {
  position: relative;
  display: inline-block;
  margin: 0 auto 28px;
}

.wheel-outer {
  border-radius: 50%;
  box-shadow:
    0 0 0 5px rgba(255,255,255,0.06),
    0 0 0 9px rgba(108,63,197,0.2),
    0 0 55px rgba(108,63,197,0.4),
    0 0 110px rgba(245,200,66,0.08);
  display: inline-block;
  position: relative;
  transition: box-shadow 0.8s ease;
}

/* Gold explosion when wheel wins */
.wheel-outer.wheel-win-glow {
  box-shadow:
    0 0 0 5px rgba(245,200,66,0.5),
    0 0 0 12px rgba(245,200,66,0.2),
    0 0 70px rgba(245,200,66,0.6),
    0 0 130px rgba(245,200,66,0.35),
    0 0 200px rgba(245,200,66,0.15);
  animation: wheelGlowPulse 1.4s ease-out;
}
@keyframes wheelGlowPulse {
  0%   { box-shadow: 0 0 0 5px rgba(245,200,66,0.8), 0 0 80px rgba(245,200,66,0.9), 0 0 160px rgba(245,200,66,0.5); }
  50%  { box-shadow: 0 0 0 5px rgba(245,200,66,0.5), 0 0 70px rgba(245,200,66,0.6), 0 0 130px rgba(245,200,66,0.35); }
  100% { box-shadow: 0 0 0 5px rgba(245,200,66,0.5), 0 0 70px rgba(245,200,66,0.6), 0 0 130px rgba(245,200,66,0.35); }
}

/* White flash when modal wins */
.wheel-flash {
  animation: modalFlash 0.9s ease-out;
}
@keyframes modalFlash {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0), 0 30px 100px rgba(0,0,0,0.7); }
  15%  { box-shadow: 0 0 80px 40px rgba(245,200,66,0.4), 0 30px 100px rgba(0,0,0,0.7); }
  100% { box-shadow: 0 0 0 0 rgba(245,200,66,0), 0 30px 100px rgba(0,0,0,0.7); }
}

#wheel-canvas {
  display: block;
  border-radius: 50%;
}

/* Pointer — gold diamond shape */
.wheel-pointer {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  color: var(--gold);
  z-index: 10;
  filter: drop-shadow(0 0 10px rgba(245,200,66,0.9));
  line-height: 1;
  transition: transform 0.08s ease-out;
}

/* Excited shake when it lands */
.pointer-win {
  animation: pointerWin 0.7s cubic-bezier(0.36,0.07,0.19,0.97) forwards;
}
@keyframes pointerWin {
  0%   { transform: translateX(-50%) rotate(0deg); }
  15%  { transform: translateX(-50%) rotate(-20deg); }
  30%  { transform: translateX(-50%) rotate(22deg); }
  45%  { transform: translateX(-50%) rotate(-16deg); }
  60%  { transform: translateX(-50%) rotate(12deg); }
  75%  { transform: translateX(-50%) rotate(-8deg); }
  90%  { transform: translateX(-50%) rotate(4deg); }
  100% { transform: translateX(-50%) rotate(0deg); filter: drop-shadow(0 0 16px rgba(245,200,66,1)); }
}

.wheel-shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 32% 22%, rgba(255,255,255,0.14) 0%, transparent 52%);
  pointer-events: none;
}

/* Spin button */
.btn-spin {
  background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 50%, #5b21b6 100%);
  background-size: 200% auto;
  color: #fff;
  border: none;
  padding: 17px 48px;
  border-radius: 100px;
  font-size: 1.02rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.4s ease;
  box-shadow: 0 0 40px rgba(108,63,197,0.55), 0 4px 20px rgba(0,0,0,0.3);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.btn-spin::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 100px;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.12) 50%, transparent 60%);
  background-size: 200% auto;
  animation: btnSheen 3s linear infinite;
  pointer-events: none;
}
@keyframes btnSheen {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.btn-spin:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 0 65px rgba(108,63,197,0.8), 0 8px 30px rgba(0,0,0,0.4);
}
.btn-spin:active:not(:disabled) {
  transform: scale(0.97);
}
.btn-spin:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Gold shimmer for the post-win button */
@keyframes goldShimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.wheel-hint {
  font-size: 0.8rem;
  color: var(--text-soft);
  letter-spacing: 0.06em;
  min-height: 22px;
  transition: all 0.5s ease;
  font-style: italic;
}

/* ============================================
   GIFT REVEAL MODAL
   ============================================ */
.gift-modal-box {
  background: linear-gradient(160deg, #1a0c08 0%, #0d0d1a 50%, #0a1a08 100%);
  border-color: rgba(245,200,66,0.2);
}

.gift-burst {
  font-size: 4rem;
  display: block;
  margin-bottom: 16px;
  animation: giftPop 0.6s cubic-bezier(0.34,1.8,0.64,1) forwards;
  transform-origin: center;
}
@keyframes giftPop {
  0%   { transform: scale(0) rotate(-15deg); opacity: 0; }
  60%  { transform: scale(1.25) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.gift-modal-title em { color: var(--gold); }

.gift-modal-sub {
  margin-bottom: 24px;
}

/* ── Step 1: Mystery veil ── */
.gift-mystery-sub {
  margin-bottom: 20px;
}

.gift-mystery-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(245,200,66,0.25);
  border-radius: 20px;
  padding: 32px 24px;
  margin: 0 auto 28px;
  max-width: 320px;
  position: relative;
  overflow: hidden;
}
.gift-mystery-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(245,200,66,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.gift-mystery-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(108,63,197,0.3), rgba(245,200,66,0.15));
  border: 2px solid rgba(245,200,66,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: rgba(245,200,66,0.6);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  box-shadow: 0 0 30px rgba(245,200,66,0.12), inset 0 0 20px rgba(108,63,197,0.15);
  animation: mysteryPulse 2.8s ease-in-out infinite;
}
@keyframes mysteryPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(245,200,66,0.12), inset 0 0 20px rgba(108,63,197,0.15); }
  50%       { box-shadow: 0 0 50px rgba(245,200,66,0.25), inset 0 0 28px rgba(108,63,197,0.25); }
}

.gift-mystery-label {
  font-size: 0.85rem;
  color: var(--text-soft);
  font-style: italic;
  line-height: 1.5;
  text-align: center;
  max-width: 220px;
}

/* Order gift button */
.btn-order-gift {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #f5c842 0%, #e8a918 50%, #f5c842 100%);
  background-size: 200% auto;
  color: #1a0800;
  border: none;
  padding: 17px 44px;
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 0 45px rgba(245,200,66,0.45), 0 4px 20px rgba(0,0,0,0.3);
  width: 100%;
  margin-bottom: 12px;
  animation: goldShimmer 2.5s linear infinite;
}
.btn-order-gift:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 0 70px rgba(245,200,66,0.65), 0 8px 28px rgba(0,0,0,0.4);
}
.btn-order-gift:active {
  transform: scale(0.97);
}

/* Step 2 second gift burst */
.gift-burst-2 {
  animation: giftPop 0.55s cubic-bezier(0.34,1.8,0.64,1) forwards;
}

/* Gift delivery card */
.gift-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(245,200,66,0.18);
  border-radius: 20px;
  padding: 22px 24px;
  margin: 0 auto 24px;
  max-width: 360px;
  text-align: left;
  box-shadow: 0 0 40px rgba(245,200,66,0.06);
}

.gift-card-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.gift-card-icon-wrap {
  width: 52px;
  height: 52px;
  background: #1a1200;
  border: 1px solid rgba(245,200,66,0.25);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 8px;
}

.ups-logo {
  width: 36px;
  height: auto;
  filter: brightness(0) invert(1) sepia(1) saturate(3) hue-rotate(5deg);
}

.gift-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.gift-card-status {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  box-shadow: 0 0 8px var(--green);
  animation: pulseDot 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 8px var(--green); }
  50%       { box-shadow: 0 0 18px var(--green); }
}

.gift-card-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  margin-bottom: 16px;
}

.gift-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.gift-detail-row:last-child { margin-bottom: 0; }

.gift-detail-icon {
  color: var(--gold);
  font-size: 0.95rem;
  margin-top: 2px;
  flex-shrink: 0;
  opacity: 0.8;
}

.gift-detail-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 3px;
}

.gift-detail-value {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.track-num {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem !important;
  color: var(--gold-light) !important;
  letter-spacing: 0.08em;
  word-break: break-all;
}

.btn-track {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #1a0800;
  padding: 16px 40px;
  border-radius: 100px;
  font-size: 0.98rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  transition: all 0.35s ease;
  box-shadow: 0 0 40px rgba(245,200,66,0.35);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  width: 100%;
  justify-content: center;
}
.btn-track:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 0 65px rgba(245,200,66,0.6);
}

.gift-close-btn {
  width: 100%;
  justify-content: center;
  padding: 13px 20px;
  font-size: 0.88rem;
}

/* ── Birthday screen action row (post-wish) ── */
.bday-actions-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-bday-action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 26px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: none;
}

.btn-track-action {
  background: linear-gradient(135deg, #f5c842 0%, #e8a918 50%, #f5c842 100%);
  background-size: 200% auto;
  color: #1a0800;
  box-shadow: 0 0 35px rgba(245,200,66,0.35);
  animation: goldShimmer 3s linear infinite;
}
.btn-track-action:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 0 55px rgba(245,200,66,0.6);
}

.btn-wish-action {
  background: rgba(108,63,197,0.18);
  border: 1px solid rgba(167,139,250,0.35) !important;
  color: var(--purple-light);
  box-shadow: 0 0 25px rgba(108,63,197,0.15);
}
.btn-wish-action:hover {
  background: rgba(108,63,197,0.32);
  border-color: rgba(167,139,250,0.65) !important;
  box-shadow: 0 0 45px rgba(108,63,197,0.35);
  transform: translateY(-3px) scale(1.04);
  color: #fff;
}

/* "Make a wish" button inside gift step 2 */
.btn-make-wish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  border-radius: 100px;
  border: 1px solid rgba(167,139,250,0.4);
  background: rgba(108,63,197,0.14);
  color: var(--purple-light);
  font-size: 0.96rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  box-shadow: 0 0 30px rgba(108,63,197,0.15);
}
.btn-make-wish:hover {
  background: rgba(108,63,197,0.28);
  border-color: rgba(167,139,250,0.7);
  box-shadow: 0 0 50px rgba(108,63,197,0.35);
  transform: translateY(-2px);
  color: #fff;
}

/* ============================================
   MAKE A WISH MODAL
   ============================================ */
.wish-modal-box {
  background: radial-gradient(ellipse at 50% 20%, #130d2e 0%, #070710 65%, #08100f 100%);
  border-color: rgba(167,139,250,0.2);
  box-shadow: 0 30px 100px rgba(0,0,0,0.8), 0 0 120px rgba(108,63,197,0.18);
  overflow: hidden;
  position: relative;
}

/* Animated stars canvas sits behind all content */
.wish-stars-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  border-radius: 28px;
}
.wish-modal-box > div { position: relative; z-index: 1; }

/* Moon icon */
.wish-moon {
  font-size: 2.8rem;
  display: block;
  margin-bottom: 12px;
  animation: wishMoonFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(167,139,250,0.6));
}
@keyframes wishMoonFloat {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%       { transform: translateY(-8px) rotate(6deg); }
}

.wish-badge {
  background: rgba(167,139,250,0.12);
  border-color: rgba(167,139,250,0.3);
  color: var(--purple-light);
  margin-bottom: 18px;
}

.wish-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 10px;
}
.wish-title em {
  background: linear-gradient(135deg, var(--purple-light), #c4b5fd, var(--rose-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: italic;
}

.wish-sub {
  font-style: italic;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.42);
  margin-bottom: 22px;
  letter-spacing: 0.02em;
}

/* Textarea */
.wish-input-wrap {
  position: relative;
  margin-bottom: 20px;
}

.wish-textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(167,139,250,0.28);
  border-radius: 18px;
  padding: 18px 20px;
  font-family: 'Playfair Display', serif;
  font-size: 1rem; /* ≥16px prevents iOS auto-zoom */
  font-style: italic;
  color: rgba(255,255,255,0.88);
  resize: none;
  outline: none;
  line-height: 1.7;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  caret-color: var(--purple-light);
  -webkit-appearance: none;
  appearance: none;
}
.wish-textarea::placeholder {
  color: rgba(255,255,255,0.22);
  font-style: italic;
}
.wish-textarea:focus {
  border-color: rgba(167,139,250,0.6);
  box-shadow: 0 0 35px rgba(108,63,197,0.25), inset 0 0 20px rgba(108,63,197,0.06);
}

.wish-char-count {
  position: absolute;
  bottom: 10px;
  right: 16px;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.08em;
  pointer-events: none;
}

/* Send button */
.btn-send-wish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 20px;
  border-radius: 100px;
  border: none;
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 50%, #6d28d9 100%);
  background-size: 200% auto;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 0 45px rgba(108,63,197,0.5), 0 4px 20px rgba(0,0,0,0.3);
  margin-bottom: 12px;
  animation: btnSheen 3s linear infinite;
}
.btn-send-wish:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 0 70px rgba(108,63,197,0.75), 0 8px 28px rgba(0,0,0,0.4);
}
.btn-send-wish:active:not(:disabled) { transform: scale(0.97); }
.btn-send-wish:disabled { opacity: 0.5; cursor: not-allowed; }

.wish-skip-btn {
  width: 100%;
  justify-content: center;
  padding: 12px 20px;
  font-size: 0.85rem;
  opacity: 0.7;
}
.wish-skip-btn:hover { opacity: 1; }

/* ── State 2: Wish sent ── */
.wish-sent-burst {
  font-size: 3.2rem;
  display: block;
  margin-bottom: 8px;
  animation: wishBurstPop 0.7s cubic-bezier(0.34,1.8,0.64,1) forwards;
}
@keyframes wishBurstPop {
  0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
  60%  { transform: scale(1.3) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg);   opacity: 1; }
}

/* Orbiting rings */
.wish-orbit {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 22px;
}
.wish-orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(167,139,250,0.35);
  animation: wishOrbit 3s linear infinite;
}
.wish-orbit-ring-2 {
  inset: 12px;
  border-color: rgba(245,200,66,0.25);
  animation-duration: 4.5s;
  animation-direction: reverse;
}
@keyframes wishOrbit {
  to { transform: rotate(360deg); }
}
.wish-orbit-dot {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple-light);
  box-shadow: 0 0 10px var(--purple-light);
  animation: wishOrbit 3s linear infinite;
  transform-origin: 50% 49px;
}

.wish-sent-title {
  font-size: clamp(1.45rem, 3.8vw, 1.95rem);
  margin-bottom: 18px;
}
.wish-sent-title em {
  background: linear-gradient(135deg, var(--purple-light), #c4b5fd, var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: italic;
}

/* The typed-back wish text */
.wish-sent-message {
  font-family: 'Playfair Display', serif;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  font-style: italic;
  color: rgba(255,255,255,0.65);
  line-height: 1.65;
  max-width: 340px;
  margin: 0 auto 14px;
  min-height: 2.4em;
  word-break: break-word;
}

.wish-sent-sub {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.35);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.wish-done-btn {
  width: 100%;
  justify-content: center;
  padding: 14px 20px;
  font-size: 0.92rem;
  border-color: rgba(167,139,250,0.35);
  color: var(--purple-light);
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden { display: none !important; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE — MOBILE FIRST
   ============================================ */

/* ── Tablets & small laptops ── */
@media (max-width: 640px) {
  /* Page inner spacing */
  .page-inner { padding: 28px 18px; }

  /* Typography */
  .headline { font-size: clamp(1.65rem, 7vw, 2.4rem); margin-bottom: 14px; }
  .sub { font-size: 0.95rem; margin-bottom: 32px; }

  /* Buttons */
  .btn-row { flex-direction: column; align-items: center; gap: 12px; }
  .btn-primary, .btn-ghost { width: 100%; max-width: 320px; text-align: center; }
  .btn-gold { padding: 16px 40px; font-size: 1rem; }

  /* Question pages */
  .q-question { font-size: clamp(1.3rem, 5.5vw, 1.8rem); }
  .q-subtext { font-size: 0.9rem; }
  .q-icon { font-size: 2.6rem; margin-bottom: 18px; }
  .q-progress { margin-bottom: 32px; }

  /* Answer inputs */
  .answer-wrap { max-width: 100%; }
  .answer-input { font-size: 1rem; padding: 14px 16px; }
  .btn-submit { width: 48px; height: 48px; }

  /* Trick box */
  .trick-box { padding: 20px 18px; }
  .trick-q { font-size: 1rem; }

  /* Q5 grid — single column on phones */
  .q5-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 16px; }
  .q5-card { padding: 20px 16px; }

  /* Confirmed page */
  .confirmed-icon { width: 72px; height: 72px; font-size: 2rem; }
  .confirmed-title { font-size: clamp(1.5rem, 6vw, 2.2rem); }

  /* Badge */
  .badge { font-size: 0.6rem; padding: 6px 14px; margin-bottom: 22px; }
}

/* ── Mobile phones ── */
@media (max-width: 480px) {
  /* Base page */
  .page-inner { padding: 24px 16px; }
  .page-inner.center { justify-content: flex-start; padding-top: 40px; padding-bottom: 40px; min-height: 100dvh; }

  /* Typography */
  .headline { font-size: clamp(1.5rem, 6.5vw, 2.2rem); margin-bottom: 12px; line-height: 1.25; }
  .sub { font-size: 0.9rem; line-height: 1.7; margin-bottom: 28px; }

  /* Buttons */
  .btn-primary { padding: 15px 28px; font-size: 0.95rem; }
  .btn-ghost { padding: 14px 24px; font-size: 0.9rem; }
  .btn-gold { padding: 15px 36px; font-size: 0.98rem; }

  /* Questions */
  .q-question { font-size: clamp(1.25rem, 5.5vw, 1.65rem); }
  .q-subtext { font-size: 0.88rem; }
  .q-hint { font-size: 0.68rem; }
  .q-counter { font-size: 0.65rem; }
  .q-icon { font-size: 2.4rem; margin-bottom: 16px; }
  .q-progress { width: 160px; margin-bottom: 28px; }

  /* Feedback */
  .feedback { font-size: 0.82rem; min-height: 20px; }

  /* Trick box */
  .trick-box { padding: 18px 16px; }

  /* Q5 — message textarea */
  .msg-input { font-size: 0.85rem; rows: 3; }

  /* Confirmed page */
  .confirmed-title { font-size: clamp(1.4rem, 6vw, 2rem); }
  .confirmed-sub { font-size: 0.9rem; margin-bottom: 28px; }

  /* Badge */
  .badge { font-size: 0.58rem; padding: 5px 12px; margin-bottom: 18px; }

  /* Surprise button on birthday page */
  .btn-surprise { padding: 15px 24px 15px 20px; font-size: 0.95rem; gap: 10px; }
  .surprise-gift-icon { font-size: 1.4rem; }

  /* Birthday action buttons */
  .bday-actions-row { flex-direction: column; align-items: center; gap: 10px; }
  .btn-bday-action { width: 100%; max-width: 300px; justify-content: center; font-size: 0.88rem; padding: 13px 20px; }

  /* Music button */
  .music-btn { bottom: 16px; right: 16px; width: 44px; height: 44px; font-size: 0.9rem; }
}

/* ── Very small phones (SE, Galaxy A series) ── */
@media (max-width: 375px) {
  .page-inner { padding: 20px 14px; }
  .page-inner.center { padding-top: 32px; padding-bottom: 32px; }
  .headline { font-size: clamp(1.35rem, 6vw, 1.9rem); }
  .sub { font-size: 0.85rem; }
  .q-question { font-size: clamp(1.15rem, 5.5vw, 1.5rem); }
  .btn-surprise { padding: 13px 20px 13px 16px; font-size: 0.9rem; }
  .badge { font-size: 0.55rem; }
}

/* ── Birthday page — mobile ── */
@media (max-width: 480px) {
  .bday-inner { padding: 28px 16px 48px; }
  .bday-name { font-size: clamp(3.2rem, 14vw, 5.5rem); min-height: 60px; }
  .bday-hb { font-size: clamp(0.9rem, 3vw, 1.1rem); }
  .bday-date { font-size: 0.6rem; letter-spacing: 0.2em; }
  .bday-tagline { font-size: clamp(0.82rem, 2.5vw, 1rem); margin-bottom: 12px; }
  .bday-message { font-size: clamp(0.82rem, 2.5vw, 0.95rem); }

  /* Smaller photo ring */
  .bday-photo-wrap { width: 130px; height: 130px; margin: 6px auto 16px; }
}

@media (max-width: 375px) {
  .bday-photo-wrap { width: 110px; height: 110px; }
  .bday-name { font-size: clamp(2.8rem, 14vw, 4.5rem); }
}

/* ── Modal overlays — mobile ── */
@media (max-width: 480px) {
  /* Modal base — slides up from bottom like a native sheet */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
    overflow-y: hidden;
  }

  .modal-box {
    padding: 32px 22px 36px;
    border-radius: 28px 28px 0 0;
    max-width: 100%;
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Override the desktop pop-in with a slide-up */
    animation: modalSlideUp 0.42s cubic-bezier(0.34,1.3,0.64,1) forwards;
  }

  /* Modal typography */
  .modal-title { font-size: clamp(1.4rem, 5.5vw, 1.85rem); }
  .modal-sub { font-size: 0.86rem; margin-bottom: 20px; }
  .modal-badge { font-size: 0.58rem; padding: 5px 12px; margin-bottom: 16px; }

  /* Wheel modal */
  .wheel-modal-box { padding: 26px 18px 24px; }
  .wheel-modal-title { font-size: clamp(1.3rem, 5vw, 1.75rem); }
  .wheel-modal-sub { font-size: 0.82rem; margin-bottom: 16px; }
  .wheel-wrap { margin-bottom: 20px; }
  .btn-spin { padding: 15px 36px; font-size: 0.95rem; margin-bottom: 12px; }
  .wheel-hint { font-size: 0.75rem; }

  /* Gift modal */
  .gift-modal-box { padding: 28px 18px 24px; }
  .gift-burst { font-size: 3rem; margin-bottom: 12px; }
  .gift-mystery-box { padding: 24px 16px; margin-bottom: 20px; }
  .gift-mystery-icon { width: 60px; height: 60px; font-size: 1.7rem; }
  .gift-mystery-label { font-size: 0.8rem; }
  .btn-order-gift { padding: 15px 32px; font-size: 0.95rem; }

  /* Gift card */
  .gift-card { padding: 18px 16px; }
  .gift-card-top { gap: 12px; margin-bottom: 12px; }
  .gift-card-icon-wrap { width: 44px; height: 44px; }
  .ups-logo { width: 30px; }
  .gift-card-status { font-size: 0.82rem; }
  .gift-detail-row { gap: 10px; margin-bottom: 10px; }
  .gift-detail-value { font-size: 0.82rem; }
  .track-num { font-size: 0.75rem !important; }
  .btn-track { padding: 14px 28px; font-size: 0.92rem; }
  .btn-make-wish { padding: 13px 16px; font-size: 0.9rem; }

  /* Wish modal */
  .wish-modal-box { padding: 28px 18px 24px; }
  .wish-moon { font-size: 2.2rem; }
  .wish-title { font-size: clamp(1.3rem, 5vw, 1.7rem); }
  .wish-sub { font-size: 0.82rem; }
  .wish-textarea { font-size: 0.95rem; padding: 15px 16px; border-radius: 14px; }
  .btn-send-wish { padding: 15px 16px; font-size: 0.93rem; }
  .wish-sent-title { font-size: clamp(1.25rem, 5vw, 1.7rem); }
  .wish-sent-message { font-size: 0.92rem; }
  .wish-sent-sub { font-size: 0.8rem; }
  .wish-orbit { width: 72px; height: 72px; margin-bottom: 16px; }

  /* Make-wish close button on birthday page */
  .btn-make-wish { margin-top: 8px; }
}

/* ── Landscape mobile: prevent elements from being too tall ── */
@media (max-height: 600px) and (max-width: 900px) {
  .page-inner.center { justify-content: flex-start; padding-top: 20px; padding-bottom: 20px; min-height: 100dvh; }
  .q-icon { font-size: 2rem; margin-bottom: 10px; }
  .q-progress { margin-bottom: 18px; }
  .badge { margin-bottom: 14px; }
  .headline { margin-bottom: 10px; }
  .sub { margin-bottom: 20px; }
  .bday-inner { padding: 20px 20px 32px; }
  .bday-photo-wrap { width: 100px; height: 100px; }
  .modal-overlay { align-items: center; }
}

/* Slide-up animation for mobile modals */
@keyframes modalSlideUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Safe area support for notched phones ── */
@supports (padding: env(safe-area-inset-bottom)) {
  .modal-overlay {
    padding-bottom: 0;
  }
  .modal-box {
    padding-bottom: max(36px, calc(env(safe-area-inset-bottom) + 24px));
  }
  .music-btn {
    bottom: max(16px, env(safe-area-inset-bottom));
    right: max(16px, env(safe-area-inset-right));
  }
  .bday-inner {
    padding-bottom: max(48px, calc(env(safe-area-inset-bottom) + 24px));
  }
}

/* ── Touch target minimum sizes (WCAG) ── */
@media (max-width: 640px) {
  button, a, label {
    min-height: 44px;
  }
  .btn-submit { min-width: 48px; }
  .wish-skip-btn, .gift-close-btn, .wish-done-btn { min-height: 48px; }
  /* Prevent text zoom on input focus in iOS */
  .answer-input, .msg-input, .msg-input-full, .wish-textarea {
    font-size: max(1rem, 16px);
  }
}

/* ── Prevent horizontal scroll globally ── */
body, .page { overflow-x: hidden; }

/* ── Birthday page — ensure full scroll on mobile ── */
#page-birthday {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* ── No-msg button overflow fix ── */
.no-msg { overflow-wrap: break-word; word-break: break-word; }
.no-msg button { white-space: normal; min-height: 44px; }
