:root {
  --bg-1: #f1ede6;
  --bg-2: #e9e2d8;
  --gold: #d8af67;
  --paper: #f6f1e8;
  --accent: #b0737d;
  --ink: #4c433f;
}

* {
  box-sizing: border-box;
}

/* ═══ Intro Video Overlay ═══ */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.2s ease;
}

.intro-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.intro-overlay.hidden {
  display: none;
}

.intro-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* While intro is visible, hide the main content behind it */
body.intro-active .scene,
body.intro-active .bg-glow {
  opacity: 0;
}

body.intro-done .scene,
body.intro-done .bg-glow {
  animation: fadeInPage 1s ease forwards;
}

@keyframes fadeInPage {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cormorant Garamond", "Georgia", serif;
  background: radial-gradient(circle at 50% -20%, #faf8f3 0%, var(--bg-1) 44%, var(--bg-2) 100%);
  color: #544c45;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 16% 24%, #ffffff99 0, transparent 34%),
    radial-gradient(circle at 83% 8%, #ffffff66 0, transparent 35%),
    radial-gradient(circle at 68% 77%, #e2d8ca66 0, transparent 32%);
  pointer-events: none;
}

.scene {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.scene.opened {
  justify-content: flex-start;
  padding-top: 12px;
}

.envelope-wrap {
  text-align: center;
  transition: transform 0.8s ease, opacity 0.8s ease;
}

.envelope-wrap.opened {
  transform: translateY(-60px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  max-height: 0;
  margin: 0;
  overflow: hidden;
}

.envelope {
  position: relative;
  width: min(92vw, 540px);
  height: 700px;
  margin: 0 auto;
  filter: drop-shadow(0 22px 28px #b6a69299);
}

/* Subtle light-play overlay on the envelope */
.envelope::before {
  content: "";
  position: absolute;
  inset: 26px 0 0;
  border-radius: 8px;
  pointer-events: none;
  z-index: 3;
  background:
    radial-gradient(circle at 25% 18%, #ffffff40 0, transparent 40%),
    radial-gradient(circle at 75% 10%, #ffffff30 0, transparent 38%),
    radial-gradient(circle at 60% 90%, #0000000a 0, transparent 52%),
    radial-gradient(circle at 10% 85%, #0000000d 0, transparent 50%);
  opacity: 0.45;
}

.envelope::after {
  content: "";
  position: absolute;
  inset: 26px 0 0;
  border-radius: 8px;
  pointer-events: none;
  z-index: 3;
  box-shadow:
    inset 0 1px 0 #ffffffb8,
    inset 0 -22px 36px #00000009,
    inset 0 20px 26px #ffffff1e,
    inset 14px 0 20px #00000006,
    inset -14px 0 20px #00000006;
  opacity: 0.85;
}

.envelope-body {
  position: absolute;
  inset: 26px 0 0;
  background:
    /* subtle warm-spot highlights */
    radial-gradient(circle at 22% 16%, #fffefa66 0, transparent 32%),
    radial-gradient(circle at 74% 10%, #fffdf860 0, transparent 28%),
    /* very slight bottom shadow */
    radial-gradient(circle at 50% 92%, #00000006 0, transparent 52%),
    /* base envelope cardboard — warm off-white */
    linear-gradient(176deg, #f5f0e7, #ede7dc 40%, #eae3d6 75%, #e8e0d3);
  border-radius: 8px;
  border: 1px solid #ddd4c5;
  z-index: 2;
  filter: url(#paperGrain);
  box-shadow:
    inset 0 1px 0 #ffffffcc,
    inset 0 -18px 28px #00000008,
    inset 12px 0 18px #00000005,
    inset -12px 0 18px #00000005,
    0 2px 0 #ffffff52;
}

.envelope-body::before,
.envelope-body::after {
  content: "";
  position: absolute;
  bottom: 148px;
  width: 58%;
  height: 1.4px;
  background: linear-gradient(to right, #d8cfbf, #ddd4c5, #d8cfbf);
  box-shadow: 0 1px 0 #ffffff9c;
}

.envelope-body::before {
  left: 0;
  transform: rotate(36deg);
  transform-origin: left bottom;
}

.envelope-body::after {
  right: 0;
  transform: rotate(-36deg);
  transform-origin: right bottom;
}

.flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: auto;
  width: 100%;
  height: 330px;
  background:
    radial-gradient(circle at 24% 10%, #fffefa66 0, transparent 34%),
    radial-gradient(circle at 80% 14%, #fffdf856 0, transparent 28%),
    linear-gradient(180deg, #f5f0e8, #ede7db 55%, #eae2d5);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top;
  transition: transform 1s ease;
  z-index: 4;
  border: 1px solid #ddd4c6;
  border-bottom: none;
  overflow: hidden;
}

/* Apply texture to a child inside the flap (clip-path blocks filter on the flap itself) */
.flap-texture {
  position: absolute;
  inset: 0;
  filter: url(#paperGrainFlap);
  background:
    radial-gradient(circle at 50% 94%, #00000008 0, transparent 52%),
    radial-gradient(circle at 30% 12%, #fffefa44 0, transparent 36%),
    linear-gradient(178deg, #f5f0e8, #ede7db 50%, #eae2d5);
  pointer-events: none;
}

.flap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, #ffffff48 0%, transparent 35%),
    linear-gradient(180deg, transparent 55%, #00000010 100%),
    linear-gradient(to right, #0000000a 0%, transparent 14%, transparent 86%, #0000000a 100%);
  opacity: 0.75;
  z-index: 1;
}

.envelope.open .flap {
  transform: rotateX(180deg);
}

.letter-preview {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 170px;
  height: 380px;
  background:
    radial-gradient(circle at 20% 18%, #fffef966 0, transparent 26%),
    radial-gradient(circle at 80% 14%, #fffdf854 0, transparent 24%),
    linear-gradient(178deg, #f6f1e9, #ede7dc 50%, #eae3d7);
  color: var(--ink);
  border-radius: 6px;
  border: 1px solid #ddd4c6;
  padding: 26px;
  z-index: 1;
  transform: translateY(145px);
  transition: transform 1s ease;
  text-align: center;
  will-change: transform, opacity;
  filter: url(#paperGrain);
  box-shadow:
    inset 0 1px 0 #ffffffc0,
    inset 0 -10px 18px #00000006;
}

.envelope.open .letter-preview {
  transform: translateY(-32px);
}

.envelope.extracting .letter-preview {
  animation: sheetExtract 1.15s cubic-bezier(0.2, 0.75, 0.22, 1) forwards;
}

.envelope.extracting .stamp {
  opacity: 0;
  pointer-events: none;
}

@keyframes sheetExtract {
  0% {
    transform: translateY(145px) scale(1);
    opacity: 1;
  }
  55% {
    transform: translateY(-60px) scale(1.01);
    opacity: 1;
  }
  100% {
    transform: translateY(-150px) scale(1.02);
    opacity: 1;
  }
}

@keyframes stampFollowSheet {
  0% {
    transform: translateX(-50%) rotate(-5deg) translateY(0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%) rotate(-5deg) translateY(-120px) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) rotate(-5deg) translateY(-240px) scale(0.97);
    opacity: 1;
  }
}

.letter-preview h2 {
  margin: 8px 0 0;
  color: #7e6268;
  font-size: clamp(2.3rem, 6vw, 3.35rem);
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.letter-preview p {
  margin: 6px 0 0;
  color: #86746d;
  font-size: 1.32rem;
  font-style: italic;
}

.exclusive-msg {
  margin-top: 18px !important;
  font-size: 1.95rem !important;
  line-height: 1.05;
  color: #7f6d65 !important;
  font-family: "Great Vibes", cursive;
  font-style: normal !important;
}

/* ── Animated hand ── */
.hand-wrap {
  position: absolute;
  left: 50%;
  top: -60px;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Show hand when hovering the envelope (before opened) */
.envelope:not(.opening):not(.peeling):not(.lifting):not(.extracting):not(.open):hover .hand-wrap {
  opacity: 1;
}

/* On touch devices, show a subtle bounce hint */
.envelope:not(.opening):not(.peeling):not(.lifting):not(.extracting):not(.open) .hand-wrap {
  animation: handHint 2s ease-in-out 1.5s infinite;
}

@keyframes handHint {
  0%, 100% { opacity: 0; top: -60px; }
  20% { opacity: 0.7; top: -40px; }
  40% { opacity: 0.5; top: -50px; }
  60% { opacity: 0.7; top: -38px; }
  80% { opacity: 0.4; top: -52px; }
}

.hand {
  font-size: 3.2rem;
  transform: scaleX(-1) rotate(180deg);
  filter: drop-shadow(0 4px 8px #00000030);
  transform-origin: center bottom;
}

/* Phase 1: hand reaches down to stamp */
.envelope.opening .hand-wrap {
  opacity: 1;
  animation: handReachStamp 0.8s ease forwards;
}

@keyframes handReachStamp {
  0%   { top: -60px; }
  100% { top: 210px; }
}

/* Phase 2: hand grabs and peels stamp off */
.envelope.peeling .hand-wrap {
  opacity: 1;
  top: 210px;
  animation: handPeelStamp 0.7s ease forwards;
}

@keyframes handPeelStamp {
  0%   { top: 210px; transform: translateX(-50%) rotate(0); }
  40%  { top: 200px; transform: translateX(-50%) rotate(-8deg); }
  100% { top: 80px; transform: translateX(-80%) rotate(-15deg); opacity: 0.7; }
}

/* Stamp being peeled — stays hidden after animation */
.envelope.peeling .stamp {
  animation: stampPeeled 0.7s ease forwards;
}

.envelope.lifting .stamp,
.envelope.extracting .stamp,
.envelope.open .stamp {
  opacity: 0;
  pointer-events: none;
}

@keyframes stampPeeled {
  0%   { transform: translateX(-50%) rotate(-5deg) scale(1); opacity: 1; }
  40%  { transform: translateX(-50%) rotate(-12deg) scale(1.02); opacity: 1; }
  100% { transform: translateX(-120%) rotate(-25deg) scale(0.8); opacity: 0; }
}

/* Phase 3: hand comes back to top and lifts flap */
.envelope.lifting .hand-wrap {
  opacity: 1;
  animation: handLiftFlap 0.8s ease forwards;
}

@keyframes handLiftFlap {
  0%   { top: 80px; transform: translateX(-80%) rotate(-15deg); opacity: 0.7; }
  35%  { top: 10px; transform: translateX(-50%) rotate(0); opacity: 1; }
  65%  { top: -10px; transform: translateX(-50%) rotate(5deg); opacity: 1; }
  100% { top: -50px; transform: translateX(-50%) rotate(0); opacity: 0.5; }
}

/* Phase 4: hand gone, sheet extracts */
.envelope.extracting .hand-wrap {
  opacity: 0;
  pointer-events: none;
}

.stamp {
  position: absolute;
  left: 50%;
  top: 260px;
  transform: translateX(-50%) rotate(-5deg);
  width: 142px;
  height: 142px;
  border-radius: 52% 48% 50% 45% / 46% 51% 49% 54%;
  border: 0;
  background:
    radial-gradient(circle at 26% 18%, #ff8a80 0%, #e33f35 28%, #be1818 58%, #7f0d12 100%);
  color: #ffd5ca;
  font-weight: 400;
  font-size: 2.05rem;
  cursor: pointer;
  z-index: 5;
  box-shadow:
    inset 0 3px 5px #ffb7ac99,
    inset 0 -9px 11px #65080d8a,
    0 10px 18px #6e161e52;
  transition: transform 0.25s ease;
  display: grid;
  place-items: center;
}

.stamp::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 2px solid #d93a34;
  box-shadow:
    inset 0 2px 2px #ffb5aa80,
    0 0 0 1px #8f1118;
  opacity: 0.95;
}

.stamp::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px solid #a5181f;
  opacity: 0.7;
}

.stamp span {
  font-family: "Great Vibes", cursive;
  transform: translateY(2px);
  /* same-material engraving (not gold): pressed into wax */
  color: #a5151b;
  text-shadow:
    0 -1px 0 #ffb3a9a8,
    0 1px 0 #5e070c,
    0 2px 2px #3c04076b;
  opacity: 0.95;
}

.stamp:hover {
  transform: translateX(-50%) rotate(-5deg) scale(1.04);
}

/* Make whole envelope clickable */
.envelope:not(.opening):not(.peeling):not(.lifting):not(.extracting) {
  cursor: pointer;
}

.envelope-front-msg {
  position: absolute;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  margin: 0;
  width: 80%;
  text-align: center;
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.6rem, 4.6vw, 2.5rem);
  line-height: 1;
  z-index: 3;
  /* dark engraved — pressed into the paper */
  color: #7a6f65;
  text-shadow:
    -1px -1px 0 #ffffffb8,
    1px 1px 1px #00000030,
    0 -1px 0 #ffffff8c,
    0 1px 1px #00000022,
    2px 2px 5px #00000012;
}

/* Engraved groove — lighter highlight shifted up */
.envelope-front-msg::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  color: #b5aa9e;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  text-align: inherit;
  text-shadow:
    0 -1px 0 #ffffffa0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.4;
}

.envelope-front-msg::after {
  display: none;
}

.invitation-panel {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  transition: opacity 0.9s ease, transform 0.9s ease;
  margin-top: 8px;
}

.invitation-panel.hidden {
  opacity: 0;
  transform: translateY(30px) scale(0.96);
  pointer-events: none;
}

.invitation-card {
  width: min(100vw - 6px, 1400px);
  margin: 0 auto;
  background: linear-gradient(165deg, #fffef9, #f6ead9);
  color: var(--ink);
  border-radius: 18px;
  border: 2px solid #e2c691;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 22px 48px #00000047;
}

.eyebrow {
  margin: 4px 0 8px;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6f4f18;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 700;
}

.invitation-subline {
  margin: 0 0 8px;
  color: #765a2e;
  font-style: italic;
  font-size: clamp(1.02rem, 2.1vw, 1.25rem);
}

.invitation-card h1 {
  margin: 0 0 12px;
  color: #81204c;
  font-size: clamp(2rem, 5.4vw, 3rem);
}

.couple-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(18px, 4vw, 44px);
  font-family: "Cormorant Garamond", "Georgia", serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.couple-title .amp {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  font-size: 1.15em;
  letter-spacing: 0;
  color: #b24570;
}

.name-photos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 2px 0 14px;
}

.name-photo-link {
  display: inline-flex;
  border-radius: 50%;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.name-photo-link:hover {
  transform: translateY(-2px) scale(1.03);
}

.photos-heart {
  color: #b73a68;
  font-size: 2rem;
  line-height: 1;
  transform: translateY(2px);
}

.name-photos img {
  width: 188px;
  height: 188px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 25%;
  image-rendering: auto;
  filter: contrast(1.15) saturate(1.18) brightness(1.05);
  border: 4px solid #fff8ee;
  box-shadow:
    0 18px 30px #00000042,
    0 0 0 3px #edd4a8,
    0 0 0 7px #f8ead2,
    inset 0 0 0 2px #ffffffb8;
  transform: translateZ(0);
}

.name-photos img:first-of-type {
  object-position: center 18%;
}

.name-photos img:last-of-type {
  object-position: center 28%;
}

.invitation-description {
  margin: 2px auto 12px;
  max-width: 760px;
  color: #6e5b3f;
  font-size: clamp(1rem, 1.9vw, 1.15rem);
  line-height: 1.35;
  font-style: italic;
}

.save-date {
  margin: -6px 0 4px;
  color: #8b6a36;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.video-box {
  width: 100%;
  border-radius: 0;
  overflow: visible;
  border: 0;
  background: transparent !important;
  margin: 0 0 10px;
  display: grid;
  place-items: center;
}

.video-box video {
  width: min(100vw - 4px, 1800px);
  max-width: 100%;
  height: auto;
  max-height: min(95vh, 1200px);
  display: block;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}

.date-scratch-wrap {
  position: relative;
  width: min(100%, 470px);
  height: 178px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  border: 2px dashed #d68f2f;
  background: #ffeabf;
}

.married-banner {
  margin: 12px auto 2px;
  text-align: center;
  opacity: 0;
  transform: translateY(-20px) scale(0.96);
  transition: opacity 0.6s ease, transform 0.7s ease;
}

.married-banner p {
  margin: 0;
  color: #b73a68;
  font-family: "Great Vibes", cursive;
  font-size: clamp(2rem, 5.4vw, 3.4rem);
  text-shadow: 0 2px 8px #ffffffad;
}

.married-banner.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.married-banner.hidden {
  display: none;
}

.date-revealed {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  padding: 12px;
  color: #39264f;
}

.date-label {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: #70562b;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.date-full {
  margin: 0;
  color: #8d1d4f;
  font-size: clamp(1.9rem, 4.8vw, 2.7rem);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.date-value {
  margin: 0;
  font-weight: 700;
  font-size: clamp(1.8rem, 5vw, 2.35rem);
  color: #8d1d4f;
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(84px, 1fr));
  gap: 8px;
  width: min(100%, 420px);
}

.date-cell {
  background: #fff8eb;
  border: 1px solid #d8be95;
  border-radius: 8px;
  min-height: 96px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  box-shadow: inset 0 1px 0 #ffffffb8;
}

.cell-value {
  font-size: clamp(1.55rem, 4.2vw, 2rem);
  font-weight: 700;
  color: #8d1d4f;
  line-height: 1;
}

.cell-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6f5a3b;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.map-link {
  color: #642082;
  font-weight: 700;
}

#scratchCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.hall-box {
  margin-top: 14px;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid #ddc79e;
  background: #fff4df;
  color: #39264f;
  display: grid;
  gap: 6px;
}

.hall-box.hidden {
  display: none;
}

.hall-box h3,
.hall-box p {
  margin: 0;
}

.hall-box h3 {
  color: #8d1d4f;
}

.venue-time {
  color: #8d1d4f;
  font-weight: 700;
  font-size: 1.1rem;
}

.hall-photo {
  width: min(100%, 420px);
  margin: 8px auto 0;
  border-radius: 10px;
  border: 1px solid #dcc49d;
  box-shadow: 0 8px 18px #0000001f;
  display: block;
}

.countdown-box {
  margin-top: 12px;
  border: 1px solid #ddc79e;
  border-radius: 12px;
  background: #fff5e5;
  padding: 14px;
}

.countdown-box.hidden {
  display: none;
}

.countdown-title {
  margin: 0 0 10px;
  color: #7d5f2a;
  font-weight: 700;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 8px;
}

.count-cell {
  background: #fffdf7;
  border: 1px solid #e2cb9f;
  border-radius: 8px;
  padding: 8px 6px;
  display: grid;
  place-items: center;
}

.count-cell span {
  font-size: 1.25rem;
  color: #8d1d4f;
  font-weight: 700;
  line-height: 1;
}

.count-cell small {
  margin-top: 4px;
  text-transform: uppercase;
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  color: #6f5a3b;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.map-box {
  margin-top: 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #d6be95;
  height: 240px;
}

.map-box.hidden {
  display: none;
}

.map-box iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.wishes-box {
  margin-top: 14px;
  border: 1px solid #ddc79e;
  border-radius: 12px;
  background: #fff5e5;
  padding: 16px;
  text-align: left;
}

.wishes-box.hidden {
  display: none;
}

.wishes-box h3 {
  margin: 0 0 10px;
  text-align: center;
  color: #8d1d4f;
}

.wishes-form {
  display: grid;
  gap: 8px;
}

.wishes-form label {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.82rem;
  color: #6f5a3b;
  font-weight: 600;
}

.wishes-form input,
.wishes-form textarea {
  width: 100%;
  border: 1px solid #dcc39a;
  border-radius: 8px;
  padding: 10px;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: #fffdf7;
}

.wishes-form button {
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  padding: 10px;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 700;
  color: #fff;
  background: #8d1d4f;
  cursor: pointer;
}

.welcome-msg {
  margin: 12px 0 0;
  text-align: center;
  color: #6f5a3b;
  font-style: italic;
}

.final-signature {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2cfac;
  text-align: center;
}

.final-signature.hidden {
  display: none;
}

.final-signature p {
  margin: 0;
  color: #7b5f2a;
  letter-spacing: 0.1em;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 700;
}

.final-signature p:last-child {
  margin-top: 4px;
}

.fireworks {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

.decor-item {
  position: fixed;
  top: -20px;
  font-size: 18px;
  animation: fall linear forwards;
  z-index: 25;
  pointer-events: none;
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(400deg);
    opacity: 0.15;
  }
}

@media (max-width: 540px) {
  .envelope {
    height: 620px;
  }

  .envelope-front-msg {
    bottom: 78px;
  }

  .stamp {
    top: 240px;
    width: 118px;
    height: 118px;
    font-size: 1.75rem;
  }

  .hand {
    font-size: 2.6rem;
  }

  @keyframes handReachStamp {
    0%   { top: -50px; }
    100% { top: 190px; }
  }

  @keyframes handPeelStamp {
    0%   { top: 190px; transform: translateX(-50%) rotate(0); }
    40%  { top: 180px; transform: translateX(-50%) rotate(-8deg); }
    100% { top: 60px; transform: translateX(-80%) rotate(-15deg); opacity: 0.7; }
  }

  @keyframes handLiftFlap {
    0%   { top: 60px; transform: translateX(-80%) rotate(-15deg); opacity: 0.7; }
    35%  { top: 0px; transform: translateX(-50%) rotate(0); opacity: 1; }
    65%  { top: -10px; transform: translateX(-50%) rotate(5deg); opacity: 1; }
    100% { top: -40px; transform: translateX(-50%) rotate(0); opacity: 0.5; }
  }

  .letter-preview {
    top: 154px;
    height: 330px;
    transform: translateY(120px);
  }

  .exclusive-msg {
    font-size: 1.55rem !important;
  }

  .date-scratch-wrap {
    height: 172px;
    width: min(100%, 420px);
  }

  .name-photos img {
    width: 142px;
    height: 142px;
  }

  .date-grid {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
    gap: 8px;
  }

  .countdown-grid {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }

  .date-cell {
    min-height: 88px;
  }
}
