@import url('https://fonts.googleapis.com/css2?family=Cormorant+Infant:wght@500;600;700&family=Great+Vibes&family=Noto+Sans+SC:wght@400;500;700;800&family=Noto+Serif+SC:wght@600;700;900&display=swap');

:root {
  --space-ink: #040611;
  --space-navy: #0b1430;
  --space-teal: #123d4b;
  --gift-red: #dc2626;
  --gift-crimson: #9f1239;
  --gift-pink: #ec4899;
  --rose: #ff7aa8;
  --rose-soft: #ffc3d7;
  --gold: #ffd77b;
  --gold-deep: #d97706;
  --cyan: #85e7ff;
  --paper: #fffaf0;
  --text: rgba(255, 255, 255, 0.94);
  --muted: rgba(255, 255, 255, 0.68);
  --glass: rgba(7, 10, 24, 0.54);
  --hairline: rgba(255, 255, 255, 0.16);
  --firework-palette: #ffd77b, #ff7aa8, #85e7ff, #fff6d6, #ffb86b;
  --firework-ambient-a: #ffd77b;
  --firework-ambient-b: #ff7aa8;
  --firework-opacity: 1;
  --final-firework-opacity: 0.86;
  --font-display: "Noto Serif SC", "Cormorant Infant", serif;
  --font-body: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-accent: "Cormorant Infant", "Noto Serif SC", serif;
}

html[data-variant="luxury"] {
  --space-ink: #040611;
  --space-navy: #0b1430;
  --gift-red: #dc2626;
  --gift-crimson: #9f1239;
  --gift-pink: #ec4899;
  --rose: #ff7aa8;
  --gold: #ffd77b;
  --cyan: #85e7ff;
  --firework-palette: #ffd77b, #ff7aa8, #85e7ff, #fff6d6, #ffb86b;
  --firework-ambient-a: #ffd77b;
  --firework-ambient-b: #ff7aa8;
  --final-firework-opacity: 0.86;
}

html[data-variant="sweet"] {
  --space-ink: #080510;
  --space-navy: #21122f;
  --gift-red: #f43f5e;
  --gift-crimson: #be185d;
  --gift-pink: #ff6fb1;
  --rose: #ff9bc9;
  --rose-soft: #ffe0ec;
  --gold: #ffe08a;
  --gold-deep: #f59e0b;
  --cyan: #b8f0ff;
  --paper: #fff7fb;
  --firework-palette: #ffe08a, #ff9bc9, #fbcfe8, #fff7d1, #b8f0ff;
  --firework-ambient-a: #ffe08a;
  --firework-ambient-b: #ff9bc9;
  --final-firework-opacity: 0.82;
}

html[data-variant="cinema"] {
  --space-ink: #01040c;
  --space-navy: #061225;
  --space-teal: #073749;
  --gift-red: #b91c1c;
  --gift-crimson: #7f1d1d;
  --gift-pink: #fb7185;
  --rose: #fda4af;
  --rose-soft: #fecdd3;
  --gold: #f6c76b;
  --gold-deep: #b7791f;
  --cyan: #70d7ff;
  --paper: #fff6e5;
  --firework-palette: #f6c76b, #70d7ff, #fff6d6, #fda4af, #9ae6ff;
  --firework-ambient-a: #f6c76b;
  --firework-ambient-b: #70d7ff;
  --final-firework-opacity: 0.72;
}

html[data-variant="letter"] {
  --space-ink: #05030a;
  --space-navy: #160819;
  --space-teal: #162a38;
  --gift-red: #e11d48;
  --gift-crimson: #9f1239;
  --gift-pink: #fb7185;
  --rose: #fda4af;
  --rose-soft: #ffe4ea;
  --gold: #f8d98c;
  --gold-deep: #b7791f;
  --cyan: #a7e7ff;
  --paper: #fff7ee;
  --firework-palette: #f8d98c, #fda4af, #fff2cf, #ffccd5, #a7e7ff;
  --firework-ambient-a: #f8d98c;
  --firework-ambient-b: #fda4af;
  --final-firework-opacity: 0.62;
}

html[data-variant="keepsake"] {
  --space-ink: #03040b;
  --space-navy: #0a1020;
  --space-teal: #102a34;
  --gift-red: #be123c;
  --gift-crimson: #881337;
  --gift-pink: #f472b6;
  --rose: #fb7185;
  --rose-soft: #ffe4e6;
  --gold: #f7d07a;
  --gold-deep: #a16207;
  --cyan: #8bd8ff;
  --paper: #fff4e8;
  --firework-palette: #f7d07a, #fb7185, #fff1c7, #8bd8ff, #ffd2dc;
  --firework-ambient-a: #f7d07a;
  --firework-ambient-b: #fb7185;
  --final-firework-opacity: 0.46;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--space-ink);
  color: var(--text);
  font-family: var(--font-body);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(133, 231, 255, 0.18), transparent 25%),
    radial-gradient(circle at 82% 20%, rgba(236, 72, 153, 0.18), transparent 24%),
    radial-gradient(circle at 50% 42%, rgba(220, 38, 38, 0.1), transparent 31%),
    radial-gradient(ellipse at 52% 92%, rgba(255, 215, 123, 0.14), transparent 34%),
    linear-gradient(150deg, #03050d 0%, #081029 48%, #17112b 100%);
  pointer-events: none;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid rgba(255, 215, 123, 0.92);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

noscript {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #050712;
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
}

.deep-space,
.aurora,
.stardust,
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.deep-space {
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 18%),
    radial-gradient(ellipse at center, transparent 0 36%, rgba(0, 0, 0, 0.36) 78%, rgba(0, 0, 0, 0.58) 100%);
}

.aurora {
  z-index: 1;
  opacity: 0.78;
  background:
    linear-gradient(116deg, transparent 0 24%, rgba(133, 231, 255, 0.13) 39%, transparent 57%),
    linear-gradient(64deg, transparent 0 34%, rgba(255, 215, 123, 0.12) 49%, transparent 68%),
    radial-gradient(ellipse at 62% 62%, rgba(255, 122, 168, 0.18), transparent 42%);
  filter: blur(14px) saturate(118%);
  animation: auroraDrift 13s ease-in-out infinite alternate;
}

.stardust {
  z-index: 2;
  opacity: 0.52;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.72) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255,215,123,0.54) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(133,231,255,0.48) 0 1px, transparent 1.5px);
  background-size: 150px 150px, 230px 230px, 310px 310px;
  background-position: 12px 28px, 74px 92px, 132px 18px;
  animation: dustFloat 18s linear infinite;
}

.vignette {
  z-index: 4;
  background:
    radial-gradient(circle at 50% 42%, transparent 0 44%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.22), transparent 22%, rgba(0, 0, 0, 0.46));
  mix-blend-mode: multiply;
}

@keyframes auroraDrift {
  from { transform: scale(1) translate3d(-1.5%, 1%, 0); }
  to { transform: scale(1.08) translate3d(1.5%, -1%, 0); }
}

@keyframes dustFloat {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-24px, 18px, 0); }
}

#star-canvas,
#firework-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#star-canvas {
  z-index: 10;
}

#star-canvas.fallback-starfield {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(255, 215, 123, 0.72) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(133, 231, 255, 0.6) 0 1px, transparent 1.8px);
  background-position: 20px 24px, 84px 130px, 146px 68px;
  background-size: 180px 180px, 260px 260px, 340px 340px;
  animation: fallbackStars 18s linear infinite;
}

#star-canvas.fallback-sparkle {
  filter: brightness(1.3) saturate(1.2);
}

#star-canvas.fallback-meteor {
  background-image:
    linear-gradient(132deg, transparent 0 44%, rgba(255, 246, 214, 0.86) 49%, rgba(255, 122, 168, 0.42) 50%, transparent 58%),
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(255, 215, 123, 0.72) 0 1px, transparent 1.8px);
  background-position: 110vw -20vh, 20px 24px, 84px 130px;
  background-size: 46vw 22vh, 180px 180px, 260px 260px;
  animation: fallbackMeteor 1s ease-out both;
}

@keyframes fallbackStars {
  from { background-position: 20px 24px, 84px 130px, 146px 68px; }
  to { background-position: -40px 68px, 24px 172px, 86px 112px; }
}

@keyframes fallbackMeteor {
  from { background-position: 110vw -20vh, 20px 24px, 84px 130px; }
  to { background-position: -40vw 96vh, 20px 24px, 84px 130px; }
}

#firework-canvas {
  z-index: 5;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

#firework-canvas.active {
  opacity: 1;
}

#opening {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 22;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  width: min(88vw, 720px);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -45%) scale(0.96);
  transition:
    opacity 0.8s ease,
    transform 0.8s cubic-bezier(0.19, 1, 0.22, 1),
    filter 0.8s ease;
}

#opening > * {
  grid-column: 1;
}

#opening.ready {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#opening.hidden {
  opacity: 0;
  filter: blur(10px);
  pointer-events: none;
  transform: translate(-50%, -54%) scale(1.04);
}

#wish-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 23;
  display: grid;
  justify-items: center;
  width: min(86vw, 620px);
  padding: clamp(8px, 2vw, 14px) 12px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -44%) scale(0.98);
  transition:
    opacity 0.55s ease,
    transform 0.55s cubic-bezier(0.19, 1, 0.22, 1);
}

#wish-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: min(78vw, 520px);
  height: min(42vh, 300px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 215, 123, 0.15), rgba(255, 122, 168, 0.07) 44%, transparent 72%),
    radial-gradient(circle at 46% 44%, rgba(133, 231, 255, 0.09), transparent 52%);
  filter: blur(10px);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

#wish-stage.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

#wish-stage.show::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#wish-stage.committed::before {
  opacity: 0.7;
  transform: translate(-50%, -50%) scale(1.08);
}

.wish-kicker {
  margin-bottom: 14px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(133, 231, 255, 0.42);
}

#wish-line {
  color: #fff7d8;
  font-size: clamp(25px, 5vw, 52px);
  font-weight: 780;
  line-height: 1.22;
  text-wrap: balance;
  text-shadow:
    0 0 18px rgba(255, 215, 123, 0.6),
    0 0 42px rgba(255, 122, 168, 0.28),
    0 16px 46px rgba(0, 0, 0, 0.46);
}

.wish-ritual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 18px);
  margin-top: clamp(18px, 3vh, 28px);
  min-height: 24px;
}

.wish-ritual::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(100% - 14px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 123, 0.38), rgba(255, 122, 168, 0.22), transparent);
  transform: translate(-50%, -50%);
}

.wish-dot {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255, 250, 240, 0.38);
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.18);
  box-shadow: 0 0 0 rgba(255, 215, 123, 0);
  transform: scale(1);
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s ease;
}

.wish-dot.active,
.wish-dot.complete,
#wish-stage[data-step="1"] .wish-dot:nth-child(1),
#wish-stage[data-step="2"] .wish-dot:nth-child(-n + 2),
#wish-stage[data-step="3"] .wish-dot {
  border-color: rgba(255, 215, 123, 0.86);
  background: var(--gold);
  box-shadow:
    0 0 16px rgba(255, 215, 123, 0.6),
    0 0 28px rgba(255, 122, 168, 0.28);
}

.wish-dot.active,
#wish-stage[data-step="1"] .wish-dot:nth-child(1),
#wish-stage[data-step="2"] .wish-dot:nth-child(2),
#wish-stage[data-step="3"] .wish-dot:nth-child(3) {
  transform: scale(1.35);
}

.wish-constellation {
  display: grid;
  justify-items: center;
  gap: clamp(12px, 2.2vh, 18px);
  width: min(82vw, 420px);
  margin-top: clamp(18px, 3vh, 28px);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.wish-constellation.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.wish-guide {
  width: min(78vw, 380px);
  color: rgba(255, 244, 232, 0.78);
  font-size: clamp(13px, 1.9vw, 15px);
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.62);
}

.wish-star-pad {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 4vw, 34px);
  min-height: 62px;
}

.wish-star-button {
  position: relative;
  width: clamp(50px, 8vw, 64px);
  height: clamp(50px, 8vw, 64px);
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 250, 240, 0.18) 0 18%, rgba(255, 215, 123, 0.16) 19% 46%, rgba(255, 122, 168, 0.08) 47% 62%, transparent 63%),
    radial-gradient(circle, rgba(255, 215, 123, 0.1), rgba(255, 122, 168, 0.06) 58%, transparent 72%);
  box-shadow:
    0 0 22px rgba(255, 215, 123, 0.24),
    0 0 42px rgba(255, 122, 168, 0.12);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.86);
  transition: box-shadow 0.22s ease, filter 0.22s ease, transform 0.22s ease;
}

.wish-star-button::before,
.wish-star-button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74%;
  height: 74%;
  clip-path: polygon(50% 0%, 61% 34%, 96% 34%, 68% 55%, 79% 90%, 50% 69%, 21% 90%, 32% 55%, 4% 34%, 39% 34%);
  transform: translate(-50%, -50%);
  transform-origin: center;
  pointer-events: none;
}

.wish-star-button::before {
  z-index: 2;
  background:
    radial-gradient(circle at 43% 30%, rgba(255, 255, 255, 0.96) 0 9%, transparent 18%),
    linear-gradient(160deg, #fffaf0 0 12%, #ffe89e 28%, #ffd15f 58%, #e79a2a 100%);
  filter:
    drop-shadow(0 0 7px rgba(255, 250, 240, 0.65))
    drop-shadow(0 0 18px rgba(255, 215, 123, 0.52));
}

.wish-star-button::after {
  z-index: 1;
  width: 92%;
  height: 92%;
  background: rgba(255, 215, 123, 0.2);
  filter: blur(7px);
  opacity: 0.62;
}

.wish-star-button:hover,
.wish-star-button:focus-visible {
  filter: brightness(1.08) saturate(1.06);
  box-shadow:
    0 0 30px rgba(255, 215, 123, 0.42),
    0 0 54px rgba(255, 122, 168, 0.2);
}

.wish-star-button:hover::before,
.wish-star-button:focus-visible::before {
  filter:
    drop-shadow(0 0 9px rgba(255, 250, 240, 0.78))
    drop-shadow(0 0 22px rgba(255, 215, 123, 0.62));
  transform: translate(-50%, -50%) scale(1.06);
}

.wish-star-button.lit {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 250, 240, 0.3) 0 18%, rgba(255, 215, 123, 0.28) 19% 48%, rgba(255, 122, 168, 0.16) 49% 66%, transparent 67%),
    radial-gradient(circle, rgba(255, 215, 123, 0.2), rgba(255, 122, 168, 0.12) 58%, transparent 74%);
  animation: wishStarFlash 0.62s ease-out both;
  box-shadow:
    0 0 32px rgba(255, 215, 123, 0.66),
    0 0 62px rgba(255, 122, 168, 0.34);
}

.wish-star-button.lit::before {
  background:
    radial-gradient(circle at 43% 30%, #ffffff 0 12%, transparent 20%),
    linear-gradient(160deg, #ffffff 0 10%, #fff2bb 24%, #ffd77b 56%, #ffb845 100%);
  filter:
    drop-shadow(0 0 10px rgba(255, 250, 240, 0.92))
    drop-shadow(0 0 26px rgba(255, 215, 123, 0.78))
    drop-shadow(0 0 42px rgba(255, 122, 168, 0.3));
}

.wish-star-button.lit::before {
  animation: wishStarBeam 0.64s ease-out both;
}

.wish-star-button.lit::after {
  animation: wishStarBeamDiagonal 0.64s ease-out both;
}

@keyframes wishStarFlash {
  0% {
    filter: brightness(1);
    box-shadow:
      0 0 18px rgba(255, 215, 123, 0.36),
      0 0 28px rgba(255, 122, 168, 0.16),
      inset 0 0 14px rgba(255, 255, 255, 0.12);
  }
  45% {
    filter: brightness(1.24);
    box-shadow:
      0 0 34px rgba(255, 250, 240, 0.86),
      0 0 78px rgba(255, 215, 123, 0.62),
      0 0 104px rgba(255, 122, 168, 0.34),
      inset 0 0 24px rgba(255, 255, 255, 0.2);
  }
  100% {
    filter: brightness(1.02);
    box-shadow:
      0 0 28px rgba(255, 215, 123, 0.68),
      0 0 54px rgba(255, 122, 168, 0.32),
      inset 0 0 20px rgba(255, 255, 255, 0.16);
  }
}

@keyframes wishStarBeam {
  0% { opacity: 0.58; transform: translate(-50%, -50%) scale(0.72); }
  42% { opacity: 1; transform: translate(-50%, -50%) scale(1.32); }
  100% { opacity: 0.86; transform: translate(-50%, -50%) scale(1); }
}

@keyframes wishStarBeamDiagonal {
  0% { opacity: 0.36; transform: translate(-50%, -50%) scale(0.78); }
  42% { opacity: 0.88; transform: translate(-50%, -50%) scale(1.46); }
  100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.08); }
}

.wish-constellation.complete .wish-guide {
  color: #fff7d8;
}

.opening-kicker {
  margin-bottom: 16px;
  color: var(--gold);
  font-size: clamp(12px, 1.5vw, 14px);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--font-accent);
  text-shadow: 0 0 18px rgba(255, 215, 123, 0.42);
}

#opening-title {
  max-width: 10em;
  color: #fff7d8;
  font-size: clamp(44px, 9vw, 96px);
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: 0;
  text-shadow:
    0 0 18px rgba(255, 215, 123, 0.72),
    0 0 50px rgba(255, 122, 168, 0.34),
    0 16px 48px rgba(0, 0, 0, 0.5);
}

#opening-subtitle {
  width: min(88vw, 520px);
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(15px, 2vw, 19px);
  line-height: 1.7;
  text-wrap: balance;
}

#anniversary-badge {
  margin-top: 16px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(8, 12, 28, 0.42);
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.4;
  backdrop-filter: blur(12px);
}

#anniversary-badge:empty,
#anniversary-badge[hidden] {
  display: none;
}

.gift-lock[hidden] {
  display: none;
}

.gift-lock {
  position: relative;
  grid-row: 6;
  display: grid;
  justify-items: center;
  gap: 13px;
  isolation: isolate;
  width: min(86vw, 376px);
  margin-top: 74px;
  padding: 54px 20px 20px;
  overflow: visible;
  border: 1px solid rgba(255, 244, 232, 0.32);
  border-radius: 20px 20px 12px 12px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.18), transparent 23%),
    radial-gradient(circle at 78% 24%, rgba(255, 122, 168, 0.24), transparent 32%),
    linear-gradient(90deg, transparent calc(50% - 27px), rgba(255, 239, 173, 0.98) calc(50% - 27px) calc(50% + 27px), transparent calc(50% + 27px)),
    linear-gradient(135deg, rgba(127, 18, 45, 0.98), rgba(213, 38, 73, 0.98) 48%, rgba(104, 12, 42, 0.98));
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.38),
    0 0 42px rgba(244, 114, 182, 0.2),
    0 0 0 1px rgba(255, 215, 123, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -22px 44px rgba(45, 3, 20, 0.24);
  color: rgba(255, 250, 240, 0.94);
  transform-origin: 50% 20%;
  visibility: visible;
  transition:
    opacity 0.46s ease,
    transform 0.46s cubic-bezier(0.19, 1, 0.22, 1),
    filter 0.46s ease,
    visibility 0s linear 0s;
}

.gift-lock::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 54%;
  z-index: 0;
  height: 38px;
  background:
    linear-gradient(180deg, rgba(255, 249, 221, 0.96), rgba(247, 208, 122, 0.92) 60%, rgba(180, 99, 20, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(132, 61, 8, 0.34),
    0 0 26px rgba(247, 208, 122, 0.28);
  transform: translateY(-50%);
  pointer-events: none;
}

.gift-lock::after {
  content: "";
  position: absolute;
  inset: 11px;
  z-index: 0;
  border: 1px solid rgba(255, 244, 232, 0.2);
  border-radius: 14px 14px 8px 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(255, 215, 123, 0.08), transparent 42%);
  pointer-events: none;
}

