/* ---------- reset & base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: #0d2a33;
  font-family: 'Nunito', sans-serif;
  overscroll-behavior: none;
  touch-action: manipulation; /* blocks double-tap-to-zoom, still allows scroll/pan */
}
img { max-width: none; }
button { font-family: inherit; border: none; background: none; cursor: pointer; }

img, .sprite, .phone, .phone * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

:root {
  --cream: #fff6e6;
  --cream-dim: #f2e6c8;
  --sea-deep: #0a2e38;
  --sea: #0f4a56;
  --sunset: #ff7a3d;
  --coral: #ff5f6d;
  --pink: #ff5f8f;
  --gold: #d9a94c;
  --gold-bright: #f2c877;
  --wa-green: #25d366;
  --wa-green-dark: #128c4a;
  --serif: 'Playfair Display', Georgia, serif;
  --script: 'Caveat', cursive;
}

/* ---------- phone frame ---------- */
.phone {
  position: relative;
  overflow: hidden;
  background: #000;
  container-type: inline-size;
  container-name: phone;
  touch-action: none;
}

html.frame-desktop, html.frame-desktop body { height: 100%; }
html.frame-desktop body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #12525f 0%, #0d2a33 60%, #071a20 100%);
}
html.frame-desktop .phone {
  width: min(430px, 88vh);
  aspect-ratio: 9 / 16;
  border-radius: 46px;
  border: 12px solid #14201f;
  box-shadow: 0 40px 90px rgba(0,0,0,.55), 0 0 0 2px rgba(255,255,255,.05) inset;
}
html.frame-mobile .phone {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

/* ---------- loading screen ---------- */
.loading-screen {
  position: absolute; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5cqw;
  background: radial-gradient(circle at 50% 40%, #14606e 0%, #0d2a33 70%, #071a20 100%);
  transition: opacity .4s ease;
}
.loading-screen.hide { opacity: 0; pointer-events: none; }
.loading-chip {
  display: flex; align-items: center; gap: .4em;
  color: var(--cream);
  background: linear-gradient(180deg, rgba(15,74,86,.72), rgba(10,46,56,.72));
  padding: .5em 1.2em .5em .9em;
  border-radius: 999px;
  border: 1px solid rgba(217,169,76,.55);
  font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 4.2cqw;
}
.loading-bar-track { width: 40%; height: 3px; background: rgba(217,169,76,.25); border-radius: 999px; overflow: hidden; }
.loading-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); border-radius: 999px; transition: width .25s ease; }

.stage { position: absolute; inset: 0; overflow: hidden; }

/* ---------- background ---------- */
.bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background-image: url('assets/opt/backdrop-beach.webp');
  background-size: cover; background-position: center 25%; background-repeat: no-repeat;
}
.bg-vignette {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(8,20,10,.42) 0%, rgba(8,20,10,.05) 24%, rgba(8,20,10,0) 42%, rgba(8,20,10,.18) 74%, rgba(8,20,10,.5) 100%);
  pointer-events: none; z-index: 2;
}

/* ---------- kicker / progress chip / sound toggle ---------- */
.kicker {
  position: absolute; top: max(10px, 3cqw); left: max(10px, 3cqw); z-index: 40;
  display: flex; align-items: center; gap: .4em;
  color: var(--cream);
  background: linear-gradient(180deg, rgba(15,74,86,.72), rgba(10,46,56,.72));
  padding: .4em 1em .4em .8em; border-radius: 999px;
  border: 1px solid rgba(217,169,76,.55);
  box-shadow: 0 4px 14px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.06) inset;
  backdrop-filter: blur(4px);
}
.kicker-chevron { font-size: 4cqw; line-height: 1; color: var(--gold-bright); font-weight: 700; }
.kicker-text { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 2.9cqw; letter-spacing: .01em; white-space: nowrap; }

