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

:root {
  --bg-deep: #1a0a14;
  --bg-mid: #2d1525;
  --rose: #e8a4b8;
  --rose-light: #f5d0dc;
  --rose-glow: rgba(232, 164, 184, 0.35);
  --gold: #d4a574;
  --gold-light: #f0d4b0;
  --text: #fff5f8;
  --text-muted: rgba(255, 245, 248, 0.72);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Ambient background */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 12s ease-in-out infinite;
}

.orb-1 {
  width: 280px;
  height: 280px;
  background: #6b2d4a;
  top: -80px;
  right: -60px;
}

.orb-2 {
  width: 220px;
  height: 220px;
  background: #3d1f35;
  bottom: 10%;
  left: -80px;
  animation-delay: -4s;
}

.orb-3 {
  width: 180px;
  height: 180px;
  background: #8b4563;
  top: 45%;
  right: 10%;
  animation-delay: -8s;
  opacity: 0.3;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -15px) scale(1.05); }
  66% { transform: translate(-15px, 10px) scale(0.95); }
}

.hearts {
  position: absolute;
  inset: 0;
}

.heart {
  position: absolute;
  font-size: 12px;
  opacity: 0;
  animation: drift 8s ease-in-out infinite;
  color: var(--rose-light);
}

@keyframes drift {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0.5);
  }
  10% { opacity: 0.4; }
  90% { opacity: 0.2; }
  100% {
    opacity: 0;
    transform: translateY(-20vh) scale(1);
  }
}

/* App layout */
.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 20px) 24px calc(var(--safe-bottom) + 24px);
  max-width: 430px;
  margin: 0 auto;
}

/* Progress */
.progress {
  flex-shrink: 0;
  margin-bottom: 24px;
  animation: fadeIn 0.6s ease;
}

.progress-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--gold-light));
  border-radius: 999px;
  transition: width var(--transition);
  width: 0%;
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
  letter-spacing: 0.04em;
}

/* Steps container */
.steps {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  transition:
    opacity var(--transition),
    transform var(--transition),
    visibility var(--transition);
  pointer-events: none;
}

.step.active {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.step.exit {
  z-index: 1;
}

.step.exit {
  opacity: 0;
  transform: translateY(-24px);
}

.step-content {
  text-align: center;
  width: 100%;
  margin: auto 0;
  animation: contentIn 0.7s ease 0.15s both;
}

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

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

/* Typography */
.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 16px;
  font-weight: 500;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 10vw, 3.6rem);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text) 0%, var(--rose-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 6vw, 2.2rem);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 20px;
  color: var(--text);
}

.lead,
.body-text {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 320px;
  margin: 0 auto 32px;
}

.body-text p + p {
  margin-top: 1.1em;
}

.step-photo {
  margin: 0 auto 24px;
  max-width: 280px;
  padding: 4px;
  background: linear-gradient(135deg, var(--rose-light) 0%, var(--gold-light) 100%);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.step-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  aspect-ratio: 4 / 5;
}

/* Love card spinner */
.step-cards h2 {
  margin-bottom: 24px;
}

.card-spinner {
  margin: 0 auto 28px;
  max-width: 300px;
}

.love-card {
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  margin-bottom: 20px;
  background: linear-gradient(145deg, rgba(45, 21, 37, 0.9) 0%, rgba(26, 10, 20, 0.95) 100%);
  border: 1px solid rgba(232, 164, 184, 0.35);
  border-radius: 20px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.love-card::before {
  content: '♥';
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 0.85rem;
  color: var(--rose);
  opacity: 0.5;
}

.love-card-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.55;
  font-style: italic;
  color: var(--rose-light);
  text-align: center;
}

.love-card.changing {
  opacity: 0;
  transform: scale(0.96) rotate(-1deg);
}

.btn-more {
  background: rgba(232, 164, 184, 0.12);
  color: var(--rose-light);
  padding: 16px 32px;
  font-size: 1.05rem;
  font-weight: 500;
  border: 1px solid rgba(232, 164, 184, 0.55);
  border-radius: 999px;
  min-width: 220px;
  box-shadow: 0 4px 16px rgba(232, 164, 184, 0.15);
}

.btn-more:active {
  background: rgba(232, 164, 184, 0.22);
}

.btn-cards-continue {
  margin-top: 8px;
  min-width: 240px;
}

.intro .lead {
  margin-bottom: 48px;
}

.step-icon {
  display: block;
  font-size: 2.5rem;
  margin-bottom: 20px;
  line-height: 1;
}

.step-icon.big {
  font-size: 4rem;
  margin-bottom: 24px;
}

.step-icon.pulse {
  animation: pulse 2s ease-in-out infinite;
}

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

/* Question step */
.question-body {
  margin-bottom: 24px;
}

.question-lead {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.question-text {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4.5vw, 1.65rem);
  line-height: 1.55;
  font-style: italic;
  color: var(--rose-light);
  margin-bottom: 36px;
}

.hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  font-weight: 300;
}

.answer-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 280px;
  margin: 0 auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--rose) 0%, #c97a94 100%);
  color: var(--bg-deep);
  padding: 18px 48px;
  box-shadow:
    0 4px 24px var(--rose-glow),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  min-width: 200px;
}

.btn-large {
  padding: 22px 64px;
  font-size: 1.15rem;
  min-width: 240px;
}

.btn-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 60%
  );
  animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

.btn-yes {
  background: linear-gradient(135deg, #f5d0dc 0%, var(--rose) 100%);
  color: var(--bg-deep);
  padding: 20px 48px;
  font-size: 1.2rem;
  box-shadow: 0 4px 32px var(--rose-glow);
}

.btn-no {
  background: transparent;
  color: var(--text-muted);
  padding: 16px 48px;
  font-size: 0.95rem;
  font-weight: 400;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-no:active {
  background: rgba(255, 255, 255, 0.05);
}

/* Celebration */
.celebration .signature,
.gentle .signature {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--gold-light);
  margin-top: 32px;
}

.btn-restart {
  display: block;
  margin: 40px auto 0;
  padding: 12px 24px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  -webkit-tap-highlight-color: transparent;
}

.btn-restart:active {
  color: var(--text);
}

.confetti {
  position: absolute;
  inset: -50px;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(400px) rotate(720deg);
  }
}

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