/* Invitation showcase page (demo.html) — the design gets the whole screen */
body.show {
  height: 100dvh; overflow: hidden; background: var(--wine); color: #f2e2d6;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* Top bar */
.sbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .8rem;
  padding: .55rem clamp(12px, 2.5vw, 28px); padding-top: calc(.55rem + env(safe-area-inset-top));
  background: var(--wine); border-bottom: 1px solid rgba(226, 178, 87, .18); position: relative; z-index: 5;
}
.s-back { justify-self: start; display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 .4rem; font-size: .9rem; color: #d9c3b8 }
.s-back .s-logo { width: auto; height: 32px }
.s-back:hover { color: var(--gold-hi) }
.s-title { display: flex; align-items: center; gap: .4rem }
.s-arrow { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(226, 178, 87, .35); background: transparent; color: var(--gold-hi); font-size: 1.35rem; line-height: 1; flex: none }
.s-arrow:hover { background: var(--gold); color: var(--wine) }
.s-pick { position: relative; display: block; min-width: min(46vw, 280px); text-align: center; cursor: pointer }
.s-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px }
.s-pick-face { display: grid; padding: .1rem .8rem; border-radius: 12px; pointer-events: none }
.s-pick:hover .s-pick-face, .s-pick:focus-within .s-pick-face { background: rgba(255, 255, 255, .06) }
.s-pick-face b { font: 600 1.45rem/1.15 var(--ser); color: #fff6e6 }
.s-pick-face b::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: .5rem; border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold); transform: rotate(45deg) translateY(-4px) }
.s-pick-face small { font-size: .75rem; color: #b79c93 }
.s-tools { justify-self: end; display: flex; align-items: center; gap: .4rem }
.s-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(226, 178, 87, .3); background: transparent; color: #f2e2d6 }
.s-icon svg { width: 20px; height: 20px; fill: currentColor }
.s-icon:not(.wa):not(.ig) svg { fill: none }
.s-icon:hover, .s-icon[aria-expanded="true"] { background: rgba(226, 178, 87, .16); color: var(--gold-hi) }
.s-icon.wa { color: #4bd486 }
.s-icon[hidden] { display: none }
.seg { display: flex; border: 1px solid rgba(226, 178, 87, .3); border-radius: 99px; padding: 3px; margin-right: .2rem }
.seg button { width: 38px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 99px; background: transparent; color: #b79c93 }
.seg button svg { width: 19px; height: 19px }
.seg button[aria-pressed="true"] { background: var(--gold); color: var(--wine) }

/* Stage */
.stage { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(60% 70% at 50% 40%, rgba(226, 178, 87, .12), transparent 70%), #12030a }
.frame-wrap { position: absolute; inset: 0 }
.frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; opacity: 0; transition: opacity .4s }
.frame-wrap.ready iframe { opacity: 1 }
.loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 1rem; font: italic 600 1.4rem var(--ser); color: var(--gold-hi); transition: opacity .3s }
.frame-wrap.ready .loading { opacity: 0; pointer-events: none }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(226, 178, 87, .25); border-top-color: var(--gold); animation: spin 1s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }

/* Phone view: same live invitation at a true 390x800 phone size, scaled to fit */
.stage[data-view="phone"] .frame-wrap {
  --s: 1; inset: auto; left: 50%; top: 50%;
  width: calc(412px * var(--s)); height: calc(822px * var(--s)); padding: calc(11px * var(--s)); border-radius: calc(48px * var(--s));
  transform: translate(-50%, -50%);
  background: linear-gradient(160deg, #3a2a20, #120a07); box-shadow: 0 40px 90px -30px #000, inset 0 0 0 1px rgba(226, 178, 87, .4);
}
.stage[data-view="phone"] .frame-wrap iframe { left: calc(11px * var(--s)); top: calc(11px * var(--s)); right: auto; bottom: auto; width: 390px; height: 800px; transform: scale(var(--s)); transform-origin: 0 0; border-radius: 38px }
.stage[data-view="phone"] .loading { inset: calc(11px * var(--s)); border-radius: calc(38px * var(--s)); background: #2a0711 }

/* Demo mode: the invitation takes the entire screen */
.exit-full {
  display: none; position: absolute; z-index: 4; top: calc(14px + env(safe-area-inset-top)); right: 14px;
  align-items: center; gap: .45rem; min-height: 42px; padding: 0 1rem; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(20, 6, 10, .72); color: #fff; font-size: .85rem; font-weight: 600; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: opacity .4s;
}
.exit-full svg { width: 18px; height: 18px }
body.presenting .exit-full { display: inline-flex }
body.presenting.idle .exit-full { opacity: .45 }
body.presenting .exit-full:hover { opacity: 1 }
body.presenting { grid-template-rows: minmax(0, 1fr) }
body.presenting .sbar, body.presenting .abar, body.presenting .pop { display: none }
body.presenting .stage { grid-row: 1 }
body.presenting .stage[data-view] .frame-wrap { inset: 0; left: 0; top: 0; width: auto; height: auto; padding: 0; border-radius: 0; transform: none; background: none; box-shadow: none }
body.presenting .stage[data-view] .frame-wrap iframe { inset: 0; left: 0; top: 0; width: 100%; height: 100%; transform: none; border-radius: 0 }
.stage:fullscreen { width: 100vw; height: 100vh }

/* Bottom action bar: one line, three distinct buttons */
.abar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem clamp(12px, 2.5vw, 28px); padding-bottom: calc(.7rem + env(safe-area-inset-bottom));
  background: var(--wine); border-top: 1px solid rgba(226, 178, 87, .18); position: relative; z-index: 5;
}
.a-meta { display: grid; min-width: 0 }
.a-meta b { font: 600 1.35rem/1.1 var(--ser); color: #fff6e6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.a-meta span { font-size: .8rem; color: #b79c93; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.a-actions { display: flex; gap: .6rem; flex: none }
.a-actions .btn { white-space: nowrap }
.btn-ghost { border-color: rgba(242, 226, 214, .5); color: #f2e2d6; background: transparent }
.btn-ghost:hover, .btn-ghost[aria-expanded="true"] { background: #f2e2d6; color: var(--wine); border-color: #f2e2d6 }
.btn-ghost svg { fill: none !important }
.btn-gold svg { fill: none !important }
.a-actions .short { display: none }

/* Popovers */
.pop {
  position: fixed; z-index: 8; right: clamp(12px, 2.5vw, 28px); bottom: calc(84px + env(safe-area-inset-bottom));
  width: min(380px, calc(100vw - 24px)); background: var(--ivory); color: var(--ink); border-radius: 22px; padding: 1.4rem;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7); animation: popin .3s var(--ease);
}
.pop[hidden] { display: none }
@keyframes popin { from { opacity: 0; transform: translateY(10px) } }
.pop.info { top: calc(70px + env(safe-area-inset-top)); bottom: auto }
.pop-x { position: absolute; top: .5rem; right: .6rem; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 1.6rem; color: var(--maroon) }
.pop-x:hover { background: var(--blush) }
.pop h2 { font-size: 1.8rem; color: var(--maroon); padding-right: 2rem }
.pop p { color: var(--mut); font-size: .92rem; margin-top: .5rem }
.i-style { color: var(--gold-deep) !important; font-weight: 600; font-size: .8rem !important; margin-top: 0 !important }
.i-ritual { background: var(--blush); color: var(--ink) !important; padding: .6rem .8rem; border-radius: 12px }
.i-ritual:empty { display: none }
.i-price span { font: 600 1.7rem var(--ser); color: var(--maroon) }
.i-help a { color: var(--maroon); text-decoration: underline; text-underline-offset: 3px; cursor: pointer }
.n-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 1rem 0 }
.n-fields label { display: grid; gap: .3rem; font-size: .8rem; font-weight: 600; color: var(--mut); min-width: 0 }
.n-fields input { width: 100%; min-width: 0; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; font: 500 16px var(--san); background: #fff; color: var(--ink) }
.n-fields input:focus { outline: none; border-color: var(--maroon2); box-shadow: 0 0 0 3px rgba(125, 22, 48, .14) }
.pop .btn { width: 100% }

@media (max-width: 1080px) {
  .a-meta span { display: none }
}
@media (max-width: 860px) {
  .sbar { grid-template-columns: auto 1fr auto; gap: .3rem }
  .s-back .lbl { display: none }
  .s-title { justify-content: center; min-width: 0 }
  .s-pick { min-width: 0; flex: 1 }
  .s-pick-face b { font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
  .seg { display: none }
  .s-arrow { width: 36px; height: 36px }
  .a-meta { display: none }
  .abar { padding-inline: 10px }
  .a-actions { flex: 1; gap: .45rem }
  .a-actions .btn { flex: 1 1 0; min-width: 0; padding-inline: .5rem; font-size: .86rem; gap: .35rem }
  .a-actions .long { display: none }
  .a-actions .short { display: inline }
  .pop { left: 12px; right: 12px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom)) }
}
@media (max-width: 380px) {
  .s-icon.ig, #infoBtn { display: none }
  .a-actions .btn svg { display: none }
}
