/* guest screens. Owner: guest worker (CONTRACTS.md). Scope rules under body[data-area="guest"] or a screen class.
   Ported from mockups-v2/wedding/upload.html, gallery.html and styles.css. */

/* ---- frame: guests get the mock-ups' own top row, not the shell's ---- */
body[data-area="guest"] > .topbar { display: none; }
body[data-area="guest"] .app { max-width: 480px; padding: 0 18px 40px; }
body[data-area="guest"] .app:has(.g-gallery) { max-width: 1080px; }
body[data-area="guest"] [hidden] { display: none !important; }
body[data-area="guest"] .num { font-variant-numeric: tabular-nums lining-nums; }

.g-page .ico { width: 22px; height: 22px; flex: none; }
.g-page .ico-sm, .g-show .ico-sm { width: 18px; height: 18px; flex: none; }
.g-page h1, .g-page h2 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.01em; }
.g-page p { margin: 0; text-wrap: pretty; }

.g-topbar { display: flex; align-items: center; gap: 10px; min-height: 64px; padding-top: 8px; }
.g-title { font: 700 17px/1.2 var(--sans); flex: 1; }
.g-title small { display: block; font-weight: 600; font-size: 13px; color: var(--muted); }
.g-page .icon-btn, .g-show .icon-btn {
  width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; flex: none; text-decoration: none;
}
.g-page .icon-btn .i, .g-page .icon-btn .ico { width: 20px; height: 20px; }
.g-loading { min-height: 60dvh; display: grid; place-items: center; }

