* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --pink: #ff4f87;
  --dark-pink: #e92e6c;
  --light-pink: #fff0f6;
  --rose: #ff9fbd;
  --red: #e8275e;
  --text: #5a2037;
}

html, body {
  width: 100%;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.85), transparent 28%),
    radial-gradient(circle at 85% 75%, rgba(255,184,207,.5), transparent 30%),
    linear-gradient(135deg, #ffe8f0, #fff7fa 48%, #ffdce8);
}

body.lightbox-open {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  background-image:
    radial-gradient(circle, rgba(255,79,135,.18) 1px, transparent 1px);
  background-size: 24px 24px;
}

.screen {
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
  display: none;
  position: relative;
  padding: clamp(32px, 6vw, 70px) max(18px, env(safe-area-inset-right)) clamp(32px, 6vw, 70px) max(18px, env(safe-area-inset-left));
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.screen.active {
  display: flex;
  animation: screenIn .8s ease both;
}

@keyframes screenIn {
  from { opacity: 0; transform: scale(.98); }
  to { opacity: 1; transform: scale(1); }
}

h1, h2 {
  color: #8f214d;
  line-height: 1.15;
  font-family: "Baloo 2", "Comic Sans MS", cursive;
  font-weight: 500;
}

h1 { font-size: clamp(2.2rem, 6vw, 5rem); }
h2 { font-size: 55px }

p {
  line-height: 1.8;
  font-size: 1.05rem;
}

.tiny {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: .75rem;
  font-weight: bold;
  color: #c84c73;
}

.subtitle {
  margin: 20px auto 28px;
  max-width: 600px;
}

/* Keep the opening message deliberately stacked, never as one long line. */
#intro {
  padding-inline: 20px;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  isolation: isolate;
}

#intro > * {
  position: relative;
  z-index: 1;
}

/* Her photo stays on the right, softened by a pink overlay for readable text. */
#intro::before {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: min(46%, 720px);
  z-index: 0;
  background:
    linear-gradient(90deg, #fff5f9 0%, rgba(255, 231, 241, .82) 26%, rgba(255, 157, 193, .42) 100%),
    url("assets/images/bg.jpeg") center 48% / cover no-repeat;
  border-radius: 42% 0 0 42%;
  box-shadow: -32px 0 60px rgba(255, 230, 240, .8);
}

#intro h1 {
  font-weight: 500;
  margin-inline: auto;
  text-wrap: balance;
}

#intro .teddy {
  margin-bottom: 12px;
}

#intro .tiny {
  margin-bottom: 12px;
}

/* The original single start button is replaced by the Yes / No choice. */
#intro > .main-btn {
  display: none;
}

.intro-choices {
  min-height: auto;
  margin-top: 10px;
}

.teddy, .big-teddy, .final-teddy {
  font-size: clamp(5rem, 13vw, 9rem);
  filter: drop-shadow(0 18px 18px rgba(168,37,86,.22));
  animation: teddyFloat 3s ease-in-out infinite;
}

.mini-teddy, .floating-teddy {
  font-size: 4rem;
  animation: teddyFloat 2.7s ease-in-out infinite;
}

@keyframes teddyFloat {
  0%,100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-14px) rotate(2deg); }
}

.main-btn, .yes-btn {
  border: 0;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, #ff4f87, #e72662);
  padding: 15px 27px;
  border-radius: 999px;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: .3px;
  box-shadow: 0 14px 30px rgba(232,39,94,.28);
  transition: .25s ease;
  position: relative;
  z-index: 5;
  min-height: 48px;
  touch-action: manipulation;
}

.main-btn:hover, .yes-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 18px 38px rgba(232,39,94,.36);
}

.glass {
  width: min(850px, 100%);
  padding: clamp(28px, 6vw, 60px);
  border: 1px solid rgba(255,255,255,.8);
  background: rgba(255,255,255,.66);
  backdrop-filter: blur(18px);
  border-radius: 35px;
  box-shadow: 0 30px 80px rgba(142,34,74,.15);
}

.card p {
  font-size: 23px;
  margin: 17px auto;
}

.card .main-btn {
  margin-top: 20px;
}

.question-card {
  position: relative;
}

.question-card h2 {
  margin: 12px 0;
}

.choice-area {
  min-height: 130px;
  margin-top: 25px;
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: center;
  position: relative;
}

.no-btn {
  border: 2px solid #ff8eaf;
  background: #fff;
  color: #cf3b69;
  padding: 13px 25px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, font-size .2s ease, opacity .2s ease;
  z-index: 10;
  min-height: 48px;
  touch-action: manipulation;
}

.no-btn.running {
  position: fixed;
}

.letter-wrap {
  width: min(850px, 100%);
}

.envelope {
  width: min(430px, 88vw);
  height: 280px;
  margin: 0 auto 20px;
  position: relative;
  cursor: pointer;
  perspective: 900px;
  filter: drop-shadow(0 25px 25px rgba(131,28,65,.2));
}

