/* ==========================================================================
   birthday-surprise-bash-teaser-poster — "Operation: Birthday" flyer
   A classified-folder teaser poster for a surprise birthday party.
   Palette: deep ink navy · cream paper · gold · coral · mint
   ========================================================================== */

/* ---------- Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.theme-flyer {
  --ink: #171f3d;
  --ink-soft: #232c52;
  --ink-deep: #0e1430;
  --paper: #f7f0e1;
  --paper-2: #efe3c8;
  --paper-3: #e7d9b8;
  --gold: #e2b13c;
  --coral: #ff6b5e;
  --mint: #8fd6b2;
  --redact: #05070f;
  --text: #1a2136;
  --text-soft: #4c5576;
  --danger: #c7453b;
  --shadow: 0 14px 34px rgba(14, 20, 48, 0.18);
  --radius: 16px;
  --font-display: "Bebas Neue", "Arial Narrow", "Impact", sans-serif;
  --font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--paper);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; }
input, select, textarea { font: inherit; }

/* ==========================================================================
   Single-viewport shell — only the active panel scrolls internally
   ========================================================================== */
.invite-shell {
  position: relative;
  height: 100vh;                 /* fallback for older browsers */
  height: 100dvh;                /* dynamic viewport on mobile */
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 12% -4%, rgba(226, 177, 60, 0.16), transparent 42%),
    radial-gradient(circle at 90% 6%, rgba(255, 107, 94, 0.14), transparent 40%),
    var(--paper);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(23, 31, 61, 0.08);
}

/* ---------- Header ---------- */
.invite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 12px;
  background: var(--ink);
  color: var(--paper);
  flex: 0 0 auto;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: rgba(247, 240, 225, 0.12);
  border: 1px solid rgba(247, 240, 225, 0.28);
  border-radius: 12px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.brand-text small { font-size: 10.5px; opacity: 0.72; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-meta { flex: 0 0 auto; text-align: right; }

.countdown {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
}
.countdown-label { font-size: 12px; color: var(--gold); letter-spacing: 0.16em; }
.countdown-digits { font-size: 21px; color: var(--paper); font-variant-numeric: tabular-nums; }

.countdown-fallback {
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------- Panels ---------- */
.invite-panels {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;   /* critical: lets children scroll instead of growing */
}

.panel {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 31, 61, 0.3) transparent;
}
.panel.is-active { display: block; }

.panel-inner {
  max-width: 520px;
  margin: 0 auto;
  padding: 26px 22px calc(34px + env(safe-area-inset-bottom));
}

/* ==========================================================================
   Poster panel — the actual flyer
   ========================================================================== */
.poster-panel { text-align: center; position: relative; }

.stamp-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 2px 0 18px;
}

.stamp {
  display: inline-block;
  border: 3px solid var(--coral);
  color: var(--coral);
  border-radius: 10px;
  padding: 3px 14px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transform: rotate(-5deg);
  background: rgba(255, 107, 94, 0.06);
  box-shadow: 0 2px 0 rgba(14, 20, 48, 0.08);
}
.stamp--alt {
  border-color: var(--gold);
  color: var(--gold);
  transform: rotate(4deg);
  background: rgba(226, 177, 60, 0.08);
}

/* redaction bars — the classified gag */
.redact {
  background: var(--redact);
  color: transparent;
  border-radius: 7px;
  padding: 0 0.16em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  user-select: none;
  cursor: default;
  white-space: nowrap;
}

.poster-title {
  font-family: var(--font-display);
  font-size: clamp(76px, 24vw, 128px);
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: var(--ink);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 6px 0 10px;
  text-shadow: 0 4px 0 rgba(23, 31, 61, 0.08);
}
.poster-title .redact {
  font-size: 0.92em;
  transform: rotate(-2deg);
  margin-top: 0.08em;
  border-radius: 10px;
}

.poster-sub {
  font-size: 16px;
  color: var(--text-soft);
  max-width: 34ch;
  margin: 0 auto 20px;
}
.poster-sub strong { color: var(--ink); }

.fact-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 24px;
}
.chip {
  background: var(--paper-2);
  border: 1px solid rgba(23, 31, 61, 0.12);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chip-key {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral);
  background: rgba(255, 107, 94, 0.12);
  border-radius: 999px;
  padding: 2px 8px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0 0 18px;
}

/* Real event date — shown once the host sets the Main Date field; the whole
   line is removed by the platform when empty, so the teaser stays intact. */