.progress-chip {
  position: absolute; top: max(10px, 3cqw); right: max(10px, 3cqw); z-index: 40;
  display: flex; align-items: center; gap: .5em;
  color: var(--cream);
  background: linear-gradient(180deg, rgba(15,74,86,.72), rgba(10,46,56,.72));
  padding: .4em 1em; border-radius: 999px;
  border: 1px solid rgba(217,169,76,.55);
  box-shadow: 0 4px 14px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.06) inset;
  backdrop-filter: blur(4px);
  transition: opacity .25s ease;
}
.progress-chip.hide { opacity: 0; pointer-events: none; }
.pc-label { font-family: 'Baloo 2', sans-serif; font-weight: 600; font-size: 2.5cqw; letter-spacing: .04em; color: var(--cream-dim); text-transform: uppercase; }
.pc-frac { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 3.4cqw; color: var(--gold-bright); }

.sound-toggle {
  position: absolute; top: max(10px, 3cqw); right: max(10px, 3cqw); z-index: 40;
  width: 9cqw; height: 9cqw; min-width: 34px; min-height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: var(--cream);
  background: linear-gradient(180deg, rgba(15,74,86,.72), rgba(10,46,56,.72));
  border-radius: 999px; border: 1px solid rgba(217,169,76,.55);
  box-shadow: 0 4px 14px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.06) inset;
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.sound-toggle.show { opacity: 1; pointer-events: auto; }
.sound-toggle:active { transform: scale(.93); }
.sound-note { font-size: 4cqw; line-height: 1; color: var(--gold-bright); position: relative; }
.sound-slash {
  position: absolute; left: 50%; top: 50%; width: 130%; height: 1.6px; background: var(--cream);
  transform: translate(-50%,-50%) rotate(-45deg) scaleX(0); transform-origin: center;
  transition: transform .15s ease; border-radius: 2px;
}
.sound-toggle.muted .sound-slash { transform: translate(-50%,-50%) rotate(-45deg) scaleX(1); }

/* ---------- act (screens 1-4 shared rig) ---------- */
.act { position: absolute; inset: 0; z-index: 10; transition: opacity .25s ease; }
.act.hidden { opacity: 0; pointer-events: none; }

/* sand decor: static shells/props + drifting petals, present on every screen */
.sand-props { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.prop { position: absolute; width: 8cqw; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.petals-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.petal { position: absolute; width: 6.5cqw; aspect-ratio: 1/1; opacity: .92; will-change: transform; background-size: contain; background-position: center; background-repeat: no-repeat; }

/* ---------- groom / bride sprites ---------- */
/* everyone stands on one ground line: feet at 78% from the top (bottom:22%).
   Groom 58% / bride 52% of frame height, centred on the post / at ~74% x.
   The bride's skirt tucks behind the groom's right arm — that's accepted;
   groom renders in front (higher z-index) so the ropes and hitboxes always
   win, and her face/sunglasses stay clear since her head is stage-left
   within her own crop, away from the overlap. */
.groom-wrap {
  position: absolute; left: 50%; bottom: 22%; height: 58%;
  aspect-ratio: 512 / 1024; transform: translateX(-50%); z-index: 13;
}
.bride-wrap {
  position: absolute; left: 74%; bottom: 22%; height: 52%;
  aspect-ratio: 768 / 1024; transform: translateX(-50%); z-index: 12;
}
.foot-shadow {
  position: absolute; top: 78%; height: 3.2%; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(10,20,10,.4) 0%, rgba(10,20,10,.18) 55%, transparent 75%);
  transform: translate(-50%, -50%); pointer-events: none; z-index: 9;
}
.groom-shadow { left: 50%; width: 20%; }
.bride-shadow { left: 76%; width: 24%; }
.pose-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background-size: contain; background-position: bottom center; background-repeat: no-repeat;
  opacity: 0; transition: opacity .5s ease;
  filter: drop-shadow(0 14px 16px rgba(10,20,10,.35));
}
.pose-img.show { opacity: 1; }

/* rope hitboxes: one visible+pulsing at a time, positioned via inline style
   left/top per current target (percentages measured on the groom art) */
