/* Invitation app */

/* ---------- envelope ---------- */
.envelope-screen {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center;
  background: var(--ivory); max-width: 480px; margin: 0 auto;
}
.envelope-screen .toran { flex-shrink: 0; }
.envelope-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; padding: 0 24px; text-align: center; }
.envelope-body h1 { margin: 6px 0 0; font-size: 48px; line-height: 1.05; color: var(--maroon); }
.envelope-body h1 .amp { color: var(--gold-t); font-weight: 500; }
.envelope-body .date { margin: 10px 0 0; font-size: 18px; color: var(--muted); }
.env-btn { margin-top: 56px; background: none; border: 0; padding: 0; width: 330px; max-width: 100%; aspect-ratio: 330 / 236; perspective: 1200px; }
.env { position: relative; display: block; width: 100%; height: 100%; }
.env-back { position: absolute; inset: 0; background: var(--maroon-dd); border-radius: 10px; box-shadow: 0 24px 48px -18px rgba(62,10,20,.55), 0 4px 10px rgba(62,10,20,.18); }
.env-letter {
  position: absolute; left: 5%; right: 5%; top: 5%; height: 87%; z-index: 2; background: var(--paper); border-radius: 6px; border: 1px solid #E6D3AE;
  display: flex; flex-direction: column; align-items: center; padding-top: 22px;
  transform: translateY(0); transition: transform .9s cubic-bezier(.2,.8,.2,1) .5s;
}
.env-letter svg { width: 56px; height: 26px; color: #B8893A; }
.env-letter .h { display: block; margin-top: 6px; font-size: 25px; color: var(--maroon); }
.env-letter small { font-size: 14px; letter-spacing: .18em; color: var(--gold-t); }
.env-pocket { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; }
.env-flap { position: absolute; left: 0; top: 0; width: 100%; height: 60%; z-index: 4; transform-origin: 50% 0; transition: transform .75s cubic-bezier(.4,0,.2,1), z-index 0s linear .38s; }
.env-flap svg { width: 100%; height: 100%; }
.env-seal { position: absolute; left: 50%; top: 39%; width: 92px; height: 92px; margin-left: -46px; z-index: 5; transition: opacity .3s ease, transform .35s ease; }
.env-seal > span { display: block; width: 92px; height: 92px; animation: breathe 2.4s ease-in-out infinite; }
.env.open .env-flap { transform: rotateX(180deg); z-index: 1; }
.env.open .env-letter { transform: translateY(-50%); }
.env.open .env-seal { opacity: 0; transform: scale(.55); }
.tap-hint { margin: 30px 0 0; display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 500; color: var(--maroon); animation: hint 2s ease-in-out infinite; }
.tap-hint svg { width: 22px; height: 22px; }
.envelope-screen .zari { width: 100%; flex-shrink: 0; height: 18px; }
.envelope-screen.leaving { animation: fade .4s ease reverse both; }

/* ---------- stories ---------- */
.stories { position: fixed; inset: 0; z-index: 45; max-width: 480px; margin: 0 auto; background: #2A060D; color: var(--ivory); overflow: hidden; touch-action: pan-y; }
.story { position: absolute; inset: 0; animation: fade .45s ease both; }
.story-media { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; animation: drift 6s ease-out both; }
.story-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-media .lotus { width: 220px; height: 96px; color: var(--gold-l); opacity: .28; }
.story-ph { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border: 1px dashed rgba(232,201,130,.55); border-radius: 999px; font-size: 15px; color: var(--gold-l); }
.story-ph svg { width: 20px; height: 20px; }
.story-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 24px calc(40px + var(--safe-b)); background: rgba(42,6,13,.74); }
.story-cap .kicker { color: var(--gold-l); font-size: 15px; letter-spacing: .16em; }
.story-cap h2 { margin: 6px 0 0; font-size: 42px; line-height: 1.08; color: var(--ivory); }
.story-cap .btn { margin-top: 22px; }
.story-zone { position: absolute; top: 96px; bottom: 260px; background: transparent; border: 0; }
.story-zone.prev { left: 0; width: 35%; }
.story-zone.next { right: 0; width: 65%; }
.story-top { position: absolute; left: 0; right: 0; top: 0; padding: calc(14px + env(safe-area-inset-top, 0px)) 12px 0; }
.story-bars { display: flex; gap: 5px; }
.story-bars span { flex: 1; height: 3px; border-radius: 3px; background: rgba(251,246,236,.32); overflow: hidden; }
.story-bars i { display: block; height: 100%; width: 0; background: var(--ivory); }
.story-bars .done i { width: 100%; }
.story-bars .active i { animation: fill 5s linear forwards; }
.story-head { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.story-head .badge-mono { width: 42px; height: 42px; border-color: var(--gold-l); padding: 0; background: var(--maroon-dd); display: flex; align-items: center; justify-content: center; }
.story-head .badge-mono svg { width: 30px; height: 30px; }
.story-head .who { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.story-head .who b { font-size: 16px; font-weight: 600; }
.story-head .who small { font-size: 13px; color: rgba(251,246,236,.8); }

/* ---------- app shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 66px; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 18px;
  background: rgba(251,246,236,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid #EADBC0;
}
.topbar .names { flex: 1; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.topbar .names .h { font-size: 24px; color: var(--maroon); white-space: nowrap; }
.topbar .names .h em { color: var(--gold-t); font-weight: 500; }
.topbar .names small { font-size: 14px; color: var(--muted-2); }
.topbar .badge-mono { width: 50px; height: 50px; }
main { padding-bottom: calc(var(--tabbar) + var(--safe-b) + 24px); }
.panel { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.panel-pad { padding: 22px 16px 32px; display: flex; flex-direction: column; gap: 18px; }

.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 30;
  height: calc(var(--tabbar) + var(--safe-b)); padding: 6px 4px calc(12px + var(--safe-b));
  background: rgba(255,253,248,.97); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.tabbar a span { width: 58px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--maroon); }
.tabbar a[aria-current="page"] span { background: var(--sand-2); }

/* ---------- home ---------- */
.invocation { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.invocation p { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-t); }
.invocation .divider { margin-top: 10px; }
.invocation .quote { text-transform: none; letter-spacing: 0; margin: 8px 0 0; font-size: 23px; line-height: 1.35; color: #4A2A1E; font-family: var(--head); font-style: italic; font-weight: 500; }
.hero { background: var(--maroon-d); color: var(--ivory); border-radius: 22px; overflow: hidden; box-shadow: 0 18px 40px -22px rgba(62,10,20,.7); }
.hero-in { padding: 22px 20px 26px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero h1 { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.hero h1 .n { font-size: 60px; color: var(--gold-l); }
.hero h1 .w { margin: 4px 0; font-size: 26px; font-weight: 500; color: var(--ivory); }
.hero .rule { width: 64px; height: 1px; background: var(--gold); margin: 18px 0 14px; }
.hero .d { margin: 0; font-size: 19px; font-weight: 500; }
.hero .m { margin: 2px 0 0; font-size: 17px; color: var(--gold-l); }
.countdown { width: 100%; margin-top: 22px; }
.countdown .grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.countdown .cell { border: 1px solid rgba(232,201,130,.45); border-radius: 14px; padding: 10px 0 8px; display: flex; flex-direction: column; align-items: center; }
.countdown .cell b { font-size: 34px; line-height: 1; color: var(--ivory); }
.countdown .cell small { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-l); margin-top: 4px; }
.countdown p { margin: 10px 0 0; font-size: 15px; color: rgba(251,246,236,.85); }
.live { width: 100%; margin-top: 22px; border: 1px solid rgba(232,201,130,.45); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.live .pill { font-size: 15px; letter-spacing: .08em; padding: 6px 14px; gap: 10px; }
.dot { position: relative; width: 10px; height: 10px; }
.dot::before, .dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #8A1C2C; }
.dot::before { animation: ping 1.6s ease-out infinite; }
.live .t { font-size: 28px; line-height: 1.15; color: var(--ivory); }
.live .w { font-size: 16px; color: var(--gold-l); }
.after { margin: 22px 0 0; font-size: 25px; color: var(--gold-l); }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.duo .btn { padding: 0 10px; font-size: 17px; }
.invite { padding: 6px; border-color: #DCC7A0; }
.invite-in { border: 1px solid #E8D8B8; border-radius: 15px; padding: 26px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.invite-in p { margin: 0; font-size: 18px; color: var(--ink-2); }
.invite-in .name { margin: 16px 0 2px; font-size: 44px; line-height: 1; color: var(--maroon); font-weight: 700; }
.invite-in .rel { margin-top: 6px; font-size: 17px; color: var(--muted); }
.invite-in .rel strong { font-weight: 600; color: var(--ink-2); }
.invite-in .with { margin: 16px 0; }
.invite-in .with .h { font-size: 26px; color: var(--gold-t); }
.invite-in .with::before, .invite-in .with::after { content: ''; flex: 1; height: 1px; background: #DCC7A0; }
.invite-in .plea { margin-top: 20px; font-size: 22px; line-height: 1.35; color: #4A2A1E; font-family: var(--head); font-style: italic; font-weight: 500; }
.love { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.love .kicker { margin-bottom: 6px; }
.love p.h { margin: 0; font-size: 25px; color: var(--ink-2); }
.next-btn { justify-content: space-between; min-height: 60px; border-radius: 16px; font-size: 17px; }

/* ---------- events ---------- */
.day-chips { display: flex; gap: 8px; padding: 12px 16px 6px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.day-chips::-webkit-scrollbar { display: none; }
.day-chips a {
  flex-shrink: 0; min-width: 64px; height: 66px; border-radius: 16px; text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
  background: var(--paper); color: var(--maroon-dd); border: 1px solid var(--line); scroll-snap-align: start;
}
.day-chips a small { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.day-chips a b { font-size: 27px; }
.day-chips a.main { background: var(--maroon); color: var(--ivory); border-color: var(--maroon); }
.day-chips a.today { background: var(--sand-2); border-color: var(--gold); }
.days { padding: 6px 16px 32px; }
.day { padding-top: 18px; scroll-margin-top: 80px; }
.day-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.day-head .h { font-size: 27px; color: var(--ink-2); }
.day-head span { font-size: 16px; color: var(--muted-2); }
.day-head .pill { margin-left: auto; }
.day-list { display: flex; flex-direction: column; gap: 12px; }
.ticket { position: relative; display: flex; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 20px -16px rgba(62,10,20,.5); }
.ticket .stub { width: 78px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 0; background: var(--sand); border-radius: 17px 0 0 17px; line-height: 1.05; }
.ticket .stub small { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--gold-t); }
.ticket .stub b { font-size: 36px; color: var(--maroon); }
.ticket .stub i { font-style: normal; font-size: 13px; font-weight: 600; color: var(--muted-2); }
.ticket .perf { position: relative; width: 0; border-left: 2px dashed #DCC7A0; }
.ticket .perf::before, .ticket .perf::after { content: ''; position: absolute; left: -10px; width: 18px; height: 18px; border-radius: 50%; background: var(--ivory); }
.ticket .perf::before { top: -9px; border-bottom: 1px solid var(--line); }
.ticket .perf::after { bottom: -9px; border-top: 1px solid var(--line); }
.ticket .body { flex: 1; min-width: 0; padding: 14px 14px 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.ticket .when { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; letter-spacing: .04em; color: var(--gold-t); }
.ticket .when svg { width: 16px; height: 16px; }
.ticket h3 { margin: 0; font-size: 26px; line-height: 1.12; color: var(--ink-2); }
.ticket p { margin: 0; font-size: 16px; line-height: 1.4; color: var(--muted); }
.ticket .venue { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 16px; font-weight: 600; text-decoration: none; }
.ticket .venue svg { width: 16px; height: 16px; flex-shrink: 0; }
.ticket .btn { align-self: flex-start; margin-top: 10px; }
.ticket.main { background: var(--maroon-d); color: var(--ivory); border-color: var(--gold); overflow: hidden; flex-direction: column; box-shadow: 0 20px 40px -20px rgba(62,10,20,.8); }
.ticket.main .row { display: flex; }
.ticket.main .stub { background: var(--maroon-dd); border-radius: 0; }
.ticket.main .stub small, .ticket.main .stub i { color: var(--gold-l); }
.ticket.main .stub b { color: var(--ivory); font-size: 38px; }
.ticket.main .perf { border-left-color: rgba(232,201,130,.55); }
.ticket.main .perf::before, .ticket.main .perf::after { display: none; }
.ticket.main h3 { margin-top: 8px; font-size: 32px; color: var(--ivory); }
.ticket.main p { color: rgba(251,246,236,.85); }
.ticket.main .big { font-size: 40px; line-height: 1.05; color: var(--gold-l); }
.ticket.main .venue { color: var(--ivory); }
.ticket.main .btn { align-self: stretch; }
.ticket.main .pill { align-self: flex-start; font-size: 12px; letter-spacing: .12em; }

/* ---------- venues ---------- */
.venue-card { overflow: hidden; border-radius: 22px; }
.venue-card.main { border-color: var(--gold); }
.map { display: block; position: relative; height: 150px; background: #EFE3CB; }
.map svg.streets { width: 100%; height: 150px; }
.map .pin { position: absolute; left: 50%; width: 40px; height: 52px; margin-left: -20px; }
.map .open { position: absolute; right: 10px; bottom: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(255,253,248,.92); font-size: 13px; font-weight: 600; color: var(--maroon); }
.venue-in { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.venue-in .pill { align-self: flex-start; }
.venue-in h3 { margin: 6px 0 0; font-size: 30px; line-height: 1.1; color: var(--ink-2); }
.venue-in .addr { margin: 0; font-size: 17px; line-height: 1.45; color: var(--muted); }
.venue-in .ev { margin: 0; font-size: 16px; font-weight: 600; color: var(--maroon); }
.venue-in .ev:first-of-type { margin-top: 4px; }
.venue-in > .btn { margin-top: 14px; }
.venue-in .duo { margin-top: 10px; }
.venue-in .duo .btn { font-size: 16px; }
.metro { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--sand); font-size: 16px; color: #4A2A1E; }
.metro svg { width: 22px; height: 22px; color: var(--maroon); flex-shrink: 0; }

/* ---------- gallery ---------- */
.share-cta { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; background: var(--maroon-d); color: var(--ivory); text-decoration: none; box-shadow: 0 14px 30px -18px rgba(62,10,20,.8); }
.share-cta:hover { color: var(--ivory); }
.share-cta .ic { width: 52px; height: 52px; border-radius: 16px; background: var(--gold-l); color: var(--maroon-ddd); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.share-cta .ic svg { width: 26px; height: 26px; }
.share-cta b { display: block; font-size: 19px; font-weight: 600; }
.share-cta small { display: block; font-size: 15px; color: rgba(251,246,236,.82); }
.share-cta > svg { width: 22px; height: 22px; margin-left: auto; color: var(--gold-l); flex-shrink: 0; }
.gal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.live-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--maroon); }
.live-tag .dot { width: 8px; height: 8px; }
.new-pill { align-self: center; position: sticky; top: 76px; z-index: 5; box-shadow: 0 8px 20px -8px rgba(62,10,20,.6); }
.masonry { display: flex; gap: 10px; align-items: flex-start; }
.masonry .col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tile { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: linear-gradient(90deg, #EFE3CB 0, #F6EDDC 60px, #EFE3CB 120px) #EFE3CB; background-size: 400px 100%; animation: shimmer 1.4s linear infinite, rise .4s ease both; }
.tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.tile img.loaded { opacity: 1; }
.tile.loaded { animation: none; background: #EFE3CB; }
.tile .vid { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: rgba(30,4,8,.72); color: var(--ivory); font-size: 13px; font-weight: 600; }
.tile .vid svg { width: 14px; height: 14px; }
.tile .noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--maroon); }
.tile .noimg svg { width: 44px; height: 44px; }
.gal-empty { text-align: center; padding: 34px 16px; border: 1.5px dashed #DCC7A0; border-radius: 20px; color: var(--muted); }
.gal-empty .h { font-size: 26px; color: var(--maroon); margin: 0 0 4px; }
.gal-empty p { margin: 0; }
.gal-more { display: flex; justify-content: center; padding: 8px 0; color: var(--maroon); min-height: 40px; }
.gal-error { text-align: center; color: var(--muted); }

/* viewer */
.viewer { position: fixed; inset: 0; z-index: 50; max-width: 480px; margin: 0 auto; background: var(--night); color: var(--ivory); display: flex; flex-direction: column; animation: fade .25s ease both; touch-action: pan-y; }
.viewer-top { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(env(safe-area-inset-top, 0px)) 12px 0 20px; flex-shrink: 0; }
.viewer-top .meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.viewer-top .meta b { font-size: 17px; }
.viewer-top .meta small { font-size: 14px; color: rgba(251,246,236,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-top .acts { display: flex; gap: 8px; }
.viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 8px; }
.viewer-stage img, .viewer-stage video { max-width: 100%; max-height: 100%; border-radius: 12px; animation: fade .3s ease both; background: #000; }
.viewer-bot { height: calc(96px + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; align-items: center; justify-content: space-between; padding-left: 20px; padding-right: 20px; flex-shrink: 0; }
.viewer-bot button { width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid rgba(232,201,130,.6); background: transparent; color: var(--gold-l); display: flex; align-items: center; justify-content: center; }
.viewer-bot button svg { width: 24px; height: 24px; }
.viewer-bot span { font-size: 15px; color: rgba(251,246,236,.75); }

/* ---------- family ---------- */
.fam { overflow: hidden; border-radius: 18px; }
.fam > button { width: 100%; min-height: 72px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: transparent; border: 0; text-align: left; color: var(--ink-2); }
.fam > button .t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.fam > button .t .h { font-size: 26px; color: var(--maroon); }
.fam > button .t small { font-size: 15px; color: var(--muted-2); margin-top: 2px; }
.fam .count { min-width: 30px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--sand); color: var(--gold-t); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.fam .chev { width: 22px; height: 22px; color: var(--maroon); transition: transform .25s ease; }
.fam > button[aria-expanded="true"] .chev { transform: rotate(180deg); }
.fam ul { list-style: none; margin: 0; padding: 0 16px 10px; animation: rise .35s ease both; }
.fam li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-2); font-size: 18px; line-height: 1.35; color: var(--ink-2); }
.fam li::before { content: ''; width: 7px; height: 7px; flex-shrink: 0; transform: rotate(45deg); background: var(--gold); }
.memory { margin-top: 8px; border-radius: 20px; background: var(--maroon-dd); color: var(--ivory); padding: 22px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.memory svg { width: 40px; height: 40px; color: var(--gold-l); }
.memory .kicker { color: var(--gold-l); }
.memory p { margin: 0; }
.memory .h { font-size: 28px; }