.poster-dateline {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-align: center;
  margin: 0 0 24px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.poster-footnote {
  font-size: 12.5px;
  color: var(--text-soft);
  font-style: italic;
  max-width: 40ch;
  margin: 0 auto;
}

/* ---------- decorative gift box + balloons ---------- */
.decor { position: relative; height: 148px; margin-top: 8px; }

.gift {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 132px;
  height: 104px;
}
.gift-lid {
  position: absolute;
  top: 0; left: -6px;
  width: 144px; height: 30px;
  background: var(--gold);
  border-radius: 6px;
  box-shadow: 0 3px 0 rgba(14, 20, 48, 0.18);
}
.gift-body {
  position: absolute;
  top: 26px; left: 0;
  width: 132px; height: 78px;
  background: var(--coral);
  border-radius: 4px 4px 8px 8px;
  box-shadow: inset 0 -10px 0 rgba(14, 20, 48, 0.08);
}
.gift-ribbon {
  position: absolute;
  top: 0; left: 50%;
  width: 26px; height: 104px;
  transform: translateX(-50%);
  background: var(--gold);
}
.gift-bow {
  position: absolute;
  top: -16px; left: 50%;
  transform: translateX(-50%);
  width: 34px; height: 22px;
  background: var(--gold);
  border-radius: 60% 60% 30% 30%;
  box-shadow: -10px -2px 0 -2px var(--gold), 10px -2px 0 -2px var(--gold);
  z-index: 2;
}

.balloon {
  position: absolute;
  font-size: 40px;
  animation: float 4.5s ease-in-out infinite;
}
.balloon--1 { left: 6%; top: 8px; animation-delay: -1.2s; }
.balloon--2 { right: 8%; top: 22px; animation-delay: -2.6s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-14px) rotate(3deg); }
}

.confetti-dot {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 3px;
  opacity: 0.85;
  animation: float 3.6s ease-in-out infinite;
}
.dot--1 { left: 18%; top: 46px; background: var(--gold); transform: rotate(24deg); }
.dot--2 { right: 16%; top: 64px; background: var(--mint); transform: rotate(-18deg); animation-delay: -1.6s; }
.dot--3 { left: 30%; top: 18px; background: var(--coral); border-radius: 50%; animation-delay: -0.8s; }
.dot--4 { right: 30%; top: 10px; background: var(--ink); border-radius: 50%; animation-delay: -2.2s; }

/* ==========================================================================
   Clues panel
   ========================================================================== */
.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 8px;
}
.panel-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 9vw, 48px);
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 12px;
}
.panel-lead {
  color: var(--text-soft);
  font-size: 15px;
  margin-bottom: 22px;
  max-width: 46ch;
}

.clue-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.clue-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fffdf7;
  border: 1px dashed rgba(23, 31, 61, 0.3);
  border-radius: 14px;
  padding: 15px 17px;
  box-shadow: 0 4px 14px rgba(14, 20, 48, 0.06);
}
/* inner dashed frame — reads like a stamped evidence card, not a plain border */
.clue-card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(226, 177, 60, 0.4);
  border-radius: 9px;
  pointer-events: none;
}
/* hand-placed tilt: even cards lean one way, odd cards the other */
.clue-card:nth-child(odd) { transform: rotate(-0.4deg); }
.clue-card:nth-child(even) { transform: rotate(0.5deg); }
/* dog-eared corner so the cards feel like pinned notes, not boxes */
.clue-card::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 14px;
  height: 14px;
  background: linear-gradient(225deg, rgba(23, 31, 61, 0.06) 50%, transparent 50%);
  border-bottom-left-radius: 8px;
  border-top-right-radius: 13px;
  pointer-events: none;
}
.clue-ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-size: 20px;
  line-height: 1;
  background: var(--paper-2);
  border: 1px dashed rgba(23, 31, 61, 0.25);
  border-radius: 9px;
}
.clue-card p { font-size: 15px; color: var(--text); }