.gift-lock-present {
  position: absolute;
  left: 50%;
  top: -60px;
  z-index: 3;
  width: 230px;
  height: 94px;
  pointer-events: none;
  transform: translateX(-50%);
  transform-origin: 50% 72%;
}

.gift-lock-present::after {
  content: "";
  position: absolute;
  left: 36px;
  right: 36px;
  bottom: 13px;
  height: 12px;
  border-radius: 999px;
  background: rgba(30, 3, 17, 0.28);
  filter: blur(8px);
}

.gift-lock-lid {
  position: absolute;
  left: 18px;
  top: 40px;
  width: 194px;
  height: 36px;
  border: 1px solid rgba(255, 244, 232, 0.3);
  border-radius: 12px 12px 7px 7px;
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(90deg, transparent calc(50% - 22px), rgba(255, 239, 173, 0.98) calc(50% - 22px) calc(50% + 22px), transparent calc(50% + 22px)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 50%),
    linear-gradient(135deg, rgba(244, 63, 94, 0.98), rgba(159, 18, 57, 0.98));
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.3),
    0 0 24px rgba(244, 114, 182, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.gift-lock-ribbon-vertical,
.gift-lock-ribbon-horizontal {
  position: absolute;
  z-index: 4;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28), transparent 35%),
    linear-gradient(180deg, #fff9d8, #f7d07a 58%, #b96112);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    inset 0 -1px 0 rgba(132, 61, 8, 0.28),
    0 0 18px rgba(247, 208, 122, 0.34);
}

.gift-lock-ribbon-vertical {
  left: 94px;
  top: 40px;
  width: 42px;
  height: 42px;
}

.gift-lock-ribbon-horizontal {
  left: 18px;
  top: 51px;
  width: 194px;
  height: 16px;
}

.gift-lock-bow {
  position: absolute;
  top: 1px;
  z-index: 5;
  width: 62px;
  height: 46px;
  border: 10px solid rgba(247, 208, 122, 0.98);
  background:
    radial-gradient(circle at 40% 38%, rgba(255, 255, 255, 0.24), transparent 30%),
    rgba(255, 244, 232, 0.04);
  box-shadow:
    0 0 20px rgba(247, 208, 122, 0.48),
    0 8px 14px rgba(0, 0, 0, 0.12),
    inset 0 0 8px rgba(255, 255, 255, 0.18);
}

.gift-lock-bow-left {
  left: 54px;
  border-radius: 58% 42% 52% 48%;
  transform: rotate(-18deg);
}

.gift-lock-bow-right {
  right: 54px;
  border-radius: 42% 58% 48% 52%;
  transform: rotate(18deg);
}

.gift-lock-title,
.gift-lock-row,
.gift-lock-message {
  position: relative;
  z-index: 2;
}

.gift-lock-title {
  color: rgba(255, 250, 240, 0.94);
  font-size: clamp(13px, 1.8vw, 15px);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.28);
}

.gift-lock-row {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(100%, 298px);
}

.gift-code {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

#gift-password-input {
  display: none;
}

.gift-code-digit {
  appearance: none;
  width: 100%;
  min-width: 0;
  height: 56px;
  border: 1px solid rgba(255, 244, 232, 0.5);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.72), transparent 36%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 239, 220, 0.92));
  box-shadow:
    inset 0 2px 8px rgba(71, 22, 38, 0.08),
    inset 0 -8px 14px rgba(247, 208, 122, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 215, 123, 0.08);
  color: rgba(48, 24, 18, 0.92);
  caret-color: rgba(190, 18, 60, 0.88);
  font: 900 24px/1 var(--font-body);
  letter-spacing: 0;
  text-align: center;
  outline: 0;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    background 0.2s ease;
}

.gift-code-digit:focus {
  border-color: rgba(255, 236, 160, 0.88);
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.82), transparent 38%),
    linear-gradient(180deg, rgba(255, 253, 244, 1), rgba(255, 241, 223, 0.96));
  box-shadow:
    0 0 0 4px rgba(247, 208, 122, 0.16),
    0 0 22px rgba(247, 208, 122, 0.28),
    inset 0 2px 8px rgba(71, 22, 38, 0.08),
    0 12px 28px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

#gift-password-button {
  min-height: 42px;
  padding: 0 23px;
  border: 1px solid rgba(255, 250, 240, 0.32);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 250, 232, 0.98), rgba(247, 208, 122, 0.92) 62%, rgba(214, 151, 52, 0.9));
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.18),
    0 0 18px rgba(247, 208, 122, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
  color: #2f1606;
  cursor: pointer;
  font: 900 13px/1 var(--font-body);
  white-space: nowrap;
  transition:
    transform 0.2s ease,
    filter 0.2s ease,
    box-shadow 0.2s ease;
}

#gift-password-button:hover,
#gift-password-button:focus-visible {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.24),
    0 0 24px rgba(247, 208, 122, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.gift-lock-message {
  min-height: 19px;
  margin: 0;
  color: rgba(255, 244, 232, 0.76);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.24);
}

.gift-lock.is-error {
  animation: giftLockShake 0.42s ease both;
}

.gift-lock.is-error .gift-code-digit,
.gift-code-digit[aria-invalid="true"] {
  border-color: rgba(255, 171, 171, 0.96);
  box-shadow:
    0 0 0 4px rgba(244, 63, 94, 0.14),
    inset 0 2px 8px rgba(71, 22, 38, 0.1),
    0 12px 28px rgba(0, 0, 0, 0.18);
}

.gift-lock.is-attention {
  animation: giftLockPulse 0.58s ease both;
}

.gift-lock.is-unlocked {
  opacity: 0;
  filter: blur(3px);
  pointer-events: none;
  transform: translateY(-10px) scale(0.98);
  visibility: hidden;
  transition:
    opacity 0.46s ease,
    transform 0.46s cubic-bezier(0.19, 1, 0.22, 1),
    filter 0.46s ease,
    visibility 0s linear 0.46s;
}

.gift-lock.is-unlocked .gift-lock-present {
  animation: giftLockOpen 0.66s cubic-bezier(0.19, 1, 0.22, 1) both;
}

@keyframes giftLockShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px) rotate(-0.6deg); }
  42% { transform: translateX(7px) rotate(0.5deg); }
  64% { transform: translateX(-4px) rotate(-0.3deg); }
  82% { transform: translateX(3px) rotate(0.2deg); }
}

@keyframes giftLockPulse {
  0%, 100% { transform: scale(1); }
  48% { transform: scale(1.025); }
}

@keyframes giftLockOpen {
  0% { transform: translateX(-50%) translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-34px) rotate(-5deg); opacity: 0; }
}

@media (max-width: 640px) {
  .gift-lock {
    width: min(88vw, 330px);
    margin-top: 58px;
    padding: 45px 14px 15px;
    gap: 10px;
  }

  .gift-lock-present {
    top: -47px;
    width: 188px;
    height: 76px;
  }

  .gift-lock-lid,
  .gift-lock-ribbon-horizontal {
    left: 18px;
    width: 152px;
  }

  .gift-lock-lid {
    top: 32px;
    height: 30px;
  }

  .gift-lock-ribbon-vertical {
    left: 78px;
    top: 32px;
    width: 32px;
    height: 34px;
  }

  .gift-lock-ribbon-horizontal {
    top: 42px;
    height: 14px;
  }

  .gift-lock-bow {
    width: 48px;
    height: 38px;
    border-width: 8px;
  }

  .gift-lock-bow-left {
    left: 48px;
  }

  .gift-lock-bow-right {
    right: 48px;
  }

  .gift-lock-row {
    width: min(100%, 262px);
    gap: 10px;
  }

  .gift-code {
    gap: 7px;
  }

  .gift-code-digit {
    height: 48px;
    border-radius: 12px;
    font-size: 21px;
  }

  #gift-password-button {
    min-height: 40px;
    padding-inline: 21px;
  }
}

.opening-actions,
.final-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.opening-actions {
  grid-row: 6;
  align-self: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.98);
  transition:
    opacity 0.42s ease,
    transform 0.42s cubic-bezier(0.19, 1, 0.22, 1),
    visibility 0s linear 0.42s;
  visibility: hidden;
}

#opening.is-unlocked .opening-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0.22s, 0.22s, 0s;
  visibility: visible;
}

#opening.is-locked .opening-actions,
#opening.hidden .opening-actions {
  pointer-events: none;
}

#opening #start-button {
  margin-top: 0;
}

#start-button,
#replay-button {
  position: relative;
  min-height: 46px;
  margin-top: 28px;
  padding: 0 28px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 245, 214, 0.98), rgba(255, 215, 123, 0.94) 48%, rgba(217, 119, 6, 0.9)),
    var(--gold-deep);
  box-shadow:
    0 18px 52px rgba(220, 38, 38, 0.18),
    0 0 36px rgba(255, 215, 123, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
  color: #3b2608;
  cursor: pointer;
  font-weight: 800;
  isolation: isolate;
  letter-spacing: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

#start-button::before,
#start-button::after {
  content: "";
  position: absolute;
  inset: -14px;
  z-index: -1;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
}

#start-button::before {
  border: 1px solid rgba(255, 250, 240, 0.76);
  box-shadow:
    0 0 24px rgba(255, 215, 123, 0.52),
    0 0 56px rgba(255, 122, 168, 0.28);
}

#start-button::after {
  inset: -24px -34px;
  background:
    radial-gradient(circle at 12% 46%, rgba(255, 250, 240, 0.98) 0 2px, transparent 3px),
    radial-gradient(circle at 28% 18%, rgba(255, 215, 123, 0.94) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 22%, rgba(255, 250, 240, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 62%, rgba(255, 122, 168, 0.82) 0 2px, transparent 3px),
    radial-gradient(circle at 50% 82%, rgba(255, 215, 123, 0.88) 0 2px, transparent 3px);
  filter: drop-shadow(0 0 10px rgba(255, 215, 123, 0.72));
}

#start-button:hover,
#replay-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow:
    0 22px 60px rgba(255, 122, 168, 0.24),
    0 0 46px rgba(255, 215, 123, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

#start-button.is-igniting {
  transform: translateY(-1px) scale(0.98);
  filter: brightness(1.1);
  box-shadow:
    0 20px 62px rgba(255, 122, 168, 0.28),
    0 0 58px rgba(255, 215, 123, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

#start-button.is-igniting::before {
  animation: startIgniteRing 0.58s ease-out both;
}

#start-button.is-igniting::after {
  animation: startIgniteSparks 0.66s ease-out both;
}

@keyframes startIgniteRing {
  0% {
    opacity: 0.8;
    transform: scale(0.78);
  }
  62% {
    opacity: 0.58;
    transform: scale(1.24);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

@keyframes startIgniteSparks {
  0% {
    opacity: 0;
    transform: scale(0.76) rotate(0deg);
  }
  24% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.18) rotate(10deg);
  }
}

#top-controls {
  position: absolute;
  right: clamp(16px, 4vw, 34px);
  top: clamp(16px, 4vw, 34px);
  z-index: 26;
  display: flex;
  gap: 10px;
}

#sound-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(8, 12, 28, 0.44);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
  color: var(--gold);
  cursor: pointer;
  backdrop-filter: blur(14px);
}

#sound-toggle.muted {
  color: rgba(255, 255, 255, 0.58);
}

#photo-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#rose-stage {
  position: absolute;
  inset: 0;
  z-index: 17;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(26px, 6vw, 72px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.72s ease;
}

#rose-stage[hidden] {
  display: none;
}

#rose-stage.show {
  opacity: 1;
}

#rose-stage::before,
#rose-stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

#rose-stage::before {
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 38%, rgba(244, 114, 182, 0.16), transparent 30%),
    radial-gradient(circle at 45% 52%, rgba(255, 215, 123, 0.1), transparent 38%),
    radial-gradient(circle at 64% 66%, rgba(133, 231, 255, 0.06), transparent 34%),
    linear-gradient(180deg, rgba(3, 5, 13, 0.2), rgba(5, 7, 18, 0.48));
}

#rose-stage::after {
  left: 50%;
  top: 45%;
  z-index: -1;
  width: min(74vw, 560px);
  height: min(58vh, 460px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 244, 232, 0.13), transparent 18%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 122, 168, 0.23), rgba(255, 215, 123, 0.08) 38%, transparent 70%);
  filter: blur(24px);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72);
  transition: opacity 1s ease, transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

#rose-stage.forming::after {
  opacity: 0.88;
  transform: translate(-50%, -50%) scale(1);
}

.rose-copy {
  position: absolute;
  left: 50%;
  bottom: clamp(44px, 8vh, 82px);
  z-index: 2;
  display: grid;
  justify-items: center;
  width: min(82vw, 560px);
  gap: 8px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.72s ease, transform 0.72s cubic-bezier(0.19, 1, 0.22, 1);
}

#rose-stage.complete .rose-copy {
  opacity: 1;
  transform: translate(-50%, 0);
}

.rose-kicker {
  color: rgba(255, 215, 123, 0.92);
  font-family: var(--font-accent);
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 800;
  line-height: 1;
  text-shadow:
    0 0 18px rgba(255, 215, 123, 0.42),
    0 8px 24px rgba(0, 0, 0, 0.55);
}

.rose-message {
  color: rgba(255, 244, 232, 0.82);
  font-size: clamp(14px, 1.7vw, 17px);
  font-weight: 700;
  line-height: 1.65;
  text-wrap: balance;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.72);
}

.photo-card {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  gap: clamp(10px, 2vh, 16px);
  justify-items: center;
  width: min(74vw, 560px);
  opacity: 0;
  transform: translate(-50%, -46%) scale(0.88) rotate(-1.2deg);
  transition:
    transform 0.76s cubic-bezier(0.19, 1, 0.22, 1),
    opacity 0.5s ease;
}

.photo-card::before {
  content: "";
  position: absolute;
  inset: -18px -18px 54px;
  z-index: -1;
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 215, 123, 0.2), transparent 42%),
    radial-gradient(circle at 18% 82%, rgba(255, 122, 168, 0.18), transparent 34%);
  filter: blur(18px);
  opacity: 0.9;
}

.photo-card.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(-1.2deg);
}

.photo-card.has-video {
  pointer-events: auto;
}

.photo-card.manual-memory {
  pointer-events: auto;
}

.memory-meta {
  order: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 520px);
  min-height: 26px;
  padding: 0 4px;
  color: rgba(255, 244, 232, 0.68);
  font-family: var(--font-accent);
  font-size: clamp(11px, 1.2vw, 13px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(255, 215, 123, 0.22);
}

.memory-meta span:last-child {
  color: rgba(255, 215, 123, 0.82);
}

.photo-card > img,
.memory-media,
.memory-face,
.photo-card.memory-card::after,
.photo-card.missing-photo::after {
  order: 1;
  width: min(100%, 520px);
  aspect-ratio: 4 / 5;
  max-height: 55vh;
  border-radius: 10px;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.56),
    0 0 58px rgba(255, 215, 123, 0.22);
}

.photo-card.with-memory-face::after {
  content: none;
  display: none;
}

.photo-card > img {
  padding: 12px 12px 46px;
  object-fit: cover;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--paper));
}

.memory-media {
  position: relative;
  overflow: hidden;
  padding: 12px 12px 46px;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), var(--paper)),
    #fffaf0;
}

.memory-media img,
.memory-media video {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
  background: rgba(54, 29, 40, 0.08);
  transition: opacity 0.9s ease, transform 1.2s cubic-bezier(0.19, 1, 0.22, 1), filter 0.9s ease;
}

.memory-media video {
  position: absolute;
  inset: 12px 12px 46px;
  width: calc(100% - 24px);
  height: calc(100% - 58px);
  opacity: 0;
  transform: scale(1.018);
  pointer-events: none;
}

.memory-video-sheen {
  position: absolute;
  inset: 12px 12px 46px;
  border-radius: 7px;
  background: linear-gradient(105deg, transparent 24%, rgba(255, 244, 232, 0.34) 42%, transparent 58%);
  opacity: 0;
  transform: translateX(-120%);
  pointer-events: none;
}

.memory-video-copy {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(calc(100% - 28px), 390px);
  padding: 10px 12px 11px;
  border: 1px solid rgba(255, 244, 232, 0.34);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(9, 11, 24, 0.68), rgba(9, 11, 24, 0.48)),
    rgba(255, 122, 168, 0.1);
  box-shadow:
    0 12px 34px rgba(3, 4, 11, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  transform: translateX(-50%);
  transition:
    opacity 0.24s ease,
    transform 0.24s ease;
}

.memory-video-prompt {
  max-width: 100%;
  margin: 0;
  color: rgba(255, 250, 240, 0.9);
  font-size: clamp(11px, 1.24vw, 13px);
  font-weight: 740;
  line-height: 1.48;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  text-wrap: balance;
}

.memory-video-play {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255, 244, 232, 0.68);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(5, 7, 18, 0.56), rgba(5, 7, 18, 0.34)),
    rgba(255, 215, 123, 0.14);
  box-shadow:
    0 8px 24px rgba(3, 4, 11, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: rgba(255, 250, 240, 0.94);
  font: 800 12px/1 var(--font-ui);
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  transition:
    opacity 0.24s ease,
    transform 0.24s ease,
    border-color 0.24s ease,
    box-shadow 0.24s ease;
}

.memory-video-play::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid rgba(255, 250, 240, 0.96);
}

.memory-video-play:hover {
  border-color: rgba(255, 215, 123, 0.86);
  box-shadow:
    0 10px 28px rgba(3, 4, 11, 0.32),
    0 0 24px rgba(255, 215, 123, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.memory-video-play:focus-visible {
  outline: 2px solid rgba(255, 215, 123, 0.9);
  outline-offset: 3px;
}

.photo-card.has-video.video-playing .memory-media img {
  opacity: 0.16;
  transform: scale(1.032);
  filter: saturate(1.06) contrast(1.03) brightness(1.05);
}

.photo-card.has-video.video-playing .memory-media video {
  opacity: 1;
  transform: scale(1);
}

.photo-card.has-video.video-playing .memory-video-sheen {
  animation: memoryVideoSheen 1.1s ease-out both;
}

.photo-card.has-video.video-playing .memory-video-copy {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 7px) scale(0.96);
}

@keyframes memoryVideoSheen {
  0% {
    opacity: 0;
    transform: translateX(-120%);
  }
  20%,
  58% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translateX(120%);
  }
}

.photo-card.has-photo > img {
  border: 1px solid rgba(255, 255, 255, 0.62);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), var(--paper)),
    #fffaf0;
  filter: saturate(1.03) contrast(1.02) brightness(0.98);
}

.memory-face {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: clamp(28px, 5vw, 52px);
  overflow: hidden;
  border: 12px solid rgba(255, 250, 240, 0.96);
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 215, 123, 0.28), transparent 26%),
    radial-gradient(circle at 76% 78%, rgba(133, 231, 255, 0.12), transparent 30%),
    linear-gradient(145deg, #fffaf0, #f4edf4 58%, #eaf8ff);
  color: rgba(20, 25, 42, 0.68);
  text-align: center;
}

.memory-face::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(217, 119, 6, 0.14);
  border-radius: 8px;
  pointer-events: none;
}

.memory-face-mark {
  color: rgba(20, 25, 42, 0.7);
  font-size: clamp(22px, 3.3vw, 34px);
  font-weight: 900;
  line-height: 1.1;
}

.memory-face-note {
  max-width: 15em;
  color: rgba(88, 65, 74, 0.58);
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 700;
  line-height: 1.5;
}

