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

:root {
  --cream: #fffdf0;
  --paper: rgba(255, 255, 255, 0.83);
  --yellow: #ffd83d;
  --yellow-soft: #fff19a;
  --yellow-deep: #f3b51b;
  --brown: #5b472f;
  --green: #728f55;
  --pink: #f6b8b8;
  --shadow: 0 18px 45px rgba(113, 87, 25, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Quicksand", system-ui, sans-serif;
  color: var(--brown);
  background:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,.95) 0 5%, transparent 5.5%),
    radial-gradient(circle at 88% 14%, rgba(255,255,255,.8) 0 4%, transparent 4.5%),
    linear-gradient(155deg, #fff8bf 0%, #fffde7 48%, #fff2a5 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  filter: blur(15px);
  opacity: .35;
  z-index: -2;
}

body::before {
  background: #ffd83d;
  top: -90px;
  right: -70px;
}

body::after {
  background: #fbd1d1;
  bottom: -110px;
  left: -70px;
}

.page-shell {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.view {
  display: none;
  animation: fadeIn .38s ease;
}

.view.active {
  display: block;
}

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

.note-card,
.surprise-card {
  position: relative;
  background: var(--paper);
  border: 2px solid rgba(255, 211, 54, .58);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.note-card {
  max-width: 820px;
  margin: 0 auto;
  padding: 30px 34px 28px;
  transform: rotate(-0.3deg);
}

.note-card::before {
  content: "♡";
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 32px;
  color: #efb2b2;
  transform: rotate(10deg);
}

.tiny-label {
  font-family: "Patrick Hand", cursive;
  text-transform: lowercase;
  letter-spacing: .04em;
  font-size: 1.05rem;
  color: #9c7a2a;
}

h1,
h2 {
  font-family: "Patrick Hand", cursive;
  font-weight: 400;
  margin: 7px 0 12px;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.35rem, 6vw, 4.45rem);
  color: #d79d00;
  text-align: center;
}

h2 {
  font-size: clamp(2rem, 5vw, 3.3rem);
  color: #d79d00;
}

.note-card p {
  margin: 0;
  font-size: clamp(.98rem, 2vw, 1.08rem);
  line-height: 1.8;
  text-align: center;
}

.signature {
  margin-top: 16px;
  text-align: right;
  font-family: "Patrick Hand", cursive;
  font-size: 1.25rem;
  color: #be8d10;
}

.instruction {
  text-align: center;
  font-family: "Patrick Hand", cursive;
  font-size: 1.5rem;
  margin: 28px 0 12px;
}

.flower-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 820px;
  margin: 0 auto;
}