.note-card {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 14px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.note-card::after {
  content: "🤫";
  position: absolute;
  right: 10px; bottom: -6px;
  font-size: 40px;
  opacity: 0.14;
  transform: rotate(-12deg);
}
.note-card strong { color: var(--gold); }

/* ==========================================================================
   RSVP form
   ========================================================================== */
.rsvp-form { display: flex; flex-direction: column; gap: 18px; }

.rsvp-field { display: flex; flex-direction: column; gap: 6px; }
.rsvp-field label,
.rsvp-field legend {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  padding: 0;
}
.rsvp-field label small { font-weight: 600; color: var(--text-soft); }

.rsvp-field input[type="text"],
.rsvp-field input[type="email"],
.rsvp-field input[type="tel"],
.rsvp-field select,
.rsvp-field textarea {
  width: 100%;
  border: 2px solid rgba(23, 31, 61, 0.16);
  border-radius: 12px;
  background: #fffdf7;
  color: var(--text);
  padding: 12px 14px;
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.rsvp-field input:focus,
.rsvp-field select:focus,
.rsvp-field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(226, 177, 60, 0.25);
}
.rsvp-field textarea { resize: vertical; min-height: 72px; }
.rsvp-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23171f3d' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

/* attending segmented choice */
.rsvp-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.choice-card { position: relative; cursor: pointer; }
.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice-face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  border: 2px solid rgba(23, 31, 61, 0.16);
  border-radius: 12px;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-soft);
  background: #fffdf7;
  transition: all 0.15s ease;
  min-height: 52px;
}
.choice-card input:checked + .choice-face {
  border-color: var(--mint);
  background: rgba(143, 214, 178, 0.22);
  color: var(--ink);
  box-shadow: 0 0 0 3px rgba(143, 214, 178, 0.3);
}
.choice-card input:focus-visible + .choice-face {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.choice-card:nth-child(2) input:checked + .choice-face {
  border-color: var(--coral);
  background: rgba(255, 107, 94, 0.14);
  box-shadow: 0 0 0 3px rgba(255, 107, 94, 0.2);
}
.choice-card:hover .choice-face { border-color: var(--gold); }

/* platform-injected error messages (hidden until shown) */
.error-message {
  display: none;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

/* platform-controlled loading state */
.loading {
  display: none;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.form-footnote {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--text-soft);
  text-align: center;
}

/* ==========================================================================
   Guestbook (platform mounts content into .guestbook-body)
   ========================================================================== */
.guestbook-section { margin-top: 4px; }
.guestbook-body { min-height: 60px; }
.guestbook-body:empty::after {
  content: "No whispers yet — be the first. 🤫";
  display: block;
  color: var(--text-soft);
  font-style: italic;
  font-size: 14px;
  text-align: center;
  padding: 26px 0;
  border: 1.5px dashed rgba(23, 31, 61, 0.25);
  border-radius: var(--radius);
}

/* ==========================================================================
   Free page — optional repeatable blocks (title + text + optional photo)
   ========================================================================== */
.free-blocks {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 22px;
}
.free-block {
  background: #fffdf7;
  border: 1px solid rgba(23, 31, 61, 0.14);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 6px 18px rgba(14, 20, 48, 0.08);
}
.free-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.02em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 8px;
}
.free-content { font-size: 15px; color: var(--text); }
.free-content p + p { margin-top: 10px; }
.free-figure { margin: 14px 0 0; }
.free-frame { aspect-ratio: 4 / 3; border-radius: 9px; }
.free-cap {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  padding: 9px 2px 3px;
}

/* ==========================================================================
   Mission checklist
   ========================================================================== */
.checklist { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.check-item {
  background: #fffdf7;
  border: 1px solid rgba(23, 31, 61, 0.1);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.15s ease;
}
.check-item:hover { transform: translateX(3px); }

.check-item label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
}
.check-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.check-box {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  margin-top: 1px;
  border: 2px solid rgba(23, 31, 61, 0.3);
  border-radius: 8px;
  position: relative;
  transition: all 0.15s ease;
}
.check-item input:checked + .check-box {
  background: var(--mint);
  border-color: var(--mint);
}
.check-item input:checked + .check-box::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-weight: 900;
  font-size: 15px;
}
.check-item input:focus-visible + .check-box {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.check-text { font-size: 14.5px; color: var(--text); transition: color 0.15s ease; }
.check-item input:checked ~ .check-text {
  color: var(--text-soft);
  text-decoration: line-through;
  text-decoration-color: var(--mint);
}

.progress-card {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 14px;
}
.progress-meta strong {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.05em;
  color: var(--gold);
}
.progress-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(247, 240, 225, 0.16);
  overflow: hidden;
}
.progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--coral));
  transition: width 0.4s ease;
}
.progress-note {
  margin-top: 10px;
  font-size: 13px;
  color: rgba(247, 240, 225, 0.75);
  font-style: italic;
}

/* ==========================================================================
   Photos — honoree polaroid + moments gallery (optional, configurable)
   ========================================================================== */