.photo-card.memory-card::after,
.photo-card.missing-photo::after {
  content: attr(data-label);
  display: grid;
  place-items: center;
  padding: 24px;
  border: 12px solid rgba(255, 250, 240, 0.96);
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 215, 123, 0.32), transparent 28%),
    linear-gradient(145deg, #fffaf0, #f4edf4 58%, #eaf8ff);
  color: rgba(20, 25, 42, 0.62);
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.photo-card.with-memory-face.memory-card::after,
.photo-card.with-memory-face.missing-photo::after {
  content: none;
  display: none;
}

.photo-card .caption {
  order: 2;
  max-width: min(82vw, 640px);
  min-height: 42px;
  padding: 12px 22px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(11, 16, 36, 0.7), rgba(6, 8, 20, 0.5)),
    linear-gradient(90deg, rgba(255, 215, 123, 0.08), rgba(255, 122, 168, 0.06));
  box-shadow:
    0 14px 44px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: clamp(15px, 1.9vw, 18px);
  line-height: 1.65;
  text-align: center;
  text-shadow: 0 0 18px rgba(255, 215, 123, 0.3);
  backdrop-filter: blur(16px);
}

.memory-nav {
  order: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 14px);
  min-height: 44px;
  margin-top: clamp(8px, 1vh, 12px);
}

.memory-prev,
.memory-next {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 244, 232, 0.82);
  font: 800 13px/1 var(--font-ui);
  letter-spacing: 0.08em;
  text-shadow:
    0 0 18px rgba(255, 215, 123, 0.28),
    0 8px 22px rgba(0, 0, 0, 0.42);
  cursor: pointer;
  transition:
    color 0.22s ease,
    opacity 0.22s ease,
    transform 0.22s ease;
}

.memory-prev::before,
.memory-next::after {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 1px solid currentColor;
}

.memory-prev::before {
  border-left: 1px solid currentColor;
  transform: rotate(-45deg);
}

.memory-next::after {
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}

.memory-prev:hover,
.memory-next:hover {
  color: rgba(255, 215, 123, 0.96);
}

.memory-prev:hover {
  transform: translateX(-2px);
}

.memory-next:hover {
  transform: translateX(2px);
}

.memory-prev:focus-visible,
.memory-next:focus-visible {
  outline: 2px solid rgba(255, 215, 123, 0.8);
  outline-offset: 2px;
}

.photo-card.is-advancing .memory-prev,
.photo-card.is-advancing .memory-next {
  opacity: 0;
  pointer-events: none;
}

#hint-text {
  position: absolute;
  left: 50%;
  bottom: clamp(30px, 9vh, 92px);
  z-index: 24;
  max-width: min(86vw, 520px);
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(255, 246, 230, 0.54);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  transform: translateX(-50%);
  animation: none;
  pointer-events: none;
  text-shadow: 0 0 14px rgba(247, 208, 122, 0.2);
  backdrop-filter: none;
}

#hint-text::before {
  content: none;
}

#hint-text:empty {
  display: none;
}

#photo-wall {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.8vh, 18px);
  padding: clamp(18px, 4vw, 56px);
  pointer-events: none;
}

#photo-wall::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: min(86vw, 820px);
  height: min(74vh, 660px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(5, 7, 18, 0.72), rgba(5, 7, 18, 0.36) 48%, transparent 72%),
    radial-gradient(circle at 50% 60%, rgba(255, 215, 123, 0.08), transparent 50%);
  transform: translate(-50%, -50%);
  filter: blur(2px);
}

#photo-wall.show {
  display: flex;
}

#photo-wall .grid {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(9px, 1.15vw, 14px);
  width: min(88vw, 700px);
  margin-bottom: clamp(6px, 1vh, 10px);
  align-items: center;
  justify-content: center;
}

#photo-wall .grid > img,
.photo-tile,
.memory-tile {
  width: clamp(106px, 8.8vw, 128px);
  flex: 0 0 auto;
  max-width: 128px;
  aspect-ratio: 1;
  border: 7px solid rgba(255, 250, 240, 0.97);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 215, 123, 0.24), transparent 34%),
    linear-gradient(145deg, #fffaf0, #fff1f2 54%, #f7fbff);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.3),
    0 0 18px rgba(236, 72, 153, 0.1);
  opacity: 0;
  transform: translateY(18px) scale(0.84);
  transition:
    opacity 0.45s ease,
    transform 0.58s cubic-bezier(0.19, 1, 0.22, 1);
}

#photo-wall .grid > img {
  object-fit: cover;
}

.photo-tile {
  position: relative;
  overflow: hidden;
  padding: 6px;
}

.photo-tile.has-photo {
  cursor: zoom-in;
  pointer-events: auto;
}

.photo-tile.has-photo:focus-visible {
  outline: 3px solid rgba(255, 215, 123, 0.88);
  outline-offset: 5px;
}

.photo-tile::before {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: 1;
  border-radius: 7px;
  background:
    linear-gradient(180deg, transparent 34%, rgba(3, 4, 11, 0.18) 58%, rgba(3, 4, 11, 0.7) 100%),
    linear-gradient(90deg, rgba(3, 4, 11, 0.2), transparent 22%, transparent 78%, rgba(3, 4, 11, 0.2));
  pointer-events: none;
}

.photo-tile img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
  background: rgba(255, 244, 232, 0.42);
  filter: saturate(1.04) contrast(1.02) brightness(0.98);
}

.photo-video-mark {
  position: absolute;
  right: 11px;
  top: 11px;
  z-index: 3;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 250, 240, 0.72);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(5, 7, 18, 0.58), rgba(5, 7, 18, 0.3)),
    rgba(255, 215, 123, 0.2);
  box-shadow:
    0 0 18px rgba(255, 215, 123, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.photo-video-mark::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid rgba(255, 250, 240, 0.92);
}

.photo-tile.has-video figcaption::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 5px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid rgba(255, 215, 123, 0.92);
  vertical-align: -1px;
}

.photo-tile figcaption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: -webkit-box;
  max-height: 38px;
  overflow: hidden;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(5, 7, 18, 0.76), rgba(5, 7, 18, 0.5));
  color: rgba(255, 250, 240, 0.92);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.28;
  text-align: center;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.memory-tile {
  position: relative;
  display: grid;
  place-items: center;
  padding: 13px;
  color: rgba(22, 28, 48, 0.74);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.32;
  text-align: center;
}

.memory-tile::before {
  content: attr(data-index);
  position: absolute;
  left: 10px;
  top: 8px;
  color: rgba(217, 119, 6, 0.72);
  font-size: 11px;
  font-family: var(--font-accent);
  font-weight: 700;
}

#photo-wall .grid > img:nth-child(2n),
.photo-tile:nth-child(2n),
.memory-tile:nth-child(2n) {
  transform: translateY(18px) scale(0.84) rotate(2deg);
}

#photo-wall .grid > img:nth-child(2n + 1),
.photo-tile:nth-child(2n + 1),
.memory-tile:nth-child(2n + 1) {
  transform: translateY(18px) scale(0.84) rotate(-2deg);
}

#photo-wall .grid > img.show,
.photo-tile.show,
.memory-tile.show {
  opacity: 1;
  transform: translateY(0) scale(1) rotate(0deg);
}

.final-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 22px);
  width: min(92vw, 900px);
}

#photo-wall .birthday-text {
  max-width: min(90vw, 900px);
  color: #fff7d8;
  font-size: clamp(44px, 6.8vw, 76px);
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-wrap: balance;
  text-shadow:
    0 0 18px rgba(255, 215, 123, 0.78),
    0 0 42px rgba(255, 122, 168, 0.42),
    0 14px 38px rgba(0, 0, 0, 0.48);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.5s ease, transform 1s ease;
}

#photo-wall .birthday-text.show {
  opacity: 1;
  transform: translateY(0);
}

.birthday-cake {
  position: relative;
  width: clamp(96px, 10vw, 132px);
  height: clamp(98px, 10.6vw, 142px);
  flex: 0 0 auto;
  margin-top: clamp(2px, 0.4vw, 5px);
  isolation: isolate;
  opacity: 0;
  transform: translateY(18px) scale(0.92);
  transform-origin: 50% 86%;
  transition: opacity 1s ease, transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
  filter:
    drop-shadow(0 0 13px rgba(255, 215, 123, 0.38))
    drop-shadow(0 14px 24px rgba(0, 0, 0, 0.36));
  cursor: pointer;
}

.birthday-cake:focus-visible {
  outline: 3px solid rgba(255, 215, 123, 0.88);
  outline-offset: 6px;
  border-radius: 18px;
}

.birthday-cake.is-celebrating {
  filter:
    drop-shadow(0 0 20px rgba(255, 215, 123, 0.78))
    drop-shadow(0 0 34px rgba(244, 114, 182, 0.42))
    drop-shadow(0 16px 24px rgba(0, 0, 0, 0.36));
}

.birthday-cake::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4%;
  z-index: 0;
  width: 96%;
  height: 13%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 215, 123, 0.34), rgba(0, 0, 0, 0.14) 55%, transparent 73%);
  translate: -50% 0;
  filter: blur(1px);
}

#photo-wall .birthday-text.show + .birthday-cake {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.cake-halo {
  position: absolute;
  inset: 7% -12% 1%;
  z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 248, 223, 0.28), transparent 30%),
    radial-gradient(ellipse at 50% 67%, rgba(244, 114, 182, 0.24), rgba(255, 215, 123, 0.13) 42%, transparent 72%);
  filter: blur(9px);
  opacity: 0.82;
  animation: cakeHaloPulse 2.8s ease-in-out infinite;
  pointer-events: none;
}

.cake-candles {
  position: absolute;
  left: 52%;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  translate: -50% 0;
}

.cake-candle {
  position: relative;
  display: grid;
  place-items: end center;
  width: clamp(20px, 2.1vw, 28px);
  height: clamp(43px, 4.3vw, 58px);
  transform-origin: 50% 100%;
  animation: cakeCandleSway 2.4s ease-in-out infinite;
}

.cake-candle:nth-child(1) {
  rotate: -2deg;
  animation-delay: -0.34s;
}

.cake-candle:nth-child(2) {
  rotate: 2deg;
  animation-delay: -1.1s;
}

.cake-candle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: clamp(11px, 1.18vw, 15px);
  z-index: 2;
  width: 2px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(110, 63, 38, 0.86), rgba(255, 248, 223, 0.72));
  translate: -50% 0;
}

.cake-flame {
  position: absolute;
  left: 50%;
  top: -4px;
  z-index: 4;
  width: clamp(11px, 1.15vw, 15px);
  height: clamp(16px, 1.55vw, 21px);
  border-radius: 60% 60% 46% 46%;
  background:
    radial-gradient(circle at 50% 71%, #fffaf0 0 18%, transparent 20%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.78) 0 16%, transparent 18%),
    linear-gradient(180deg, #ffe9a8 0%, #ffd77b 42%, #ff8b4a 100%);
  box-shadow:
    0 0 14px rgba(255, 215, 123, 0.92),
    0 0 26px rgba(255, 122, 168, 0.35);
  translate: -50% 0;
  transform-origin: 50% 88%;
  animation: flameFlicker 0.9s ease-in-out infinite alternate;
}

.cake-flame::after {
  content: "";
  position: absolute;
  inset: 20% 28% 24%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  filter: blur(1px);
}

.birthday-cake.is-celebrating .cake-flame {
  animation-duration: 0.48s;
  box-shadow:
    0 0 18px rgba(255, 248, 223, 0.96),
    0 0 36px rgba(255, 215, 123, 0.82),
    0 0 48px rgba(244, 114, 182, 0.42);
}

.cake-digit {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(34px, 3.3vw, 44px);
  border-radius: 9px;
  background: linear-gradient(180deg, #fff8df 0%, #ffe1b4 48%, #ffc3d7 100%);
  background-clip: text;
  color: #fff8df;
  font-size: clamp(23px, 2.45vw, 34px);
  font-weight: 950;
  line-height: 1;
  text-shadow:
    0 1px 0 rgba(122, 62, 28, 0.46),
    0 0 12px rgba(255, 215, 123, 0.5),
    0 0 20px rgba(244, 114, 182, 0.22);
  -webkit-text-stroke: 0.9px rgba(159, 18, 57, 0.62);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cake-suffix {
  align-self: center;
  margin-left: -1px;
  margin-bottom: 7px;
  color: rgba(255, 248, 223, 0.84);
  font-size: clamp(10px, 1.1vw, 13px);
  font-weight: 850;
  text-shadow:
    0 0 10px rgba(255, 215, 123, 0.42),
    0 1px 2px rgba(0, 0, 0, 0.32);
}

.cake-sugar {
  position: absolute;
  z-index: 6;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffaf0 0 35%, #ffd77b 36% 68%, transparent 70%);
  box-shadow: 0 0 12px rgba(255, 215, 123, 0.68);
  opacity: 0.9;
  animation: cakeSugarTwinkle 1.8s ease-in-out infinite;
}

.cake-sugar-one {
  left: 27%;
  top: 44%;
}

.cake-sugar-two {
  left: 50%;
  top: 39%;
  width: 5px;
  height: 5px;
  background: radial-gradient(circle, #fffaf0 0 32%, #ffb7cf 34% 68%, transparent 70%);
  animation-delay: -0.55s;
}

.cake-sugar-three {
  right: 28%;
  top: 46%;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #fffaf0 0 32%, #95e7ff 34% 68%, transparent 70%);
  animation-delay: -1.1s;
}

.cake-top,
.cake-middle,
.cake-base,
.cake-plate {
  position: absolute;
  left: 50%;
  translate: -50% 0;
}

.cake-top,
.cake-middle,
.cake-base {
  overflow: hidden;
}

.cake-top {
  top: 39%;
  z-index: 4;
  width: 68%;
  height: 20%;
  border-radius: 18px 18px 11px 11px;
  background:
    radial-gradient(circle at 18% 100%, #fffaf0 0 15%, transparent 16%),
    radial-gradient(circle at 42% 100%, #fffaf0 0 17%, transparent 18%),
    radial-gradient(circle at 68% 100%, #fffaf0 0 15%, transparent 16%),
    linear-gradient(180deg, #fffaf0 0 44%, #ffd77b 45% 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    inset 0 -4px 0 rgba(122, 62, 28, 0.08),
    0 6px 11px rgba(108, 59, 25, 0.2);
}

.cake-top::after,
.cake-middle::after,
.cake-base::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(108deg, transparent 0 28%, rgba(255, 255, 255, 0.32) 42%, transparent 56%);
  translate: -120% 0;
  animation: cakeSheen 3.6s ease-in-out infinite;
  pointer-events: none;
}

.cake-middle {
  top: 54%;
  z-index: 3;
  width: 84%;
  height: 19%;
  border-radius: 13px;
  background:
    linear-gradient(90deg, transparent 0 16%, rgba(255, 255, 255, 0.34) 16% 20%, transparent 20% 44%, rgba(255, 255, 255, 0.26) 44% 49%, transparent 49%),
    linear-gradient(180deg, #ffd3df, #ff91bd);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.46),
    inset 0 -5px 0 rgba(117, 35, 76, 0.11);
}

.cake-base {
  bottom: 6%;
  z-index: 2;
  width: 100%;
  height: 32%;
  border-radius: 16px 16px 21px 21px;
  background:
    radial-gradient(circle at 18% 28%, rgba(255, 250, 240, 0.9) 0 4px, transparent 5px),
    radial-gradient(circle at 38% 52%, rgba(255, 250, 240, 0.78) 0 3px, transparent 4px),
    radial-gradient(circle at 61% 33%, rgba(255, 250, 240, 0.82) 0 3px, transparent 4px),
    radial-gradient(circle at 82% 46%, rgba(255, 250, 240, 0.9) 0 4px, transparent 5px),
    linear-gradient(180deg, #ff9fc1, #ec4899 64%, #be185d);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.48),
    inset 0 -7px 0 rgba(117, 35, 76, 0.16);
}

.cake-plate {
  bottom: 0;
  z-index: 1;
  width: 113%;
  height: 17%;
  border-radius: 50%;
  background:
    linear-gradient(90deg, rgba(255, 244, 232, 0.08), rgba(255, 244, 232, 0.58), rgba(255, 244, 232, 0.08)),
    radial-gradient(ellipse, rgba(255, 215, 123, 0.4), rgba(255, 122, 168, 0.18) 48%, rgba(5, 7, 18, 0.06) 78%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.66),
    0 3px 8px rgba(0, 0, 0, 0.22);
}

.cake-sparkle {
  position: absolute;
  left: 50%;
  top: 24%;
  z-index: 10;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fffaf0 0 24%, #ffd77b 25% 62%, rgba(255, 215, 123, 0) 64%);
  box-shadow:
    0 0 11px rgba(255, 215, 123, 0.86),
    0 0 20px rgba(244, 114, 182, 0.38);
  opacity: 0;
  pointer-events: none;
}

@keyframes flameFlicker {
  from { transform: scale(0.9) rotate(-5deg) skewX(-2deg); }
  45% { transform: scale(1.05) rotate(3deg) skewX(2deg); }
  to { transform: scale(0.96) rotate(5deg) skewX(-1deg); }
}

@keyframes cakeCandleSway {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
}

@keyframes cakeHaloPulse {
  0%, 100% { opacity: 0.62; transform: scale(0.96); }
  50% { opacity: 0.92; transform: scale(1.04); }
}

@keyframes cakeSugarTwinkle {
  0%, 100% { opacity: 0.58; transform: scale(0.74); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes cakeSheen {
  0%, 46% { translate: -120% 0; opacity: 0; }
  62% { opacity: 0.68; }
  82%, 100% { translate: 120% 0; opacity: 0; }
}

.final-message {
  width: min(86vw, 760px);
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(15px, 1.75vw, 17px);
  font-weight: 500;
  line-height: 1.7;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.76);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1s ease, transform 1s ease;
}

.final-message.show {
  opacity: 1;
  transform: translateY(0);
}

.final-wishes {
  display: grid;
  gap: 5px;
  width: min(82vw, 680px);
  margin-top: 2px;
}

.final-wish {
  appearance: none;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(13px, 1.6vw, 15px);
  font-weight: 500;
  line-height: 1.65;
  text-align: center;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.76);
  opacity: 0;
  transform: translateY(10px);
  cursor: pointer;
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.final-wish.show {
  opacity: 1;
  transform: translateY(0);
}

.final-wish:hover,
.final-wish:focus-visible,
.final-wish.is-lit {
  color: rgba(255, 250, 240, 0.96);
  text-shadow:
    0 0 18px rgba(255, 215, 123, 0.42),
    0 8px 24px rgba(0, 0, 0, 0.76);
}

.final-wish.is-lit::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px rgba(255, 215, 123, 0.78);
  vertical-align: middle;
}

#replay-button {
  position: relative;
  z-index: 25;
  margin-top: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

#replay-button.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.interaction-spark {
  position: absolute;
  z-index: 60;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fffaf0 0 24%, var(--gold) 25% 62%, rgba(255, 215, 123, 0) 64%);
  box-shadow:
    0 0 10px rgba(255, 215, 123, 0.8),
    0 0 18px rgba(244, 114, 182, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.memory-viewer {
  position: absolute;
  inset: 0;
  z-index: 58;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 54px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.memory-viewer.show {
  opacity: 1;
  pointer-events: auto;
}

.memory-viewer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 215, 123, 0.12), transparent 36%),
    rgba(3, 4, 11, 0.68);
  backdrop-filter: blur(12px);
  cursor: zoom-out;
}

.memory-viewer-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(88vw, 420px);
  max-height: min(82vh, 680px);
  padding: clamp(12px, 2.4vw, 16px);
  border: 1px solid rgba(255, 244, 232, 0.74);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 241, 244, 0.95)),
    var(--paper);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.52),
    0 0 46px rgba(255, 215, 123, 0.16);
  color: #361d28;
}

.memory-viewer-card img {
  display: block;
}

.memory-viewer-media {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: min(62vh, 500px);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 215, 123, 0.18), transparent 34%),
    rgba(54, 29, 40, 0.08);
}

.memory-viewer-media img,
.memory-viewer-media video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
  transition: opacity 0.82s ease, transform 1s cubic-bezier(0.19, 1, 0.22, 1), filter 0.82s ease;
}

.memory-viewer-media video {
  opacity: 0;
  transform: scale(1.018);
  pointer-events: none;
}

.memory-viewer:not(.has-video) .memory-viewer-media video,
.memory-viewer:not(.has-video) .memory-video-sheen,
.memory-viewer:not(.has-video) .memory-video-copy {
  display: none;
}

.memory-viewer-media .memory-video-copy {
  bottom: 14px;
  width: min(calc(100% - 32px), 360px);
  background:
    linear-gradient(180deg, rgba(5, 7, 18, 0.66), rgba(5, 7, 18, 0.46)),
    rgba(255, 122, 168, 0.14);
}

.memory-viewer-media .memory-video-prompt {
  font-size: clamp(12px, 2.8vw, 13px);
}

.memory-viewer-media .memory-video-play {
  min-height: 38px;
  padding: 0 16px;
  background:
    linear-gradient(180deg, rgba(5, 7, 18, 0.62), rgba(5, 7, 18, 0.4)),
    rgba(255, 122, 168, 0.16);
  color: rgba(255, 250, 240, 0.96);
  font-size: 13px;
}

.memory-viewer.video-playing .memory-viewer-media img {
  opacity: 0;
  transform: scale(1.032);
  filter: saturate(1.05) brightness(1.08);
}

.memory-viewer.video-playing .memory-viewer-media video {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.memory-viewer.video-playing .memory-video-sheen {
  animation: memoryVideoSheen 1.05s ease-out both;
}

.memory-viewer.video-playing .memory-video-copy {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 7px) scale(0.96);
}

.memory-viewer-card p {
  color: rgba(54, 29, 40, 0.82);
  font-size: clamp(13px, 2.4vw, 15px);
  font-weight: 750;
  line-height: 1.58;
  text-align: center;
}

.memory-viewer-card .memory-video-prompt {
  color: rgba(255, 250, 240, 0.92);
  font-size: clamp(12px, 2.8vw, 13px);
  font-weight: 760;
  line-height: 1.45;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.52);
}