.env-front {
  position: absolute;
  inset: 0;
  background: #ff719d;
  border-radius: 14px;
  z-index: 3;
  clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%);
}

.env-flap {
  position: absolute;
  inset: 0 0 auto;
  height: 60%;
  background: #ff8fb2;
  clip-path: polygon(0 0, 100% 0, 50% 75%);
  transform-origin: top;
  transition: 1s ease;
  z-index: 4;
}

.env-paper {
  position: absolute;
  inset: 18px;
  background: #fffafc;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 3rem;
  z-index: 1;
}

.envelope.opened .env-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

.letter {
  display: none;
  background: #fffafc;
  padding: clamp(30px, 6vw, 55px);
  border-radius: 20px;
  text-align: left;
  box-shadow: 0 25px 80px rgba(126,28,63,.18);
  border: 1px solid #ffd2df;
}

.letter.show {
  display: block;
  animation: paperUp .8s ease both;
}

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

.letter h2 {
  margin-bottom: 20px;
}

.letter p {
  margin: 15px 0;
}

.signature {
  text-align: right;
  margin-top: 28px !important;
}

.letter .main-btn {
  display: block;
  margin: 30px auto 0;
}

.section-head {
  margin-bottom: 30px;
}

/* Memories flow vertically: heading, photo grid, then the next button. */
#memories {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

#memories .section-head {
  width: 100%;
  margin-bottom: 30px;
}

#memories > .main-btn {
  margin-top: 4px;
}

.section-head span {
  font-size: 2rem;
}

