﻿:root {
  --bg-start-a: #ffe5ee;
  --bg-start-b: #ffd3e1;
  --bg-start-c: #ffc0d3;
  --bg-cinema-a: #220814;
  --bg-cinema-b: #4c1328;
  --bg-cinema-c: #7a1f3c;
  --card: rgba(255, 255, 255, 0.9);
  --text: #6e2040;
  --yes-a: #ff4d79;
  --yes-b: #ff2f63;
  --no-a: #ffd9e6;
  --no-b: #ffc3d8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(140deg, var(--bg-start-a), var(--bg-start-b) 52%, var(--bg-start-c));
  transition: background 1.2s ease-in-out, transform 1.2s ease-in-out;
}

body.yes-mode {
  background: linear-gradient(140deg, var(--bg-cinema-a), var(--bg-cinema-b) 52%, var(--bg-cinema-c));
}

.skip-animations {
  position: fixed;
  top: 0.9rem;
  left: 0.9rem;
  z-index: 60;
  text-decoration: none;
  color: #7a2145;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(122, 33, 69, 0.12);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.38rem 0.72rem;
}

.skip-animations:focus-visible,
.btn:focus-visible {
  outline: 3px solid rgba(255, 77, 121, 0.38);
  outline-offset: 2px;
}

.vignette,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.vignette {
  z-index: 4;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, 0.38) 100%);
}

.grain {
  z-index: 5;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.08) 0.6px, transparent 0.6px),
    radial-gradient(rgba(0, 0, 0, 0.06) 0.6px, transparent 0.6px);
  background-size: 3px 3px, 4px 4px;
  background-position: 0 0, 1px 1px;
}

body.yes-mode .vignette,
body.yes-mode .grain {
  opacity: 1;
}

body.yes-mode .grain {
  animation: grainMove 2.2s steps(2, end) infinite;
}

.page-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  position: relative;
  z-index: 8;
}

.card {
  width: min(760px, 100%);
  min-height: 450px;
  border-radius: 28px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 28px 70px rgba(129, 30, 67, 0.22);
  padding: 2.4rem 1.8rem;
  transition: transform 1.2s cubic-bezier(0.18, 0.78, 0.15, 1), opacity 1.2s ease-in-out;
  transform-origin: center;
}

.card.is-exiting {
  transform: scale(1.08);
  opacity: 0;
  pointer-events: none;
}

.headline {
  margin: 0 0 1.3rem;
  text-align: center;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  color: #7d2045;
  line-height: 1.14;
}

.headline-note {
  margin: -0.65rem 0 1.1rem;
  text-align: center;
  font-size: clamp(0.72rem, 1.4vw, 0.9rem);
  letter-spacing: 0.03em;
  color: rgba(125, 32, 69, 0.78);
  font-weight: 600;
}

.play-area {
  position: relative;
  height: 250px;
  border-radius: 18px;
  border: 1px dashed rgba(201, 77, 123, 0.34);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 237, 244, 0.8));
  overflow: hidden;
}

.btn {
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.72;
  cursor: default;
}

.music-prompt {
  position: fixed;
  right: 0.9rem;
  top: 0.9rem;
  z-index: 80;
  border: 1px solid rgba(255, 220, 232, 0.35);
  background: rgba(30, 9, 18, 0.72);
  color: #ffeaf2;
  border-radius: 999px;
  padding: 0.5rem 0.86rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.music-prompt.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.btn-yes {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  min-width: 180px;
  padding: 0.95rem 2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--yes-a), var(--yes-b));
  font-size: 1.18rem;
  box-shadow: 0 14px 28px rgba(255, 47, 99, 0.32);
  z-index: 2;
}

.btn-no {
  position: absolute;
  top: 20px;
  left: 20px;
  min-width: 92px;
  padding: 0.65rem 0.95rem;
  color: #8d3658;
  background: linear-gradient(135deg, var(--no-a), var(--no-b));
  font-size: 0.92rem;
  box-shadow: 0 8px 18px rgba(181, 82, 124, 0.2);
  z-index: 3;
  transition: left 0.24s ease-in-out, top 0.24s ease-in-out;
}

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

.floating-heart {
  position: absolute;
  color: rgba(255, 95, 137, 0.34);
  font-size: clamp(0.9rem, 2vw, 1.5rem);
  animation: floatBase 12s linear infinite;
}

.h1 { left: 10%; animation-duration: 11.2s; animation-delay: -1.3s; }
.h2 { left: 23%; animation-duration: 13.8s; animation-delay: -4.6s; }
.h3 { left: 38%; animation-duration: 12.3s; animation-delay: -2.4s; }
.h4 { left: 58%; animation-duration: 10.7s; animation-delay: -5.2s; }
.h5 { left: 76%; animation-duration: 14.1s; animation-delay: -1.1s; }
.h6 { left: 90%; animation-duration: 11.8s; animation-delay: -3.7s; }

.post-scene {
  position: absolute;
  inset: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  grid-auto-rows: min-content;
  row-gap: 0.2rem;
  text-align: center;
  padding: 1.5rem 1.2rem 7rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease-in-out;
  z-index: 10;
}

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

.post-copy {
  display: grid;
  justify-items: center;
  row-gap: 0.2rem;
  width: min(920px, 92vw);
}

.post-scene.secret-open {
  padding-bottom: 1.5rem;
}

.post-scene.secret-open .post-copy {
  position: absolute;
  left: 50%;
  top: calc(var(--secret-top, 72vh) / 2);
  transform: translate(-50%, -50%);
}

.post-title,
.post-sub,
.post-emotional,
.post-final {
  margin: 0.35rem 0;
  color: #ffeaf1;
  text-shadow: 0 0 26px rgba(255, 134, 173, 0.35);
}