.memory-viewer-close {
  position: absolute;
  right: -12px;
  top: -12px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 244, 232, 0.78);
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 215, 123, 0.94));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
  cursor: pointer;
}

.memory-viewer-close::before,
.memory-viewer-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: #5f2a16;
  transform: translate(-50%, -50%) rotate(45deg);
}

.memory-viewer-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 215, 123, 0.14), transparent 30%),
    radial-gradient(circle at 58% 56%, rgba(255, 122, 168, 0.1), transparent 24%),
    #050712;
  color: var(--muted);
  font-size: 14px;
  transition: opacity 0.6s ease;
}

.loading-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px var(--gold), 0 0 34px rgba(255, 122, 168, 0.58);
  animation: loadingTwinkle 1.2s ease-in-out infinite;
}

@keyframes loadingTwinkle {
  0%, 100% { transform: scale(0.72); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
}

#loading.hidden {
  opacity: 0;
  pointer-events: none;
}

html[data-variant="sweet"] body::before {
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 224, 138, 0.18), transparent 24%),
    radial-gradient(circle at 78% 18%, rgba(255, 111, 177, 0.26), transparent 27%),
    radial-gradient(circle at 50% 44%, rgba(244, 63, 94, 0.12), transparent 31%),
    radial-gradient(ellipse at 48% 94%, rgba(184, 240, 255, 0.16), transparent 35%),
    linear-gradient(150deg, #080510 0%, #1b1030 46%, #2a1028 100%);
}

html[data-variant="sweet"] .aurora {
  opacity: 0.9;
  background:
    linear-gradient(118deg, transparent 0 24%, rgba(184, 240, 255, 0.12) 40%, transparent 58%),
    linear-gradient(64deg, transparent 0 30%, rgba(255, 224, 138, 0.16) 50%, transparent 69%),
    radial-gradient(ellipse at 62% 60%, rgba(255, 111, 177, 0.26), transparent 44%);
  filter: blur(16px) saturate(128%);
}

html[data-variant="sweet"] .stardust {
  opacity: 0.6;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.76) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255,224,138,0.58) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255,155,201,0.52) 0 1px, transparent 1.5px);
}

html[data-variant="sweet"] .opening-kicker,
html[data-variant="sweet"] .wish-kicker {
  color: var(--rose-soft);
  text-shadow: 0 0 18px rgba(255, 155, 201, 0.5);
}

html[data-variant="sweet"] #opening {
  width: min(90vw, 760px);
}

html[data-variant="sweet"] #opening-title,
html[data-variant="sweet"] #wish-line,
html[data-variant="sweet"] #photo-wall .birthday-text {
  color: #fff5dd;
  text-shadow:
    0 0 20px rgba(255, 224, 138, 0.72),
    0 0 48px rgba(255, 111, 177, 0.42),
    0 16px 46px rgba(0, 0, 0, 0.48);
}

html[data-variant="sweet"] #opening-title {
  text-shadow:
    0 0 20px rgba(255, 224, 138, 0.78),
    0 0 64px rgba(255, 111, 177, 0.5),
    0 18px 52px rgba(0, 0, 0, 0.5);
}

html[data-variant="sweet"] #opening-subtitle {
  color: rgba(255, 242, 249, 0.82);
}

html[data-variant="sweet"] #anniversary-badge {
  background: rgba(42, 16, 40, 0.38);
  border-color: rgba(255, 224, 238, 0.22);
  color: rgba(255, 244, 250, 0.74);
}

html[data-variant="sweet"] #start-button,
html[data-variant="sweet"] #replay-button {
  background:
    linear-gradient(180deg, rgba(255, 248, 222, 0.98), rgba(255, 224, 138, 0.94) 46%, rgba(255, 111, 177, 0.88)),
    var(--gold-deep);
  box-shadow:
    0 18px 52px rgba(255, 111, 177, 0.22),
    0 0 38px rgba(255, 224, 138, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: #4a1c2d;
}

html[data-variant="sweet"] .photo-card::before {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 224, 138, 0.24), transparent 42%),
    radial-gradient(circle at 18% 82%, rgba(255, 155, 201, 0.24), transparent 34%);
}

html[data-variant="sweet"] .photo-card > img,
html[data-variant="sweet"] .memory-face,
html[data-variant="sweet"] .photo-card.memory-card::after,
html[data-variant="sweet"] .photo-card.missing-photo::after,
html[data-variant="sweet"] #photo-wall .grid > img,
html[data-variant="sweet"] .photo-tile,
html[data-variant="sweet"] .memory-tile {
  border-radius: 18px;
  border-color: rgba(255, 247, 251, 0.98);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.34),
    0 0 28px rgba(255, 111, 177, 0.18);
}

html[data-variant="sweet"] .photo-card.memory-card::after,
html[data-variant="sweet"] .memory-face,
html[data-variant="sweet"] .photo-card.missing-photo::after,
html[data-variant="sweet"] .memory-tile {
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 224, 138, 0.3), transparent 30%),
    linear-gradient(145deg, #fff7fb, #ffeaf3 58%, #effbff);
  color: rgba(58, 28, 49, 0.72);
}

html[data-variant="sweet"] .photo-card .caption,
html[data-variant="sweet"] #anniversary-badge,
html[data-variant="sweet"] #sound-toggle {
  background: linear-gradient(180deg, rgba(42, 16, 40, 0.62), rgba(22, 12, 34, 0.44));
  border-color: rgba(255, 224, 238, 0.24);
}

html[data-variant="sweet"] #photo-wall::before {
  background:
    radial-gradient(circle at 50% 42%, rgba(8, 5, 16, 0.72), rgba(31, 12, 38, 0.42) 48%, transparent 72%),
    radial-gradient(circle at 50% 60%, rgba(255, 155, 201, 0.12), transparent 50%);
}

html[data-variant="sweet"] #photo-wall::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 51%;
  z-index: -1;
  width: min(78vw, 700px);
  height: min(58vh, 520px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 42%, rgba(255, 111, 177, 0.18), transparent 34%),
    radial-gradient(circle at 62% 58%, rgba(255, 224, 138, 0.14), transparent 38%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), transparent 56%);
  transform: translate(-50%, -50%);
  filter: blur(18px);
  pointer-events: none;
}

html[data-variant="sweet"] #photo-wall .birthday-text {
  color: #fff0df;
  text-shadow:
    0 0 18px rgba(255, 224, 138, 0.72),
    0 0 58px rgba(255, 111, 177, 0.56),
    0 16px 46px rgba(0, 0, 0, 0.48);
}

html[data-variant="sweet"] .final-message {
  color: rgba(255, 244, 250, 0.88);
}

html[data-variant="sweet"] .final-wish {
  color: rgba(255, 230, 241, 0.76);
}

html[data-variant="sweet"] .cake-top {
  background:
    radial-gradient(circle at 18% 100%, #fff7fb 0 15%, transparent 16%),
    radial-gradient(circle at 42% 100%, #fff7fb 0 17%, transparent 18%),
    radial-gradient(circle at 68% 100%, #fff7fb 0 15%, transparent 16%),
    linear-gradient(180deg, #fff7fb 0 44%, #ffe08a 45% 100%);
}

html[data-variant="sweet"] .cake-middle {
  background:
    linear-gradient(90deg, transparent 0 16%, rgba(255, 255, 255, 0.34) 16% 20%, transparent 20% 44%, rgba(255, 255, 255, 0.26) 44% 49%, transparent 49%),
    linear-gradient(180deg, #ffd8e9, #ff8fc2);
}

html[data-variant="sweet"] .cake-base {
  background:
    radial-gradient(circle at 22% 34%, rgba(255, 247, 251, 0.9) 0 4px, transparent 5px),
    radial-gradient(circle at 48% 42%, rgba(255, 247, 251, 0.8) 0 3px, transparent 4px),
    radial-gradient(circle at 76% 34%, rgba(255, 247, 251, 0.9) 0 4px, transparent 5px),
    linear-gradient(180deg, #ffadd1, #ff6fb1 64%, #db2777);
}

html[data-variant="cinema"] body::before {
  background:
    radial-gradient(circle at 16% 14%, rgba(112, 215, 255, 0.15), transparent 24%),
    radial-gradient(circle at 80% 22%, rgba(246, 199, 107, 0.12), transparent 25%),
    radial-gradient(circle at 48% 42%, rgba(185, 28, 28, 0.08), transparent 30%),
    radial-gradient(ellipse at 50% 104%, rgba(112, 215, 255, 0.13), transparent 36%),
    linear-gradient(150deg, #01040c 0%, #061225 52%, #110b1c 100%);
}

html[data-variant="cinema"] .aurora {
  opacity: 0.58;
  background:
    linear-gradient(112deg, transparent 0 26%, rgba(112, 215, 255, 0.16) 42%, transparent 61%),
    linear-gradient(64deg, transparent 0 36%, rgba(246, 199, 107, 0.12) 50%, transparent 70%),
    radial-gradient(ellipse at 64% 63%, rgba(251, 113, 133, 0.12), transparent 42%);
  filter: blur(18px) saturate(112%);
}

html[data-variant="cinema"] .stardust {
  opacity: 0.42;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.72) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(246,199,107,0.48) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(112,215,255,0.52) 0 1px, transparent 1.5px);
}

html[data-variant="cinema"] #firework-canvas {
  filter: brightness(0.78) saturate(0.92);
}

html[data-variant="cinema"] .vignette {
  background:
    radial-gradient(circle at 50% 41%, transparent 0 36%, rgba(0, 0, 0, 0.5) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.34), transparent 24%, rgba(0, 0, 0, 0.58));
}

html[data-variant="cinema"] .opening-kicker,
html[data-variant="cinema"] .wish-kicker {
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(112, 215, 255, 0.48);
}

html[data-variant="cinema"] #opening {
  top: 50%;
  width: min(86vw, 680px);
}

html[data-variant="cinema"] #opening-title,
html[data-variant="cinema"] #wish-line,
html[data-variant="cinema"] #photo-wall .birthday-text {
  color: #fff3cf;
  text-shadow:
    0 0 16px rgba(246, 199, 107, 0.68),
    0 0 44px rgba(112, 215, 255, 0.28),
    0 18px 52px rgba(0, 0, 0, 0.64);
}

html[data-variant="cinema"] #opening-title {
  font-size: clamp(42px, 8.2vw, 88px);
}

html[data-variant="cinema"] #opening-subtitle,
html[data-variant="cinema"] .final-message,
html[data-variant="cinema"] .final-wish {
  color: rgba(255, 255, 255, 0.78);
}

html[data-variant="cinema"] #opening-subtitle {
  width: min(84vw, 500px);
}

html[data-variant="cinema"] #start-button,
html[data-variant="cinema"] #replay-button {
  background:
    linear-gradient(180deg, rgba(255, 240, 197, 0.96), rgba(246, 199, 107, 0.92) 48%, rgba(154, 97, 28, 0.9)),
    var(--gold-deep);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.34),
    0 0 34px rgba(246, 199, 107, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
  color: #211506;
}

html[data-variant="cinema"] .photo-card::before {
  background:
    radial-gradient(circle at 50% 18%, rgba(246, 199, 107, 0.16), transparent 42%),
    radial-gradient(circle at 18% 82%, rgba(112, 215, 255, 0.16), transparent 34%);
}

html[data-variant="cinema"] .photo-card > img,
html[data-variant="cinema"] .memory-face,
html[data-variant="cinema"] .photo-card.memory-card::after,
html[data-variant="cinema"] .photo-card.missing-photo::after,
html[data-variant="cinema"] #photo-wall .grid > img,
html[data-variant="cinema"] .photo-tile,
html[data-variant="cinema"] .memory-tile {
  border-color: rgba(255, 246, 229, 0.92);
  border-radius: 8px;
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(246, 199, 107, 0.18),
    0 0 26px rgba(112, 215, 255, 0.12);
}

html[data-variant="cinema"] .photo-card.memory-card::after,
html[data-variant="cinema"] .memory-face,
html[data-variant="cinema"] .photo-card.missing-photo::after,
html[data-variant="cinema"] .memory-tile {
  background:
    radial-gradient(circle at 50% 38%, rgba(246, 199, 107, 0.24), transparent 32%),
    linear-gradient(145deg, #fff6e5, #f4e7d0 58%, #eaf8ff);
  color: rgba(23, 30, 46, 0.74);
}

html[data-variant="cinema"] .photo-card .caption,
html[data-variant="cinema"] #anniversary-badge,
html[data-variant="cinema"] #sound-toggle {
  background: linear-gradient(180deg, rgba(3, 10, 25, 0.72), rgba(2, 6, 18, 0.5));
  border-color: rgba(112, 215, 255, 0.18);
}

html[data-variant="cinema"] #photo-wall::before {
  width: min(82vw, 760px);
  height: min(70vh, 620px);
  background:
    radial-gradient(circle at 50% 42%, rgba(1, 4, 12, 0.8), rgba(1, 4, 12, 0.44) 48%, transparent 72%),
    radial-gradient(circle at 50% 60%, rgba(112, 215, 255, 0.08), transparent 50%);
}

html[data-variant="cinema"] #photo-wall::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 51%;
  z-index: -1;
  width: min(78vw, 720px);
  height: min(58vh, 520px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.22) 46%, transparent 70%),
    radial-gradient(circle at 50% 58%, rgba(112, 215, 255, 0.1), transparent 52%);
  transform: translate(-50%, -50%);
  filter: blur(8px);
  pointer-events: none;
}

html[data-variant="cinema"] .cake-top {
  background:
    radial-gradient(circle at 18% 100%, #fff6e5 0 15%, transparent 16%),
    radial-gradient(circle at 42% 100%, #fff6e5 0 17%, transparent 18%),
    radial-gradient(circle at 68% 100%, #fff6e5 0 15%, transparent 16%),
    linear-gradient(180deg, #fff6e5 0 44%, #f6c76b 45% 100%);
}

html[data-variant="cinema"] .cake-middle {
  background:
    linear-gradient(90deg, transparent 0 16%, rgba(255, 255, 255, 0.3) 16% 20%, transparent 20% 44%, rgba(255, 255, 255, 0.22) 44% 49%, transparent 49%),
    linear-gradient(180deg, #ffd7df, #fb7185);
}

html[data-variant="cinema"] .cake-base {
  background:
    radial-gradient(circle at 22% 34%, rgba(255, 246, 229, 0.88) 0 4px, transparent 5px),
    radial-gradient(circle at 48% 42%, rgba(255, 246, 229, 0.76) 0 3px, transparent 4px),
    radial-gradient(circle at 76% 34%, rgba(255, 246, 229, 0.88) 0 4px, transparent 5px),
    linear-gradient(180deg, #fda4af, #e11d48 64%, #991b1b);
}

html[data-variant="letter"] body::before {
  background:
    radial-gradient(circle at 18% 18%, rgba(248, 217, 140, 0.13), transparent 24%),
    radial-gradient(circle at 78% 16%, rgba(253, 164, 175, 0.17), transparent 27%),
    radial-gradient(circle at 50% 42%, rgba(159, 18, 57, 0.12), transparent 32%),
    radial-gradient(ellipse at 50% 96%, rgba(167, 231, 255, 0.09), transparent 36%),
    linear-gradient(150deg, #05030a 0%, #130719 46%, #07101d 100%);
}

html[data-variant="letter"] .aurora {
  opacity: 0.66;
  background:
    linear-gradient(112deg, transparent 0 27%, rgba(253, 164, 175, 0.15) 42%, transparent 61%),
    linear-gradient(64deg, transparent 0 34%, rgba(248, 217, 140, 0.12) 50%, transparent 70%),
    radial-gradient(ellipse at 58% 64%, rgba(225, 29, 72, 0.14), transparent 42%);
  filter: blur(18px) saturate(112%);
}

html[data-variant="letter"] .stardust {
  opacity: 0.46;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.7) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(248,217,140,0.5) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(253,164,175,0.46) 0 1px, transparent 1.5px);
}

html[data-variant="letter"] #firework-canvas {
  filter: brightness(0.76) saturate(0.96);
}

html[data-variant="letter"] .opening-kicker,
html[data-variant="letter"] .wish-kicker {
  color: var(--rose-soft);
  text-shadow: 0 0 20px rgba(253, 164, 175, 0.45);
}

html[data-variant="letter"] #opening {
  width: min(88vw, 700px);
}

html[data-variant="letter"] #opening-title,
html[data-variant="letter"] #wish-line,
html[data-variant="letter"] #photo-wall .birthday-text {
  color: #fff0d6;
  text-shadow:
    0 0 17px rgba(248, 217, 140, 0.7),
    0 0 46px rgba(253, 164, 175, 0.32),
    0 18px 54px rgba(0, 0, 0, 0.58);
}

html[data-variant="letter"] #opening-subtitle {
  color: rgba(255, 239, 231, 0.8);
}

html[data-variant="letter"] #anniversary-badge,
html[data-variant="letter"] .photo-card .caption,
html[data-variant="letter"] #sound-toggle {
  background: linear-gradient(180deg, rgba(36, 12, 24, 0.62), rgba(9, 7, 18, 0.44));
  border-color: rgba(255, 228, 234, 0.22);
}

html[data-variant="letter"] #start-button,
html[data-variant="letter"] #replay-button {
  background:
    linear-gradient(180deg, rgba(255, 246, 219, 0.98), rgba(248, 217, 140, 0.94) 48%, rgba(253, 164, 175, 0.88)),
    var(--gold-deep);
  box-shadow:
    0 18px 48px rgba(159, 18, 57, 0.2),
    0 0 34px rgba(248, 217, 140, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: #40200f;
}