/* Shared frame: fixed ratio, img fills it without distortion */
.photo-frame {
  position: relative;
  overflow: hidden;
  background: var(--ink-deep);
}
/* A frame whose image was removed (empty photo field) must not leave a
   dark empty box on the page — drop it entirely. */
.photo-frame:not(:has(img)) { display: none; }
.photo-slot-cap:empty { display: none; }
.photo-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.18s ease;
}
.photo-frame img:hover { transform: scale(1.04); }
.photo-frame img:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }

/* Poster hero — a tilted “Exhibit A” polaroid of the honoree */
.evidence-photo {
  width: min(212px, 58vw);
  margin: 0 auto 24px;
  background: #fffdf7;
  border: 1px solid rgba(23, 31, 61, 0.14);
  border-radius: 14px;
  padding: 9px 9px 7px;
  box-shadow: var(--shadow);
  transform: rotate(-3deg);
  transition: transform 0.2s ease;
}
.evidence-photo:hover,
.evidence-photo:focus-within { transform: rotate(-1.5deg) translateY(-3px) scale(1.02); }
.evidence-photo .photo-frame { aspect-ratio: 4 / 5; border-radius: 8px; }
.evidence-photo figcaption {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  padding: 9px 2px 3px;
}

/* Moments gallery grid — the party-moment showcase */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.photo-slot {
  margin: 0;
  background: #fffdf7;
  border: 1px solid rgba(23, 31, 61, 0.14);
  border-radius: 14px;
  padding: 7px 7px 5px;
  box-shadow: 0 6px 18px rgba(14, 20, 48, 0.1);
  transition: transform 0.15s ease;
}
.photo-slot:hover { transform: translateY(-2px); }
.photo-slot .photo-frame { aspect-ratio: 4 / 3; border-radius: 9px; }
.photo-slot figcaption {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  padding: 8px 2px 4px;
}

/* Feature kill-switch (added by main.js when photos are turned off or a
   slot is emptied): removes the slot / whole Moments feature cleanly. */
.photo-slot.is-disabled,
.evidence-photo.is-disabled,
.banner-card.is-disabled { display: none; }
[data-photo-feature].is-disabled,
[data-video-feature].is-disabled { display: none !important; }

/* Optional official flyer/banner — leads the poster when the host enables
   it (CONFIG.banner.src); hidden by default via .is-disabled. */
.banner-card {
  margin: 0 auto 24px;
  background: #fffdf7;
  border: 1px solid rgba(23, 31, 61, 0.14);
  border-radius: 16px;
  padding: 8px 8px 6px;
  box-shadow: var(--shadow);
  transform: rotate(-0.6deg);
  transition: transform 0.2s ease;
}
.banner-card:hover,
.banner-card:focus-within { transform: rotate(0deg) translateY(-2px); }
.banner-card .banner-frame { aspect-ratio: 16 / 9; border-radius: 10px; }
.banner-card figcaption {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  padding: 9px 2px 3px;
}

/* Optional highlight-reel video card (CONFIG.video) */
.film-card { margin-bottom: 24px; }
.film-card .eyebrow { margin-bottom: 4px; }
.film-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.02em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 10px;
}
.film-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: var(--ink-deep);
  box-shadow: var(--shadow);
}
.film-open {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: none;
  text-align: center;
}
.film-open img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.film-open:hover img { transform: scale(1.04); }
.film-open:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.film-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: rgba(23, 31, 61, 0.55);
  border: 2px solid rgba(247, 240, 225, 0.7);
  backdrop-filter: blur(4px);
  transition: transform 0.18s ease, background 0.18s ease;
}
.film-play svg { width: 26px; height: 26px; }
.film-open:hover .film-play {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--coral);
  color: #fff;
}
.film-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper);
  background: rgba(23, 31, 61, 0.55);
  border-radius: 999px;
  padding: 5px 12px;
  backdrop-filter: blur(4px);
}

/* Video viewer — a full-screen overlay, opened from the film card */
.video-viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(5, 7, 15, 0.92);
  backdrop-filter: blur(6px);
  padding: 1rem;
}
.video-viewer.is-open { display: flex; }
.video-stage {
  width: min(92vw, 880px);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
.video-stage iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-note {
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--gold);
  font-weight: 700;
  padding: 2rem;
}
.video-viewer .film-external {
  color: var(--paper);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 240, 225, 0.5);
  padding-bottom: 2px;
}
.video-viewer .film-external:hover { color: var(--gold); border-color: var(--gold); }

