:root {
  --primary: #f3f0ff;
  /* Soft Lavender background */
  --gold: #d4af37;
  --gold-gradient: linear-gradient(135deg, #d4af37 0%, #f9f295 45%, #e6b8af 70%, #d4af37 100%);
  --text: #4a3e56;
  --white: #ffffff;
}

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

body {
  font-family: 'Cormorant Garamond', serif;
  background: var(--primary);
  color: var(--text);
  min-height: 100dvh;
  /* Use dynamic viewport height */
  width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
}

h1,
h2,
.bride-name {
  font-family: 'Playfair Display', serif;
}

/* ===================== SHARED ELEMENTS ===================== */

.scene {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  /* Prevent flowers/envelope from causing scroll */
}

.scene.active {
  opacity: 1;
  pointer-events: auto;
}

#proposal-scene {
  overflow-y: auto;
  height: 100dvh;
  /* Use dynamic viewport height */
  justify-content: flex-start;
  padding: 40px 0;
}

.sparkle-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(230, 230, 250, 0.4) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

/* ===================== DECORATIVE FLOWERS ===================== */

.decor-flower {
  position: absolute;
  width: 500px;
  /* Big flowers as requested */
  max-width: 80vw;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.05));
  transition: transform 1s ease-out, opacity 1s ease-out;
}

.top-left-flower {
  top: -60px;
  left: -60px;
  transform: rotate(90deg);
  /* Adjust for upright look */
}

.bottom-right-flower {
  bottom: -60px;
  right: -60px;
  transform: rotate(-90deg);
  /* Adjust for upright look */
}

.scene:not(.active) .decor-flower {
  opacity: 0;
  transform: scale(1.2) rotate(10deg);
}

/* ===================== SCENE 1: IMAGE ENVELOPE ===================== */

.envelope-hint {
  margin-bottom: 2rem;
  font-size: 1.25rem;
  font-style: italic;
  opacity: 0.7;
  letter-spacing: 1px;
  text-align: center;
  padding: 0 20px;
}

#envelope-wrapper {
  perspective: 1500px;
  perspective-origin: center;
}

.envelope-img-container {
  position: relative;
  width: 550px;
  /* Increased from 400px */
  max-width: 90vw;
  aspect-ratio: 1.5;
  transform-style: preserve-3d;
  cursor: pointer;
}

.envelope-main {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.1));
}

