:root {
  --paper: #f8f0e6;
  --ink: #2e2324;
  --wine: #632d42;
  --rose: #c6657b;
  --muted: #7e6c67;
  --serif: "Italiana", Didot, Georgia, serif;
  --script: "Nanum Pen Script", "Bradley Hand", cursive;
  --sans: "DM Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
}

body {
  color: var(--ink);
  font-family: var(--sans);
}

button {
  color: inherit;
  font: inherit;
}

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
}

.stage::before,
.stage::after {
  content: "";
  position: absolute;
  z-index: -2;
  width: 52vw;
  height: 52vw;
  border: 1px solid rgba(99, 45, 66, 0.09);
  border-radius: 50%;
}

.stage::before {
  top: -34vw;
  left: -26vw;
}

.stage::after {
  right: -25vw;
  bottom: -36vw;
}

.grain {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0.06;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
}

.surprise {
  position: absolute;
  z-index: 0;
  inset: 20px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(99, 45, 66, 0.19);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 43%),
    var(--paper);
}

.fine-line {
  position: absolute;
  top: 63px;
  left: 50%;
  width: 42px;
  height: 1px;
  background: var(--wine);
  transform: translateX(-50%);
}

.dedication,
.signature {
  position: absolute;
  z-index: 3;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.dedication {
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.signature {
  right: 33px;
  bottom: 28px;
  font-family: var(--script);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  transform: rotate(-4deg);
}

.signature span {
  color: var(--rose);
}

.message {
  position: relative;
  z-index: 4;
  width: min(720px, 56vw);
  padding: 50px 32px;
  text-align: center;
}

.message__tiny {
  margin: 0 0 26px;
  color: var(--wine);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.message h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(62px, 7.2vw, 112px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.84;
}

.message h1 em {
  display: block;
  margin-top: 10px;
  color: var(--wine);
  font-family: var(--script);
  font-size: 0.92em;
  font-weight: 400;
  letter-spacing: -0.025em;
  transform: rotate(-2deg);
}

.message__love {
  max-width: 390px;
  margin: 30px auto 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(16px, 1.5vw, 21px);
  line-height: 1.5;
}

.message__sparkle {
  position: absolute;
  top: 8px;
  left: 50%;
  color: #c99b43;
  font-size: 18px;
  transform: translateX(-50%);
}

.message__heart {
  display: block;
  width: 46px;
  height: 46px;
  margin: 12px auto 0;
  color: var(--rose);
  font-size: 30px;
  line-height: 46px;
  transition: color 0.2s, transform 0.2s;
}

.message__heart.is-hovered {
  color: var(--wine);
  transform: scale(1.12);
}

.message__heart.is-bursting {
  animation: heart-pop 0.48s cubic-bezier(0.2, 0.9, 0.25, 1);
}

@keyframes heart-pop {
  0% { transform: scale(1); }
  38% { transform: scale(1.5) rotate(-8deg); }
  70% { transform: scale(0.82) rotate(5deg); }
  100% { transform: scale(1); }
}

.heart-hit-target {
  position: absolute;
  z-index: 5;
  width: 70px;
  height: 70px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.heart-hit-target:focus-visible {
  outline: 1px solid rgba(99, 45, 66, 0.42);
  outline-offset: -8px;
}

.photo {
  position: absolute;
  z-index: 2;
  width: clamp(135px, 16vw, 245px);
  margin: 0;
  padding: 9px 9px 32px;
  background: #fffdf9;
  box-shadow: 0 22px 50px rgba(66, 38, 42, 0.18);
}

.photo::after {
  content: "♡";
  position: absolute;
  right: 14px;
  bottom: 4px;
  color: var(--rose);
  font-family: var(--script);
  font-size: 22px;
}

.photo__image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: linear-gradient(145deg, #e7c6bd, #c78a92 56%, #865169);
}

.photo img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo.is-missing img {
  display: none;
}

.photo__placeholder {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  align-content: center;
  color: rgba(255, 250, 246, 0.86);
  font-family: var(--script);
  font-size: clamp(23px, 2.4vw, 35px);
  line-height: 0.75;
  text-align: center;
}

.photo__placeholder small {
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.photo figcaption {
  position: absolute;
  right: 12px;
  bottom: 7px;
  left: 12px;
  color: var(--wine);
  font-family: var(--script);
  font-size: 16px;
  line-height: 0.9;
  text-align: center;
}

.photo--one {
  top: 11%;
  left: 9%;
  width: clamp(125px, 12vw, 180px);
  transform: rotate(-8deg);
}

.photo--one .photo__image {
  aspect-ratio: 1;
}

.photo--two {
  top: 10%;
  right: 9%;
  width: clamp(135px, 14vw, 220px);
  padding-bottom: 52px;
  transform: rotate(7deg);
}

.photo--two figcaption {
  font-size: 13px;
  line-height: 0.9;
}

.photo--three {
  bottom: 8%;
  left: 10%;
  width: clamp(200px, 19vw, 280px);
  padding-bottom: 48px;
  transform: rotate(-4deg);
}

.photo--three::after {
  display: none;
}

.photo--three .photo__image {
  aspect-ratio: 3 / 2;
}

.photo--four {
  right: 10%;
  bottom: 9%;
  width: clamp(210px, 20vw, 300px);
  transform: rotate(4deg);
}

.photo--four .photo__image {
  aspect-ratio: 16 / 9;
}

#flower-wall {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: none;
}

.reset-flowers {
  position: absolute;
  z-index: 5;
  bottom: 26px;
  left: 30px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  color: var(--wine);
  border: 1px solid rgba(99, 45, 66, 0.3);
  border-radius: 50%;
  background: rgba(248, 240, 230, 0.86);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  transform: translateY(8px);
  transition: opacity 0.4s, transform 0.4s, background 0.2s;
}

.reset-flowers.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.reset-flowers:hover,
.reset-flowers:focus-visible {
  background: #fffaf4;
}

.reset-flowers span {
  font-size: 22px;
  line-height: 1;
}

.mini-game {
  position: absolute;
  z-index: 1;
  bottom: 18px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(760px, calc(100% - 190px));
  min-height: 54px;
  padding: 9px 10px 9px 18px;
  color: var(--muted);
  border: 1px solid rgba(99, 45, 66, 0.2);
  border-radius: 40px;
  background: rgba(248, 240, 230, 0.9);
  box-shadow: 0 12px 30px rgba(66, 38, 42, 0.12);
  backdrop-filter: blur(9px);
  transform: translateX(-50%);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.mini-game.is-playing {
  border-color: rgba(198, 101, 123, 0.55);
  box-shadow: 0 12px 34px rgba(99, 45, 66, 0.18);
}

.mini-game p {
  margin: 0;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.35;
}

.mini-game__controls {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
}

.mini-game__timer {
  min-width: 54px;
  color: var(--wine);
  font-family: var(--sans);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: right;
}

.mini-game.is-finished .mini-game__timer {
  color: var(--rose);
}

.mini-game__play {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #fffaf5;
  border: 0;
  border-radius: 50%;
  background: var(--wine);
  transition: background 0.2s, transform 0.2s;
}

.mini-game__play.is-hovered {
  background: var(--rose);
  transform: scale(1.08);
}

.mini-game__play span {
  margin-left: 2px;
  font-size: 12px;
}

.game-hit-target {
  position: absolute;
  z-index: 5;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.game-hit-target:focus-visible {
  outline: 1px solid rgba(99, 45, 66, 0.5);
  outline-offset: 3px;
}

.custom-cursor {
  position: fixed;
  z-index: 6;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s, width 0.2s, height 0.2s;
}

.custom-cursor.is-visible {
  opacity: 1;
}

.custom-cursor i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
}

@media (max-width: 760px) {
  .surprise {
    inset: 10px;
  }

  .fine-line {
    top: 43px;
  }

  .dedication {
    top: 60px;
  }

  .message {
    width: calc(100% - 34px);
    padding: 40px 5px;
  }

  .message__tiny {
    margin-bottom: 20px;
    font-size: 7px;
  }

  .message h1 {
    font-size: clamp(54px, 17vw, 82px);
  }

  .message h1 em {
    font-size: 0.86em;
  }

  .message__love {
    max-width: 280px;
    margin-top: 22px;
    font-size: 16px;
  }

  .photo {
    width: 128px;
    padding: 6px 6px 24px;
  }

  .photo--one {
    top: 10%;
    left: -10px;
    width: 116px;
  }

  .photo--two {
    top: 10%;
    right: -10px;
    width: 112px;
    padding-bottom: 42px;
  }

  .photo--two figcaption {
    right: 7px;
    bottom: 6px;
    left: 7px;
    font-size: 10px;
    line-height: 0.9;
  }

  .photo--three {
    bottom: 8%;
    left: -12px;
    width: 172px;
    padding-bottom: 41px;
  }

  .photo--three figcaption {
    right: 7px;
    bottom: 6px;
    left: 7px;
    font-size: 11px;
    line-height: 0.9;
  }

  .photo--four {
    right: -14px;
    bottom: 9%;
    width: 176px;
  }

  .photo__placeholder {
    font-size: 24px;
  }

  .signature {
    right: 20px;
    bottom: 18px;
  }

  .reset-flowers {
    bottom: 84px;
    left: 18px;
  }

  .mini-game {
    bottom: 10px;
    gap: 9px;
    width: calc(100% - 20px);
    min-height: 58px;
    padding: 8px 8px 8px 14px;
    border-radius: 22px;
  }

  .mini-game p {
    font-size: 9px;
    line-height: 1.3;
  }

  .mini-game__controls {
    gap: 7px;
  }

  .mini-game__timer {
    min-width: 40px;
    font-size: 9px;
  }

  .mini-game__play {
    width: 36px;
    height: 36px;
  }

  .custom-cursor {
    display: none;
  }
}

@media (max-height: 680px) and (min-width: 761px) {
  .fine-line { top: 35px; }
  .dedication { top: 51px; }
  .message { transform: scale(0.88); }
  .photo { width: 165px; }
  .photo--one { width: 125px; }
  .photo--three { width: 215px; }
  .photo--four { width: 225px; }
}