/* Full-screen photo viewer (lightbox, built by main.js) */
.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 15, 0.92);
  backdrop-filter: blur(6px);
  padding: 1rem;
}
.photo-viewer.is-open { display: flex; }

.pv-btn {
  position: absolute;
  z-index: 2;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink);
  background: var(--gold);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, background 0.15s ease;
}
.pv-btn:hover { transform: scale(1.08); background: var(--coral); color: #fff; }
.pv-btn:focus-visible { outline: 3px solid var(--paper); outline-offset: 2px; }
.pv-close { top: 1rem; right: 1rem; }
.pv-zoom { top: 1rem; left: 1rem; }
.pv-prev { left: 0.6rem; top: 50%; transform: translateY(-50%); }
.pv-next { right: 0.6rem; top: 50%; transform: translateY(-50%); }
.pv-prev:hover, .pv-next:hover { transform: translateY(-50%) scale(1.08); }

/* zoomable stage: magnifier button, pinch, wheel, drag-to-pan */
.lb-stage {
  max-width: min(92vw, 860px);
  max-height: 76dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.lb-stage figure { margin: 0; text-align: center; }
.lb-stage.is-zoomed img { cursor: grab; }
.lb-stage.is-zoomed.dragging img { cursor: grabbing; }

.photo-viewer figure { margin: 0; max-width: min(90vw, 760px); text-align: center; }
.photo-viewer img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 12px;
  background: #fffdf7;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  transition: transform 0.25s ease;
  will-change: transform;
}
.photo-viewer figcaption { margin-top: 0.9rem; color: var(--paper); font-weight: 700; }
.lb-count {
  position: absolute;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  color: var(--paper);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: rgba(5, 7, 15, 0.6);
  border-radius: 999px;
  padding: 5px 12px;
}
.pv-unavailable {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  text-align: center;
  color: var(--gold);
  font-weight: 700;
  padding: 2rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  border: none;
  border-radius: 999px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.btn--primary {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 107, 94, 0.38);
}
.btn--primary:hover { background: #ff5849; box-shadow: 0 10px 24px rgba(255, 107, 94, 0.45); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}
.btn--ghost:hover { background: rgba(23, 31, 61, 0.06); }

.btn--block { width: 100%; }

/* ==========================================================================
   Bottom nav tabs
   ========================================================================== */
.invite-nav {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-around;
  gap: 4px;
  background: var(--ink);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(247, 240, 225, 0.12);
}

.nav-btn {
  flex: 1 1 0;
  min-height: 46px;   /* comfortable tap target on mobile */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 7px 2px 6px;
  color: rgba(247, 240, 225, 0.55);
  cursor: pointer;
  transition: flex-grow 0.25s ease, background 0.15s ease, color 0.15s ease;
  min-width: 0;
}
.nav-btn .nav-ico { font-size: 19px; line-height: 1; }
.nav-btn .nav-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.nav-btn:hover { color: var(--paper); background: rgba(247, 240, 225, 0.08); }
.nav-btn.is-active { color: var(--paper); background: rgba(226, 177, 60, 0.22); }
.nav-btn.is-active .nav-label { color: var(--gold); }
.nav-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Narrow screens: seven tabs never fit seven full labels ("Moments" alone
   needs ~58px of a ~49px slot), so the bar adapts instead of truncating —
   inactive tabs collapse to their emoji while the active tab widens and
   keeps its label. Labels stay in the accessibility tree via the clip
   pattern; nothing is cut off and no sideways scrolling is needed at any
   phone width down to 320px. Above 480px every label fits as-is. */
@media (max-width: 480px) {
  .nav-btn.is-active { flex-grow: 2; }
  .nav-btn:not(.is-active) .nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* ==========================================================================
   Confetti layer (spawned by main.js) and the flyer's img README note
   ========================================================================== */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  overflow: hidden;
}
.confetti-layer span {
  position: absolute;
  top: -3vh;
  border-radius: 2px;
  animation-name: confetti-fall;
  animation-timing-function: linear;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-3vh) rotate(0deg); opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(540deg); opacity: 0; }
}

/* ==========================================================================
   Brand footer — tucked into the last panel by main.js (.is-tucked)
   ========================================================================== */
.app-footer { display: none; }
.app-footer.is-tucked {
  display: block;
  margin: 6px 0 2px;
  padding-top: 16px;
  border-top: 1.5px dashed rgba(23, 31, 61, 0.18);
  text-align: center;
}
.footer-brand {
  font-size: 12.5px;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}