html[data-variant="letter"] .photo-card > img,
html[data-variant="letter"] .memory-face,
html[data-variant="letter"] .photo-card.memory-card::after,
html[data-variant="letter"] .photo-card.missing-photo::after,
html[data-variant="letter"] #photo-wall .grid > img,
html[data-variant="letter"] .photo-tile,
html[data-variant="letter"] .memory-tile {
  border-color: rgba(255, 247, 238, 0.96);
  border-radius: 10px;
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.36),
    0 0 0 1px rgba(248, 217, 140, 0.18),
    0 0 24px rgba(253, 164, 175, 0.12);
}

html[data-variant="letter"] .photo-card.memory-card::after,
html[data-variant="letter"] .memory-face,
html[data-variant="letter"] .photo-card.missing-photo::after,
html[data-variant="letter"] .memory-tile {
  background:
    linear-gradient(90deg, rgba(248, 217, 140, 0.18) 0 1px, transparent 1px),
    radial-gradient(circle at 50% 38%, rgba(248, 217, 140, 0.22), transparent 32%),
    linear-gradient(145deg, #fff7ee, #ffeef2 58%, #f7fbff);
  background-size: 18px 100%, auto, auto;
  color: rgba(53, 31, 41, 0.74);
}

html[data-variant="letter"] #photo-wall::before {
  width: min(84vw, 780px);
  height: min(70vh, 640px);
  background:
    radial-gradient(circle at 50% 42%, rgba(5, 3, 10, 0.78), rgba(22, 8, 25, 0.42) 48%, transparent 72%),
    radial-gradient(circle at 50% 62%, rgba(253, 164, 175, 0.08), transparent 52%);
}

html[data-variant="letter"] #photo-wall::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: -1;
  width: min(76vw, 690px);
  height: min(58vh, 520px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 44% 42%, rgba(248, 217, 140, 0.1), transparent 34%),
    radial-gradient(circle at 60% 60%, rgba(253, 164, 175, 0.13), transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(255, 247, 238, 0.06), transparent 58%);
  transform: translate(-50%, -50%);
  filter: blur(16px);
  pointer-events: none;
}

html[data-variant="letter"] .final-message {
  width: min(84vw, 720px);
  padding: 10px 18px;
  border: 1px solid rgba(255, 228, 234, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(36, 12, 24, 0.42), rgba(9, 7, 18, 0.24));
  color: rgba(255, 243, 235, 0.9);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

html[data-variant="letter"] .final-wishes {
  gap: 4px;
}

html[data-variant="letter"] .final-wish {
  display: block;
  color: rgba(255, 231, 224, 0.78);
}

html[data-variant="letter"] .final-wish::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(248, 217, 140, 0.6);
  vertical-align: 2px;
}

html[data-variant="letter"] .cake-top {
  background:
    radial-gradient(circle at 18% 100%, #fff7ee 0 15%, transparent 16%),
    radial-gradient(circle at 42% 100%, #fff7ee 0 17%, transparent 18%),
    radial-gradient(circle at 68% 100%, #fff7ee 0 15%, transparent 16%),
    linear-gradient(180deg, #fff7ee 0 44%, #f8d98c 45% 100%);
}

html[data-variant="letter"] .cake-middle {
  background:
    linear-gradient(90deg, transparent 0 16%, rgba(255, 255, 255, 0.34) 16% 20%, transparent 20% 44%, rgba(255, 255, 255, 0.24) 44% 49%, transparent 49%),
    linear-gradient(180deg, #ffe1e7, #fda4af);
}

html[data-variant="letter"] .cake-base {
  background:
    radial-gradient(circle at 22% 34%, rgba(255, 247, 238, 0.9) 0 4px, transparent 5px),
    radial-gradient(circle at 48% 42%, rgba(255, 247, 238, 0.78) 0 3px, transparent 4px),
    radial-gradient(circle at 76% 34%, rgba(255, 247, 238, 0.9) 0 4px, transparent 5px),
    linear-gradient(180deg, #fda4af, #e11d48 64%, #9f1239);
}

html[data-variant="keepsake"] body::before {
  background:
    radial-gradient(circle at 18% 16%, rgba(139, 216, 255, 0.11), transparent 24%),
    radial-gradient(circle at 78% 18%, rgba(244, 114, 182, 0.13), transparent 27%),
    radial-gradient(circle at 50% 42%, rgba(190, 18, 60, 0.11), transparent 31%),
    radial-gradient(ellipse at 50% 98%, rgba(247, 208, 122, 0.12), transparent 34%),
    linear-gradient(150deg, #03040b 0%, #081020 48%, #160814 100%);
}

html[data-variant="keepsake"] .aurora {
  opacity: 0.6;
  background:
    linear-gradient(114deg, transparent 0 26%, rgba(139, 216, 255, 0.12) 42%, transparent 62%),
    linear-gradient(64deg, transparent 0 34%, rgba(247, 208, 122, 0.13) 50%, transparent 70%),
    radial-gradient(ellipse at 62% 64%, rgba(244, 114, 182, 0.13), transparent 42%);
  filter: blur(18px) saturate(112%);
}

html[data-variant="keepsake"] .stardust {
  opacity: 0.48;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.7) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(247,208,122,0.52) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(139,216,255,0.42) 0 1px, transparent 1.5px);
}

html[data-variant="keepsake"] #firework-canvas {
  filter: brightness(0.66) saturate(0.9);
}

html[data-variant="keepsake"] .opening-kicker,
html[data-variant="keepsake"] .wish-kicker {
  color: var(--gold);
  text-shadow:
    0 0 18px rgba(247, 208, 122, 0.5),
    0 0 32px rgba(244, 114, 182, 0.18);
}

html[data-variant="keepsake"] #wish-stage::before {
  background:
    radial-gradient(circle at 50% 50%, rgba(247, 208, 122, 0.16), rgba(244, 114, 182, 0.08) 46%, transparent 72%),
    radial-gradient(circle at 44% 44%, rgba(139, 216, 255, 0.07), transparent 54%);
}

html[data-variant="keepsake"] .wish-ritual::before {
  background: linear-gradient(90deg, transparent, rgba(247, 208, 122, 0.4), rgba(244, 114, 182, 0.24), transparent);
}

html[data-variant="keepsake"] .wish-dot.active,
html[data-variant="keepsake"] .wish-dot.complete {
  background: #f7d07a;
  border-color: rgba(255, 244, 232, 0.76);
  box-shadow:
    0 0 16px rgba(247, 208, 122, 0.58),
    0 0 30px rgba(244, 114, 182, 0.26);
}

html[data-variant="keepsake"] #opening {
  top: 49%;
  width: min(88vw, 700px);
}

html[data-variant="keepsake"] #opening-title,
html[data-variant="keepsake"] #wish-line,
html[data-variant="keepsake"] #photo-wall .birthday-text {
  color: #fff0cf;
  text-shadow:
    0 0 16px rgba(247, 208, 122, 0.7),
    0 0 40px rgba(244, 114, 182, 0.3),
    0 18px 54px rgba(0, 0, 0, 0.62);
}

html[data-variant="keepsake"] #opening-title {
  font-size: clamp(44px, 8.6vw, 92px);
}

html[data-variant="keepsake"] #opening-subtitle {
  width: min(86vw, 510px);
  color: rgba(255, 242, 228, 0.8);
}

html[data-variant="keepsake"] #anniversary-badge,
html[data-variant="keepsake"] .photo-card .caption,
html[data-variant="keepsake"] #sound-toggle {
  background: linear-gradient(180deg, rgba(12, 16, 32, 0.68), rgba(6, 8, 18, 0.46));
  border-color: rgba(247, 208, 122, 0.18);
}

html[data-variant="keepsake"] .memory-meta {
  color: rgba(255, 244, 232, 0.62);
}

html[data-variant="keepsake"] .memory-meta span:first-child {
  position: relative;
  padding-left: 14px;
}

html[data-variant="keepsake"] .memory-meta span:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f7d07a;
  box-shadow: 0 0 14px rgba(247, 208, 122, 0.52);
  transform: translateY(-50%);
}

html[data-variant="keepsake"] .memory-meta span:last-child {
  color: rgba(247, 208, 122, 0.84);
}

html[data-variant="keepsake"] #start-button,
html[data-variant="keepsake"] #replay-button {
  background:
    linear-gradient(180deg, rgba(255, 245, 213, 0.98), rgba(247, 208, 122, 0.94) 48%, rgba(190, 18, 60, 0.82)),
    var(--gold-deep);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.3),
    0 0 34px rgba(247, 208, 122, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: #291403;
}

html[data-variant="keepsake"] .photo-card > img,
html[data-variant="keepsake"] .memory-face,
html[data-variant="keepsake"] .photo-card.memory-card::after,
html[data-variant="keepsake"] .photo-card.missing-photo::after,
html[data-variant="keepsake"] #photo-wall .grid > img,
html[data-variant="keepsake"] .photo-tile,
html[data-variant="keepsake"] .memory-tile {
  border-color: rgba(255, 244, 232, 0.94);
  border-radius: 9px;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(247, 208, 122, 0.16),
    0 0 22px rgba(244, 114, 182, 0.1);
}

html[data-variant="keepsake"] .photo-card.memory-card::after,
html[data-variant="keepsake"] .photo-card.missing-photo::after,
html[data-variant="keepsake"] .memory-face,
html[data-variant="keepsake"] .photo-tile,
html[data-variant="keepsake"] .memory-tile {
  background:
    radial-gradient(circle at 50% 38%, rgba(247, 208, 122, 0.22), transparent 32%),
    linear-gradient(145deg, #fff4e8, #fff0f3 58%, #edf9ff);
  color: rgba(37, 30, 42, 0.76);
}

html[data-variant="keepsake"] .photo-card .caption {
  max-width: min(84vw, 600px);
  border-color: rgba(247, 208, 122, 0.18);
  background:
    linear-gradient(180deg, rgba(12, 16, 32, 0.72), rgba(6, 8, 18, 0.5)),
    linear-gradient(90deg, rgba(247, 208, 122, 0.08), rgba(244, 114, 182, 0.06), rgba(139, 216, 255, 0.04));
  color: rgba(255, 246, 232, 0.92);
  text-shadow:
    0 10px 28px rgba(0, 0, 0, 0.58),
    0 0 18px rgba(247, 208, 122, 0.18);
}

html[data-variant="keepsake"] .photo-card.has-photo > img {
  filter: saturate(1.02) contrast(1.03) brightness(0.97);
  box-shadow:
    0 22px 58px rgba(0, 0, 0, 0.44),
    0 0 0 1px rgba(247, 208, 122, 0.2),
    0 0 24px rgba(244, 114, 182, 0.12);
}

html[data-variant="keepsake"] .photo-tile::before {
  inset: 5px;
  background:
    linear-gradient(180deg, transparent 34%, rgba(3, 4, 11, 0.18) 56%, rgba(3, 4, 11, 0.74) 100%),
    radial-gradient(circle at 50% 100%, rgba(247, 208, 122, 0.12), transparent 64%);
}

html[data-variant="keepsake"] .memory-face {
  border-width: 10px;
  border-color: rgba(255, 244, 232, 0.96);
  background:
    linear-gradient(90deg, rgba(247, 208, 122, 0.32), rgba(244, 114, 182, 0.18), rgba(139, 216, 255, 0.12)) top / 100% 5px no-repeat,
    radial-gradient(circle at 50% 34%, rgba(247, 208, 122, 0.24), transparent 26%),
    radial-gradient(circle at 78% 78%, rgba(139, 216, 255, 0.1), transparent 30%),
    linear-gradient(145deg, rgba(255, 248, 238, 0.98), rgba(255, 240, 243, 0.96) 58%, rgba(239, 249, 255, 0.94));
}

html[data-variant="keepsake"] .memory-face::before {
  border-color: rgba(161, 98, 7, 0.14);
}

html[data-variant="keepsake"] .memory-face-mark {
  color: rgba(37, 30, 42, 0.72);
}

html[data-variant="keepsake"] .memory-face-note {
  color: rgba(136, 19, 55, 0.48);
}

html[data-variant="keepsake"] #photo-wall::before {
  width: min(84vw, 760px);
  height: min(68vh, 610px);
  background:
    radial-gradient(circle at 50% 42%, rgba(3, 4, 11, 0.84), rgba(8, 16, 32, 0.48) 48%, transparent 72%),
    radial-gradient(circle at 50% 62%, rgba(247, 208, 122, 0.08), transparent 52%);
}

html[data-variant="keepsake"] #photo-wall::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: -1;
  width: min(74vw, 680px);
  height: min(56vh, 500px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 44%, rgba(0, 0, 0, 0.34), transparent 42%),
    radial-gradient(circle at 46% 58%, rgba(247, 208, 122, 0.1), transparent 45%),
    radial-gradient(circle at 62% 50%, rgba(244, 114, 182, 0.08), transparent 42%);
  transform: translate(-50%, -50%);
  filter: blur(12px);
  pointer-events: none;
}

html[data-variant="keepsake"] #photo-wall .grid {
  width: min(90vw, 760px);
  gap: clamp(10px, 1.25vw, 16px);
  opacity: 0.96;
}

html[data-variant="keepsake"] .final-title-row {
  gap: clamp(10px, 1.7vw, 18px);
}

html[data-variant="keepsake"] #photo-wall .birthday-text {
  position: relative;
  padding-bottom: 8px;
}

html[data-variant="keepsake"] #photo-wall .birthday-text::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(46vw, 260px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(247, 208, 122, 0.88), rgba(244, 114, 182, 0.54), transparent);
  box-shadow: 0 0 18px rgba(247, 208, 122, 0.34);
  transform: translateX(-50%);
}

html[data-variant="keepsake"] .final-message {
  width: min(84vw, 740px);
  padding: 7px 0 8px;
  border-top: 1px solid rgba(247, 208, 122, 0.13);
  border-bottom: 1px solid rgba(244, 114, 182, 0.12);
  background: linear-gradient(90deg, transparent, rgba(247, 208, 122, 0.06), rgba(244, 114, 182, 0.04), transparent);
  color: rgba(255, 246, 232, 0.9);
  text-shadow:
    0 10px 30px rgba(0, 0, 0, 0.78),
    0 0 18px rgba(247, 208, 122, 0.16);
}

html[data-variant="keepsake"] .final-wishes {
  gap: 3px;
  margin-top: 0;
}

html[data-variant="keepsake"] .final-wish {
  color: rgba(255, 232, 224, 0.76);
}

html[data-variant="keepsake"] .memory-tile::before {
  left: 13px;
  top: 11px;
  color: rgba(161, 98, 7, 0.68);
}

html[data-variant="keepsake"] .photo-tile,
html[data-variant="keepsake"] .memory-tile {
  width: clamp(132px, 10.6vw, 154px);
  max-width: 154px;
  aspect-ratio: 1.1;
  overflow: hidden;
  border-width: 1px;
  border-color: rgba(247, 208, 122, 0.32);
  background:
    linear-gradient(90deg, rgba(247, 208, 122, 0.34), rgba(251, 113, 133, 0.2), rgba(139, 216, 255, 0.15)) top / 100% 4px no-repeat,
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.74), transparent 22%),
    radial-gradient(circle at 86% 88%, rgba(247, 208, 122, 0.18), transparent 30%),
    linear-gradient(145deg, rgba(255, 248, 238, 0.98), rgba(255, 240, 243, 0.96) 56%, rgba(239, 249, 255, 0.94));
  color: rgba(34, 27, 38, 0.82);
  font-size: clamp(12px, 1vw, 13px);
  line-height: 1.45;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-variant="keepsake"] .photo-tile {
  padding: 5px;
}

html[data-variant="keepsake"] .photo-tile img {
  border-radius: 6px;
  filter: saturate(1.04) contrast(1.02);
}

html[data-variant="keepsake"] .photo-tile figcaption {
  left: 9px;
  right: 9px;
  bottom: 9px;
  border-color: rgba(247, 208, 122, 0.18);
  background:
    linear-gradient(180deg, rgba(8, 12, 28, 0.82), rgba(8, 12, 28, 0.58)),
    linear-gradient(90deg, rgba(247, 208, 122, 0.18), rgba(244, 114, 182, 0.12));
  color: rgba(255, 246, 232, 0.94);
}

html[data-variant="keepsake"] .memory-tile {
  align-content: center;
  justify-items: center;
  padding: 30px 15px 19px;
}

html[data-variant="keepsake"] .memory-tile::after {
  content: attr(data-label);
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: rgba(136, 19, 55, 0.44);
  font-family: var(--font-accent);
  font-size: 11px;
  font-weight: 700;
}

html[data-variant="keepsake"] .birthday-cake {
  filter:
    drop-shadow(0 0 10px rgba(247, 208, 122, 0.34))
    drop-shadow(0 14px 24px rgba(0, 0, 0, 0.38));
}

