@font-face { font-family: "Pinyon Script"; src: url("assets/fonts/pinyon-script-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant Upright"; src: url("assets/fonts/cormorant-upright-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant Upright"; src: url("assets/fonts/cormorant-upright-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant Upright"; src: url("assets/fonts/cormorant-upright-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant Upright"; src: url("assets/fonts/cormorant-upright-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --script: "Pinyon Script", cursive;
  --serif: "Cormorant Upright", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gold: #b8913a;
  --dark: #121011;
  --dark-2: #241f21;
}
[data-side="pink"] { --ink: #7a2846; --soft: #7e4558; --accent: #9e4462; --paper: #fbf4f1; --line: #e6c3cc; --chip: #f3dfe3; --on-ink: #fff6f8; }
[data-side="green"] { --ink: #2c5239; --soft: #46604b; --accent: #3f6b4c; --paper: #f5f8f2; --line: #c5d6c2; --chip: #e1ebde; --on-ink: #f7fbf5; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); }
body { font-family: var(--serif); color: var(--ink); -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.app { position: relative; width: 100%; max-width: 480px; height: 100dvh; margin: 0 auto; overflow: hidden; background: var(--paper); }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; animation: fade .35s ease both; }
.screen.dark { background: var(--dark); color: #f4ece6; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .55s cubic-bezier(.22,1,.36,1) both; }
.d1 { animation-delay: .08s; } .d2 { animation-delay: .18s; } .d3 { animation-delay: .3s; } .d4 { animation-delay: .42s; }

.paper-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; background-size: cover; background-position: center; opacity: .6; }
.band { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 1600 / 330; z-index: 1; background-repeat: no-repeat; background-size: 100% auto; pointer-events: none; }

/* buttons */
.btn { border: 0; border-radius: 14px; padding: 13px 22px; font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2; min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-solid { background: var(--ink); color: var(--on-ink); box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-light { background: #f6eee6; color: var(--ink); }
.btn-ghost-dark { background: transparent; color: #f6eee6; border: 1.5px solid rgba(246,238,230,.55); }
.btn-link { background: none; border: 0; padding: 8px; font-family: var(--serif); font-weight: 700; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px; color: var(--ink); }
.row { display: flex; gap: 10px; width: 100%; }
.row > .btn { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; font-size: 15px; letter-spacing: .03em; white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: inherit; padding: 0; }
.icon-btn svg { width: 24px; height: 24px; }

/* cover */
.cover { align-items: center; text-align: center; padding: clamp(44px, 13vw, 62px) 24px calc(18px + env(safe-area-inset-bottom)); }
.cover > :not(.band):not(.paper-bg) { position: relative; z-index: 2; }
.cover-logo { width: clamp(58px, 9dvh, 84px); height: auto; display: block; margin: 0 auto 2px; }
.kicker { margin: 0; font-weight: 600; font-size: 14px; letter-spacing: .28em; text-transform: uppercase; color: var(--soft); }
.names { margin: 0; font-family: var(--script); font-weight: 400; line-height: 1.15; color: var(--ink); white-space: nowrap; }
.cover .names { font-size: clamp(38px, 6.6dvh, 54px); }
.date { margin: 0; font-weight: 600; font-size: 16px; letter-spacing: .08em; color: var(--soft); }
.arch { --h: clamp(190px, 37dvh, 360px); position: relative; height: var(--h); width: calc(var(--h) * .72); margin: clamp(10px, 2.4dvh, 22px) auto 0; flex-shrink: 0; }
.arch-photo { position: absolute; inset: 3.5% 4.5% 1.5%; border-radius: 999px 999px 10px 10px; overflow: hidden; background: #ddd; box-shadow: 0 14px 30px rgba(0,0,0,.18); }
.arch-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.arch-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.arch-flowers { position: absolute; left: 50%; bottom: -9%; width: 128%; transform: translateX(-50%); pointer-events: none; }
.tagline { margin: clamp(22px, 4.4dvh, 40px) 0 0; font-size: 17px; font-weight: 600; line-height: 1.35; color: var(--soft); max-width: 300px; }
.cover-actions { margin-top: auto; width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 12px; }
.cover-actions .btn { width: 100%; }

/* inner header */
.head { position: relative; z-index: 2; flex-shrink: 0; text-align: center; padding: clamp(40px, 12vw, 56px) 56px 10px; }
.head .logo { width: 40px; height: auto; display: block; margin: 0 auto; }
.head .names { font-size: 30px; }
.head .date { font-size: 14px; }
.back { position: absolute; left: 8px; top: clamp(40px, 12vw, 56px); z-index: 3; }
.dark .head .names, .dark .head .date { color: #f4ece6; }
.body { position: relative; z-index: 2; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; padding: 6px 22px 0; }
.foot { position: relative; z-index: 2; flex-shrink: 0; padding: 12px 22px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.foot > .btn { width: 100%; max-width: 340px; }
.title { margin: 0; font-weight: 600; font-size: 25px; letter-spacing: .04em; text-transform: uppercase; text-align: center; line-height: 1.2; }
.sub { margin: 6px 0 0; font-size: 16px; font-weight: 500; color: var(--soft); text-align: center; line-height: 1.35; }
.divider { width: 150px; height: auto; display: block; margin: 8px auto 0; }

/* name */
.name-body { justify-content: center; gap: 10px; }
.name-input { width: 100%; max-width: 340px; margin-top: 18px; border: 0; border-bottom: 1.5px solid var(--ink); background: transparent; padding: 10px 4px; text-align: center; font-size: 22px; font-weight: 600; outline: none; }
.name-input::placeholder { color: var(--soft); opacity: .55; }
.hint { font-family: var(--sans); font-size: 12.5px; color: var(--soft); opacity: .8; margin: 4px 0 0; text-align: center; }

/* frame picker */
.chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.chip { border: 0; border-radius: 999px; padding: 8px 16px; background: var(--chip); color: var(--ink); font-family: var(--sans); font-weight: 600; font-size: 13.5px; }
.chip.on { background: var(--ink); color: var(--on-ink); }
.carousel { flex: 1; min-height: 0; width: calc(100% + 44px); margin: 12px -22px 0; display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px calc(50% - 90px) 6px; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 auto; height: 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; border: 0; background: none; padding: 0; }
.slide canvas { height: 100%; max-height: 100%; width: auto; max-width: 74vw; border-radius: 6px; box-shadow: 0 10px 26px rgba(0,0,0,.22); transition: transform .25s, opacity .25s; opacity: .55; transform: scale(.9); }
.slide.on canvas { opacity: 1; transform: none; }
.frame-label { margin: 10px 0 0; font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--soft); }
.dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line); transition: width .2s; }
.dots i.on { width: 22px; background: var(--ink); }

/* camera */
.cam-top { position: relative; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 4px; }
.cam-top .names { font-size: 24px; color: #f4ece6; }
.viewport { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 6px 18px; }
.viewfinder { position: relative; max-width: 100%; max-height: 100%; border-radius: 16px; overflow: hidden; background: var(--dark-2); }
.viewfinder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewfinder video.mirror { transform: scaleX(-1); }
.cam-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center; font-family: var(--sans); font-size: 14px; color: rgba(244,236,230,.8); }
.cam-msg svg { width: 34px; height: 34px; opacity: .7; }
.timer-toggle { position: absolute; top: 10px; right: 10px; z-index: 2; border: 0; border-radius: 99px; padding: 7px 12px; background: rgba(0,0,0,.45); color: #fff; font-family: var(--sans); font-size: 13px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.timer-toggle svg { width: 16px; height: 16px; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 120px; color: #fff; text-shadow: 0 4px 24px rgba(0,0,0,.5); pointer-events: none; }
.flash { position: absolute; inset: 0; background: #fff; animation: flash .45s ease-out both; pointer-events: none; }
@keyframes flash { from { opacity: .95; } to { opacity: 0; } }
.thumbs { flex-shrink: 0; display: flex; gap: 10px; justify-content: center; padding: 8px 0 4px; }
.thumb { position: relative; width: 46px; height: 58px; border-radius: 8px; border: 1.5px solid rgba(244,236,230,.35); background: var(--dark-2); display: grid; place-items: center; font-family: var(--sans); font-size: 14px; color: rgba(244,236,230,.6); overflow: visible; padding: 0; }
.thumb.on { border-color: #f4ece6; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; }
.thumb .x { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: #f6eee6; color: #222; display: grid; place-items: center; font-size: 13px; line-height: 1; font-weight: 700; }
.cam-controls { flex-shrink: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 26px calc(20px + env(safe-area-inset-bottom)); }
.round { width: 52px; height: 52px; border-radius: 50%; border: 0; background: #2c2829; color: #f4ece6; display: grid; place-items: center; }
.round svg { width: 24px; height: 24px; }
.round:disabled { opacity: .35; }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 3px solid #f4ece6; background: transparent; padding: 5px; }
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #f6eee6; transition: transform .1s; }
.shutter:active span { transform: scale(.9); }
.shutter:disabled { opacity: .4; }
.cam-controls .left { justify-self: start; }
.cam-controls .right { justify-self: end; }
.cam-next { grid-column: 1 / -1; width: 100%; }

/* adjust */
.adjust-head { flex-shrink: 0; text-align: center; padding: 26px 20px 0; }
.adjust-head .title { color: #f4ece6; font-size: 23px; }
.adjust-head .sub { color: rgba(244,236,230,.7); font-family: var(--sans); font-size: 13.5px; }
.adjust-box { position: relative; max-width: 100%; max-height: 100%; border-radius: 14px; overflow: hidden; touch-action: none; cursor: grab; box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 16px 40px rgba(0,0,0,.5); }
.adjust-box canvas { display: block; width: 100%; height: 100%; }
.pill { flex-shrink: 0; align-self: center; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: #2a2627; font-family: var(--sans); font-size: 13px; color: rgba(244,236,230,.85); margin: 6px 0 0; }
.pill svg { width: 16px; height: 16px; }
.zoom { width: min(260px, 70%); align-self: center; margin-top: 8px; accent-color: #f6eee6; }

/* preview / filter / ready */
.preview { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; padding: 4px 0; }
.preview canvas, .preview img { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.22); display: block; }
.filters { flex-shrink: 0; width: calc(100% + 44px); margin: 10px -22px 0; display: flex; gap: 8px; overflow-x: auto; padding: 2px 22px 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { flex-shrink: 0; }
.notice { font-family: var(--sans); font-size: 13px; text-align: center; color: var(--ink); background: var(--chip); border-radius: 10px; padding: 8px 12px; margin: 0; width: 100%; max-width: 340px; }
.notice.error { background: #fde4e1; color: #8f1d14; }

/* wish */
.wish-body { justify-content: center; gap: 4px; }
.rec { position: relative; width: 108px; height: 108px; border-radius: 50%; border: 0; background: #c0392b; color: #fff; display: grid; place-items: center; margin-top: 18px; box-shadow: 0 10px 26px rgba(192,57,43,.35); }
.rec svg { width: 40px; height: 40px; }
.rec.on::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid #c0392b; animation: ring 1.4s ease-out infinite; }
@keyframes ring { from { transform: scale(.85); opacity: .8; } to { transform: scale(1.3); opacity: 0; } }
.rec-time { font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; margin-top: 14px; color: var(--soft); }
.levels { display: flex; gap: 4px; align-items: center; height: 40px; margin-top: 10px; }
.levels i { width: 5px; height: 100%; border-radius: 4px; background: var(--ink); transform: scaleY(.15); transition: transform .08s; }
.player { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 340px; padding: 10px 14px; border-radius: 14px; background: var(--chip); margin-top: 18px; }
.player .play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; flex-shrink: 0; }
.player .play svg { width: 20px; height: 20px; }
.track { flex: 1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: var(--ink); }
.player time { font-family: var(--sans); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--soft); }

/* printing */
.printing { position: absolute; inset: 0; z-index: 10; background: rgba(18,16,17,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #f4ece6; animation: fade .3s both; }
.printer { width: 250px; height: 46px; border-radius: 14px 14px 6px 6px; background: linear-gradient(#3a3335, #2a2526); position: relative; box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 2; }
.printer::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 8px; height: 6px; border-radius: 4px; background: #0d0b0c; }
.printer .light { position: absolute; right: 16px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: #6fdc8c; animation: blink .9s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.paper-out { width: 190px; height: 300px; margin-top: -8px; overflow: hidden; position: relative; z-index: 1; }
.paper-out img { width: 100%; display: block; transform: translateY(-100%); animation: printout 2.2s cubic-bezier(.45,.05,.4,1) forwards; box-shadow: 0 8px 22px rgba(0,0,0,.5); }
@keyframes printout { to { transform: translateY(0); } }
.printing p { font-size: 20px; font-weight: 600; letter-spacing: .04em; margin: 22px 0 0; }

/* gallery */
.gal-head { position: relative; z-index: 2; flex-shrink: 0; padding: clamp(42px, 12vw, 56px) 18px 10px 62px; }
.gal-head .kicker { font-size: 12px; }
.gal-head .names { font-size: 28px; }
.gal-title { position: relative; z-index: 2; margin: 0; padding: 0 20px 10px; font-size: 26px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.gal-title em { font-style: normal; color: var(--accent); }
.grid { position: relative; z-index: 2; flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); columns: 2; column-gap: 12px; overscroll-behavior: contain; }
.card { break-inside: avoid; margin: 0 0 12px; border: 0; padding: 0; width: 100%; text-align: left; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.1); display: block; }
.card img { width: 100%; display: block; background: var(--chip); }
.card-meta { padding: 8px 10px 10px; font-family: var(--sans); }
.card-name { font-weight: 700; font-size: 13.5px; color: var(--ink); display: flex; align-items: center; gap: 6px; overflow: hidden; }
.card-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-name svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--accent); }
.card-time { font-size: 11.5px; color: var(--soft); margin-top: 2px; }
.empty { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 30px 60px; }
.empty .title { font-size: 22px; }
.more { column-span: all; display: flex; justify-content: center; padding: 6px 0 10px; font-family: var(--sans); font-size: 13px; color: var(--soft); }

.detail { position: absolute; inset: 0; z-index: 20; background: rgba(18,16,17,.96); color: #f4ece6; display: flex; flex-direction: column; animation: fade .25s both; }
.detail-top { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; padding: 12px 10px 0; }
.detail-img { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px 18px; }
.detail-img img { max-width: 100%; max-height: 100%; border-radius: 6px; }
.detail-meta { flex-shrink: 0; padding: 4px 22px calc(22px + env(safe-area-inset-bottom)); text-align: center; }
.detail-meta h3 { margin: 0; font-size: 24px; font-weight: 600; }
.detail-meta p { margin: 2px 0 0; font-family: var(--sans); font-size: 13px; opacity: .75; }
.detail .player { margin: 12px auto 0; background: #2a2627; }
.detail .player time { color: rgba(244,236,230,.8); }
.detail .track { background: #4a4345; }
.detail .track i { background: #f6eee6; }
.detail .play { background: #f6eee6; color: #2a2627; }
.danger { background: #b3261e; color: #fff; }

.toast { position: absolute; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; background: #222; color: #fff; font-family: var(--sans); font-size: 13.5px; padding: 10px 16px; border-radius: 10px; max-width: calc(100% - 40px); text-align: center; animation: rise .3s both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
