/* ============================================================
   Hey Rosie — style.css
   Palette: pastel pink bg · white/deep-rose text · red accents
   ============================================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg:          #fde8ef;
  --bg-grad:     linear-gradient(155deg, #fde8ef 0%, #fce4ec 55%, #ffd6e5 100%);
  --card-bg:     rgba(255, 255, 255, 0.72);
  --red:         #c0392b;
  --red-light:   #e57373;
  --rose-dark:   #7d2c44;
  --rose-mid:    #a05070;
  --rose-muted:  #c080a0;
  --muted-text:  #c0a0a8;
  --border:      rgba(255, 255, 255, 0.9);
  --shadow:      rgba(192, 57, 91, 0.15);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Lato', sans-serif;
  background: var(--bg);
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ============================================================
   FALLING PETALS LAYER
   ============================================================ */
#petals-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

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

/* ============================================================
   SCREENS — shared base
   ============================================================ */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-grad);
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  overflow: hidden;
}

.screen.active {
  opacity: 1;
  transform: translateX(0);
}

.screen.exit {
  opacity: 0;
  transform: translateX(-100%);
}

/* ============================================================
   SCREEN 0 — ROSE BLOOM
   ============================================================ */
#screen-bloom {
  flex-direction: column;
  gap: 44px;
  cursor: pointer;
  background: linear-gradient(155deg, #fce4ec 0%, #f8bbd0 60%, #fde8ef 100%);
}

/* ---- SVG Rose ---- */
.rose-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rose-svg {
  width: min(270px, 68vw);
  height: auto;
  filter: drop-shadow(0 10px 28px rgba(192, 57, 91, 0.28));
}

/* Stem + leaves: simple fade-in */
.stem-group {
  animation: fadeIn 0.6s ease-out 0.1s both;
}

/* Petal rings: bloom from center outward */
.petal-ring {
  transform-box: fill-box;
  transform-origin: center;
}

.petal-outer {
  animation: bloomRing 1s ease-out 0.4s both;
}
.petal-mid {
  animation: bloomRing 0.85s ease-out 1.1s both;
}
.petal-inner {
  animation: bloomRing 0.75s ease-out 1.75s both;
}
.rose-center {
  transform-box: fill-box;
  transform-origin: center;
  animation: bloomRing 0.5s ease-out 2.3s both;
}

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

@keyframes bloomRing {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Tap hint */
.tap-hint {
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: #c0748a;
  opacity: 0;
  animation: pulseHint 2.2s ease-in-out 3.2s infinite both;
}

@keyframes pulseHint {
  0%, 100% { opacity: 0.45; transform: translateY(0); }
  50%       { opacity: 1;    transform: translateY(-5px); }
}

/* ============================================================
   SCREENS 1–3 — STORY SLIDES
   ============================================================ */
.slide-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 36px 24px 40px;
  width: 100%;
  max-width: 400px;
  z-index: 3;
}

/* Polaroid-style photo frame */
.photo-frame {
  background: #ffffff;
  padding: 11px 11px 44px;
  border-radius: 3px;
  box-shadow:
    0 6px 24px var(--shadow),
    0 2px 8px rgba(0, 0, 0, 0.07);
  transform: rotate(-2.5deg);
  width: 100%;
  max-width: 270px;
  transition: transform 0.35s ease;
}

.photo-frame.tilt-right {
  transform: rotate(2deg);
}

.photo-frame:hover,
.photo-frame:focus-within {
  transform: rotate(0deg) scale(1.02);
}

.photo-frame img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 2px;
}

/* Placeholder shown when image is missing */
.photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
  display: none;          /* shown via onerror inline style */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 2px;
}

.photo-placeholder span {
  font-size: 2.8rem;
}

.photo-placeholder small {
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b07088;
}

/* Message card */
.message-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 20px 26px;
  width: 100%;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px var(--shadow);
}

.message-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--rose-dark);
  text-align: center;
}

/* Continue button */
.continue-btn {
  background: linear-gradient(135deg, var(--red), var(--red-light));
  color: #fff;
  border: none;
  padding: 14px 38px;
  border-radius: 50px;
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(192, 57, 91, 0.38);
  transition: transform 0.2s, box-shadow 0.2s;
}

.continue-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(192, 57, 91, 0.5);
}

.continue-btn:active {
  transform: translateY(0);
}

/* ============================================================
   SCREEN 4 — THE QUESTION
   ============================================================ */
.question-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
  padding: 40px 28px;
  z-index: 3;
}

.rose-emoji {
  font-size: 4.5rem;
  animation: roseSway 3.5s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(192, 57, 91, 0.3));
}

@keyframes roseSway {
  0%, 100% { transform: rotate(-6deg) scale(1);    }
  50%       { transform: rotate(6deg)  scale(1.06); }
}

.question-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.65rem, 7.5vw, 2.3rem);
  font-weight: 700;
  color: var(--rose-dark);
  text-align: center;
  line-height: 1.3;
  max-width: 320px;
}

.answer-buttons {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

/* YES button */
.yes-btn {
  background: linear-gradient(135deg, var(--red), var(--red-light));
  color: #fff;
  border: none;
  padding: 18px 52px;
  border-radius: 50px;
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-style: italic;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(192, 57, 91, 0.42);
  animation: yesGlow 2.2s ease-in-out infinite;
  transition: transform 0.2s;
}

@keyframes yesGlow {
  0%, 100% { box-shadow: 0 6px 24px rgba(192, 57, 91, 0.42); }
  50%       { box-shadow: 0 8px 36px rgba(192, 57, 91, 0.68); }
}

.yes-btn:hover  { transform: scale(1.06); }
.yes-btn:active { transform: scale(0.97); }

/* NO button — shy & small */
.no-btn {
  background: transparent;
  color: var(--muted-text);
  border: 1px solid #e8c0c8;
  padding: 10px 26px;
  border-radius: 50px;
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem;
  font-weight: 300;
  cursor: pointer;
  transition: left 0.15s ease, top 0.15s ease, opacity 0.15s;
}

/* When dodging, becomes fixed-position */
.no-btn.dodging {
  position: fixed;
  z-index: 100;
}

/* ============================================================
   SCREEN 5 — SHE SAID YES
   ============================================================ */
.yes-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 40px 28px;
  z-index: 3;
  text-align: center;
}

.yes-rose {
  font-size: 5.5rem;
  animation: heartPop 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
  filter: drop-shadow(0 6px 18px rgba(192, 57, 91, 0.4));
}

@keyframes heartPop {
  from { transform: scale(0) rotate(-15deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

.yes-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 9vw, 3.2rem);
  font-weight: 700;
  color: var(--rose-dark);
  animation: fadeInUp 0.6s ease 0.2s both;
}

.yes-subtitle {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--rose-mid);
  animation: fadeInUp 0.6s ease 0.5s both;
}

.yes-small {
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  font-size: 0.9rem;
  color: var(--rose-muted);
  animation: fadeInUp 0.6s ease 0.9s both;
}

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

/* ============================================================
   FALLING PETALS
   ============================================================ */
.falling-petal {
  position: fixed;
  top: -24px;
  border-radius: 50% 0 50% 0;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(252, 228, 236, 0.92),
    rgba(244, 143, 177, 0.55)
  );
  animation: fallPetal linear forwards;
}

@keyframes fallPetal {
  0%   { transform: translateY(0)     rotate(0deg)   translateX(0);              opacity: 0; }
  6%   { opacity: 1; }
  90%  { opacity: 0.7; }
  100% { transform: translateY(110vh) rotate(540deg) translateX(var(--drift, 40px)); opacity: 0; }
}
