@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/*
  TEXTS TO CUSTOMIZE:
  - Open main.js and edit the CUSTOM_TEXT object.
  - You can change the question, subtitle, YES reply, and NO reply there.

  COLORS TO CUSTOMIZE:
  - Change these CSS variables if you want another palette.
*/
:root {
  --dark-color: #2a0719;
  --pink-50: #fff4fa;
  --pink-100: #ffe7f2;
  --pink-200: #ffc9df;
  --pink-300: #ff9fc4;
  --pink-400: #ff73ad;
  --pink-500: #f94f98;
  --pink-600: #d92f7d;
  --berry: #8f2458;
  --deep-berry: #5f1237;
  --leaf-green: #8fd6a4;
  --leaf-deep: #3f9360;
}

* {
  font-family: 'Poppins', sans-serif;
}

body {
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 231, 242, 0.95) 0 16%, transparent 35%),
    radial-gradient(circle at 82% 18%, rgba(255, 159, 196, 0.55) 0 14%, transparent 36%),
    linear-gradient(135deg, #ffeaf4 0%, #ffd1e3 42%, #ffb5d2 100%);
}

.night {
  background-image:
    radial-gradient(ellipse at top, rgba(255, 244, 250, 0.18), transparent 58%),
    radial-gradient(ellipse at bottom, rgba(255, 115, 173, 0.34), rgba(42, 7, 25, 0.92)),
    repeating-linear-gradient(220deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 22px),
    linear-gradient(90deg, rgba(255, 159, 196, 0.75), rgba(255, 244, 250, 0.9));
  opacity: 0.92;
}

.question-card {
  position: fixed;
  z-index: 100;
  top: 50%;
  left: 50%;
  width: min(90vw, 410px);
  padding: 34px 28px 30px;
  border-radius: 34px;
  text-align: center;
  color: var(--deep-berry);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 24px 60px rgba(217, 47, 125, 0.28), inset 0 1px 0 rgba(255,255,255,0.8);
  backdrop-filter: blur(18px);
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 0.55s ease, transform 0.55s ease, visibility 0.55s ease;
}

.card-glow {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.75), rgba(255, 115, 173, 0.32));
  filter: blur(18px);
  opacity: 0.5;
  z-index: -1;
}

.eyebrow,
.tiny-label {
  margin-bottom: 10px;
  color: var(--pink-600);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.question-card h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1.05;
  color: var(--berry);
  text-shadow: 0 4px 18px rgba(255, 115, 173, 0.28);
}

.card-subtitle {
  margin: 0 auto 24px;
  max-width: 31ch;
  color: #9d3b6d;
  font-size: 0.98rem;
  line-height: 1.65;
}

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

.answer-btn {
  min-width: 112px;
  border: 0;
  border-radius: 999px;
  padding: 13px 24px;
  color: white;
  font-weight: 800;
  font-size: 0.98rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  box-shadow: 0 12px 22px rgba(249, 79, 152, 0.32);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.answer-btn.no {
  background: linear-gradient(135deg, #ff9fc4, #f94f98);
}

.answer-btn:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 16px 28px rgba(249, 79, 152, 0.42);
  filter: saturate(1.08);
}

.locked .flowers {
  opacity: 0;
  transform: translateY(13vmin) scale(0.55);
  filter: blur(3px);
}

.flowers {
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2,.9,.2,1.2), filter 0.8s ease;
}

body.bloom .question-card {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -58%) scale(0.92);
  pointer-events: none;
}