.footer-brand-heart { color: var(--coral); }
.footer-brand-name {
  font-weight: 800;
  color: var(--ink);
}

/* ==========================================================================
   Powered-by brand strip — full-width “Powered by Kundangi” line between
   the panels and the tab bar. The engine swaps the literal Kundangi token
   inside .link-footer for the platform name at render; the cockpit's Free
   Powered By field can override the whole line.
   ========================================================================== */
.powered-by {
  flex: 0 0 auto;
  width: 100%;
  text-align: center;
  padding: 8px 14px;
  border-top: 1px solid rgba(247, 240, 225, 0.12);
  background: var(--ink);
  color: rgba(247, 240, 225, 0.55);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.powered-by .link-footer { color: var(--gold); }

/* ==========================================================================
   Accessibility: prefers-reduced-motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .balloon, .confetti-dot, .loading { animation: none; }
  .check-item:hover, .btn:active, .check-item:hover { transform: none; }
}

/* ==========================================================================
   Print — a clean, single-flow version of the invite
   ========================================================================== */
@media print {
  body.theme-flyer { background: #fff; color: #111; }
  .invite-shell {
    height: auto;
    max-width: none;
    display: block;
    overflow: visible;
    box-shadow: none;
    background: #fff;
  }
  .invite-header { background: #fff; color: #111; border-bottom: 2px solid #111; }
  .brand-text strong { color: #111; }
  .brand-text small, .countdown { color: #555; }
  .countdown-label { color: #111; }
  .invite-nav, .btn, .decor, .photo-viewer, .video-viewer, .film-card, .powered-by { display: none !important; }
  .invite-panels { overflow: visible; }
  .panel {
    position: static;
    display: block !important;
    overflow: visible;
    height: auto;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .panel-inner { max-width: none; padding: 16px 0; }
  .poster-title { text-shadow: none; }
  .clue-card, .note-card, .progress-card, .check-item, .choice-face {
    box-shadow: none;
    background: #f6f6f6;
    border-color: #999;
  }
  .evidence-photo, .photo-slot, .banner-card {
    box-shadow: none;
    background: #f6f6f6;
    border: 1px solid #999;
    break-inside: avoid;
  }
  .evidence-photo figcaption, .photo-slot figcaption, .banner-card figcaption { color: #333; }
  .app-footer.is-tucked { border-top-color: #999; }
  .footer-brand { color: #333; }
  .footer-brand-name { color: #111; }
  .redact { background: #222; box-shadow: none; }
  .stamp { border-color: #111; color: #111; background: none; }
  .rsvp-form { break-inside: avoid; }
}

/* ── Guestbook (platform-injected form + message list) ─────────────── */
.guestbook-body { width: 100%; }

.guestbook-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#guestbookForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 18px;
  background: var(--paper);
  border: 2px solid rgba(23, 31, 61, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
#guestbookForm .form-group { display: flex; flex-direction: column; gap: 6px; }
#guestbookForm .form-group label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);
}
#guestbookForm .form-control {
  width: 100%;
  border: 2px solid rgba(23, 31, 61, 0.16);
  border-radius: 12px;
  background: #fffdf7;
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#guestbookForm .form-control::placeholder { color: var(--text-soft); }
#guestbookForm .form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(226, 177, 60, 0.25);
}
#guestbookForm textarea.form-control { resize: vertical; min-height: 72px; }
#guestbookForm .error {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
}

.guestbook-chapta { margin-top: 12px; }

#guestbookForm button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 4px auto 0;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  background: var(--coral);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 107, 94, 0.38);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
#guestbookForm button[type="submit"]:hover { filter: brightness(1.06); transform: translateY(-1px); }

.loading-guestbook {
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
}

/* Message list (#comments-container.guestbook-wrap) */
.guestbook-wrap {
  margin-top: 22px !important;
  border-top: 2px solid rgba(23, 31, 61, 0.14) !important;
  padding-top: 18px !important;
}
.guestbook-entry {
  background: var(--paper-2);
  border: 1px solid rgba(23, 31, 61, 0.12);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.guestbook-entry h5 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.guestbook-entry p { margin: 0 0 6px; font-size: 0.9rem; color: var(--text); overflow-wrap: anywhere; }
.guestbook-entry small { font-size: 0.72rem; color: var(--text-soft); }

.more-guestbook-wrap { text-align: center; margin-top: 4px; }
#load-more {
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  padding: 10px 26px;
  cursor: pointer;
}
#load-more:hover { background: rgba(23, 31, 61, 0.06); }