html[data-variant="keepsake"] .cake-top {
  background:
    radial-gradient(circle at 18% 100%, #fff4e8 0 15%, transparent 16%),
    radial-gradient(circle at 42% 100%, #fff4e8 0 17%, transparent 18%),
    radial-gradient(circle at 68% 100%, #fff4e8 0 15%, transparent 16%),
    linear-gradient(180deg, #fff4e8 0 44%, #f7d07a 45% 100%);
}

html[data-variant="keepsake"] .cake-middle {
  background:
    linear-gradient(90deg, transparent 0 16%, rgba(255, 255, 255, 0.32) 16% 20%, transparent 20% 44%, rgba(255, 255, 255, 0.24) 44% 49%, transparent 49%),
    linear-gradient(180deg, #ffd7df, #fb7185);
}

html[data-variant="keepsake"] .cake-base {
  background:
    radial-gradient(circle at 22% 34%, rgba(255, 244, 232, 0.88) 0 4px, transparent 5px),
    radial-gradient(circle at 48% 42%, rgba(255, 244, 232, 0.78) 0 3px, transparent 4px),
    radial-gradient(circle at 76% 34%, rgba(255, 244, 232, 0.88) 0 4px, transparent 5px),
    linear-gradient(180deg, #fb7185, #be123c 64%, #881337);
}

@media (max-width: 640px) {
  html[data-variant="luxury"] {
    --final-firework-opacity: 0.74;
  }

  html[data-variant="sweet"] {
    --final-firework-opacity: 0.68;
  }

  html[data-variant="cinema"] {
    --final-firework-opacity: 0.58;
  }

  html[data-variant="letter"] {
    --final-firework-opacity: 0.54;
  }

  html[data-variant="keepsake"] {
    --final-firework-opacity: 0.34;
  }

  html[data-variant="keepsake"] #photo-wall .birthday-text {
    padding-bottom: 5px;
  }

  html[data-variant="keepsake"] #photo-wall .birthday-text::after {
    width: min(54vw, 190px);
  }

  html[data-variant="keepsake"] .final-message {
    padding: 4px 0 5px;
  }

  #opening {
    top: 46%;
  }

  #opening-title {
    font-size: clamp(42px, 15vw, 64px);
  }

  #opening-subtitle {
    margin-top: 14px;
  }

  #wish-line {
    font-size: clamp(25px, 9vw, 40px);
  }

  .wish-kicker {
    margin-bottom: 11px;
    font-size: 12px;
  }

  .wish-ritual {
    margin-top: 18px;
  }

  .wish-dot {
    width: 8px;
    height: 8px;
  }

  .wish-constellation {
    gap: 10px;
    width: min(84vw, 320px);
    margin-top: 14px;
  }

  .wish-guide {
    width: min(82vw, 300px);
    font-size: 12px;
    line-height: 1.45;
  }

  .wish-star-pad {
    gap: 16px;
    min-height: 52px;
  }

  .wish-star-button {
    width: 46px;
    height: 46px;
  }

  .opening-actions,
  .final-actions {
    gap: 10px;
  }

  #start-button,
  #replay-button {
    min-height: 44px;
    padding: 0 18px;
  }

  .memory-viewer {
    padding: 18px;
  }

  .memory-viewer-card {
    width: min(90vw, 340px);
    max-height: 78vh;
    padding: 11px;
  }

  .memory-viewer-media {
    max-height: 56vh;
  }

  .memory-viewer-close {
    right: -8px;
    top: -8px;
    width: 34px;
    height: 34px;
  }

  .photo-card {
    width: min(88vw, 420px);
  }

  .memory-meta {
    min-height: 22px;
    font-size: 11px;
  }

  .photo-card > img,
  .memory-media,
  .memory-face,
  .photo-card.memory-card::after,
  .photo-card.missing-photo::after {
    max-height: 43vh;
  }

  .photo-card > img,
  .memory-media {
    padding: 9px 9px 36px;
  }

  .memory-media video,
  .memory-video-sheen {
    inset: 9px 9px 36px;
    width: calc(100% - 18px);
    height: calc(100% - 45px);
  }

  .memory-video-copy {
    bottom: 8px;
    width: min(calc(100% - 22px), 330px);
    gap: 6px;
    padding: 8px 10px 9px;
    border-radius: 14px;
  }

  .memory-video-prompt {
    font-size: 11px;
    line-height: 1.4;
  }

  .memory-video-play {
    min-height: 32px;
    padding: 0 12px;
    font-size: 11px;
  }

  .memory-nav {
    gap: 8px;
  }

  .memory-prev,
  .memory-next {
    min-height: 44px;
    padding: 0 10px;
    font-size: 12px;
    letter-spacing: 0.06em;
  }

  .photo-card .caption,
  #hint-text {
    border-radius: 18px;
    font-size: 14px;
  }

  #hint-text {
    bottom: clamp(20px, 6vh, 54px);
  }

  #photo-wall {
    justify-content: center;
    gap: 8px;
    padding: 16px;
  }

  #photo-wall .grid {
    width: min(88vw, 390px);
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 6px;
  }

  #photo-wall .grid > img,
  .photo-tile,
  .memory-tile {
    width: clamp(104px, 36vw, 120px);
    max-width: 120px;
    border-width: 5px;
    font-size: 12px;
  }

  .photo-tile {
    padding: 5px;
  }

  .photo-tile figcaption {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-height: 34px;
    padding: 4px 5px;
    font-size: 9px;
  }

  .photo-tile::before {
    inset: 5px;
  }

  .memory-tile {
    padding: 12px;
  }

  #photo-wall .birthday-text {
    font-size: clamp(34px, 12vw, 54px);
  }

  .final-title-row {
    gap: 10px;
    flex-wrap: wrap;
  }

  .birthday-cake {
    width: 72px;
    height: 76px;
    margin-top: 0;
  }

  .final-message {
    font-size: 14px;
  }

  .final-wishes {
    gap: 6px;
  }

  .final-wish {
    font-size: 13px;
  }
}

@media (max-height: 620px) {
  .photo-card > img,
  .memory-media,
  .memory-face,
  .photo-card.memory-card::after,
  .photo-card.missing-photo::after {
    max-height: 42vh;
  }

  #photo-wall {
    gap: 10px;
  }

  #photo-wall .grid > img,
  .photo-tile,
  .memory-tile {
    max-width: 112px;
  }
}

/* Iteration 11: keepsake final composition */
html[data-variant="keepsake"] #photo-wall {
  gap: clamp(7px, 1.35vh, 14px);
  padding-block: clamp(30px, 5vh, 58px) clamp(24px, 4vh, 44px);
}

html[data-variant="keepsake"] #photo-wall::before {
  width: min(78vw, 720px);
  height: min(64vh, 570px);
  background:
    radial-gradient(circle at 50% 38%, rgba(3, 4, 11, 0.9), rgba(8, 16, 32, 0.58) 46%, transparent 73%),
    radial-gradient(circle at 50% 61%, rgba(247, 208, 122, 0.11), transparent 50%),
    radial-gradient(circle at 58% 48%, rgba(244, 114, 182, 0.08), transparent 48%);
  filter: blur(3px);
}

html[data-variant="keepsake"] #photo-wall::after {
  top: 50%;
  width: min(70vw, 660px);
  height: min(48vh, 430px);
  background:
    linear-gradient(90deg, transparent, rgba(247, 208, 122, 0.08), rgba(244, 114, 182, 0.06), transparent),
    radial-gradient(circle at 50% 50%, rgba(255, 244, 232, 0.055), transparent 62%);
  filter: blur(10px);
}

html[data-variant="keepsake"] #photo-wall .grid {
  position: relative;
  width: min(82vw, 690px);
  gap: clamp(8px, 1vw, 12px);
  margin-bottom: clamp(1px, 0.4vh, 5px);
  opacity: 0.86;
}

html[data-variant="keepsake"] #photo-wall .grid::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: calc(100% + 26px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(247, 208, 122, 0.28), rgba(244, 114, 182, 0.18), transparent);
  transform: translate(-50%, -50%);
}

html[data-variant="keepsake"] .photo-tile,
html[data-variant="keepsake"] .memory-tile {
  width: clamp(118px, 9.2vw, 138px);
  max-width: 138px;
  aspect-ratio: 1.28;
  border-radius: 8px;
  border-color: rgba(247, 208, 122, 0.24);
  background:
    linear-gradient(90deg, rgba(247, 208, 122, 0.26), rgba(251, 113, 133, 0.16), rgba(139, 216, 255, 0.1)) top / 100% 3px no-repeat,
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.68), transparent 22%),
    linear-gradient(145deg, rgba(255, 248, 238, 0.96), rgba(255, 240, 243, 0.94) 56%, rgba(239, 249, 255, 0.9));
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

html[data-variant="keepsake"] .memory-tile {
  padding: 24px 14px 18px;
  font-size: clamp(11px, 0.92vw, 12px);
  line-height: 1.38;
}

html[data-variant="keepsake"] .memory-tile::before {
  left: 12px;
  top: 9px;
  font-size: 10px;
}

html[data-variant="keepsake"] .memory-tile::after {
  right: 11px;
  bottom: 8px;
  font-size: 10px;
}

html[data-variant="keepsake"] .final-title-row {
  position: relative;
  gap: clamp(8px, 1.35vw, 16px);
  margin-top: clamp(0px, 0.4vh, 4px);
}

html[data-variant="keepsake"] .final-title-row::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: -1;
  width: min(74vw, 560px);
  height: 56%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(247, 208, 122, 0.15), rgba(244, 114, 182, 0.07) 48%, transparent 72%);
  transform: translate(-50%, -50%);
  filter: blur(14px);
}

html[data-variant="keepsake"] #photo-wall .birthday-text {
  font-size: clamp(50px, 6.2vw, 82px);
  line-height: 0.98;
  padding-bottom: 10px;
}

html[data-variant="keepsake"] #photo-wall .birthday-text::after {
  width: min(40vw, 240px);
}

html[data-variant="keepsake"] .birthday-cake {
  width: clamp(78px, 7.8vw, 106px);
  height: clamp(80px, 8.2vw, 112px);
}

html[data-variant="keepsake"] .final-message {
  width: min(78vw, 690px);
  margin-top: clamp(1px, 0.5vh, 5px);
  padding: 9px 18px 10px;
  border-top-color: rgba(247, 208, 122, 0.2);
  border-bottom-color: rgba(244, 114, 182, 0.17);
  background:
    linear-gradient(90deg, transparent, rgba(247, 208, 122, 0.07), rgba(244, 114, 182, 0.055), transparent);
  font-size: clamp(15px, 1.55vw, 18px);
  font-weight: 700;
  line-height: 1.62;
}

html[data-variant="keepsake"] .final-wishes {
  width: min(74vw, 620px);
  gap: 4px;
  margin-top: 2px;
}

html[data-variant="keepsake"] .final-wish {
  position: relative;
  padding-left: 18px;
  color: rgba(255, 238, 229, 0.78);
  font-size: clamp(12px, 1.28vw, 14px);
  line-height: 1.54;
  text-align: left;
}

html[data-variant="keepsake"] .final-wish::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.78em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(247, 208, 122, 0.9);
  box-shadow: 0 0 12px rgba(247, 208, 122, 0.5);
}

html[data-variant="keepsake"] #replay-button {
  margin-top: 6px;
}

@media (max-width: 640px) {
  html[data-variant="keepsake"] #photo-wall {
    gap: 7px;
    padding: 18px 18px 20px;
  }

  html[data-variant="keepsake"] #photo-wall::before {
    width: 92vw;
    height: 76vh;
  }

  html[data-variant="keepsake"] #photo-wall::after {
    width: 86vw;
    height: 58vh;
  }

  html[data-variant="keepsake"] #photo-wall .grid {
    width: min(86vw, 350px);
    gap: 8px;
    margin-bottom: 3px;
  }

  html[data-variant="keepsake"] .photo-tile,
  html[data-variant="keepsake"] .memory-tile {
    width: clamp(96px, 31vw, 112px);
    max-width: 112px;
    aspect-ratio: 1.08;
    border-width: 1px;
    border-radius: 8px;
  }

  html[data-variant="keepsake"] .memory-tile {
    padding: 23px 10px 16px;
    font-size: 11px;
    line-height: 1.34;
  }

  html[data-variant="keepsake"] .memory-tile::after {
    right: 9px;
    bottom: 7px;
    font-size: 9px;
  }

  html[data-variant="keepsake"] .final-title-row {
    gap: 8px;
    flex-wrap: nowrap;
  }

  html[data-variant="keepsake"] #photo-wall .birthday-text {
    font-size: clamp(42px, 12.4vw, 52px);
    padding-bottom: 7px;
  }

  html[data-variant="keepsake"] #photo-wall .birthday-text::after {
    width: min(44vw, 150px);
  }

  html[data-variant="keepsake"] .birthday-cake {
    width: 66px;
    height: 72px;
  }

  html[data-variant="keepsake"] .final-message {
    width: min(88vw, 340px);
    padding: 7px 8px 8px;
    font-size: 13px;
    line-height: 1.56;
  }

  html[data-variant="keepsake"] .final-wishes {
    width: min(84vw, 322px);
    gap: 3px;
  }

  html[data-variant="keepsake"] .final-wish {
    padding-left: 15px;
    font-size: 12px;
    line-height: 1.42;
  }

  html[data-variant="keepsake"] #replay-button {
    min-height: 42px;
    margin-top: 5px;
    padding-inline: 20px;
  }
}

/* Iteration 12: compact final memory rail */
@media (max-width: 640px) {
  html[data-variant="keepsake"] #photo-wall {
    gap: 6px;
    padding: 22px 18px 24px;
  }

  html[data-variant="keepsake"] #photo-wall .grid {
    flex-wrap: nowrap;
    width: min(88vw, 342px);
    gap: 6px;
    margin-bottom: 7px;
    opacity: 0.8;
  }

  html[data-variant="keepsake"] #photo-wall .grid::before {
    width: calc(100% + 14px);
    opacity: 0.72;
  }

  html[data-variant="keepsake"] .photo-tile,
  html[data-variant="keepsake"] .memory-tile {
    width: clamp(70px, 20vw, 78px);
    max-width: 78px;
    aspect-ratio: 1;
    border-radius: 7px;
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(255, 255, 255, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.62);
  }

  html[data-variant="keepsake"] .memory-tile {
    overflow: hidden;
    padding: 17px 7px 10px;
    font-size: 9px;
    line-height: 1.22;
  }

  html[data-variant="keepsake"] .memory-tile::before {
    left: 7px;
    top: 6px;
    font-size: 8px;
  }

  html[data-variant="keepsake"] .memory-tile::after {
    content: none;
  }

  html[data-variant="keepsake"] .photo-tile {
    padding: 4px;
  }

  html[data-variant="keepsake"] .photo-tile::before {
    inset: 4px;
    border-radius: 5px;
    background: linear-gradient(180deg, transparent 34%, rgba(3, 4, 11, 0.46) 100%);
  }

  html[data-variant="keepsake"] .photo-tile figcaption {
    display: none;
  }

  html[data-variant="keepsake"] .final-title-row {
    margin-top: 5px;
  }

  html[data-variant="keepsake"] #photo-wall .birthday-text {
    font-size: clamp(48px, 13.2vw, 58px);
    line-height: 0.96;
  }

  html[data-variant="keepsake"] .birthday-cake {
    width: 70px;
    height: 74px;
  }

  html[data-variant="keepsake"] .final-message {
    margin-top: 6px;
    font-size: 13.5px;
  }
}

/* Iteration 13: quiet final placeholders when photos are missing */
html[data-variant="keepsake"] .memory-tile.placeholder-memory {
  font-size: 0;
  background:
    linear-gradient(90deg, rgba(247, 208, 122, 0.28), rgba(251, 113, 133, 0.16), rgba(139, 216, 255, 0.1)) top / 100% 3px no-repeat,
    radial-gradient(circle at 50% 42%, rgba(247, 208, 122, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(255, 248, 238, 0.96), rgba(255, 240, 243, 0.94) 58%, rgba(239, 249, 255, 0.88));
}

html[data-variant="keepsake"] .memory-tile.placeholder-memory::before {
  left: 50%;
  top: 43%;
  color: rgba(45, 34, 48, 0.72);
  font-family: var(--font-accent);
  font-size: clamp(20px, 2.1vw, 26px);
  font-weight: 800;
  letter-spacing: 0.02em;
  transform: translate(-50%, -50%);
}

html[data-variant="keepsake"] .memory-tile.placeholder-memory::after {
  left: 0;
  right: 0;
  bottom: 17px;
  color: rgba(136, 19, 55, 0.5);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 640px) {
  html[data-variant="keepsake"] .memory-tile.placeholder-memory::before {
    top: 40%;
    font-size: 16px;
  }

  html[data-variant="keepsake"] .memory-tile.placeholder-memory::after {
    content: attr(data-label);
    left: 0;
    right: 0;
    bottom: 9px;
    color: rgba(136, 19, 55, 0.48);
    font-size: 8px;
    text-align: center;
  }
}

/* Iteration 14: real photo final rail */
html[data-variant="keepsake"] #photo-wall .grid.has-real-photos {
  width: min(84vw, 720px);
  align-items: flex-end;
  gap: clamp(9px, 1vw, 13px);
  margin-bottom: clamp(2px, 0.6vh, 7px);
  opacity: 0.94;
}

html[data-variant="keepsake"] #photo-wall .grid.has-real-photos .photo-tile.has-photo {
  width: clamp(102px, 7.8vw, 126px);
  max-width: 126px;
  aspect-ratio: 4 / 5;
  padding: 5px;
  border-color: rgba(255, 244, 232, 0.82);
  background:
    linear-gradient(90deg, rgba(247, 208, 122, 0.28), rgba(251, 113, 133, 0.18), rgba(139, 216, 255, 0.12)) top / 100% 3px no-repeat,
    linear-gradient(145deg, rgba(255, 248, 238, 0.97), rgba(255, 240, 243, 0.94));
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.38),
    0 0 22px rgba(247, 208, 122, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

html[data-variant="keepsake"] #photo-wall .grid.has-real-photos .photo-tile.has-photo::before {
  inset: 5px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(3, 4, 11, 0.08), transparent 28%, rgba(3, 4, 11, 0.18) 58%, rgba(3, 4, 11, 0.74) 100%),
    linear-gradient(90deg, rgba(3, 4, 11, 0.18), transparent 20%, transparent 80%, rgba(3, 4, 11, 0.18));
}

html[data-variant="keepsake"] #photo-wall .grid.has-real-photos .photo-tile.has-photo img {
  border-radius: 6px;
  filter: saturate(1.03) contrast(1.03) brightness(0.98);
}

html[data-variant="keepsake"] #photo-wall .grid.has-real-photos .photo-tile.has-photo figcaption {
  display: none;
}

html[data-variant="keepsake"] #photo-wall .grid.has-real-photos ~ .final-title-row {
  margin-top: clamp(2px, 0.6vh, 7px);
}

html[data-variant="keepsake"] #photo-wall .grid.has-real-photos .photo-tile.has-photo::after {
  content: attr(data-index);
  position: absolute;
  left: 9px;
  bottom: 8px;
  z-index: 2;
  min-width: 18px;
  padding: 2px 4px;
  border-radius: 999px;
  background: rgba(5, 7, 18, 0.62);
  color: rgba(255, 244, 232, 0.84);
  font-family: var(--font-accent);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.26);
}

@media (max-width: 640px) {
  html[data-variant="keepsake"] #photo-wall .grid.has-real-photos {
    width: min(90vw, 348px);
    gap: 6px;
    margin-bottom: 7px;
  }

  html[data-variant="keepsake"] #photo-wall .grid.has-real-photos .photo-tile.has-photo {
    width: clamp(72px, 20.5vw, 80px);
    max-width: 80px;
    aspect-ratio: 4 / 5;
    padding: 3px;
    border-radius: 7px;
  }

  html[data-variant="keepsake"] #photo-wall .grid.has-real-photos .photo-tile.has-photo::before {
    inset: 3px;
    border-radius: 5px;
    background:
      linear-gradient(180deg, rgba(3, 4, 11, 0.04), transparent 42%, rgba(3, 4, 11, 0.4) 100%),
      linear-gradient(90deg, rgba(3, 4, 11, 0.14), transparent 24%, transparent 76%, rgba(3, 4, 11, 0.14));
  }

  html[data-variant="keepsake"] #photo-wall .grid.has-real-photos .photo-tile.has-photo img {
    border-radius: 5px;
  }

  html[data-variant="keepsake"] #photo-wall .grid.has-real-photos ~ .final-title-row {
    margin-top: 7px;
  }

  html[data-variant="keepsake"] #photo-wall .grid.has-real-photos .photo-tile.has-photo::after {
    left: 7px;
    bottom: 7px;
    min-width: 15px;
    padding: 2px 3px;
    font-size: 8px;
  }
}

/* Iteration 17: make memory photos read as one keepsake card */
html[data-variant="keepsake"] .photo-card.has-photo {
  gap: 0;
}

html[data-variant="keepsake"] .photo-card.has-photo .memory-meta {
  margin-bottom: clamp(8px, 1.4vh, 12px);
}

html[data-variant="keepsake"] .photo-card.has-photo > img,
html[data-variant="keepsake"] .photo-card.has-photo .memory-media {
  width: min(100%, 540px);
  aspect-ratio: 4 / 5;
  max-height: 58vh;
  padding: 13px 13px 76px;
  border-radius: 11px;
  background:
    linear-gradient(90deg, rgba(247, 208, 122, 0.28), rgba(244, 114, 182, 0.14), rgba(139, 216, 255, 0.09)) top / 100% 5px no-repeat,
    linear-gradient(180deg, rgba(255, 250, 240, 0.99), rgba(255, 244, 232, 0.98));
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(247, 208, 122, 0.2),
    0 0 30px rgba(244, 114, 182, 0.12);
}

html[data-variant="keepsake"] .photo-card.has-photo .caption {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 42px), 470px);
  min-height: 50px;
  margin-top: -68px;
  padding: 8px 18px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(58, 37, 43, 0.78);
  font-size: clamp(13px, 1.35vw, 16px);
  font-weight: 800;
  line-height: 1.46;
  text-align: center;
  text-shadow: none;
  backdrop-filter: none;
}

html[data-variant="keepsake"] .photo-card.has-photo .caption::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -2px;
  width: min(58%, 210px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(161, 98, 7, 0.28), transparent);
  transform: translateX(-50%);
}