.seal-img-btn {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110px;
  /* Increased from 80px */
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.seal-img-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.seal-image {
  width: 100%;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

.envelope-letter {
  position: absolute;
  top: 20%;
  left: 10%;
  width: 80%;
  height: 60%;
  background: white;
  z-index: 2;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.letter-text {
  font-size: 3rem;
}

/* ===================== SCENE 2: PROPOSAL ===================== */

.proposal-container {
  width: 95%;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 0;
}

.proposal-card {
  background: var(--white);
  padding: 60px 40px;
  border-radius: 8px;
  box-shadow: 0 30px 60px rgba(74, 62, 86, 0.1);
  position: relative;
  text-align: center;
  border: 1px solid rgba(230, 230, 250, 0.5);
  overflow: hidden;
  margin-bottom: 20px;
}

.flower-corner {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.6;
}

.top-left {
  top: 15px;
  left: 15px;
}

.top-right {
  top: 15px;
  right: 15px;
}

.bottom-left {
  bottom: 15px;
  left: 15px;
}

.bottom-right {
  bottom: 15px;
  right: 15px;
}

.proposal-title {
  font-size: 2.8rem;
  margin-bottom: 20px;
  color: var(--text);
  line-height: 1.2;
}

.proposal-title .accent {
  display: block;
  color: var(--gold);
  font-style: italic;
  font-weight: 400;
  margin-top: 5px;
  font-size: 2rem;
}

.purple {
  color: #8e7fb0;
  font-style: italic;
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

.divider::before,
.divider::after {
  content: '';
  height: 1px;
  width: 60px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.divider-icon {
  margin: 0 15px;
  font-size: 1.2rem;
}

.proposal-message {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 30px;
}

.proposal-message p {
  margin-bottom: 15px;
}

.question-highlight {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--gold);
  margin: 25px 0;
  line-height: 1.3;
  font-style: italic;
}

.ps-section {
  background: rgba(243, 240, 255, 0.5);
  padding: 20px;
  border-radius: 8px;
  margin-top: 30px;
  text-align: left;
  border-left: 3px solid var(--gold);
}

.preference-list {
  list-style: none;
  padding: 0;
  margin-top: 10px;
}

.preference-list li {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.signature {
  margin-top: 40px;
  font-family: 'Great Vibes', cursive;
  font-size: 2.2rem;
  color: #8e7fb0;
  line-height: 1.4;
}

.question-text {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 25px;
  color: var(--text);
}

/* Typing Effect Styles */
.typing-text {
  visibility: hidden;
  position: relative;
}

.typing-text.is-typing {
  visibility: visible;
}

.typing-cursor::after {
  content: '|';
  display: inline-block;
  margin-left: 2px;
  color: var(--gold);
  animation: blink 0.8s step-end infinite;
  font-weight: 300;
}

@keyframes blink {

  from,
  to {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.btn-skip {
  position: absolute;
  top: 15px;
  right: 50px;
  background: rgba(74, 62, 86, 0.05);
  border: 1px solid rgba(74, 62, 86, 0.1);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  z-index: 20;
  transition: all 0.3s ease;
  font-family: 'Cormorant Garamond', serif;
  opacity: 0.6;
}

.btn-skip:hover {
  background: rgba(74, 62, 86, 0.1);
  opacity: 1;
}

.btn-skip.hidden {
  opacity: 0;
  pointer-events: none;
}

.button-group {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
}

.btn {
  padding: 12px 30px;
  border-radius: 50px;
  border: none;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-emoji {
  font-size: 1.3rem;
}

.btn-yes {
  background: var(--gold-gradient);
  color: #000 !important;
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.btn-yes:hover {
  transform: translateY(-5px) scale(1.05);
  filter: brightness(1.1);
}

.btn-no {
  background: #f8f9fa;
  color: #adb5bd;
  border: 1px solid #e9ecef;
}

.btn-no:hover {
  background: #f1f3f5;
  color: #868e96;
}

/* ===================== NO FEEDBACK ===================== */

.sad-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.sad-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.sad-content {
  text-align: center;
  max-width: 400px;
  padding: 20px;
}

.sad-emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 20px;
}

.sad-content p {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.sad-sub {
  font-size: 1rem !important;
  color: #adb5bd;
  margin-bottom: 30px !important;
}

.btn-go-back {
  background: var(--primary);
  color: var(--text);
  margin: 0 auto;
}

/* ===================== MOBILE RESPONSIVENESS ===================== */

@media (max-width: 480px) {
  #envelope-wrapper {
    transform: scale(0.95);
    /* Increased from 0.8 */
  }

  .envelope-img-container {
    width: 350px;
    /* Increased from 320px */
  }

  .proposal-title {
    font-size: 1.8rem;
  }

  .proposal-container {
    padding: 20px 10px;
    width: 100%;
  }

  .proposal-card {
    padding: 40px 20px;
    width: 90%;
    /* Show margins on the sides */
    margin: 0 auto 30px auto;
    border-radius: 12px;
  }

  .proposal-message {
    font-size: 1rem;
    line-height: 1.6;
  }

  .question-highlight {
    font-size: 1.5rem;
  }

  .signature {
    font-size: 1.6rem;
  }

  .btn {
    padding: 12px 15px;
    font-size: 1rem;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  #envelope-wrapper {
    transform: scale(0.85);
    /* Increased from 0.7 */
  }

  .envelope-img-container {
    width: 300px;
    /* Increased from 280px */
  }

  .envelope-hint {
    font-size: 1rem;
  }

  .proposal-title {
    font-size: 1.5rem;
  }

  .proposal-card {
    width: 92%;
    padding: 30px 15px;
  }
}