/* -------------------------------------------------------------
   ROMANTIC INTERACTIVE PROPOSAL STYLES
   Pure CSS3 - 100% Fixed Full-Viewport, Zero-Scroll, Mobile-First
   ------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Quicksand:wght@600;700&display=swap');

:root {
  --font-display: 'Quicksand', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --color-bg-start: #fff1f4;
  --color-bg-mid: #ffe4e9;
  --color-bg-end: #fcd5e0;

  --color-card-bg: rgba(255, 255, 255, 0.95);
  --color-card-border: rgba(255, 255, 255, 0.92);

  --color-primary: #ff2a6d;
  --color-primary-hover: #fa1259;
  --color-primary-shadow: rgba(255, 42, 109, 0.38);

  --color-text-main: #881337;
  --color-text-sub: #9f1239;
  --color-text-highlight: #e11d48;

  --color-no-btn: #be123c;
  --color-no-bg: #ffffff;
  --color-no-border: #fecdd3;

  --radius-card: 26px;
  --radius-image: 20px;
  --radius-btn: 9999px;

  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ZERO SCROLLING: Complete lock to 100vh / 100dvh */
html, body {
  width: 100%;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: manipulation;
  font-family: var(--font-body);
  background: linear-gradient(145deg, var(--color-bg-start) 0%, var(--color-bg-mid) 45%, var(--color-bg-end) 100%);
  color: var(--color-text-main);
  position: fixed;
  inset: 0;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

/* Ambient Background Glow */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: 
    radial-gradient(circle at 15% 20%, rgba(255, 182, 193, 0.45) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(254, 205, 211, 0.45) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 228, 230, 0.3) 0%, transparent 60%);
  z-index: 0;
}

/* Top bar with sound toggle - compact & safe */
.top-bar {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 50;
}

.music-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-sub);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(254, 205, 211, 0.9);
  border-radius: var(--radius-btn);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform 0.2s var(--ease-smooth), background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(244, 114, 182, 0.12);
}

.music-toggle-btn:hover {
  transform: translateY(-1px);
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(244, 114, 182, 0.2);
}

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

.music-toggle-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, #ff4071, #ff1a53);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(255, 42, 109, 0.35);
}

/* Main Container Layout - perfectly centered & viewport bounded */
.main-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - 30px);
  margin: auto;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Romantic Card Container */
.romantic-card {
  width: 100%;
  max-height: calc(100dvh - 32px);
  background: #ffffff;
  border-radius: var(--radius-card);
  border: 1.5px solid var(--color-card-border);
  box-shadow: 
    0 20px 45px rgba(225, 29, 72, 0.13),
    0 4px 14px rgba(244, 63, 94, 0.07);
  padding: clamp(14px, 2.8vh, 28px) clamp(14px, 4vw, 24px);
  text-align: center;
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.35s var(--ease-smooth), opacity 0.35s ease;
  opacity: 1;
}

.card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Image Presentation - Fluidly adapts to mobile height so it NEVER pushes layout to scroll */
.image-wrapper {
  position: relative;
  width: clamp(130px, 25vh, 220px);
  height: clamp(130px, 25vh, 220px);
  max-width: 220px;
  max-height: 220px;
  aspect-ratio: 1 / 1;
  margin-bottom: clamp(10px, 1.8vh, 18px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-image);
  background: #ffffff;
  padding: 8px;
  box-shadow: 
    0 10px 24px rgba(244, 63, 94, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s var(--ease-spring);
  flex-shrink: 0;
}

.image-wrapper:hover {
  transform: translateY(-2px) scale(1.02);
}

.step-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: calc(var(--radius-image) - 4px);
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Instant pop animation on image swap */
.pop-image {
  animation: popImage 0.32s var(--ease-spring) forwards;
}

@keyframes popImage {
  0% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  60% {
    transform: scale(1.04);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Content Typography */
.content-wrapper {
  width: 100%;
  margin-bottom: clamp(12px, 2vh, 20px);
  padding: 0 4px;
}

.title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4.8vw, 1.85rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text-main);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.subtitle {
  font-size: clamp(0.88rem, 3.4vw, 1.05rem);
  font-weight: 600;
  color: var(--color-text-sub);
  line-height: 1.35;
  opacity: 0.92;
}

.final-love-note {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 4.2vw, 1.4rem);
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 8px;
  animation: pulse-gentle 2s infinite ease-in-out;
}

/* Button Arena & Safe Movement Bounds */
.buttons-arena {
  position: relative;
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 2px;
}

/* Action Buttons Base */
.action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  min-width: 108px;
  padding: 10px 22px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  outline: none;
  user-select: none;
  white-space: nowrap;
  transition: 
    transform 0.22s var(--ease-smooth),
    box-shadow 0.22s var(--ease-smooth),
    background 0.2s ease,
    color 0.2s ease;
}

