@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,700;1,600&family=Poppins:wght@300;400;500;600&display=swap');

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

:root {
  --pink-light: #2a2a30;
  --pink-mid: #3a3a42;
  --pink-deep: #b8283f;
  --rose: #8a1f30;
  --rose-dark: #d4af37;
  --gold: #d4af37;
  --cream: #f5f0e8;
  --text-dark: #ece7e0;
  --bg-black: #0a0a0c;
  --card-bg: #161618;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Poppins', sans-serif;
  background: radial-gradient(circle at 50% 0%, #1c1c20 0%, #0a0a0c 55%, #000000 100%);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  padding: 24px;
}

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

.floating-heart {
  position: absolute;
  bottom: -10%;
  font-size: 22px;
  opacity: 0.45;
  animation: floatUp linear infinite;
  filter: drop-shadow(0 2px 4px rgba(212, 175, 55, 0.2));
}

@keyframes floatUp {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-110vh) translateX(var(--drift, 20px)) rotate(360deg);
    opacity: 0;
  }
}

/* Card */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  background: linear-gradient(165deg, rgba(28,28,32,0.9), rgba(12,12,14,0.9));
  backdrop-filter: blur(14px);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 28px;
  padding: 48px 36px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212,175,55,0.06) inset;
  text-align: center;
  overflow: hidden;
}

.step {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: fadeIn 0.7s ease;
}

.step.active {
  display: flex;
}

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

/* Intro */
.pretitle {
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 12px;
  color: #a89264;
  font-weight: 500;
}

.name {
  font-family: 'Playfair Display', serif;
  font-size: 38px;
  line-height: 1.25;
  color: var(--rose-dark);
  font-weight: 700;
}

.subtitle {
  font-size: 15px;
  color: var(--text-dark);
  opacity: 0.85;
  font-style: italic;
  font-family: 'Playfair Display', serif;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #b8902f);
  color: #171717;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(212, 175, 55, 0.35);
}

/* Envelope (message step) */
.envelope {
  width: 140px;
  height: 100px;
  position: relative;
  margin: 10px auto 0;
}

.envelope-body {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #2c2c30, #17171a);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5);
}

.envelope-flap {
  position: absolute;
  top: -1px;
  left: 0;
  width: 0;
  height: 0;
  border-left: 70px solid transparent;
  border-right: 70px solid transparent;
  border-top: 55px solid #232327;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

.envelope-heart {
  font-size: 26px;
  animation: pulse 1.6s ease-in-out infinite;
}

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

.message-text {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dark);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  padding: 0 6px;
}

.signature {
  font-size: 13.5px;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  opacity: 0.85;
  align-self: flex-end;
  padding-right: 6px;
}

/* Question step */
.question-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  color: var(--rose-dark);
  line-height: 1.4;
}

.date-card {
  background: linear-gradient(160deg, #1c1c20, #101012);
  border: 1.5px dashed var(--gold);
  border-radius: 18px;
  padding: 20px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.date-icon {
  font-size: 26px;
  margin-bottom: 4px;
}

.date-day {
  font-size: 18px;
  font-weight: 600;
  color: var(--rose-dark);
}

.date-time {
  font-size: 15px;
  color: var(--text-dark);
  opacity: 0.8;
}

.mystery-note {
  font-size: 13.5px;
  color: var(--rose-dark);
  opacity: 0.75;
  font-style: italic;
}

.answer-buttons {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  width: 100%;
}

.btn-yes {
  background: linear-gradient(135deg, var(--gold), #8a6d1f);
  color: #171717;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease, padding 0.25s ease, font-size 0.25s ease;
}

.btn-yes:hover {
  transform: translateY(-2px) scale(1.03);
}

.btn-no {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  position: relative;
  transition: transform 0.15s ease;
}

.btn-no.escaping {
  position: fixed;
}

/* Sizes form */
.sizes-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin-top: 6px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.field-label {
  font-size: 13.5px;
  color: var(--cream);
  opacity: 0.85;
  font-weight: 500;
}

.field select {
  appearance: none;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: #1c1c20;
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--text-dark);
  font-family: 'Poppins', sans-serif;
  font-size: 14.5px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.field select:focus {
  outline: none;
  border-color: var(--gold);
}

.sizes-form .btn-primary {
  margin-top: 8px;
}

/* Success step */
.success-heart {
  font-size: 56px;
  animation: pop 0.6s ease;
}

@keyframes pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.success-title {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  color: var(--rose-dark);
}

.success-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-dark);
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

@media (max-width: 480px) {
  .card {
    padding: 36px 22px;
  }
  .name {
    font-size: 30px;
  }
  .answer-buttons {
    flex-direction: column;
  }
}