.post-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.2rem, 5.2vw, 4rem);
}

.post-sub {
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: #ffd5e3;
}

.post-emotional,
.post-final {
  font-size: clamp(1rem, 2.1vw, 1.3rem);
}

.reveal-step {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s ease-in-out, transform 0.7s ease-in-out;
}

.reveal-step.show {
  opacity: 1;
  transform: translateY(0);
}

.instruction-bubble,
.secret-note {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 220, 232, 0.3);
  color: #fff2f7;
  backdrop-filter: blur(4px);
  padding: 0.62rem 0.9rem;
  font-size: 0.92rem;
}

.instruction-bubble {
  top: 10%;
}

.secret-note {
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  width: min(560px, 92vw);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-in-out;
}

.secret-note.revealed {
  opacity: 1;
}

.secret-carousel {
  width: min(560px, 100%);
  margin: 0 auto 0.55rem;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 226, 238, 0.25);
}

.secret-track {
  display: flex;
  width: max-content;
  gap: 0.55rem;
  padding: 0.15rem 0.2rem;
  transition: none;
  will-change: transform;
}

.secret-track.marquee {
  animation-name: secretMarquee;
  animation-duration: var(--marquee-duration, 12000ms);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.secret-photo {
  flex: 0 0 auto;
  width: min(29vw, 168px);
  aspect-ratio: 3 / 4;
  max-height: 186px;
  object-fit: contain;
  object-position: center;
  background: rgba(22, 8, 15, 0.42);
  border-radius: 12px;
  border: 1px solid rgba(255, 231, 240, 0.45);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  animation: secretPulse 2.2s ease-in-out infinite;
}

.secret-photo:nth-child(2n) { animation-delay: 0.3s; }
.secret-photo:nth-child(3n) { animation-delay: 0.6s; }

.secret-caption {
  margin: 0;
  text-align: center;
  font-size: clamp(0.82rem, 1.8vw, 0.98rem);
  font-weight: 700;
  color: #fff4f8;
  letter-spacing: 0.02em;
}

.drift-heart-layer {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

.drift-heart {
  position: absolute;
  user-select: none;
  touch-action: none;
  pointer-events: auto;
  cursor: grab;
  line-height: 1;
  opacity: 0.42;
  transition: transform 0.12s ease-out;
}

.drift-heart.dragging {
  opacity: 0.88;
  filter: drop-shadow(0 0 14px rgba(255, 188, 214, 0.95));
  animation: heartShine 0.95s ease-in-out infinite alternate;
}

.drift-heart.special.popped {
  animation: heartPop 0.4s ease-out forwards;
}

#fxCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 20;
  pointer-events: none;
}

@keyframes floatBase {
  0% { transform: translateY(110vh) scale(0.7); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-25vh) scale(1.12); opacity: 0; }
}

@keyframes grainMove {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1%); }
  66% { transform: translate(2%, -1%); }
  100% { transform: translate(0, 0); }
}

@keyframes heartPop {
  0% { transform: scale(1); opacity: 0.75; }
  100% { transform: scale(1.8); opacity: 0; }
}

@keyframes heartShine {
  0% {
    filter: drop-shadow(0 0 8px rgba(255, 182, 209, 0.7));
  }
  100% {
    filter: drop-shadow(0 0 16px rgba(255, 205, 224, 1));
  }
}

@keyframes secretPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes secretMarquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-1 * var(--marquee-distance, 240px)));
  }
}

@media (max-width: 840px) {
  .card {
    min-height: 430px;
    border-radius: 22px;
    padding: 2rem 1.15rem;
  }

  .play-area {
    height: 238px;
  }

  .btn-yes {
    min-width: 160px;
    font-size: 1.04rem;
  }

  .post-scene {
    padding: 1rem;
  }
}

@media (max-width: 640px) {
  .music-prompt {
    top: 0.55rem;
    right: 0.55rem;
    font-size: 0.74rem;
    padding: 0.42rem 0.72rem;
  }

  .page-wrap {
    padding: max(0.75rem, env(safe-area-inset-top)) 0.72rem max(0.88rem, env(safe-area-inset-bottom));
  }

  .card {
    min-height: 405px;
    padding: 1.75rem 0.9rem;
  }

  .headline {
    font-size: clamp(1.7rem, 7.8vw, 2.45rem);
  }

  .play-area {
    height: 220px;
  }

  .btn-yes {
    min-width: 145px;
    padding: 0.82rem 1.5rem;
    font-size: 0.96rem;
    bottom: 16px;
  }

  .btn-no {
    min-width: 82px;
    font-size: 0.8rem;
    padding: 0.55rem 0.72rem;
  }

  .post-title {
    font-size: clamp(1.72rem, 9.2vw, 2.45rem);
  }

  .post-sub,
  .post-emotional,
  .post-final {
    font-size: clamp(0.92rem, 4.3vw, 1.06rem);
  }

  .post-scene {
    padding: 1rem 0.9rem 6.2rem;
  }

  .instruction-bubble {
    top: 8%;
    font-size: 0.82rem;
  }

  .secret-carousel {
    width: 100%;
    max-width: 100%;
  }

  .secret-note {
    width: min(92vw, 400px);
    padding: 0.5rem 0.58rem;
    bottom: calc(max(0.9rem, env(safe-area-inset-bottom)) + 3.2rem);
    left: 50%;
    transform: translateX(-50%);
  }

  .secret-track {
    gap: 0.38rem;
    padding: 0.08rem;
  }

  .secret-photo {
    width: min(34vw, 112px);
    max-height: 152px;
    border-radius: 10px;
  }

  .secret-caption {
    font-size: clamp(0.74rem, 3.4vw, 0.9rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .grain,
  .bg-hearts {
    opacity: 0.25;
  }
}