.rope-hitbox {
  position: absolute; width: 17cqw; height: 17cqw; min-width: 50px; min-height: 50px;
  transform: translate(-50%,-50%); border-radius: 50%; z-index: 20; padding: 0;
  -webkit-appearance: none; display: none;
}
.rope-hitbox.show { display: block; }
.rope-ring {
  position: absolute; inset: 6%; border-radius: 50%;
  border: 3px solid rgba(255,246,230,.92);
  box-shadow: 0 0 0 3px rgba(255,95,111,.55), 0 0 14px rgba(255,246,230,.5);
  animation: ropePulse 1.3s ease-in-out infinite;
}
@keyframes ropePulse { 0%,100% { transform: scale(.92); opacity: .75; } 50% { transform: scale(1.08); opacity: 1; } }

/* the pointing guest-hand + blade cue, anchored near the hook pill */
.hand-touch { position: absolute; z-index: 19; pointer-events: none; }
.cue-hand { width: 15cqw; display: block; filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); }
.blade-cue {
  position: absolute; width: 7cqw; left: 100%; top: -10%;
  transform: rotate(-24deg); filter: drop-shadow(0 3px 4px rgba(0,0,0,.4));
}

/* blade swipe + cut fx, positioned via JS to the active rope's coords */
.cutfx-layer { position: absolute; inset: 0; z-index: 22; pointer-events: none; }
.blade-swipe { position: absolute; width: 13cqw; opacity: 0; filter: drop-shadow(0 3px 5px rgba(0,0,0,.4)); }
.cut-star { position: absolute; width: 14cqw; opacity: 0; }
.cut-lines { position: absolute; width: 12cqw; opacity: 0; }
.rope-piece { position: absolute; width: 9cqw; opacity: 0; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.varmala-piece { position: absolute; width: 13cqw; opacity: 0; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.sparkle-burst { position: absolute; width: 16cqw; opacity: 0; }

/* ---------- headline / pill / tagline ---------- */
.headline {
  position: absolute; left: 0; right: 0; top: 8%; z-index: 25;
  text-align: center; padding: 0 6%; pointer-events: none;
}
.headline::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 130%; height: 220%;
  transform: translate(-50%,-50%);
  background: radial-gradient(ellipse at center, rgba(8,20,10,.45) 0%, rgba(8,20,10,.2) 45%, rgba(8,20,10,0) 75%);
  z-index: -1;
}
.h-name {
  font-family: var(--serif); font-weight: 700; font-style: italic; font-size: 7.4cqw; line-height: 1.08;
  color: var(--coral); text-shadow: 0 0 2px rgba(255,255,255,.6), 0 3px 10px rgba(0,0,0,.4);
}
.h-sub {
  font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 4.8cqw; color: var(--cream);
  margin-top: .2em; text-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.tagline {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%,-50%) scale(.85);
  font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 6cqw; color: var(--cream);
  background: rgba(255,95,111,.9); padding: .4em .9em; border-radius: 14px; z-index: 35;
  opacity: 0; pointer-events: none; white-space: nowrap; text-align: center;
}

/* ---------- hook pill ---------- */
.press-cue { position: absolute; left: 42%; top: 88%; transform: translateX(-50%); z-index: 15; pointer-events: none; transition: opacity .25s ease; }
.cue-pill {
  display: flex; align-items: center; gap: .5em;
  background: var(--cream); color: var(--sea-deep);
  font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 3.8cqw; line-height: 1.15;
  padding: .5em .9em; border-radius: 20px; text-align: center; box-shadow: 0 4px 10px rgba(0,0,0,.25);
  position: relative; white-space: nowrap;
}
.cue-pill-blade { width: 2.4em; transform: rotate(-18deg); flex-shrink: 0; }
.cue-pill::after {
  content: ""; position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  border-width: 0 8px 8px 8px; border-style: solid; border-color: transparent transparent var(--cream) transparent;
}
.press-cue.hide { opacity: 0; }

/* ---------- signpost ---------- */
.signpost {
  /* far left, in front of the left drape, planted just inside the edge */
  position: absolute; left: 1%; bottom: 22%; height: 19%; aspect-ratio: 400 / 444;
  /* below the groom: he's the foreground figure, sign is set-dressing behind him */
  z-index: 8; transform: rotate(3deg); filter: drop-shadow(0 8px 10px rgba(0,0,0,.3));
  pointer-events: none; /* decorative only — never steal taps from a rope hitbox beneath it */
}
.signpost img { width: 100%; display: block; opacity: 0; position: absolute; inset: 0; transition: opacity .3s ease; }
.signpost img.show { opacity: 1; position: relative; }
.signpost-text {
  /* left-aligned, hugging the left edge of the plank: the bride stands in
     front of the sign's right side, so this is the part that stays clear */
  position: absolute; left: 10%; right: 9%; top: 30%; bottom: 30%;
  display: flex; align-items: center; justify-content: flex-start;
  font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 1.65cqw; letter-spacing: -.01em;
  line-height: 1.2; color: #5c3517; text-align: left;
}

/* ---------- generic screen (5 & 6) ---------- */
.screen { position: absolute; inset: 0; z-index: 15; opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.screen.show { opacity: 1; pointer-events: auto; }

.reveal-headline { position: absolute; left: 0; right: 0; top: 9%; text-align: center; padding: 0 6%; z-index: 20; }
.rh-line1 { font-family: var(--serif); font-weight: 700; font-style: italic; font-size: 7cqw; color: var(--coral); text-shadow: 0 0 2px rgba(255,255,255,.5), 0 3px 14px rgba(0,0,0,.5); }
.rh-badge {
  display: inline-block; margin-top: .35em; background: var(--pink); color: var(--cream);
  font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 3.8cqw; padding: .35em 1em; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
}
.reveal-couple {
  /* same 78% ground line as screens 1-4: bottom edge (feet in the sand) at 78% */
  position: absolute; left: 50%; bottom: 22%; width: 78%; aspect-ratio: 1024 / 1536;
  transform: translateX(-50%); z-index: 14;
  filter: drop-shadow(0 18px 26px rgba(10,20,10,.45));
}
.reveal-couple img { width: 100%; display: block; }

.card { position: absolute; filter: drop-shadow(0 20px 28px rgba(10,20,10,.5)); }
.card > img { width: 100%; display: block; aspect-ratio: 2/3; }
.card-text {
  /* measured off card-goa.png's alpha/colour: inner gold rule sits at
     x 10.2-89.2%, y 12.2-86.5% — inset a few % further for a safety margin */
  position: absolute; left: 13%; right: 13%; top: 15%; bottom: 16%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35em;
  text-align: center; color: #6e3a12;
}
.card-text > div { max-width: 100%; overflow-wrap: break-word; word-break: break-word; hyphens: auto; }
.ct-eyebrow { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 2.6cqw; letter-spacing: .22em; text-transform: uppercase; color: var(--coral); }
.ct-names { font-family: var(--serif); font-weight: 700; font-size: 6.6cqw; line-height: 1.1; white-space: nowrap; }
.ct-names .amp { font-style: italic; font-weight: 600; color: var(--coral); padding: 0 .05em; }
.ct-date { font-family: var(--serif); font-weight: 700; font-size: 4cqw; letter-spacing: .06em; text-transform: uppercase; color: var(--coral); margin-top: .1em; white-space: nowrap; }
.ct-rule { display: flex; align-items: center; justify-content: center; gap: .5em; width: 55%; margin: .15em 0; }
.gold-line { flex: 1; height: 1.5px; background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent); }
.ct-city { font-family: var(--serif); font-weight: 700; font-size: 3.5cqw; letter-spacing: .12em; text-transform: uppercase; color: #6e3a12; }
.ct-tag { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.9cqw; letter-spacing: .05em; color: #a8712c; margin-top: .3em; line-height: 1.35; }

.reveal-footer { position: absolute; left: 0; right: 0; top: 80%; text-align: center; z-index: 20; padding: 0 8%; }
.reveal-footer-text { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 3.4cqw; color: var(--cream); text-shadow: 0 2px 6px rgba(0,0,0,.5); }
.tap-hint { position: absolute; left: 50%; bottom: 2%; transform: translateX(-50%); font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 2.8cqw; color: var(--cream-dim); opacity: .85; z-index: 20; animation: hintPulse 1.6s ease-in-out infinite; }
@keyframes hintPulse { 0%,100%{opacity:.5} 50%{opacity:.95} }

/* ---------- confirm screen ---------- */
.screen-confirm { background: rgba(6,20,14,.4); }
.confirm-scroll {
  position: absolute; inset: 0; z-index: 10; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; padding: 14cqw 6cqw 4cqw; gap: .7cqw;
}
.confirm-eyebrow { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 2.6cqw; letter-spacing: .26em; text-transform: uppercase; color: var(--cream-dim); opacity: .9; text-shadow: 0 2px 6px rgba(0,0,0,.5); }
.confirm-title { font-family: var(--serif); font-weight: 700; font-size: 10.5cqw; line-height: 1.05; color: var(--cream); margin: .08em 0 0; text-shadow: 0 0 18px rgba(0,0,0,.55), 0 4px 16px rgba(0,0,0,.5); }
.confirm-subtag { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 2.4cqw; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-bright); text-shadow: 0 2px 6px rgba(0,0,0,.5); }

.card-confirm { position: relative; width: 78%; flex-shrink: 0; margin-top: 1.6cqw; }
.card-confirm .ct-names { font-size: 5.8cqw; }
.card-confirm .ct-date { font-size: 3.4cqw; }
.card-confirm .ct-city { font-size: 3cqw; }
.card-confirm .ct-tag { font-size: 1.75cqw; }

.btn-calendar {
  width: 88%; margin-top: 2.4cqw; padding: 3.6cqw 0;
  background: linear-gradient(180deg, #9c2036, #4a0c15 70%); color: var(--cream);
  border: 2px solid var(--gold); font-size: 4.1cqw; border-radius: 999px;
  box-shadow: 0 10px 22px rgba(0,0,0,.45), 0 0 0 1.5px rgba(255,255,255,.1) inset;
  display: flex; align-items: center; justify-content: center; gap: .55em; flex-shrink: 0;
}
.btn-cal-icon { width: 1.1em; height: 1.1em; color: var(--gold-bright); flex-shrink: 0; }
.btn-cal-label { font-family: var(--serif); font-weight: 700; }
.btn-calendar:active { transform: scale(.97); }

.share-row {
  width: 90%; margin-top: 2.2cqw; background: rgba(255,246,230,.97); border: 2px solid var(--gold);
  border-radius: 20px; padding: 2.6cqw 2.8cqw; display: flex; align-items: center; gap: 2.6cqw;
  box-shadow: 0 10px 22px rgba(0,0,0,.4); flex-shrink: 0;
}
.share-avatar { width: 19cqw; height: 19cqw; object-fit: cover; border-radius: 22%; display: block; box-shadow: 0 0 0 2px var(--sunset); flex-shrink: 0; }
.share-text { flex: 1; font-family: var(--script); font-weight: 700; font-size: 5cqw; line-height: 1.15; color: var(--sea-deep); }
.btn-whatsapp {
  width: 12cqw; height: 12cqw; min-width: 42px; min-height: 42px; border-radius: 50%; flex-shrink: 0;
  background: var(--wa-green); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.btn-whatsapp svg { width: 55%; height: 55%; fill: #fff; }
.btn-whatsapp:active { transform: scale(.92); }

.confirm-footer { display: flex; flex-direction: column; align-items: center; gap: .4em; margin-top: 1.6cqw; padding-bottom: 2cqw; }
.footer-script { font-family: var(--script); font-weight: 700; font-size: 6cqw; color: var(--gold-bright); text-shadow: 0 2px 6px rgba(0,0,0,.5); }

.toast {
  position: absolute; left: 50%; bottom: 6%; transform: translate(-50%, 20px);
  background: rgba(6,20,14,.9); color: var(--cream); font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 3.2cqw;
  padding: .7em 1.3em; border-radius: 999px; z-index: 60; opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .petal { display: none; }
  .rope-ring { animation: none; }
}