.memory-wall {
  width: min(1700px, 100%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-bottom: 35px;
}

.memory {
  background: #fff;
  padding: 9px 9px 18px;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(115,30,61,.16);
  transform: rotate(var(--r));
  transition: .3s ease;
  position: relative;
  cursor: zoom-in;
}

.memory::before {
  content: "";
  width: 55px;
  height: 14px;
  background: rgba(255,182,205,.75);
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  z-index: 2;
}

.memory:hover {
  transform: translateY(-8px) rotate(0deg) scale(1.04);
  z-index: 4;
}

.memory:focus-visible {
  outline: 3px solid #ff4f87;
  outline-offset: 5px;
}

.memory img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.memory span {
  display: block;
  padding-top: 9px;
  font-family: cursive;
  color: #8f214d;
}

.memory-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(58, 12, 34, .78);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.memory-lightbox.show {
  opacity: 1;
  visibility: visible;
}

.lightbox-image {
  display: block;
  max-width: min(92vw, 850px);
  max-height: 86svh;
  border: 8px solid #fff;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
  object-fit: contain;
}

.lightbox-close {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  color: #8f214d;
  background: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.proposal-card {
  max-width: 750px;
}

.proposal-card > p {
  max-width: 620px;
  margin: 18px auto;
}

.shayari {
  max-width: 650px;
  margin: 24px auto 4px;
  padding: 18px 22px;
  color: #8f214d;
  background: rgba(255, 240, 246, .72);
  border: 1px solid rgba(255, 174, 204, .7);
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(151, 36, 78, .08);
}

.shayari p {
  margin: 0;
  font-family: "Baloo 2", cursive;
  font-size: 1.08rem;
  line-height: 1.65;
}

.shayari p + p {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed #f3a1bc;
}

.proposal-buttons {
  min-height: 180px;
}

.promise-card {
  width: min(850px, 100%);
  padding: clamp(30px, 6vw, 60px);
  background:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,.85), transparent 25%),
    linear-gradient(145deg, #fff1f6, #ffd9e7);
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 40px;
  box-shadow: 0 30px 80px rgba(130,31,67,.2);
}

.promise-card p {
  max-width: 650px;
  margin: 18px auto;
}

.promise-line {
  margin: 30px auto;
  max-width: 650px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(255,255,255,.65);
  font-size: 1.25rem;
  font-weight: 800;
  color: #a32252;
}

.video-card video {
  width: min(390px, 100%);
  height: auto;
  max-height: 72svh;
  margin: 25px auto;
  display: block;
  border-radius: 20px;
  background: #2d1720;
  box-shadow: 0 20px 55px rgba(91,22,47,.2);
  aspect-ratio: auto;
  object-fit: contain;
}

.video-card.video-complete > .video-heart,
.video-card.video-complete > h2,
.video-card.video-complete > p,
.video-card.video-complete > video {
  display: none;
}

.video-love {
  display: none;
  margin: 8px auto 26px;
  color: #9c1c50;
  font-family: "Baloo 2", "Comic Sans MS", cursive;
  text-align: center;
}

.video-love.show {
  display: grid;
  gap: 8px;
}

.video-love span {
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  font-weight: 800;
  line-height: 1;
  opacity: 0;
}

.video-love strong {
  color: #ef2f70;
  font-size: clamp(2.7rem, 8vw, 6.2rem);
  line-height: 1.05;
  text-shadow: 0 10px 24px rgba(231, 39, 98, .22);
  opacity: 0;
}

.video-love em {
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-style: normal;
  font-weight: 700;
  letter-spacing: .04em;
  opacity: 0;
}

.video-love.show span { animation: loveReveal .7s cubic-bezier(.2, .9, .25, 1.25) .1s both; }
.video-love.show strong { animation: loveReveal .8s cubic-bezier(.2, .9, .25, 1.25) .85s both; }
.video-love.show em { animation: loveReveal .7s cubic-bezier(.2, .9, .25, 1.25) 1.7s both; }

@keyframes loveReveal {
  from { opacity: 0; transform: translateY(24px) scale(.78); }
  70% { opacity: 1; transform: translateY(-4px) scale(1.04); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.video-heart {
  font-size: 4rem;
}

.final-card {
  max-width: 850px;
  padding: 35px;
  position: relative;
}

.final-card p {
  max-width: 650px;
  margin: 16px auto;
}

.final-card h2 {
  margin-top: 28px;
}

.forever {
  margin-top: 25px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #a01e50;
}

.heart-big {
  color: #ee326c;
  font-size: 7rem;
  line-height: 1;
  margin-top: 20px;
  animation: heartBeat 1.2s infinite;
}

@keyframes heartBeat {
  0%,100% { transform: scale(1); }
  20% { transform: scale(1.18); }
  35% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.sparkles {
  font-size: 2rem;
  letter-spacing: 15px;
  color: #ff5b91;
  animation: sparkle 2s infinite;
}

@keyframes sparkle {
  50% { opacity: .45; transform: scale(.92); }
}

.float-heart {
  position: fixed;
  bottom: -30px;
  pointer-events: none;
  z-index: 0;
  animation: floatHeart linear forwards;
}

@keyframes floatHeart {
  from { transform: translateY(0) rotate(0); opacity: 0; }
  15% { opacity: 1; }
  to { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

@media (max-width: 900px) {
  .memory-wall {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 650px) {
  .screen { padding: 32px 16px; align-items: flex-start; }
  #forgive, #proposal { align-items: center; }
  #intro { align-items: center; }
  #intro h1 {
    max-width: 13ch;
    font-size: clamp(2.35rem, 11vw, 3.6rem);
    line-height: 1.05;
  }
  .intro-choices { min-height: 112px; }
  #intro::before {
    width: 100%;
    border-radius: 0;
    background:
      linear-gradient(90deg, rgba(255, 246, 250, .93), rgba(255, 222, 236, .76)),
      url("assets/images/bg.jpeg") 70% center / cover no-repeat;
    box-shadow: none;
  }
  .teddy, .big-teddy, .final-teddy { font-size: clamp(4.8rem, 25vw, 7rem); }
  .mini-teddy, .floating-teddy { font-size: 3.4rem; }
  h2 { font-size: clamp(1.75rem, 8vw, 2.4rem); }
  p { font-size: .98rem; line-height: 1.7; }
  .glass, .promise-card { padding: 28px 20px; border-radius: 26px; }
  .choice-area { gap: 12px; min-height: 142px; flex-wrap: wrap; }
  .main-btn, .yes-btn, .no-btn { max-width: 100%; padding: 13px 20px; }
  .card p { margin: 14px auto; }
  .memory-wall {
    width: min(390px, 100%);
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .memory { padding: 10px 10px 18px; }
  .memory img { aspect-ratio: 4 / 5; }
  .memory-lightbox { padding: 16px; }
  .lightbox-image { max-width: 94vw; max-height: 82svh; border-width: 5px; }
  .memory span { font-size: .88rem; padding-top: 7px; }
  .memory:nth-child(3n) { display: block; }
  .envelope { width: min(360px, 92vw); height: min(58vw, 220px); }
  .letter { padding: 28px 20px; border-radius: 18px; }
  .letter p { margin: 13px 0; }
  .proposal-buttons { min-height: 155px; }
  .shayari { margin-top: 18px; padding: 16px; }
  .shayari p { font-size: .95rem; line-height: 1.55; }
  .promise-line { margin: 24px auto; padding: 17px; font-size: 1.08rem; }
  .video-card video { width: min(330px, 100%); max-height: 62svh; margin: 20px auto; border-radius: 14px; }
  .video-love { margin-bottom: 22px; }
  .video-love span { font-size: clamp(2rem, 10vw, 3rem); }
  .video-love strong { font-size: clamp(2.5rem, 13vw, 4rem); }
  .video-love em { font-size: 1.1rem; }
  .final-card { padding: 20px 4px; }
  .sparkles { font-size: 1.5rem; letter-spacing: 9px; }
  .heart-big { font-size: 5.5rem; }
}

@media (max-width: 390px) {
  .screen { padding-inline: 13px; }
  .glass, .promise-card { padding: 24px 16px; }
  .main-btn, .yes-btn, .no-btn { padding: 12px 16px; font-size: .84rem; }
  .choice-area { gap: 8px; }
  .envelope { height: 190px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