.final-message {
  position: fixed;
  top: 7vh;
  left: 50%;
  z-index: 90;
  width: min(92vw, 760px);
  padding: 18px 22px;
  border-radius: 26px;
  text-align: center;
  color: var(--pink-50);
  background: rgba(143, 36, 88, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 18px 44px rgba(95, 18, 55, 0.22);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translate(-50%, -20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.8s ease 0.25s, transform 0.8s ease 0.25s;
}

body.bloom .final-message {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}

.final-message h2 {
  font-size: clamp(1.35rem, 5vw, 2.55rem);
  line-height: 1.25;
  color: #fff4fa;
  text-shadow: 0 3px 18px rgba(95, 18, 55, 0.46);
}

.flower__leaf,
.flower__leaf--4 {
  background-color: var(--pink-300) !important;
  background-image: linear-gradient(to top, var(--pink-600), var(--pink-200)) !important;
  box-shadow: inset 0 0 2vmin rgba(255,255,255,0.55), 0 0 3vmin rgba(255, 159, 196, 0.25);
}

.flower__leafs::after {
  background-color: var(--pink-400) !important;
}

.flower__white-circle {
  background: radial-gradient(circle, #fff9fc 0 38%, #ffd1e3 39% 100%) !important;
}

.flower__light {
  background-color: #fff0f7 !important;
  box-shadow: 0 0 1.8vmin rgba(255, 244, 250, 0.9);
}

.flower__line,
.flower__line__leaf,
.flower__g-long__top,
.flower__g-long__bottom,
.flower__g-right .leaf,
.flower__g-front__leaf,
.flower__grass--top,
.flower__grass--bottom,
.flower__grass__leaf,
.long-g .leaf {
  background-image: linear-gradient(to top, var(--leaf-deep), var(--leaf-green)) !important;
  background-color: var(--leaf-green) !important;
}

.flower__line {
  box-shadow: inset 0 0 2px rgba(255,255,255,0.35);
}

@media (max-width: 620px) {
  .question-card {
    padding: 28px 20px 24px;
    border-radius: 28px;
  }

  .answer-btn {
    min-width: 100px;
    padding: 12px 20px;
  }

  .final-message {
    top: 5vh;
  }
}

/* === Extra interactive design added === */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.float-shape {
  position: absolute;
  display: grid;
  place-items: center;
  width: clamp(46px, 8vw, 92px);
  height: clamp(46px, 8vw, 92px);
  border-radius: 999px;
  color: rgba(143, 36, 88, 0.34);
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow: 0 18px 50px rgba(249, 79, 152, 0.16);
  backdrop-filter: blur(8px);
  font-size: clamp(1.2rem, 3vw, 2.4rem);
  animation: floatAround var(--speed, 12s) ease-in-out infinite alternate;
}

.shape-1 { top: 9%; left: 7%; --speed: 11s; }
.shape-2 { top: 18%; right: 10%; --speed: 14s; animation-delay: -3s; }
.shape-3 { bottom: 14%; left: 11%; --speed: 13s; animation-delay: -6s; }
.shape-4 { bottom: 9%; right: 9%; --speed: 16s; animation-delay: -8s; }
.shape-5 { top: 48%; left: 3%; --speed: 12s; animation-delay: -4s; }
.shape-6 { top: 58%; right: 4%; --speed: 15s; animation-delay: -7s; }

.question-card {
  z-index: 110;
  overflow: hidden;
  transform: translate(-50%, -50%) perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) scale(1);
  will-change: transform;
}

.question-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 0 35%, rgba(255,255,255,0.38) 48%, transparent 62% 100%);
  transform: translateX(-130%);
  animation: cardShine 4.8s ease-in-out infinite;
  pointer-events: none;
}

.card-sparkle {
  position: absolute;
  color: rgba(217, 47, 125, 0.38);
  filter: drop-shadow(0 6px 12px rgba(249, 79, 152, 0.2));
  animation: sparklePulse 2.8s ease-in-out infinite;
  pointer-events: none;
}

.sparkle-a { top: 20px; right: 26px; font-size: 1.3rem; }
.sparkle-b { bottom: 22px; left: 26px; font-size: 1.15rem; animation-delay: -1.1s; }

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 16px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(217, 47, 125, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.58);
  transition: width 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.dot.active {
  width: 26px;
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  transform: translateY(-1px);
}

.answer-note {
  min-height: 24px;
  margin: -8px 0 18px;
  color: var(--pink-600);
  font-weight: 700;
  font-size: 0.92rem;
}

.answer-btn {
  position: relative;
  overflow: hidden;
}

.answer-btn::after {
  content: "";
  position: absolute;
  inset: -40% -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.46), transparent);
  transform: translateX(-100%);
  transition: transform 0.55s ease;
}

.answer-btn:hover::after {
  transform: translateX(100%);
}

.page-pop {
  animation: pagePop 0.42s cubic-bezier(.2,.9,.2,1.2);
}

.final-subtitle {
  margin: 10px auto 0;
  max-width: 44ch;
  color: rgba(255, 244, 250, 0.88);
  line-height: 1.6;
}

.petal-burst {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  color: rgba(255, 244, 250, 0.98);
  text-shadow: 0 8px 20px rgba(143, 36, 88, 0.35);
  font-size: clamp(1rem, 4vw, 2rem);
  animation: petalBurst 1.65s ease-out forwards;
}

body.bloom .ambient-bg {
  opacity: 0.36;
  mix-blend-mode: screen;
}

@keyframes floatAround {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(18px, -26px, 0) rotate(10deg) scale(1.08); }
  100% { transform: translate3d(-18px, 22px, 0) rotate(-12deg) scale(0.94); }
}

@keyframes cardShine {
  0%, 48% { transform: translateX(-130%); }
  70%, 100% { transform: translateX(130%); }
}

@keyframes sparklePulse {
  0%, 100% { transform: scale(0.85) rotate(-8deg); opacity: 0.45; }
  50% { transform: scale(1.18) rotate(8deg); opacity: 0.95; }
}

