/* ===== Fonts & Reset ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg-1: #ffe3ec;
  --color-bg-2: #ffd1dc;
  --color-bg-3: #ffc4d6;
  --color-text: #5a2a3a;
  --color-text-muted: #8a5468;
  --color-accent: #e0567c;
  --color-accent-hover: #c73e63;
  --color-accent-active: #a52f4e;
  --color-surface: #fff5f8;
  --color-border: rgba(90, 42, 58, 0.15);
  --shadow-soft: 0 8px 24px rgba(224, 86, 124, 0.18);
  --radius-md: 12px;
  --radius-lg: 20px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Poppins', 'Segoe UI', sans-serif;
}

html, body {
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--color-text);
  background: linear-gradient(135deg, var(--color-bg-1), var(--color-bg-2) 50%, var(--color-bg-3));
  background-attachment: fixed;
  overflow: hidden;
}

body { position: relative; }

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.85rem, 2vw, 1.4rem);
  padding: clamp(1rem, 3vw, 2rem);
  text-align: center;
  position: relative;
}

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

.bg-heart {
  position: absolute;
  bottom: -10%;
  font-size: clamp(1rem, 2vw, 1.8rem);
  color: rgba(224, 86, 124, 0.25);
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-110vh) rotate(25deg); opacity: 0; }
}

.title {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  max-width: 60ch;
  color: var(--color-text);
  position: relative;
  z-index: 2;
}

.title--hero { font-size: clamp(1.6rem, 6vw, 3rem); }
.title--small { font-size: clamp(1.1rem, 4.2vw, 2rem); }

/* Image box uses explicit width AND height (not aspect-ratio) so the
   image always has real, non-zero space to render into. */
.image-box {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 4px solid var(--color-surface);
  background: var(--color-surface);
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: rgba(255, 245, 248, 0.95);
}

.image-box--landscape {
  width: min(520px, 74vw);
  height: min(347px, 49.3vw);
}

.image-box--portrait {
  width: min(270px, 28vw);
  height: min(360px, 37.3vw);
}

.button-row {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.btn {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  font-weight: 600;
  padding: 0.85rem 2.2rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: transform 200ms cubic-bezier(0.16,1,0.3,1), background-color 180ms ease, box-shadow 180ms ease, top 220ms cubic-bezier(0.16,1,0.3,1), left 220ms cubic-bezier(0.16,1,0.3,1);
  min-width: 96px;
  min-height: 44px;
}

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

.btn-yes {
  background: var(--color-accent);
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.btn-yes:hover { background: var(--color-accent-hover); }
.btn-yes:active { background: var(--color-accent-active); }

.btn-no {
  background: transparent;
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
}
.btn-no:hover { background: rgba(90, 42, 58, 0.06); }

.btn-no.shrink-1 { transform: scale(0.5); }

.btn-no.btn-no-floating,
.btn-no.no-btn-dodge {
  position: fixed;
  z-index: 8;
}

.please-text,
.message-box,
.floating-msg {
  position: fixed;
  font-size: clamp(0.9rem, 1.8vw, 1.05rem);
  color: var(--color-text);
  background: rgba(255, 245, 248, 0.96);
  border: 1px solid rgba(90, 42, 58, 0.08);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.2rem;
  max-width: min(92vw, 420px);
  z-index: 7;
  text-align: center;
}

.please-text {
  font-style: italic;
  color: var(--color-text-muted);
}

.flash-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  background: rgba(255, 227, 236, 0.55);
}

.flash-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 12vw, 6rem);
  color: var(--color-accent);
  animation: flashPulse 0.5s steps(1, end) infinite;
  text-shadow: 0 4px 24px rgba(224, 86, 124, 0.4);
}

@keyframes flashPulse {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.tears-container {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.tears-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0) 0%, rgba(102,164,201,0.12) 70%, rgba(61,143,184,0.22) 100%);
  animation: sobPulse 1.3s ease-in-out infinite;
}

.cry-emoji {
  position: absolute;
  top: 7vh;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(3.2rem, 7vw, 5.5rem);
  opacity: 0.88;
  filter: drop-shadow(0 8px 18px rgba(61, 143, 184, 0.24));
  animation: sobShake 0.7s ease-in-out infinite;
}

.tear {
  position: absolute;
  top: -14%;
  border-radius: 55% 55% 60% 60% / 65% 65% 35% 35%;
  clip-path: polygon(50% 0%, 92% 60%, 50% 100%, 8% 60%);
  background: linear-gradient(180deg, rgba(201,240,255,0.98), rgba(91,173,219,0.96) 55%, rgba(43,121,174,0.95));
  box-shadow: 0 0 18px rgba(111, 203, 255, 0.55);
  opacity: 0.95;
  animation: fallDown linear forwards;
}

@keyframes fallDown {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  8% { opacity: 1; }
  50% { transform: translateY(55vh) translateX(var(--drift, 0px)) scale(1.08); }
  100% { transform: translateY(120vh) translateX(calc(var(--drift, 0px) * 1.8)) scale(0.88); opacity: 0; }
}

@keyframes sobPulse {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}

@keyframes sobShake {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  25% { transform: translateX(calc(-50% - 6px)) rotate(-4deg); }
  75% { transform: translateX(calc(-50% + 6px)) rotate(4deg); }
}

.final-box {
  width: min(420px, 80vw);
  min-height: 30vh;
  display: flex;
  flex-direction: column;       /* stack children vertically */
  align-items: center;          /* center text and button horizontally */
  justify-content: center;
  gap: 1rem;                    /* space between text and button */
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 3rem);
  color: var(--color-accent);
  text-align: center;
  padding: 2rem;
  z-index: 2;
}

.final-text {
  margin: 0;
}

.final-calendar-btn {
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
}

.hidden { display: none !important; }

@media (max-width: 700px) {
  .image-box--portrait { width: min(300px, 66vw); height: min(400px, 88vw); }
  .image-box--landscape { width: min(440px, 86vw); height: min(293px, 57.3vw); }
}

@media (max-width: 480px) {
  html, body { overflow: hidden; }
  .btn { padding: 0.75rem 1.6rem; }
  .image-box--portrait { width: min(250px, 72vw); height: min(333px, 96vw); }
  .image-box--landscape { width: min(340px, 86vw); height: min(227px, 57.3vw); }
}