@media (max-width: 640px) {
  html[data-variant="keepsake"] .photo-card.has-photo {
    width: min(88vw, 390px);
  }

  html[data-variant="keepsake"] .photo-card.has-photo .memory-meta {
    margin-bottom: 8px;
  }

  html[data-variant="keepsake"] .photo-card.has-photo > img,
  html[data-variant="keepsake"] .photo-card.has-photo .memory-media {
    max-height: 45vh;
    padding: 9px 9px 62px;
    border-radius: 10px;
  }

  html[data-variant="keepsake"] .photo-card.has-photo .caption {
    width: min(calc(100% - 30px), 318px);
    min-height: 46px;
    margin-top: -56px;
    padding: 7px 12px 8px;
    font-size: 13px;
    line-height: 1.36;
  }
}

/* Iteration 18: ceremony album and blessing-letter composition */
html[data-scheme="ceremony"] {
  --final-firework-opacity: 0.34;
}

html[data-scheme="ceremony"] #photo-wall.show {
  display: grid;
  grid-template-columns: minmax(270px, 380px) minmax(460px, 660px);
  grid-template-areas:
    "photos title"
    "photos message"
    "photos wishes"
    "photos actions";
  align-content: center;
  align-items: center;
  justify-content: center;
  column-gap: clamp(46px, 5.4vw, 84px);
  row-gap: clamp(10px, 1.45vh, 17px);
  padding: clamp(34px, 6vh, 76px) clamp(46px, 7vw, 104px);
}

html[data-scheme="ceremony"] #photo-wall::before {
  width: min(88vw, 980px);
  height: min(72vh, 650px);
  border-radius: 38px;
  background:
    radial-gradient(circle at 32% 42%, rgba(247, 208, 122, 0.11), transparent 36%),
    radial-gradient(circle at 69% 48%, rgba(244, 114, 182, 0.13), transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(3, 4, 11, 0.92), rgba(8, 16, 32, 0.48) 54%, transparent 78%);
  filter: blur(5px);
}

html[data-scheme="ceremony"] #photo-wall::after {
  top: 51%;
  width: min(76vw, 860px);
  height: min(58vh, 520px);
  background:
    linear-gradient(90deg, transparent, rgba(247, 208, 122, 0.08), rgba(244, 114, 182, 0.08), transparent),
    radial-gradient(circle at 37% 44%, rgba(255, 244, 232, 0.07), transparent 48%),
    radial-gradient(circle at 71% 52%, rgba(139, 216, 255, 0.05), transparent 42%);
  filter: blur(14px);
}

html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos {
  grid-area: photos;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-self: end;
  width: min(29vw, 374px);
  gap: clamp(12px, 1.25vw, 18px);
  margin: 0;
  opacity: 0.98;
}

html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos::before {
  width: calc(100% + 70px);
  height: calc(100% + 70px);
  border: 1px solid rgba(247, 208, 122, 0.045);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 50%, rgba(247, 208, 122, 0.08), transparent 62%),
    radial-gradient(circle at 36% 28%, rgba(244, 114, 182, 0.065), transparent 44%);
  opacity: 0.58;
}

html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos .photo-tile.has-photo {
  width: 100%;
  max-width: none;
  aspect-ratio: 4 / 5;
  padding: 6px;
  border-width: 1px;
  border-color: rgba(255, 244, 232, 0.86);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(247, 208, 122, 0.32), rgba(244, 114, 182, 0.18), rgba(139, 216, 255, 0.12)) top / 100% 4px no-repeat,
    linear-gradient(145deg, rgba(255, 250, 240, 0.98), rgba(255, 240, 243, 0.94));
  box-shadow:
    0 20px 46px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.4),
    0 0 24px rgba(247, 208, 122, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos .photo-tile.has-photo::before {
  inset: 6px;
  border-radius: 8px;
}

html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos .photo-tile.has-photo::after {
  left: 10px;
  bottom: 10px;
}

html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos .photo-tile.has-photo.show:nth-child(1) {
  transform: translateY(-8px) rotate(-3deg);
}

html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos .photo-tile.has-photo.show:nth-child(2) {
  transform: translateY(12px) rotate(2.2deg);
}

html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos .photo-tile.has-photo.show:nth-child(3) {
  transform: translateY(-2px) rotate(2.6deg);
}

html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos .photo-tile.has-photo.show:nth-child(4) {
  transform: translateY(8px) rotate(-2deg);
}

html[data-scheme="ceremony"] #photo-wall.has-many-photos.show {
  grid-template-columns: minmax(238px, 320px) minmax(460px, 660px);
}

html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos.has-many-photos {
  width: min(24vw, 318px);
  gap: clamp(8px, 0.9vw, 12px);
}

html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos.has-many-photos .photo-tile.has-photo {
  padding: 5px;
}

html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos.has-many-photos .photo-tile.has-photo figcaption {
  left: 8px;
  right: 8px;
  bottom: 8px;
  max-height: 32px;
  padding: 4px 6px;
  font-size: 9px;
}

html[data-scheme="ceremony"] .final-title-row {
  grid-area: title;
  justify-content: flex-start;
  width: min(46vw, 660px);
  gap: clamp(12px, 1.6vw, 20px);
  margin: 0;
}

html[data-scheme="ceremony"] .final-title-row::before {
  left: 39%;
  width: min(43vw, 500px);
  height: 68%;
  background: radial-gradient(ellipse, rgba(247, 208, 122, 0.19), rgba(244, 114, 182, 0.1) 46%, transparent 74%);
  filter: blur(17px);
}

html[data-scheme="ceremony"] #photo-wall .birthday-text {
  max-width: 7em;
  padding-bottom: 8px;
  font-size: clamp(60px, 7vw, 104px);
  line-height: 0.94;
  text-align: left;
}

html[data-scheme="ceremony"] #photo-wall .birthday-text::after {
  left: 0;
  width: min(19vw, 220px);
  transform: none;
}

html[data-scheme="ceremony"] .birthday-cake {
  width: clamp(90px, 8.2vw, 122px);
  height: clamp(94px, 8.8vw, 132px);
  margin-top: clamp(8px, 1vw, 14px);
  filter:
    drop-shadow(0 0 12px rgba(255, 215, 123, 0.44))
    drop-shadow(0 0 22px rgba(244, 114, 182, 0.18))
    drop-shadow(0 16px 24px rgba(0, 0, 0, 0.36));
}

html[data-scheme="ceremony"] .birthday-cake::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1%;
  z-index: 0;
  width: 112%;
  height: 15%;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255, 244, 232, 0.08), rgba(255, 244, 232, 0.44), rgba(255, 244, 232, 0.08));
  transform: translateX(-50%);
  filter: blur(0.5px);
}

html[data-scheme="ceremony"] .cake-candles {
  left: 51%;
  top: -3%;
  gap: 5px;
}

html[data-scheme="ceremony"] .cake-digit {
  width: clamp(21px, 2.1vw, 28px);
  height: clamp(36px, 3.35vw, 45px);
  color: #fff8df;
  font-size: clamp(24px, 2.55vw, 34px);
  text-shadow:
    0 1px 0 rgba(122, 62, 28, 0.42),
    0 0 12px rgba(255, 215, 123, 0.58),
    0 0 22px rgba(244, 114, 182, 0.22);
  -webkit-text-stroke: 0.85px rgba(159, 18, 57, 0.56);
}

html[data-scheme="ceremony"] .cake-candle:nth-child(1) {
  rotate: -2deg;
}

html[data-scheme="ceremony"] .cake-candle:nth-child(2) {
  rotate: 2deg;
}

html[data-scheme="ceremony"] .cake-flame {
  top: -5px;
  width: 11px;
  height: 16px;
}

html[data-scheme="ceremony"] .cake-candle::after {
  top: 12px;
  height: 8px;
}

html[data-scheme="ceremony"] .cake-suffix {
  margin-bottom: 7px;
  color: rgba(255, 248, 223, 0.9);
}

html[data-scheme="ceremony"] .cake-top {
  top: 37%;
  width: 70%;
  height: 21%;
  border-radius: 18px 18px 11px 11px;
  background:
    radial-gradient(circle at 19% 100%, #fffaf0 0 15%, transparent 16%),
    radial-gradient(circle at 43% 100%, #fffaf0 0 17%, transparent 18%),
    radial-gradient(circle at 68% 100%, #fffaf0 0 15%, transparent 16%),
    linear-gradient(180deg, #fffdf4 0 43%, #ffd77b 44% 100%);
}

html[data-scheme="ceremony"] .cake-middle {
  top: 53%;
  width: 84%;
  background:
    linear-gradient(90deg, transparent 0 13%, rgba(255, 255, 255, 0.35) 13% 18%, transparent 18% 45%, rgba(255, 255, 255, 0.28) 45% 50%, transparent 50%),
    linear-gradient(180deg, #ffdbe6, #ff8db9);
}

html[data-scheme="ceremony"] .cake-base {
  height: 32%;
  border-radius: 15px 15px 20px 20px;
  background:
    radial-gradient(circle at 22% 34%, rgba(255, 250, 240, 0.9) 0 4px, transparent 5px),
    radial-gradient(circle at 48% 42%, rgba(255, 250, 240, 0.8) 0 3px, transparent 4px),
    radial-gradient(circle at 76% 34%, rgba(255, 250, 240, 0.9) 0 4px, transparent 5px),
    linear-gradient(180deg, #ffabc8, #ec4899 62%, #be185d);
}

html[data-scheme="ceremony"] .final-message {
  grid-area: message;
  width: min(46vw, 640px);
  margin: 0;
  padding: 13px 0 13px 22px;
  border-top: 0;
  border-bottom: 0;
  border-left: 2px solid rgba(247, 208, 122, 0.42);
  background:
    linear-gradient(90deg, rgba(247, 208, 122, 0.1), rgba(244, 114, 182, 0.055), transparent 88%);
  font-size: clamp(16px, 1.35vw, 18px);
  font-weight: 750;
  line-height: 1.72;
  text-align: left;
}

html[data-scheme="ceremony"] .final-wishes {
  grid-area: wishes;
  width: min(43vw, 610px);
  gap: 7px;
  margin-top: 0;
}

html[data-scheme="ceremony"] .final-wish {
  padding-left: 20px;
  color: rgba(255, 238, 229, 0.8);
  font-size: clamp(13px, 1.08vw, 15px);
  line-height: 1.55;
}

html[data-scheme="ceremony"] .final-actions {
  grid-area: actions;
  justify-content: flex-start;
}

html[data-scheme="ceremony"] #replay-button {
  margin-top: 6px;
}

@media (max-width: 760px) {
  html[data-scheme="ceremony"] #photo-wall.show {
    grid-template-columns: 1fr;
    grid-template-areas:
      "photos"
      "title"
      "message"
      "wishes"
      "actions";
    row-gap: 9px;
    padding: 24px 18px 24px;
  }

  html[data-scheme="ceremony"] #photo-wall::before {
    width: 92vw;
    height: 78vh;
    border-radius: 28px;
  }

  html[data-scheme="ceremony"] #photo-wall::after {
    width: 86vw;
    height: 62vh;
  }

  html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos {
    justify-self: center;
    width: min(58vw, 216px);
    gap: 7px;
    margin: 0 0 4px;
  }

  html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos::before {
    width: calc(100% + 28px);
    height: calc(100% + 28px);
    border-radius: 20px;
  }

  html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos .photo-tile.has-photo {
    padding: 3px;
    border-radius: 8px;
  }

  html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos .photo-tile.has-photo::before {
    inset: 3px;
    border-radius: 5px;
  }

  html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos .photo-tile.has-photo::after {
    left: 7px;
    bottom: 7px;
    font-size: 8px;
  }

  html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos .photo-tile.has-photo.show:nth-child(1),
  html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos .photo-tile.has-photo.show:nth-child(2),
  html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos .photo-tile.has-photo.show:nth-child(3),
  html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos .photo-tile.has-photo.show:nth-child(4) {
    transform: translateY(0) rotate(0deg);
  }

  html[data-scheme="ceremony"] #photo-wall.has-many-photos.show {
    grid-template-columns: 1fr;
    grid-template-areas:
      "photos"
      "title"
      "message"
      "wishes"
      "actions";
    column-gap: 0;
    row-gap: 7px;
    padding: 18px 14px 18px;
  }

  html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos.has-many-photos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(76vw, 282px);
    gap: 6px;
    margin-bottom: 1px;
  }

  html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos.has-many-photos .photo-tile.has-photo {
    padding: 3px;
  }

  html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos.has-many-photos .photo-tile.has-photo figcaption {
    display: none;
  }

  html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos.has-many-photos .photo-video-mark {
    right: 7px;
    top: 7px;
    width: 18px;
    height: 18px;
  }

  html[data-scheme="ceremony"] #photo-wall .grid.has-real-photos.has-many-photos .photo-video-mark::before {
    left: 7px;
    top: 5px;
    border-top-width: 4px;
    border-bottom-width: 4px;
    border-left-width: 6px;
  }

  html[data-scheme="ceremony"] .final-title-row {
    justify-content: center;
    width: min(90vw, 340px);
    gap: 8px;
  }

  html[data-scheme="ceremony"] .final-title-row::before {
    left: 50%;
    width: min(82vw, 320px);
  }

  html[data-scheme="ceremony"] #photo-wall .birthday-text {
    max-width: 6em;
    font-size: clamp(42px, 12.2vw, 54px);
    line-height: 0.95;
    text-align: center;
  }

  html[data-scheme="ceremony"] #photo-wall .birthday-text::after {
    left: 50%;
    width: min(40vw, 140px);
    transform: translateX(-50%);
  }

  html[data-scheme="ceremony"] .birthday-cake {
    width: 68px;
    height: 74px;
    margin-top: 6px;
  }

  html[data-scheme="ceremony"] .cake-candles {
    gap: 3px;
  }

  html[data-scheme="ceremony"] .final-message {
    width: min(88vw, 340px);
    padding: 8px 8px 9px;
    border-left: 0;
    border-top: 1px solid rgba(247, 208, 122, 0.22);
    border-bottom: 1px solid rgba(244, 114, 182, 0.16);
    background:
      linear-gradient(90deg, transparent, rgba(247, 208, 122, 0.08), rgba(244, 114, 182, 0.055), transparent);
    font-size: 13px;
    line-height: 1.58;
    text-align: center;
  }

  html[data-scheme="ceremony"] .final-wishes {
    width: min(84vw, 322px);
    gap: 4px;
  }

  html[data-scheme="ceremony"] .final-wish {
    padding-left: 15px;
    font-size: 12px;
    line-height: 1.42;
  }

  html[data-scheme="ceremony"] .final-actions {
    justify-content: center;
  }

  html[data-scheme="ceremony"] #replay-button {
    min-height: 42px;
    margin-top: 5px;
    padding-inline: 20px;
  }
}

/* Iteration 19: soft love-letter finale */
html[data-scheme="loveletter"] {
  --final-firework-opacity: 0.24;
}

html[data-scheme="loveletter"] #photo-wall.show {
  display: flex;
  gap: clamp(9px, 1.45vh, 16px);
  padding: clamp(28px, 5vh, 58px) clamp(28px, 6vw, 76px);
}

html[data-scheme="loveletter"] #photo-wall::before {
  width: min(82vw, 820px);
  height: min(78vh, 700px);
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 250, 240, 0.08), transparent 34%),
    radial-gradient(circle at 42% 55%, rgba(247, 208, 122, 0.13), transparent 45%),
    radial-gradient(circle at 64% 58%, rgba(244, 114, 182, 0.1), transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(3, 4, 11, 0.9), rgba(9, 14, 31, 0.48) 58%, transparent 80%);
  filter: blur(5px);
}

html[data-scheme="loveletter"] #photo-wall::after {
  top: 50%;
  width: min(72vw, 740px);
  height: min(54vh, 480px);
  background:
    linear-gradient(90deg, transparent, rgba(247, 208, 122, 0.11), rgba(244, 114, 182, 0.075), transparent),
    radial-gradient(circle at 50% 52%, rgba(255, 244, 232, 0.08), transparent 62%);
  filter: blur(16px);
}

html[data-scheme="loveletter"] #photo-wall .grid.has-real-photos {
  width: min(78vw, 600px);
  gap: clamp(10px, 1.05vw, 14px);
  margin: 0 0 clamp(6px, 0.8vh, 10px);
  opacity: 0.96;
}

html[data-scheme="loveletter"] #photo-wall .grid.has-real-photos::before {
  width: calc(100% + 42px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 232, 0.18), rgba(247, 208, 122, 0.32), rgba(255, 244, 232, 0.18), transparent);
  opacity: 0.92;
}

html[data-scheme="loveletter"] #photo-wall .grid.has-real-photos .photo-tile.has-photo {
  width: clamp(96px, 7.2vw, 116px);
  max-width: 116px;
  aspect-ratio: 4 / 5;
  padding: 5px;
  border-width: 1px;
  border-color: rgba(255, 248, 238, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.99), rgba(255, 241, 244, 0.94));
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

html[data-scheme="loveletter"] #photo-wall .grid.has-real-photos .photo-tile.has-photo::before {
  inset: 5px;
  border-radius: 5px;
  background:
    linear-gradient(180deg, transparent 38%, rgba(3, 4, 11, 0.22) 68%, rgba(3, 4, 11, 0.72) 100%),
    linear-gradient(90deg, rgba(3, 4, 11, 0.12), transparent 24%, transparent 76%, rgba(3, 4, 11, 0.12));
}

html[data-scheme="loveletter"] #photo-wall .grid.has-real-photos .photo-tile.has-photo::after {
  left: 8px;
  bottom: 8px;
}

html[data-scheme="loveletter"] .final-title-row {
  gap: clamp(10px, 1.45vw, 18px);
  width: min(86vw, 780px);
  margin-top: 0;
}

html[data-scheme="loveletter"] .final-title-row::before {
  width: min(68vw, 540px);
  height: 76%;
  background: radial-gradient(ellipse, rgba(247, 208, 122, 0.17), rgba(244, 114, 182, 0.085) 48%, transparent 74%);
  filter: blur(15px);
}

html[data-scheme="loveletter"] #photo-wall .birthday-text {
  font-size: clamp(54px, 5.8vw, 86px);
  line-height: 0.98;
}

html[data-scheme="loveletter"] #photo-wall .birthday-text::after {
  width: min(34vw, 220px);
}

html[data-scheme="loveletter"] .birthday-cake {
  width: clamp(78px, 7.1vw, 106px);
  height: clamp(82px, 7.6vw, 114px);
  filter:
    drop-shadow(0 0 12px rgba(255, 215, 123, 0.4))
    drop-shadow(0 14px 22px rgba(0, 0, 0, 0.32));
}

html[data-scheme="loveletter"] .cake-candles {
  gap: 4px;
}

html[data-scheme="loveletter"] .cake-digit {
  text-shadow:
    0 1px 0 rgba(122, 62, 28, 0.38),
    0 0 11px rgba(255, 215, 123, 0.5),
    0 0 18px rgba(244, 114, 182, 0.18);
  -webkit-text-stroke: 0.85px rgba(159, 18, 57, 0.52);
}

html[data-scheme="loveletter"] .final-message {
  position: relative;
  width: min(78vw, 700px);
  margin-top: 0;
  padding: clamp(15px, 1.7vw, 20px) clamp(22px, 3vw, 36px);
  border: 1px solid rgba(247, 208, 122, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(247, 208, 122, 0.28), rgba(244, 114, 182, 0.16), rgba(139, 216, 255, 0.1)) top / 100% 4px no-repeat,
    radial-gradient(circle at 22% 14%, rgba(255, 255, 255, 0.54), transparent 28%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(255, 241, 244, 0.92));
  box-shadow:
    0 22px 52px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: rgba(62, 38, 45, 0.84);
  font-size: clamp(15px, 1.42vw, 17px);
  font-weight: 800;
  line-height: 1.74;
  text-align: center;
  text-shadow: none;
}

html[data-scheme="loveletter"] .final-message::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: min(36%, 180px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(161, 98, 7, 0.3), transparent);
  transform: translateX(-50%);
}