.flower-card {
  appearance: none;
  border: 0;
  background: rgba(255,255,255,.56);
  border-radius: 26px;
  min-height: 205px;
  padding: 20px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(102, 80, 24, .11);
  border: 1.5px dashed rgba(207, 158, 26, .45);
  display: grid;
  place-items: center;
  gap: 8px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.flower-card:hover {
  transform: translateY(-5px) rotate(-1deg);
  box-shadow: 0 16px 35px rgba(102, 80, 24, .16);
  background: rgba(255,255,255,.76);
}

.flower-card:active {
  transform: translateY(0) scale(.98);
}

.flower-card:nth-child(even):hover {
  transform: translateY(-5px) rotate(1deg);
}

.flower {
  position: relative;
  width: 124px;
  height: 124px;
  display: block;
  animation: sway 3.6s ease-in-out infinite;
}

.flower-2 { animation-delay: -.5s; transform: scale(.95) rotate(6deg); }
.flower-3 { animation-delay: -1.1s; transform: scale(1.03) rotate(-4deg); }
.flower-4 { animation-delay: -.8s; transform: scale(.98) rotate(4deg); }
.flower-5 { animation-delay: -1.6s; transform: scale(1.02) rotate(-5deg); }
.flower-6 { animation-delay: -.25s; transform: scale(.96) rotate(3deg); }

@keyframes sway {
  0%,100% { translate: 0 0; }
  50% { translate: 0 -4px; }
}

.petal {
  position: absolute;
  width: 43px;
  height: 67px;
  left: 50%;
  top: 50%;
  margin-left: -21.5px;
  margin-top: -56px;
  background: linear-gradient(180deg, #fff375 0%, #ffd62d 70%, #ffc91f 100%);
  border-radius: 60% 60% 52% 52%;
  transform-origin: 50% 56px;
  box-shadow: inset 0 -5px 9px rgba(184, 126, 0, .08);
  border: 1px solid rgba(228, 171, 0, .22);
}

.p1 { transform: rotate(0deg); }
.p2 { transform: rotate(45deg); }
.p3 { transform: rotate(90deg); }
.p4 { transform: rotate(135deg); }
.p5 { transform: rotate(180deg); }
.p6 { transform: rotate(225deg); }
.p7 { transform: rotate(270deg); }
.p8 { transform: rotate(315deg); }

 .center {
  position: absolute;
  width: 52px;
  height: 52px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 20% 25%, rgba(255,255,255,.22) 0 10%, transparent 11%),
    radial-gradient(circle at 30% 36%, #f3cf8a 0 4%, transparent 5%),
    radial-gradient(circle at 46% 24%, #e7b86a 0 3.5%, transparent 4.5%),
    radial-gradient(circle at 62% 34%, #f0cc83 0 4%, transparent 5%),
    radial-gradient(circle at 72% 24%, #dca55f 0 3.5%, transparent 4.5%),
    radial-gradient(circle at 28% 58%, #f3cf8a 0 4%, transparent 5%),
    radial-gradient(circle at 50% 50%, #e2b671 0 4%, transparent 5%),
    radial-gradient(circle at 68% 58%, #efca80 0 4%, transparent 5%),
    radial-gradient(circle at 38% 74%, #dca55f 0 3.5%, transparent 4.5%),
    radial-gradient(circle at 60% 74%, #f0cc83 0 4%, transparent 5%),
    linear-gradient(180deg, #5e3415 0%, #4b2810 60%, #3e1f0d 100%);
  box-shadow:
    inset 0 6px 10px rgba(255,255,255,.14),
    inset 0 -6px 10px rgba(0,0,0,.16),
    0 3px 0 rgba(69,39,12,.12);
  border: 1px solid rgba(73, 38, 14, .28);
}

.flower-number {
  font-family: "Patrick Hand", cursive;
  font-size: 1.45rem;
  color: #a97a0f;
}

.footer-note {
  max-width: 820px;
  margin: 22px auto 0;
  text-align: center;
  font-family: "Patrick Hand", cursive;
  font-size: 1.08rem;
  opacity: .78;
}

.back-button {
  border: 0;
  background: rgba(255,255,255,.7);
  color: var(--brown);
  border-radius: 999px;
  padding: 11px 17px;
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(93, 68, 16, .10);
  margin: 0 0 16px 2px;
}

.back-button:hover {
  background: white;
  transform: translateY(-1px);
}

.surprise-card {
  min-height: 72vh;
  padding: clamp(24px, 5vw, 48px);
  display: grid;
  place-items: center;
}

.surprise-content {
  width: min(830px, 100%);
  text-align: center;
}

.hidden {
  display: none !important;
}

.video-frame {
  width: min(790px, 100%);
  margin: 18px auto 0;
  aspect-ratio: 16 / 9;
  background: #2f291d;
  border: 10px solid white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(77, 55, 12, .18);
  overflow: hidden;
  transform: rotate(.25deg);
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.small-love-note,
.photo-subtitle {
  font-family: "Patrick Hand", cursive;
}

.small-love-note {
  margin-top: 18px;
  font-size: 1.4rem;
  color: #c68f0e;
}

.photo-subtitle {
  margin: -5px 0 24px;
  font-size: 1.2rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.photo-polaroid {
  margin: 0;
  background: #fff;
  padding: 12px 12px 16px;
  border-radius: 8px;
  box-shadow: 0 15px 32px rgba(82, 59, 11, .18);
}

.photo-left {
  transform: rotate(-2.2deg);
}

.photo-right {
  transform: rotate(2deg);
  margin-top: 18px;
}

.photo-video {
  transform: rotate(.4deg);
  margin-top: 7px;
}

.video-photo-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #2f291d;
}

.photo-wrap {
  background: #f5f0d6;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 3px;
  position: relative;
}

.photo-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.photo-wrap img:not([src]),
.photo-wrap img[src=""] {
  display: none;
}

.photo-polaroid figcaption {
  font-family: "Patrick Hand", cursive;
  font-size: 1.55rem;
  margin-top: 8px;
  color: #9d7417;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 18px, 1080px);
    padding-top: 16px;
  }

  .note-card {
    padding: 24px 20px 22px;
    border-radius: 22px;
  }

  .flower-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .flower-card {
    min-height: 170px;
    padding: 12px;
  }

  .flower {
    width: 105px;
    height: 105px;
    transform: scale(.86);
  }

  .surprise-card {
    border-radius: 22px;
    min-height: 76vh;
  }

  .video-frame {
    border-width: 7px;
    border-radius: 15px;
  }

  .photo-grid {
    grid-template-columns: 1fr;
    max-width: 430px;
    margin: 0 auto;
  }

  .photo-video,
  .photo-right {
    margin-top: 0;
  }
}

@media (max-width: 430px) {
  .flower-card {
    min-height: 154px;
  }

  .flower {
    transform: scale(.77);
  }

  .note-card p {
    line-height: 1.68;
  }
}


.embed-help {
  max-width: 680px;
  margin: 16px auto 10px;
  font-size: .98rem;
  line-height: 1.55;
  color: #786442;
  opacity: .92;
}

.youtube-link {
  display: inline-block;
  margin-top: 4px;
  background: rgba(255,255,255,.92);
  border: 1.5px dashed rgba(126, 89, 33, .35);
  color: #6d4b18;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(77, 55, 12, .08);
}

.youtube-link:hover {
  background: #fff;
  transform: translateY(-1px);
}

.center {
  position: absolute;
  width: 52px;
  height: 52px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 20% 25%, rgba(255,255,255,.22) 0 10%, transparent 11%),
    radial-gradient(circle at 30% 36%, #f3cf8a 0 4%, transparent 5%),
    radial-gradient(circle at 46% 24%, #e7b86a 0 3.5%, transparent 4.5%),
    radial-gradient(circle at 62% 34%, #f0cc83 0 4%, transparent 5%),
    radial-gradient(circle at 72% 24%, #dca55f 0 3.5%, transparent 4.5%),
    radial-gradient(circle at 28% 58%, #f3cf8a 0 4%, transparent 5%),
    radial-gradient(circle at 50% 50%, #e2b671 0 4%, transparent 5%),
    radial-gradient(circle at 68% 58%, #efca80 0 4%, transparent 5%),
    radial-gradient(circle at 38% 74%, #dca55f 0 3.5%, transparent 4.5%),
    radial-gradient(circle at 60% 74%, #f0cc83 0 4%, transparent 5%),
    linear-gradient(180deg, #5e3415 0%, #4b2810 60%, #3e1f0d 100%);
  box-shadow:
    inset 0 6px 10px rgba(255,255,255,.14),
    inset 0 -6px 10px rgba(0,0,0,.16),
    0 3px 0 rgba(69,39,12,.12);
  border: 1px solid rgba(73, 38, 14, .28);
}
