@font-face {
  font-family: "Lacheyard Script";
  src: url("assets/fonts/LacheyardScript.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "Vogun";
  src: url("assets/fonts/Vogun-Medium.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Great Vibes";
  src: url("assets/fonts/GreatVibes.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("assets/fonts/Manrope.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Raleway";
  src: url("assets/fonts/Raleway.woff2") format("woff2");
  font-display: swap;
}

:root {
  color: #1a1a2e;
  background: #f8f6f1;
  font-family: "Manrope", Arial, sans-serif;
  --gold: #b58b3a;
  --gold-deep: #8c6926;
  --paper: #fffefa;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.04), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.04)),
    #f7f5ef;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  position: relative;
  min-height: 100vh;
}

.stage-wrap {
  position: relative;
  width: calc(var(--stage-width) * 1px);
  height: calc(var(--stage-height) * 1px);
  margin: 0 auto;
}

.stage-scale {
  position: relative;
  width: 375px;
  height: calc(var(--canvas-height) * 1px);
  transform: scale(var(--scale));
  transform-origin: top left;
}

.stage {
  position: relative;
  width: 375px;
  height: calc(var(--canvas-height) * 1px);
  overflow: hidden;
  background-color: var(--stage-bg, #fffefa);
  background-image: var(--stage-texture, none);
  background-size: 80px 80px;
}

.intro-mode .stage {
  background-size: 208px 208px;
}

.top-actions {
  position: fixed;
  z-index: 100;
  top: 24px;
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.top-actions button,
.music-float,
.buy-pill {
  pointer-events: auto;
}

.back-btn,
.buy-pill {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 30px rgba(30, 24, 14, 0.13);
  color: #5d5144;
  cursor: pointer;
  font-weight: 700;
}

.back-btn {
  min-height: 36px;
  padding: 0 16px;
}

.buy-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 24px;
  color: var(--gold-deep);
}

.music-float {
  position: fixed;
  z-index: 100;
  right: auto;
  bottom: 24px;
  left: max(24px, env(safe-area-inset-left));
  width: 46px;
  height: 46px;
  border: 2px solid rgba(181, 139, 58, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(42, 31, 13, 0.15);
  color: var(--gold-deep);
  cursor: pointer;
}

.speaker-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 20px;
}

.speaker-icon::before {
  position: absolute;
  top: 4px;
  left: 1px;
  width: 15px;
  height: 12px;
  background: currentColor;
  clip-path: polygon(0 34%, 5px 34%, 12px 0, 12px 100%, 5px 66%, 0 66%);
  content: "";
}

.speaker-icon::after {
  position: absolute;
  top: 3px;
  left: 13px;
  width: 7px;
  height: 11px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 0 12px 12px 0;
  content: "";
  opacity: 0;
}

.music-float.is-playing .speaker-icon::after {
  opacity: 1;
}

.music-float:not(.is-playing) .speaker-icon {
  transform: translateX(-1px);
}

.music-float:not(.is-playing) .speaker-icon::after {
  top: 5px;
  left: 15px;
  width: 10px;
  height: 10px;
  border: 0;
  opacity: 1;
  transform: none;
  background:
    linear-gradient(45deg, transparent 44%, currentColor 45%, currentColor 55%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, currentColor 45%, currentColor 55%, transparent 56%);
}

.canvas-element {
  position: absolute;
  transform-origin: center;
  will-change: transform, opacity;
}

.canvas-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.canvas-link {
  display: block;
  width: 100%;
  height: 100%;
}

.canvas-text {
  display: flex;
  align-items: center;
  overflow: visible;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.text-glow {
  text-shadow:
    0 0 8px var(--glow, rgba(255, 255, 255, 0.8)),
    0 2px 10px rgba(0, 0, 0, 0.2);
}

.intro-cover {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: transparent;
}

.intro-cover-img,
.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-intro-layer {
  position: absolute;
  inset: 0;
  animation: fadeIn 260ms ease both;
}

.intro-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 47%, rgba(255, 245, 218, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(10, 22, 40, 0.08), rgba(10, 22, 40, 0.34));
}

.intro-tap-button {
  position: absolute;
  left: 50%;
  top: 49.8%;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(183, 139, 57, 0.64);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #a47a2d;
  cursor: pointer;
  transform: translate(-50%, -50%);
  box-shadow: 0 7px 24px rgba(89, 67, 25, 0.08), inset 0 0 0 9px rgba(255, 248, 232, 0.78);
  animation: tapButtonFloat 2.2s ease-in-out infinite;
}

.tap-rings,
.tap-rings::before,
.tap-rings::after {
  position: absolute;
  inset: -9px;
  border: 1px solid rgba(94, 82, 72, 0.34);
  border-radius: 50%;
  content: "";
  animation: tapRing 2.2s ease-out infinite;
}

.tap-rings::before {
  inset: -18px;
  animation-delay: 0.28s;
}

.tap-rings::after {
  inset: -28px;
  animation-delay: 0.56s;
}

.tap-icon {
  position: relative;
  z-index: 1;
  font-size: 17px;
  line-height: 1;
}

.video-overlay-text {
  position: absolute;
  z-index: 5;
  opacity: 0;
  transition: opacity 320ms ease;
  white-space: nowrap;
  pointer-events: none;
}

.video-overlay-text.visible {
  opacity: 1;
}

.main-stage-enter {
  animation: fadeIn 680ms ease both;
}

.main-reveal-cloud {
  pointer-events: none;
}

.main-reveal-cloud.cloud-dissolve-active {
  animation: mainCloudDissolve 5.8s cubic-bezier(0.22, 0.74, 0.25, 1) 0.18s forwards;
}

.tree-sway {
  transform-origin: 50% 92%;
  animation: treeSway 9s ease-in-out infinite;
}

.timeline {
  width: 100%;
  height: 100%;
  padding: 10px 0;
  color: #2a2440;
  font-family: "Playfair Display", Georgia, serif;
}

.timeline-row {
  position: relative;
  min-height: 72px;
  padding-left: 44px;
}

.timeline-row::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 8px;
  bottom: -10px;
  width: 1px;
  background: linear-gradient(#c4956a, rgba(196, 149, 106, 0.08));
}

.timeline-row:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: 8px;
  top: 6px;
  width: 21px;
  height: 21px;
  border: 1px solid rgba(196, 149, 106, 0.78);
  border-radius: 999px;
  background: #fff8eb;
  box-shadow: 0 0 0 4px rgba(196, 149, 106, 0.1);
}

.timeline-card {
  min-height: 56px;
  border: 1px solid rgba(196, 149, 106, 0.22);
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.64);
  padding: 8px 11px;
  box-shadow: 0 10px 24px rgba(54, 39, 22, 0.06);
}

.timeline-title {
  font-size: 15px;
  font-weight: 700;
}

.timeline-meta,
.timeline-venue {
  margin-top: 2px;
  color: rgba(26, 26, 46, 0.66);
  font-family: "Manrope", sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.countdown {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(196, 149, 106, 0.25);
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(253, 248, 240, 0.97), rgba(250, 244, 232, 0.92));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-family: "Manrope", sans-serif;
}

.countdown-label {
  margin-bottom: 9px;
  color: rgba(120, 100, 60, 0.6);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.countdown-grid {
  display: flex;
  gap: 8px;
}

.countdown-cell {
  min-width: 44px;
  text-align: center;
}

.countdown-value {
  color: #5c4a1e;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.countdown-unit {
  margin-top: 5px;
  color: rgba(100, 80, 40, 0.62);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.scratch-card {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: hidden;
  border: 1px solid rgba(196, 149, 106, 0.28);
  border-radius: 20px;
  background: linear-gradient(145deg, #fefaf0, #efe0c8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 12px 30px rgba(72, 47, 12, 0.08);
}

.scratch-card::before {
  content: "";
  position: absolute;
  inset: -30%;
  background-image: var(--scratch-cover);
  background-position: center;
  background-size: cover;
  opacity: 0.18;
  transform: scale(1.4);
}

.scratch-title,
.scratch-desc,
.scratch-coins {
  position: relative;
  z-index: 1;
}

.scratch-title {
  color: #6a4e18;
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scratch-desc {
  color: rgba(85, 62, 22, 0.62);
  font-size: 9px;
  font-weight: 700;
}

.scratch-coins {
  display: flex;
  gap: 16px;
}

.scratch-coin {
  position: relative;
  isolation: isolate;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px solid rgba(154, 107, 30, 0.22);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.9), transparent 24%),
    linear-gradient(145deg, #fff8e8, #edd496);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.78), inset 0 -6px 12px rgba(128, 83, 13, 0.15), 0 10px 18px rgba(55, 34, 8, 0.14);
  color: #76551b;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  padding: 0;
  text-shadow: 0 1px 2px rgba(49, 30, 4, 0.36);
  touch-action: none;
}

.scratch-value {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 1px;
}

.scratch-cover-canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  cursor: crosshair;
  transition: opacity 360ms ease, transform 360ms ease;
}

.scratch-cover-canvas.scratched-away,
.scratch-coin.revealed .scratch-cover-canvas {
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
}

.scratch-coin.revealed {
  animation: coinReveal 520ms ease both;
}

.scratch-glitter {
  position: absolute;
  z-index: 3;
  left: var(--spark-x);
  top: var(--spark-y);
  width: 8px;
  height: 8px;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--spark-rot));
  animation: scratchSparkle 700ms ease-out forwards;
}

.scratch-glitter::before,
.scratch-glitter::after {
  position: absolute;
  inset: 0;
  background: #fff7c0;
  clip-path: polygon(50% 0, 60% 38%, 100% 50%, 60% 62%, 50% 100%, 40% 62%, 0 50%, 40% 38%);
  content: "";
  filter: drop-shadow(0 0 5px rgba(255, 228, 121, 0.85));
}

.scratch-glitter::after {
  transform: rotate(45deg) scale(0.62);
}

.scratch-confetti {
  position: absolute;
  z-index: 5;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: 46%;
  left: var(--confetti-x);
  width: 7px;
  height: 11px;
  border-radius: 2px;
  background: var(--confetti-color);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
  animation: confettiFall 1.9s ease-out var(--confetti-delay) forwards;
}

.gallery {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1.5px solid rgba(196, 149, 106, 0.15);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.gallery-track {
  display: flex;
  height: 100%;
  gap: 4px;
  animation: galleryScroll 18s linear infinite;
}

.gallery img {
  height: 100%;
  width: 180px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: cover;
}

.map-card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(196, 149, 106, 0.25);
  border-radius: 18px;
  background:
    linear-gradient(110deg, transparent 46%, rgba(255, 255, 255, 0.55) 47%, transparent 49%),
    linear-gradient(20deg, rgba(84, 114, 86, 0.2), transparent 35%),
    linear-gradient(160deg, rgba(68, 112, 137, 0.18), transparent 36%),
    #efe8d8;
  box-shadow: 0 12px 32px rgba(38, 28, 12, 0.1);
  text-decoration: none;
}

.map-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.map-label {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  padding: 10px 12px;
  box-shadow: 0 10px 22px rgba(43, 31, 12, 0.12);
}

.map-label strong {
  display: block;
  color: #1a1a2e;
  font-size: 13px;
}

.map-label span {
  display: block;
  margin-top: 2px;
  color: rgba(26, 26, 46, 0.68);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-label em {
  display: inline-block;
  margin-top: 6px;
  color: var(--gold);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rsvp-form {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(196, 149, 106, 0.22);
  border-radius: 20px;
  background: rgba(255, 253, 247, 0.76);
  padding: 13px;
  font-family: "Raleway", "Manrope", sans-serif;
  box-shadow: 0 12px 34px rgba(54, 39, 22, 0.08);
}

.rsvp-title {
  margin: 0 0 8px;
  color: #1a1a2e;
  font-size: 18px;
  font-weight: 700;
}

.rsvp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.rsvp-form input,
.rsvp-form textarea,
.rsvp-form select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(196, 149, 106, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  padding: 7px 8px;
  color: #1a1a2e;
  font-size: 10px;
  outline: 0;
}

.rsvp-form textarea {
  grid-column: 1 / -1;
  min-height: 46px;
  resize: none;
}

.rsvp-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.rsvp-actions select {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(196, 149, 106, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  padding: 7px 8px;
  font-size: 10px;
}

.rsvp-actions button {
  border: 0;
  border-radius: 999px;
  background: #1a1a2e;
  color: white;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  padding: 8px 12px;
}

.rsvp-success {
  margin-top: 7px;
  color: #6a4e18;
  font-size: 10px;
  font-weight: 700;
}

.music-chip {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(196, 149, 106, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #8a6422;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(67, 43, 10, 0.1);
}

.loading,
.error {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: #6f614e;
  font-weight: 700;
}

.continuous-wobble {
  animation: wobble 10s ease-in-out infinite;
}

.continuous-glow {
  animation: softGlow 7.1s ease-in-out infinite;
}

.canvas-element.main-reveal-cloud.cloud-dissolve-active {
  pointer-events: none;
  animation: mainCloudDissolve 5.8s cubic-bezier(0.22, 0.74, 0.25, 1) 0.18s forwards;
}

.canvas-element.tree-sway {
  transform-origin: 50% 92%;
  animation: treeSway 9s ease-in-out infinite;
}

@keyframes tapPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes tapButtonFloat {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }
}

@keyframes tapRing {
  0% {
    opacity: 0.72;
    transform: scale(0.82);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes mainCloudDissolve {
  0% {
    opacity: 1;
    filter: var(--base-filter);
    transform: var(--base-transform) translate3d(0, 0, 0) scale(1);
  }
  24% {
    opacity: 0.9;
    filter: var(--base-filter) blur(0.7px);
    transform: var(--base-transform) translate3d(16px, -22px, 0) scale(1.015);
  }
  58% {
    opacity: 0.38;
    filter: var(--base-filter) blur(2.2px);
    transform: var(--base-transform) translate3d(-10px, -78px, 0) scale(1.045);
  }
  100% {
    opacity: 0;
    filter: var(--base-filter) blur(7px);
    transform: var(--base-transform) translate3d(28px, -168px, 0) scale(1.075);
    visibility: hidden;
  }
}

@keyframes treeSway {
  0%,
  100% {
    transform: var(--base-transform) rotate(-5deg);
  }
  50% {
    transform: var(--base-transform) rotate(5deg);
  }
}

@keyframes coinReveal {
  0% {
    transform: scale(0.96);
  }
  62% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes scratchSparkle {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--spark-rot)) scale(0.45);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -86%) rotate(calc(var(--spark-rot) + 70deg)) scale(1.45);
  }
}

@keyframes confettiFall {
  0% {
    opacity: 0;
    transform: translate(-50%, -12px) rotate(0deg) scale(0.75);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--confetti-tx)), 118px) rotate(var(--confetti-rot)) scale(1);
  }
}

@keyframes wobble {
  0%,
  100% {
    transform: var(--base-transform) rotate(-1deg);
  }
  50% {
    transform: var(--base-transform) rotate(1.3deg);
  }
}

@keyframes softGlow {
  0%,
  100% {
    filter: var(--base-filter) drop-shadow(0 0 0 rgba(255, 238, 184, 0));
  }
  50% {
    filter: var(--base-filter) drop-shadow(0 0 14px rgba(255, 238, 184, 0.72));
  }
}

@keyframes galleryScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 520px) {
  .top-actions {
    top: 16px;
    left: 16px;
    right: 16px;
  }

  .back-btn {
    min-height: 32px;
    padding: 0 12px;
    font-size: 12px;
  }

  .buy-pill {
    min-height: 38px;
    gap: 8px;
    padding: 0 11px 0 13px;
    font-size: 12px;
  }

  .music-float {
    bottom: 24px;
    left: 16px;
    width: 46px;
    height: 46px;
  }
}