.action-btn:focus-visible {
  outline: 3px solid #ff2a6d;
  outline-offset: 3px;
}

/* Primary YES Button */
.yes-btn {
  background: linear-gradient(135deg, #ff4071 0%, #ff1a53 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px var(--color-primary-shadow);
  z-index: 10;
  transition: transform 0.25s cubic-bezier(0.34, 1.5, 0.64, 1), box-shadow 0.22s ease;
}

.yes-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 24px rgba(255, 26, 83, 0.48);
}

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

@keyframes heart-pulse {
  0% { transform: scale(var(--base-scale, 1)); }
  50% { transform: scale(calc(var(--base-scale, 1) * 1.05)); }
  100% { transform: scale(var(--base-scale, 1)); }
}

.yes-btn.pulsing {
  animation: heart-pulse 1.6s infinite ease-in-out;
}

/* Secondary NO Button */
.no-btn {
  background: var(--color-no-bg);
  color: var(--color-no-btn);
  border: 2px solid var(--color-no-border);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.08);
  z-index: 9;
}

.no-btn:hover {
  background: #fff5f7;
  border-color: #fbcfe8;
  transform: translateY(-1px) scale(1.02);
}

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

/* SAFE FULL-SCREEN MOVING MODE:
   Guaranteed to NEVER poke outside mobile screen!
*/
.no-btn.screen-moving {
  position: fixed !important;
  z-index: 9999 !important;
  max-width: calc(100vw - 32px) !important;
  box-sizing: border-box !important;
  transition: 
    left 0.22s cubic-bezier(0.34, 1.35, 0.64, 1), 
    top 0.22s cubic-bezier(0.34, 1.35, 0.64, 1),
    transform 0.2s ease !important;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.22) !important;
  will-change: left, top;
  touch-action: none !important;
}

/* Final Celebration Card Styling */
.final-card {
  box-shadow: 
    0 24px 50px rgba(244, 63, 94, 0.2),
    0 6px 18px rgba(255, 42, 109, 0.1);
  border-color: rgba(255, 255, 255, 0.95);
  padding: clamp(16px, 3.2vh, 32px) clamp(14px, 4vw, 24px);
}

.celebration-title {
  color: #ff1a53;
  animation: pop-bounce 0.6s var(--ease-spring);
}

.celebration-subtitle {
  color: var(--color-text-main);
  font-size: clamp(0.95rem, 3.6vw, 1.15rem);
}

.final-image-wrapper {
  box-shadow: 0 12px 28px rgba(255, 42, 109, 0.2);
}

/* Heart Particle System */
.hearts-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 100;
}

.floating-heart {
  position: absolute;
  bottom: -40px;
  user-select: none;
  pointer-events: none;
  will-change: transform, opacity;
  animation-name: float-upward;
  animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  animation-fill-mode: forwards;
}

@keyframes float-upward {
  0% {
    transform: translateY(0) translateX(0) scale(0.6) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 0.9;
  }
  80% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(-115vh) translateX(var(--drift, 40px)) scale(var(--target-scale, 1.2)) rotate(var(--rot, 35deg));
    opacity: 0;
  }
}

/* Utilities */
.hidden {
  display: none !important;
}

.card-enter {
  animation: card-appear 0.4s var(--ease-spring) forwards;
}

@keyframes card-appear {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px) rotate(-1.5deg); }
  40% { transform: translateX(6px) rotate(1.5deg); }
  60% { transform: translateX(-4px) rotate(-0.8deg); }
  80% { transform: translateX(4px) rotate(0.8deg); }
}

.shake {
  animation: shake 0.38s ease-in-out;
}

@keyframes pop-bounce {
  0% { transform: scale(0.85); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes pulse-gentle {
  0%, 100% { opacity: 0.92; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}