html[data-scheme="loveletter"] .final-wishes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(78vw, 700px);
  margin-top: 2px;
}

html[data-scheme="loveletter"] .final-wish {
  position: relative;
  min-height: 58px;
  padding: 10px 12px 10px 22px;
  border: 1px solid rgba(255, 244, 232, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 244, 232, 0.085), rgba(255, 244, 232, 0.035)),
    rgba(5, 7, 18, 0.18);
  color: rgba(255, 238, 229, 0.78);
  font-size: clamp(12px, 1.05vw, 14px);
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-scheme="loveletter"] .final-wish::before {
  left: 10px;
  top: 18px;
}

html[data-scheme="loveletter"] #replay-button {
  margin-top: 5px;
}

@media (max-width: 760px) {
  html[data-scheme="loveletter"] #photo-wall.show {
    gap: 8px;
    padding: 24px 18px 24px;
  }

  html[data-scheme="loveletter"] #photo-wall::before {
    width: 92vw;
    height: 78vh;
    border-radius: 26px;
  }

  html[data-scheme="loveletter"] #photo-wall::after {
    width: 86vw;
    height: 62vh;
  }

  html[data-scheme="loveletter"] #photo-wall .grid.has-real-photos {
    width: min(88vw, 340px);
    gap: 6px;
    margin-bottom: 4px;
  }

  html[data-scheme="loveletter"] #photo-wall .grid.has-real-photos .photo-tile.has-photo {
    width: clamp(72px, 20.5vw, 79px);
    max-width: 79px;
    padding: 3px;
    border-radius: 7px;
  }

  html[data-scheme="loveletter"] #photo-wall .grid.has-real-photos .photo-tile.has-photo::before {
    inset: 3px;
    border-radius: 4px;
  }

  html[data-scheme="loveletter"] #photo-wall .grid.has-real-photos .photo-tile.has-photo::after {
    left: 7px;
    bottom: 7px;
    font-size: 8px;
  }

  html[data-scheme="loveletter"] .final-title-row {
    width: min(92vw, 342px);
    gap: 8px;
  }

  html[data-scheme="loveletter"] #photo-wall .birthday-text {
    font-size: clamp(43px, 12.5vw, 54px);
    line-height: 0.95;
  }

  html[data-scheme="loveletter"] #photo-wall .birthday-text::after {
    width: min(42vw, 148px);
  }

  html[data-scheme="loveletter"] .birthday-cake {
    width: 66px;
    height: 72px;
  }

  html[data-scheme="loveletter"] .cake-candles {
    gap: 3px;
  }

  html[data-scheme="loveletter"] .final-message {
    width: min(88vw, 340px);
    padding: 12px 13px 14px;
    font-size: 12.8px;
    line-height: 1.56;
  }

  html[data-scheme="loveletter"] .final-message::after {
    bottom: 8px;
    width: 42%;
  }

  html[data-scheme="loveletter"] .final-wishes {
    grid-template-columns: 1fr;
    width: min(84vw, 322px);
    gap: 3px;
  }

  html[data-scheme="loveletter"] .final-wish {
    min-height: 0;
    padding: 0 0 0 15px;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 12px;
    line-height: 1.42;
  }

  html[data-scheme="loveletter"] .final-wish::before {
    left: 0;
    top: 0.78em;
  }

  html[data-scheme="loveletter"] #replay-button {
    min-height: 42px;
    margin-top: 5px;
    padding-inline: 20px;
  }
}

/* Iteration 20: storybook flow with first-screen memory preview */
.opening-memory-strip {
  display: none;
}

html[data-scheme="story"] {
  --final-firework-opacity: 0.28;
}

html[data-scheme="story"] #opening {
  top: 50%;
  width: min(92vw, 860px);
  gap: clamp(8px, 1.25vh, 14px);
}

html[data-scheme="story"] .opening-kicker {
  margin-bottom: 6px;
  color: rgba(247, 208, 122, 0.92);
}

html[data-scheme="story"] #opening-title {
  max-width: 9em;
  font-size: clamp(50px, 8vw, 92px);
}

html[data-scheme="story"] #anniversary-badge {
  margin-top: 8px;
}

html[data-scheme="story"] #opening-subtitle {
  width: min(86vw, 620px);
  margin-top: 8px;
  font-size: clamp(14px, 1.65vw, 18px);
  line-height: 1.66;
}

html[data-scheme="story"] .opening-memory-strip {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: min(78vw, 560px);
  min-height: clamp(82px, 13vh, 126px);
  margin: clamp(8px, 1.4vh, 14px) 0 2px;
  gap: clamp(7px, 1vw, 11px);
}

html[data-scheme="story"] .opening-memory-strip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 56%;
  z-index: -1;
  width: calc(100% + 42px);
  height: 42%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse, rgba(247, 208, 122, 0.16), rgba(244, 114, 182, 0.08) 46%, transparent 72%);
  transform: translate(-50%, -50%);
  filter: blur(14px);
}

html[data-scheme="story"] .opening-memory-frame,
html[data-scheme="story"] .opening-memory-placeholder {
  position: relative;
  display: block;
  width: clamp(62px, 7.2vw, 92px);
  aspect-ratio: 4 / 5;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 4px;
  border: 1px solid rgba(255, 244, 232, 0.84);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 241, 244, 0.94));
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.22);
  transform: rotate(-3deg);
}

html[data-scheme="story"] .opening-memory-frame:nth-child(2),
html[data-scheme="story"] .opening-memory-placeholder:nth-child(2) {
  transform: translateY(-7px) rotate(2deg);
}

html[data-scheme="story"] .opening-memory-frame:nth-child(3),
html[data-scheme="story"] .opening-memory-placeholder:nth-child(3) {
  transform: translateY(-2px) rotate(-1.5deg);
}

html[data-scheme="story"] .opening-memory-frame:nth-child(4),
html[data-scheme="story"] .opening-memory-placeholder:nth-child(4) {
  transform: translateY(4px) rotate(3deg);
}

html[data-scheme="story"] .opening-memory-frame::after,
html[data-scheme="story"] .opening-memory-placeholder::before {
  content: attr(data-index);
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  min-width: 16px;
  padding: 2px 4px;
  border-radius: 999px;
  background: rgba(5, 7, 18, 0.62);
  color: rgba(255, 244, 232, 0.88);
  font-family: var(--font-accent);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

html[data-scheme="story"] .opening-memory-frame img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 5px;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.02) brightness(0.96);
}

html[data-scheme="story"] .opening-memory-placeholder {
  display: grid;
  place-items: center;
  padding: 12px 8px 18px;
  color: rgba(58, 37, 43, 0.72);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

html[data-scheme="story"] .opening-actions {
  margin-top: 0;
}

html[data-scheme="story"] #start-button {
  margin-top: 16px;
}

html[data-scheme="story"] #wish-stage {
  width: min(86vw, 680px);
  padding: clamp(18px, 3vw, 28px) clamp(22px, 4vw, 40px);
  border: 1px solid rgba(247, 208, 122, 0.24);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(247, 208, 122, 0.3), rgba(244, 114, 182, 0.16), rgba(139, 216, 255, 0.1)) top / 100% 4px no-repeat,
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(5, 7, 18, 0.56), rgba(5, 7, 18, 0.34));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

html[data-scheme="story"] #wish-stage::before {
  width: min(82vw, 620px);
  height: min(46vh, 350px);
  background:
    radial-gradient(circle at 50% 50%, rgba(247, 208, 122, 0.19), rgba(244, 114, 182, 0.08) 44%, transparent 72%),
    radial-gradient(circle at 44% 40%, rgba(139, 216, 255, 0.08), transparent 52%);
}

html[data-scheme="story"] .wish-kicker {
  color: rgba(247, 208, 122, 0.9);
}

html[data-scheme="story"] #wish-line {
  font-size: clamp(24px, 4.4vw, 48px);
  line-height: 1.24;
}

html[data-scheme="story"] .photo-card.has-photo {
  gap: 0;
  width: min(76vw, 530px);
}

html[data-scheme="story"] .photo-card.has-photo .memory-meta {
  margin-bottom: clamp(8px, 1.4vh, 12px);
}

html[data-scheme="story"] .photo-card.has-photo > img,
html[data-scheme="story"] .photo-card.has-photo .memory-media {
  width: min(100%, 520px);
  max-height: 56vh;
  padding: 12px 12px 72px;
  border-radius: 10px;
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.44),
    0 0 0 1px rgba(247, 208, 122, 0.18),
    0 0 34px rgba(244, 114, 182, 0.12);
}

html[data-scheme="story"] .photo-card.has-photo .caption {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 42px), 460px);
  min-height: 48px;
  margin-top: -64px;
  padding: 8px 16px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(58, 37, 43, 0.78);
  font-size: clamp(13px, 1.28vw, 15px);
  font-weight: 800;
  line-height: 1.44;
  text-align: center;
  text-shadow: none;
  backdrop-filter: none;
}

html[data-scheme="story"] #photo-wall.show {
  display: grid;
  grid-template-columns: minmax(430px, 680px) minmax(280px, 380px);
  grid-template-areas:
    "title photos"
    "message photos"
    "wishes photos"
    "actions photos";
  align-content: center;
  align-items: center;
  justify-content: center;
  column-gap: clamp(42px, 5vw, 84px);
  row-gap: clamp(9px, 1.3vh, 14px);
  padding: clamp(34px, 6vh, 76px) clamp(44px, 7vw, 96px);
}

html[data-scheme="story"] #photo-wall::before {
  width: min(88vw, 980px);
  height: min(72vh, 650px);
  border-radius: 38px;
  background:
    radial-gradient(circle at 32% 42%, rgba(247, 208, 122, 0.1), transparent 36%),
    radial-gradient(circle at 68% 48%, rgba(244, 114, 182, 0.1), transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(3, 4, 11, 0.9), rgba(8, 16, 32, 0.48) 54%, transparent 78%);
  filter: blur(5px);
}

html[data-scheme="story"] #photo-wall .grid.has-real-photos {
  grid-area: photos;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-self: start;
  width: min(28vw, 360px);
  gap: clamp(10px, 1vw, 14px);
  margin: 0;
  opacity: 0.98;
}

html[data-scheme="story"] #photo-wall .grid.has-real-photos::before {
  width: calc(100% + 36px);
  height: calc(100% + 36px);
  border: 1px solid rgba(247, 208, 122, 0.06);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 50%, rgba(247, 208, 122, 0.09), transparent 62%),
    radial-gradient(circle at 36% 28%, rgba(244, 114, 182, 0.07), transparent 44%);
  opacity: 0.62;
}

html[data-scheme="story"] #photo-wall .grid.has-real-photos .photo-tile.has-photo {
  width: 100%;
  max-width: none;
  aspect-ratio: 4 / 5;
  padding: 5px;
  border-width: 1px;
  border-color: rgba(255, 244, 232, 0.84);
  border-radius: 10px;
}

html[data-scheme="story"] #photo-wall .grid.has-real-photos .photo-tile.has-photo::before {
  inset: 5px;
  border-radius: 6px;
}

html[data-scheme="story"] .final-title-row {
  grid-area: title;
  justify-content: flex-start;
  width: min(52vw, 680px);
  margin: 0;
}

html[data-scheme="story"] #photo-wall .birthday-text {
  max-width: 7em;
  font-size: clamp(62px, 7vw, 104px);
  line-height: 0.94;
  text-align: left;
}

html[data-scheme="story"] #photo-wall .birthday-text::after {
  left: 0;
  width: min(19vw, 220px);
  transform: none;
}

html[data-scheme="story"] .birthday-cake {
  width: clamp(88px, 7.8vw, 118px);
  height: clamp(92px, 8.4vw, 128px);
}

html[data-scheme="story"] .final-message {
  grid-area: message;
  width: min(50vw, 660px);
  margin: 0;
  padding: 14px 0 14px 22px;
  border-top: 0;
  border-bottom: 0;
  border-left: 2px solid rgba(247, 208, 122, 0.4);
  background:
    linear-gradient(90deg, rgba(247, 208, 122, 0.1), rgba(244, 114, 182, 0.055), transparent 88%);
  font-size: clamp(16px, 1.35vw, 18px);
  font-weight: 750;
  line-height: 1.7;
  text-align: left;
}

html[data-scheme="story"] .final-wishes {
  grid-area: wishes;
  width: min(47vw, 620px);
  gap: 7px;
}

html[data-scheme="story"] .final-wish {
  padding-left: 20px;
  color: rgba(255, 238, 229, 0.8);
  font-size: clamp(13px, 1.08vw, 15px);
  line-height: 1.55;
}

html[data-scheme="story"] .final-actions {
  grid-area: actions;
  justify-content: flex-start;
}

@media (max-width: 760px) {
  html[data-scheme="story"] #opening {
    top: 49%;
    width: min(92vw, 360px);
    gap: 6px;
  }

  html[data-scheme="story"] #opening-title {
    font-size: clamp(42px, 12.8vw, 56px);
  }

  html[data-scheme="story"] #opening-subtitle {
    width: min(88vw, 330px);
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.58;
  }

  html[data-scheme="story"] .opening-memory-strip {
    width: min(88vw, 330px);
    min-height: 86px;
    gap: 5px;
    margin: 6px 0 0;
  }

  html[data-scheme="story"] .opening-memory-frame,
  html[data-scheme="story"] .opening-memory-placeholder {
    width: clamp(58px, 19vw, 70px);
    padding: 3px;
    border-radius: 7px;
  }

  html[data-scheme="story"] .opening-memory-frame::after,
  html[data-scheme="story"] .opening-memory-placeholder::before {
    left: 6px;
    bottom: 6px;
    font-size: 8px;
  }

  html[data-scheme="story"] #start-button {
    min-height: 42px;
    margin-top: 12px;
    padding-inline: 20px;
  }

  html[data-scheme="story"] #wish-stage {
    width: min(88vw, 340px);
    padding: 18px 16px 20px;
  }

  html[data-scheme="story"] #wish-line {
    font-size: clamp(23px, 7.8vw, 33px);
    line-height: 1.28;
  }

  html[data-scheme="story"] .photo-card.has-photo {
    width: min(88vw, 386px);
  }

  html[data-scheme="story"] .photo-card.has-photo > img,
  html[data-scheme="story"] .photo-card.has-photo .memory-media {
    max-height: 45vh;
    padding: 9px 9px 62px;
  }

  html[data-scheme="story"] .photo-card.has-photo .caption {
    width: min(calc(100% - 30px), 318px);
    min-height: 46px;
    margin-top: -56px;
    padding: 7px 12px 8px;
    font-size: 13px;
    line-height: 1.36;
  }

  html[data-scheme="story"] #photo-wall.show {
    grid-template-columns: 1fr;
    grid-template-areas:
      "photos"
      "title"
      "message"
      "wishes"
      "actions";
    row-gap: 8px;
    padding: 24px 18px;
  }

  html[data-scheme="story"] #photo-wall .grid.has-real-photos {
    justify-self: center;
    width: min(58vw, 216px);
    gap: 7px;
    margin: 0 0 4px;
  }

  html[data-scheme="story"] #photo-wall .grid.has-real-photos::before {
    width: calc(100% + 28px);
    height: calc(100% + 28px);
    border-radius: 20px;
  }

  html[data-scheme="story"] #photo-wall .grid.has-real-photos .photo-tile.has-photo {
    padding: 3px;
    border-radius: 8px;
  }

  html[data-scheme="story"] #photo-wall .grid.has-real-photos .photo-tile.has-photo::before {
    inset: 3px;
    border-radius: 5px;
  }

  html[data-scheme="story"] .final-title-row {
    justify-content: center;
    width: min(90vw, 340px);
    gap: 8px;
  }

  html[data-scheme="story"] #photo-wall .birthday-text {
    max-width: 6em;
    font-size: clamp(42px, 12.2vw, 54px);
    line-height: 0.95;
    text-align: center;
  }

  html[data-scheme="story"] #photo-wall .birthday-text::after {
    left: 50%;
    width: min(40vw, 140px);
    transform: translateX(-50%);
  }

  html[data-scheme="story"] .birthday-cake {
    width: 68px;
    height: 74px;
  }

  html[data-scheme="story"] .final-message {
    width: min(88vw, 340px);
    padding: 8px 8px 9px;
    border-left: 0;
    border-top: 1px solid rgba(247, 208, 122, 0.22);
    border-bottom: 1px solid rgba(244, 114, 182, 0.16);
    background:
      linear-gradient(90deg, transparent, rgba(247, 208, 122, 0.08), rgba(244, 114, 182, 0.055), transparent);
    font-size: 13px;
    line-height: 1.58;
    text-align: center;
  }

  html[data-scheme="story"] .final-wishes {
    width: min(84vw, 322px);
    gap: 4px;
  }

  html[data-scheme="story"] .final-wish {
    padding-left: 15px;
    font-size: 12px;
    line-height: 1.42;
  }

  html[data-scheme="story"] .final-actions {
    justify-content: center;
  }

  html[data-scheme="story"] #replay-button {
    min-height: 42px;
    margin-top: 5px;
    padding-inline: 20px;
  }
}

/* Iteration 30: keep video memory captions outside the moving image. */
html[data-variant="keepsake"] .photo-card.has-video,
html[data-scheme="story"] .photo-card.has-video {
  gap: clamp(10px, 2vh, 16px);
}

html[data-variant="keepsake"] .photo-card.has-video .memory-media,
html[data-scheme="story"] .photo-card.has-video .memory-media {
  width: min(100%, 520px);
  max-height: 55vh;
  padding: 12px 12px 46px;
  border-radius: 10px;
}

html[data-variant="keepsake"] .photo-card.has-video .caption,
html[data-scheme="story"] .photo-card.has-video .caption {
  width: auto;
  max-width: min(82vw, 640px);
  min-height: 42px;
  margin-top: 0;
  padding: 12px 22px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(11, 16, 36, 0.7), rgba(6, 8, 20, 0.5)),
    linear-gradient(90deg, rgba(255, 215, 123, 0.08), rgba(255, 122, 168, 0.06));
  box-shadow:
    0 14px 44px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: clamp(15px, 1.9vw, 18px);
  font-weight: 500;
  line-height: 1.65;
  text-align: center;
  text-shadow: 0 0 18px rgba(255, 215, 123, 0.3);
  backdrop-filter: blur(16px);
}

html[data-variant="keepsake"] .photo-card.has-video .caption::before,
html[data-scheme="story"] .photo-card.has-video .caption::before {
  content: none;
}

@media (max-width: 640px) {
  html[data-variant="keepsake"] .photo-card.has-video .memory-media,
  html[data-scheme="story"] .photo-card.has-video .memory-media {
    max-height: 43vh;
    padding: 9px 9px 36px;
  }

  html[data-variant="keepsake"] .photo-card.has-video .caption,
  html[data-scheme="story"] .photo-card.has-video .caption {
    min-height: 40px;
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1.52;
  }

  html[data-variant="keepsake"] .photo-card.has-video .memory-media video,
  html[data-variant="keepsake"] .photo-card.has-video .memory-video-sheen,
  html[data-scheme="story"] .photo-card.has-video .memory-media video,
  html[data-scheme="story"] .photo-card.has-video .memory-video-sheen {
    inset: 9px 9px 36px;
    width: calc(100% - 18px);
    height: calc(100% - 45px);
  }
}

#photo-wall.show .photo-tile.has-photo {
  pointer-events: auto;
}

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

  .memory-media img,
  .memory-media video,
  .memory-viewer-media img,
  .memory-viewer-media video,
  .memory-video-play,
  .memory-prev,
  .memory-next {
    transition: none !important;
  }

  .memory-viewer.video-playing .memory-viewer-media img {
    opacity: 0;
  }

  .memory-viewer.video-playing .memory-viewer-media video {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}