/* ---- the mock-ups' shared bits ---- */
.g-page .ph, .g-show .ph { position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(60% 45% at 74% 18%, rgba(255, 238, 200, .95), transparent 70%), linear-gradient(172deg, #E8C08A 0%, #C9835F 46%, #7A4A52 78%, #3E2B3A 100%); }
.g-page .scrim::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(16, 14, 28, 0) 40%, rgba(16, 14, 28, .66) 100%); }
.g-page .on-photo { color: #fff; }
.g-page .pill { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: 999px; font: 700 13.5px/1 var(--sans); background: var(--blue-soft); color: var(--ink); }
.g-page .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #E0566B; animation: g-ping 2.4s cubic-bezier(.16, 1, .3, 1) infinite; }
@keyframes g-ping { 0% { box-shadow: 0 0 0 0 rgba(224, 86, 107, .5); } 70%, 100% { box-shadow: 0 0 0 9px rgba(224, 86, 107, 0); } }
.g-page .vid { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 999px; background: rgba(15, 15, 25, .55); color: #fff; font: 700 12.5px/1 var(--sans); }
.g-page .vid svg { width: 12px; height: 12px; }
.g-page .avatars { display: flex; }
.g-page .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 800 12px/1 var(--sans); color: #1B1E2A; border: 2px solid var(--bg); }
.g-page .avatars .av + .av { margin-left: -9px; }
.g-page .av-a { background: #F1C9CF; } .g-page .av-b { background: #C9D9F1; } .g-page .av-c { background: #D3E6C9; } .g-page .av-d { background: #F2DDB0; } .g-page .av-e { background: #DCCFF0; }
.g-page .card { border-radius: var(--r-lg); }

/* ---- landing + upload ---- */
.g-cover { margin: 6px -6px 0; border-radius: var(--r-xl); min-height: 300px; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px; box-shadow: var(--shadow-lift);
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  background: radial-gradient(60% 45% at 74% 18%, rgba(255, 238, 200, .95), transparent 70%), radial-gradient(40% 30% at 30% 70%, rgba(255, 210, 170, .35), transparent 70%), linear-gradient(172deg, #E8C08A 0%, #C9835F 46%, #7A4A52 78%, #3E2B3A 100%); }
.g-cover::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(16, 14, 28, 0) 40%, rgba(16, 14, 28, .66) 100%); }
.g-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.g-cover-names { font: 400 42px/1 var(--serif); letter-spacing: -0.015em; position: relative; z-index: 2; overflow-wrap: anywhere; }
.g-cover-meta { margin-top: 8px; font: 650 15px/1.35 var(--sans); position: relative; z-index: 2; }
.g-cover-flower { position: absolute; z-index: 2; top: 18px; left: 20px; width: 40px; height: 40px; color: #fff; --pollen: #F2C14E; --petal-line: rgba(0, 0, 0, .08); }

.g-intro { margin-top: 26px; }
.g-intro h1 { font-size: 32px; line-height: 1.1; }
.g-intro p { margin-top: 10px; font-size: 17px; color: var(--muted); max-width: 36ch; }

.g-name { margin-top: 22px; gap: 8px; }
.g-name label { font: 700 14px/1.3 var(--sans); }
.g-name label em { font-style: normal; font-weight: 600; color: var(--muted); }
.input.g-input { min-height: 52px; border-radius: var(--r-md); background: var(--surface-2); padding: 0 16px; font: 600 16px/1.2 var(--sans); caret-color: var(--blue); }
.input.g-input::placeholder { color: var(--muted); font-weight: 500; }
.input.g-input:focus { background: var(--surface); border-color: var(--blue); }

.g-add { margin-top: 22px; }
.g-add .g-big { min-height: 64px; font-size: 17.5px; border-radius: 22px; }
.g-add .g-big .ico { width: 24px; height: 24px; }
.g-or { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.g-or.g-or-one { grid-template-columns: 1fr; }
.g-or .btn { min-height: 54px; font-size: 15.5px; border-radius: 18px; padding: 0 12px; }

.g-uploads { margin-top: 28px; }
.g-uploads h2 { font-size: 22px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.g-uploads h2 small { font: 650 14px/1 var(--sans); color: var(--muted); }
.g-up { display: flex; align-items: center; gap: 14px; padding: 12px; margin-top: 10px; }
.g-thumb { width: 56px; height: 56px; border-radius: 14px; flex: none; display: grid; place-items: center; color: rgba(255, 255, 255, .9); }
.g-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.g-meta { flex: 1; min-width: 0; }
.g-meta b { display: block; font-weight: 750; font-size: 15px; }
.g-meta small { display: block; color: var(--muted); font-weight: 600; font-size: 13.5px; margin-top: 2px; }
.g-meta small.g-problem-text { color: var(--danger); }
.g-bar { height: 6px; border-radius: 6px; background: var(--blue-soft); margin-top: 8px; overflow: hidden; }
.g-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--blue); transition: width .3s ease-out; }
.g-bar.g-bar-busy i { background: linear-gradient(90deg, var(--blue-soft) 0%, var(--blue) 50%, var(--blue-soft) 100%); background-size: 200% 100%; animation: g-slide 1.3s linear infinite; }
@keyframes g-slide { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.g-done { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); flex: none; }
.g-done .ico { width: 18px; height: 18px; }
.g-cancel { min-width: 44px; height: 44px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; color: var(--muted); flex: none; cursor: pointer; font: 750 14px/1 var(--sans); }
.g-cancel.g-retry { padding: 0 12px; background: var(--blue-soft); color: var(--ink); }

.g-thanks { margin-top: 22px; display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--r-lg); background: var(--blue-soft); }
.g-thanks-flower { width: 34px; height: 34px; flex: none; color: var(--flower); }
.g-thanks p { font-size: 15.5px; }
.g-see { margin-top: 12px; }
.g-fine { margin: 22px 4px 0 !important; font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.g-fine .ico-sm { margin-top: 2px; }

.g-full { margin-top: 22px; padding: 24px 20px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.g-full-flower { display: block; width: 44px; height: 44px; margin: 0 auto; color: var(--flower); }
.g-full h2 { font-size: 26px; line-height: 1.12; margin-top: 12px; }
.g-full p { color: var(--muted); font-size: 16px; margin-top: 10px; }
.g-full .g-kept { color: var(--ok); font-weight: 750; font-size: 15px; }
.g-full .btn { margin-top: 18px; }
.is-full .g-name, .is-full .g-add, .is-full .g-uploads, .is-full .g-thanks, .is-full .g-intro { display: none; }

.g-problem { margin-top: 28px; padding: 28px 22px; text-align: center; }
.g-problem-flower { display: block; width: 44px; height: 44px; margin: 0 auto 12px; color: var(--flower); }
.g-problem h1 { font-size: 28px; line-height: 1.12; }
.g-problem p { color: var(--muted); margin-top: 10px; }
.g-problem .btn { margin-top: 18px; }

/* ---- gallery ---- */
.g-gallery { padding-bottom: 110px; }
.g-head { margin-top: 6px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.g-head h1 { font-size: 38px; line-height: 1; overflow-wrap: anywhere; }
.g-head .pill { margin-top: 12px; }
.g-head-flower { width: 46px; height: 46px; flex: none; margin-bottom: 2px; color: var(--flower); }

.g-tabs { display: flex; gap: 6px; margin: 22px -18px 0; padding: 0 18px; overflow-x: auto; scrollbar-width: none; }
.g-tabs::-webkit-scrollbar { display: none; }
.g-tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; font: 750 15px/1 var(--sans); color: var(--muted); background: transparent; border: 1.5px solid var(--line); cursor: pointer; }
.g-tabs button[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.g-tabs small { font-weight: 800; font-size: inherit; }
.g-tabs small:empty { display: none; }

.g-new { margin-top: 18px !important; display: flex; align-items: center; gap: 10px; font: 650 14.5px/1.3 var(--sans); color: var(--muted); }

.g-grid { columns: 2; column-gap: 8px; margin-top: 14px; }
.g-tile { display: block; width: 100%; break-inside: avoid; margin: 0 0 8px; padding: 0; border: 0; border-radius: 18px; cursor: zoom-in; color: #fff; }
.g-tile > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; opacity: 0; transition: opacity .3s ease-out; }
.g-tile.g-loaded > img { opacity: 1; }
.g-tile-extra { position: static; }
.g-who { position: absolute; left: 10px; right: 10px; bottom: 9px; z-index: 2; color: #fff; font: 700 13px/1.25 var(--sans); text-align: left; }
.g-who small { display: block; font-weight: 600; opacity: .9; }
.g-fresh { position: absolute; top: 10px; left: 10px; z-index: 2; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--surface); color: var(--ink); font: 800 12px/24px var(--sans); }
.g-loved { position: absolute; top: 9px; right: 9px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(15, 15, 25, .45); color: #fff; }
.g-loved .ico-sm { width: 16px; height: 16px; fill: #E0566B; }
.g-more { height: 1px; }
.g-empty { margin-top: 24px; padding: 28px 20px; text-align: center; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow); color: var(--muted); }
.g-empty h2 { color: var(--ink); font-size: 24px; }
.g-empty p { margin-top: 8px; }
.g-empty .btn { margin-top: 16px; }
.g-empty-ico { display: block; width: 40px; height: 40px; margin: 0 auto 10px; color: var(--flower); }

.g-dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 5; width: calc(100% - 28px); max-width: 452px;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; padding: 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent); box-shadow: var(--shadow-lift); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.g-dock .btn { min-height: 52px; padding: 0 14px; font-size: 15.5px; }

@media (min-width: 640px) { .g-grid { columns: 3; column-gap: 10px; } .g-tile { margin-bottom: 10px; } }
@media (min-width: 960px) { .g-grid { columns: 4; } .g-head h1 { font-size: 48px; } .g-tabs { margin-inline: 0; padding: 0; } }

/* the big view */
.g-viewer { width: 100%; height: 100%; max-width: 100%; max-height: 100%; overflow: hidden; margin: 0; padding: 0; border: 0; background: #0D0F16; color: #fff; }
.g-viewer::backdrop { background: #0D0F16; }
.g-viewer[open] { display: grid; grid-template-rows: auto 1fr auto; }
.g-v-top, .g-v-foot { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
.g-v-foot { padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); }
.g-v-count { flex: 1; font: 700 14px/1 var(--sans); opacity: .8; }
.g-v-stage { min-height: 0; min-width: 0; position: relative; overflow: hidden; touch-action: pan-y; }
.g-v-stage img, .g-v-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.g-v-who { flex: 1; font: 750 16px/1.3 var(--sans); }
.g-v-who small { display: block; font-weight: 600; font-size: 13.5px; opacity: .8; }
.g-v-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; text-decoration: none; flex: none; }
.g-v-btn .ico { width: 22px; height: 22px; }
.g-v-love[aria-pressed="true"] { color: #E0566B; }
.g-v-love[aria-pressed="true"] .ico { fill: currentColor; }
.g-v-prev, .g-v-next { position: absolute; top: 50%; transform: translateY(-50%); }
.g-v-prev { left: 12px; } .g-v-next { right: 12px; }
@media (max-width: 700px) { .g-v-prev, .g-v-next { width: 42px; height: 42px; background: rgba(15, 15, 25, .5); } .g-v-prev { left: 6px; } .g-v-next { right: 6px; } }

/* ---- slideshow: a dark stage over the whole screen ---- */
.g-show { position: fixed; inset: 0; z-index: 30; background: #0B0C12; color: #fff; overflow: hidden; font-family: var(--sans); }
.g-show .ico { width: 22px; height: 22px; }
.g-s-layer { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease-in-out; display: grid; place-items: center; }
.g-s-layer.is-on { opacity: 1; }
.g-s-layer img:not(.g-s-blur), .g-s-layer video { position: relative; max-width: 100%; max-height: 100%; object-fit: contain; }
.g-s-layer video { width: 100%; height: 100%; }
.g-s-blur { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(36px) brightness(.45) saturate(1.1); }
.g-s-layer.is-on img:not(.g-s-blur) { animation: g-drift 7s ease-out both; }
@keyframes g-drift { from { transform: scale(1.04); } to { transform: scale(1); } }
.g-s-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; }
.g-s-empty h1 { font: 400 clamp(36px, 6vw, 72px)/1 var(--serif); margin: 0; }
.g-s-empty p { margin: 0; max-width: 34ch; font-size: clamp(16px, 2vw, 22px); opacity: .85; }
.g-s-empty-flower { width: 56px; height: 56px; color: var(--flower); }
.g-s-controls { position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 16px 14px; background: linear-gradient(180deg, rgba(0, 0, 0, .45), transparent); transition: opacity .4s ease; }
.g-s-controls, .g-s-foot { z-index: 2; }
.g-s-spacer { flex: 1; }
.g-s-bars { display: inline-flex; gap: 4px; } .g-s-bars i { width: 4px; height: 16px; border-radius: 2px; background: currentColor; }
.g-s-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 60px clamp(16px, 3vw, 40px) calc(clamp(16px, 3vw, 32px) + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .6)); }
.g-s-foot p { margin: 0; }
.g-s-who { font: 750 clamp(16px, 1.8vw, 24px)/1.25 var(--sans); }
.g-s-who small { display: block; font-weight: 600; font-size: .75em; opacity: .85; }
.g-s-brand { display: flex; align-items: center; gap: 12px; text-align: right; }
.g-s-brand b { display: block; font: 400 clamp(20px, 2.4vw, 34px)/1.05 var(--serif); }
.g-s-brand small { display: block; font: 650 clamp(12px, 1.1vw, 16px)/1.3 var(--sans); opacity: .85; }
.g-s-flower { width: clamp(30px, 3vw, 44px); height: clamp(30px, 3vw, 44px); color: var(--flower); flex: none; order: 2; }
.g-show.is-idle { cursor: none; }
.g-show.is-idle .g-s-controls { opacity: 0; pointer-events: none; }
@media (max-width: 600px) { .g-s-brand small { display: none; } }
@media (prefers-reduced-motion: reduce) { .g-s-layer.is-on img { animation: none; } .g-page .live-dot { animation: none; } }