@keyframes pagePop {
  0% { transform: translate(-50%, -50%) perspective(900px) scale(0.96); opacity: 0.72; }
  100% { transform: translate(-50%, -50%) perspective(900px) scale(1); opacity: 1; }
}

@keyframes petalBurst {
  0% { transform: translate3d(0, 0, 0) scale(0.4) rotate(0deg); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translate3d(var(--drift), -145px, 0) scale(1.2) rotate(var(--spin)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .float-shape,
  .question-card::before,
  .card-sparkle,
  .page-pop,
  .petal-burst {
    animation: none !important;
  }

  .question-card {
    transform: translate(-50%, -50%) scale(1) !important;
  }
}

/* === More magical ending + removable final message === */
.final-message {
  padding: 20px 50px 18px;
  overflow: hidden;
}

.final-message::before {
  content: "";
  position: absolute;
  inset: -80% -30%;
  background:
    radial-gradient(circle, rgba(255,255,255,0.72) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(255, 231, 242, 0.9) 0 1px, transparent 2px);
  background-size: 58px 58px, 35px 35px;
  animation: modalStardust 7s linear infinite;
  opacity: 0.38;
  pointer-events: none;
}

.final-message.is-hidden {
  opacity: 0 !important;
  visibility: hidden;
  transform: translate(-50%, -28px) scale(0.9) !important;
  pointer-events: none;
}

.final-close {
  position: absolute;
  pointer-events: auto;
  top: 11px;
  right: 13px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: #8f2458;
  background: rgba(255, 244, 250, 0.9);
  box-shadow: 0 8px 18px rgba(95, 18, 55, 0.2), inset 0 0 0 1px rgba(255,255,255,0.86);
  cursor: pointer;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.final-close:hover {
  transform: scale(1.08) rotate(8deg);
  background: #fff4fa;
  box-shadow: 0 10px 24px rgba(95, 18, 55, 0.28), 0 0 20px rgba(255, 231, 242, 0.75);
}

.cheer-message {
  position: relative;
  z-index: 1;
  margin: 9px auto 0;
  max-width: 46ch;
  color: #fff9fc;
  font-size: clamp(0.92rem, 2.7vw, 1.08rem);
  font-weight: 700;
  line-height: 1.55;
  text-shadow: 0 4px 16px rgba(95, 18, 55, 0.42);
}

.close-hint {
  position: relative;
  z-index: 1;
  margin: 10px auto 0;
  color: rgba(255, 244, 250, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.magic-spark {
  position: fixed;
  z-index: 190;
  pointer-events: none;
  color: rgba(255, 250, 253, 0.98);
  font-size: var(--spark-size, 1rem);
  filter: drop-shadow(0 0 10px rgba(255, 159, 196, 0.95)) drop-shadow(0 0 22px rgba(255, 244, 250, 0.75));
  animation: magicSpark 2.25s cubic-bezier(.16,.8,.28,1) var(--spark-delay, 0s) forwards;
}

body.bloom .flowers {
  filter: drop-shadow(0 0 24px rgba(255, 159, 196, 0.34));
  animation: gardenGlow 4.8s ease-in-out infinite alternate;
}

body.bloom .flower__light {
  animation-duration: 2.2s !important;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.85));
}

body.bloom .flower__leafs {
  filter: drop-shadow(0 0 16px rgba(255, 159, 196, 0.44));
}

body.message-hidden .flowers {
  transform: translateY(0) scale(1.06);
}

body.bloom::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 26% 24%, rgba(255,255,255,0.32) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 18%, rgba(255,231,242,0.28) 0 1px, transparent 2px),
    radial-gradient(circle at 44% 62%, rgba(255,255,255,0.26) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 70%, rgba(255,231,242,0.24) 0 1px, transparent 2px);
  background-size: 180px 180px, 220px 220px, 260px 260px, 300px 300px;
  animation: dreamyTwinkle 8s linear infinite;
  opacity: 0.75;
}

.petal-burst {
  filter: drop-shadow(0 0 10px rgba(255, 244, 250, 0.9)) drop-shadow(0 0 18px rgba(249, 79, 152, 0.42));
}

@keyframes magicSpark {
  0% {
    transform: translate3d(0, 0, 0) scale(0.2) rotate(0deg);
    opacity: 0;
  }
  18% { opacity: 1; }
  72% { opacity: 0.92; }
  100% {
    transform: translate3d(var(--spark-drift-x), var(--spark-drift-y), 0) scale(1.25) rotate(165deg);
    opacity: 0;
  }
}

@keyframes modalStardust {
  from { transform: translate3d(0, 0, 0) rotate(0deg); }
  to { transform: translate3d(42px, 54px, 0) rotate(4deg); }
}

@keyframes gardenGlow {
  from { filter: drop-shadow(0 0 18px rgba(255, 159, 196, 0.24)); }
  to { filter: drop-shadow(0 0 32px rgba(255, 244, 250, 0.5)); }
}

@keyframes dreamyTwinkle {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 180px -180px, -220px 220px, 260px -260px, -300px 300px; }
}

@keyframes petalBurst {
  0% { transform: translate3d(0, 0, 0) scale(0.35) rotate(0deg); opacity: 0; }
  14% { opacity: 1; }
  78% { opacity: 0.92; }
  100% { transform: translate3d(var(--drift), calc(-1 * var(--rise)), 0) scale(var(--scale)) rotate(var(--spin)); opacity: 0; }
}

@media (max-width: 620px) {
  .final-message {
    top: 3.5vh;
    padding: 18px 44px 16px 22px;
  }

  .close-hint {
    font-size: 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .final-message::before,
  .magic-spark,
  body.bloom .flowers,
  body.bloom::after {
    animation: none !important;
  }
}

/* === Localhost + phone scaling polish === */
html {
  width: 100%;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  touch-action: manipulation;
}

.question-card {
  width: min(calc(100vw - 28px), 410px);
  max-height: calc(100svh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.final-message {
  width: min(calc(100vw - 22px), 760px);
  max-height: min(46svh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.flowers {
  transform-origin: bottom center;
  max-width: 100vw;
}

.final-close {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 560px) {
  .question-card {
    top: 50svh;
    padding: 24px 18px 22px;
    border-radius: 26px;
  }

  .question-card h1 {
    font-size: clamp(1.65rem, 9vw, 2.35rem);
  }

  .card-subtitle {
    margin-bottom: 18px;
    font-size: 0.9rem;
  }

  .answer-buttons {
    gap: 10px;
  }

  .answer-btn {
    min-width: 0;
    flex: 1 1 120px;
    padding: 12px 16px;
    font-size: 0.92rem;
  }

  .final-message {
    top: max(10px, env(safe-area-inset-top));
    padding: 16px 42px 14px 18px;
    border-radius: 22px;
  }

  .final-message h2 {
    font-size: clamp(1.18rem, 6.4vw, 1.72rem);
  }

  .cheer-message,
  .final-subtitle {
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .final-close {
    top: 9px;
    right: 9px;
    width: 38px;
    height: 38px;
    font-size: 1.45rem;
  }

  body.bloom .flowers {
    transform: translateY(2vmin) scale(0.82);
  }

  body.message-hidden .flowers {
    transform: translateY(1vmin) scale(0.9);
  }

  .locked .flowers {
    transform: translateY(13vmin) scale(0.45);
  }

  .magic-spark,
  .petal-burst {
    z-index: 95;
  }
}

@media (max-width: 380px) {
  .question-card {
    padding: 22px 15px 20px;
  }

  .answer-btn {
    flex-basis: 100%;
  }

  body.bloom .flowers {
    transform: translateY(2vmin) scale(0.74);
  }

  body.message-hidden .flowers {
    transform: translateY(1vmin) scale(0.82);
  }
}

@media (max-height: 680px) and (max-width: 900px) {
  .question-card {
    top: 50svh;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .final-message {
    max-height: 52svh;
  }

  body.bloom .flowers {
    transform: translateY(5vmin) scale(0.72);
  }

  body.message-hidden .flowers {
    transform: translateY(3vmin) scale(0.8);
  }
}


/* === Hidden sorry letter container ===
   The HTML is already placed under the current ending text.
   It is hidden by default. Remove "is-hidden" from the sorry-letter section in index.html to show it.
*/
.sorry-letter {
  position: relative;
  z-index: 1;
  margin: 16px auto 0;
  padding: 18px 18px 16px;
  max-width: 64ch;
  border-radius: 22px;
  text-align: left;
  color: var(--deep-berry);
  background: rgba(255, 244, 250, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 38px rgba(95, 18, 55, 0.22), inset 0 1px 0 rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
}

.sorry-letter.is-hidden {
  display: none;
}

.sorry-letter-title {
  margin: 0 40px 10px 0;
  color: var(--pink-600);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sorry-letter-body {
  margin: 0;
  color: #7a2450;
  font-size: clamp(0.86rem, 2.4vw, 0.98rem);
  line-height: 1.75;
  white-space: pre-line;
}

.sorry-letter-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  color: #8f2458;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 16px rgba(95, 18, 55, 0.16);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sorry-letter-close:hover {
  transform: scale(1.06) rotate(8deg);
  background: #fff;
}

@media (max-width: 560px) {
  .sorry-letter {
    margin-top: 12px;
    padding: 15px 14px 14px;
    border-radius: 18px;
  }

  .sorry-letter-body {
    font-size: 0.82rem;
    line-height: 1.62;
  }

  .sorry-letter-close {
    width: 36px;
    height: 36px;
    font-size: 1.35rem;
  }
}
