:root {
  --bg: #f4efe9;
  --card: #fffdfa;
  --tint: #f8f3ee;
  --ink: #3d3530;
  --muted: #8a7f77;
  --accent: #b8866b;
  --line: #e8dfd6;
  --sun: #c0504d;
  --sat: #4a6fa5;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  /* PC 스크롤바가 인트로(스크롤 잠금) 땐 없고 홈에선 생겨 화면이 옆으로 밀리는 것 방지:
     스크롤바 자리를 양쪽에 똑같이 비워 인트로·홈 모두 창 정가운데 */
  scrollbar-gutter: stable both-edges;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Gowun Dodum", sans-serif;
  line-height: 1.8;
  word-break: keep-all;
}

.card {
  max-width: 430px;
  margin: 0 auto;
  background: var(--card);
  min-height: 100vh;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
}

section {
  padding: 72px 28px;
  text-align: center;
}
section.tint { background: var(--tint); }

h1, h2, h3, .venue-name, .thanks, .cover-date {
  font-family: "Gowun Batang", serif;
  font-weight: 400;
}
h2 { font-size: 20px; margin-bottom: 24px; }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--accent);
  margin-bottom: 8px;
}
.muted { color: var(--muted); font-size: 14px; }

/* 스크롤 등장 */
/* 스크롤하면 섹션 안 요소가 하나씩 차례로 떠오름 (참고 영상처럼: 흐릿하게 아래에서 → 또렷하게 제자리)
   사진은 살짝 기울어진 채 작게 있다가 톡 튀어나오듯 제자리로 */
.reveal > .ri {
  opacity: 0;
  transform: translateY(32px);
  filter: blur(6px);
  transition:
    opacity 0.8s ease,
    transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.8s ease;
  transition-delay: calc(var(--i, 0) * 0.12s);
}
.reveal > .ri.photo,
.reveal > .ri.invite-pair .photo,
.reveal > .ri.gallery {
  transform: translateY(40px) scale(0.92) rotate(-2deg);
}
.reveal > .ri.invite-pair .photo {
  transition: transform 1s cubic-bezier(0.34, 1.4, 0.5, 1);
}
.reveal > .ri.invite-pair .photo + .photo { transform: translateY(40px) scale(0.92) rotate(2deg); transition-delay: 0.12s; }
.reveal > .ri.in,
.reveal > .ri.in .photo,
.reveal > .ri.in.invite-pair .photo + .photo { opacity: 1; transform: none; filter: none; }
.reveal > .ri.invite-pair { transform: none; } /* 두 사진은 각자 따로 움직임 */

/* 축하 폭죽(색종이) */
.confetti {
  position: absolute;
  left: 0;
  width: 100%;
  height: 720px;
  pointer-events: none;
  z-index: 2;
}
.invite { position: relative; }

/* 사진 자리 */
.photo {
  background: linear-gradient(135deg, #e9ddd2, #d8c6b8);
  background-size: cover;
  background-position: center;
  position: relative;
}
.photo.empty::after {
  content: "PHOTO";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  letter-spacing: 0.3em;
}

/* 커버: 분홍 천 배경 + 흰 액자 + 격자 사진 + 글자 타일 */
.cover {
  /* 휴대폰 첫 화면을 꽉 채우고, 액자·이름·날짜를 세로 가운데에 */
  min-height: 100vh;
  min-height: 100svh;
  min-height: var(--app-h, 100svh); /* main.js 가 처음 화면 높이로 고정 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px 22px 32px;
  background-color: #f4c7cf;
  /* 천 결 (가로·세로 잔무늬) */
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(160, 80, 100, 0.07) 0 1px, transparent 1px 3px);
}
.cover-frame {
  /* 화면이 낮은 휴대폰에서도 이름·날짜까지 한 화면에 들어오도록 화면 높이에 맞춰 줄어듦
     (화면 높이 − 위아래 여백·이름·날짜 약 210px) × 사진 비율 10/12 + 액자 테두리 32px */
  width: min(100%, calc((var(--app-h, 100svh) - 210px) * 10 / 12 + 32px));
  background: #fff;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(150, 70, 90, 0.18);
}
.cover-photo {
  --cols: 10; /* 가로 칸 수 (config.js 의 coverWords 와 맞춤) */
  --rows: 12;
  width: 100%;
  aspect-ratio: 10 / 12;
  overflow: hidden;
  background-color: #6b5f5a;
  background-image: linear-gradient(160deg, #8a7b72, #4e4440);
  background-position: center 20%; /* 세로 사진은 얼굴 쪽(위)을 살려서 자름 */
}
.cover-photo.empty::after { z-index: 0; }
/* 사진 위 얇은 격자선 */
.cover-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(to right, rgba(20, 16, 18, 0.25) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20, 16, 18, 0.25) 1px, transparent 1px);
  background-size: calc(100% / var(--cols)) calc(100% / var(--rows));
  pointer-events: none;
}
/* 격자 바깥 테두리 4면: 글자 타일보다 위에 그려서 맨 아래·맨 오른쪽 줄 선이 가려지지 않게 */
.cover-border {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 1px solid rgba(20, 16, 18, 0.25);
  pointer-events: none;
}
.cover-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), 1fr);
}
.cover-tile {
  margin: 1px 0 0 1px; /* 격자선이 타일 사이로 보이게 */
  background: #fbe4ec;
  display: grid;
  place-items: center;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(16px, 5.4vw, 22px);
  line-height: 1;
  color: #1f1a1c;
}
.cover-names {
  font-size: 24px;
  margin-top: 28px;
  color: #5a3a44;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
}
.cover-names i { font-style: normal; color: #d0607e; font-size: 20px; }
.cover-pixel-title { display: none; } /* 도트 테마(theme-pixel.css)에서만 보임 */
.cover-sub { color: #7a5560; font-size: 14px; margin-top: 8px; white-space: pre-line; }

/* 인사말 */
.greeting { white-space: pre-line; font-size: 15px; line-height: 2.1; }
/* 큰 사진은 섹션 좌우 끝까지, 신부·신랑 사진은 두 장 나란히 */
.invite { padding-top: 0; }
.invite-main {
  margin: 0 -28px 48px;
  aspect-ratio: 4 / 3;
  background-position: center 20%; /* 세로 사진은 머리부터 얼굴까지 보이게 */
}
.invite-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 8px 6px 44px;
}
.invite-pair .photo { aspect-ratio: 3 / 4; background-position: center top; }

/* 부모님 성함 | 관계 | 이름 — 두 줄이 같은 칸·같은 높이에 오도록 */
.parents {
  margin: 44px auto 8px;
  padding-top: 36px;
  border-top: 1px solid var(--line); /* 인사말과 구분 */
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 6px;
  width: fit-content;
  font-size: 15px;
}
.parents .pn { text-align: right; }
.parents .rel { color: var(--muted); font-size: 13px; }
.parents b { font-weight: 400; font-family: "Gowun Batang", serif; font-size: 17px; text-align: left; }

/* 버튼 */
.btn {
  font-family: inherit;
  font-size: 14px;
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn:active { opacity: 0.75; }
.btn.outline { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.btn.small { padding: 8px 16px; font-size: 13px; }

/* 달력 */
.calendar {
  margin: 28px auto 0;
  max-width: 300px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 6px;
  font-size: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.calendar span { height: 36px; display: grid; place-items: center; }
.calendar .head { color: var(--muted); font-size: 12px; }
.calendar .sun { color: var(--sun); }
.calendar .sat { color: var(--sat); }
.calendar .day-on {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 36px;
  margin: 0 auto;
}

.countdown { display: flex; justify-content: center; gap: 10px; margin-top: 32px; }
.countdown div {
  background: var(--card);
  border-radius: 10px;
  padding: 10px 0;
  width: 60px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.countdown b { display: block; font-family: "Gowun Batang", serif; font-size: 20px; font-weight: 400; }
.countdown small { font-size: 10px; color: var(--muted); letter-spacing: 0.1em; }
.dday { margin-top: 20px; font-size: 14px; }
.dday em { font-style: normal; color: var(--accent); }

/* 갤러리 */
/* 가운데 카드는 크게, 양옆 카드는 살짝 작게 보이며 옆으로 넘김 */
.gallery {
  position: relative;
  margin: 8px -28px 0; /* 섹션 좌우 끝까지 */
  height: calc(min(100vw, 430px) * 0.62 * 4 / 3 + 8px); /* 카드 폭 62%, 3:4 비율 */
  overflow: hidden;
  touch-action: pan-y; /* 세로 스크롤은 그대로, 가로 밀기만 갤러리가 받음 */
  user-select: none;
  cursor: grab;
}
.gallery.dragging { cursor: grabbing; }
.gallery .g-card {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 62%;
  aspect-ratio: 3 / 4;
  margin-left: -31%;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(60, 40, 30, 0.14);
  will-change: transform;
}
.gallery-dots { display: flex; justify-content: center; gap: 7px; margin-top: 18px; }
.gallery-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--line);
  transition: width 0.3s, background 0.3s;
}
.gallery-dots span.on { width: 20px; background: var(--accent); }

/* 방명록: 입력칸 + 압정 꽂힌 메모지 (흰 카드 안에 파스텔 메모, 살짝 기울어짐) */
.gb-form { display: flex; gap: 8px; align-items: center; margin-bottom: 36px; }
.gb-form input {
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px; /* 16px 미만이면 아이폰이 확대하므로 포커스 시 16px */
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s;
}
.gb-form input:focus { border-color: var(--accent); font-size: 16px; }
#gbName { flex: 0 0 30%; }
#gbMsg { flex: 1; }
.gb-form button {
  flex: 0 0 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(184, 134, 107, 0.35);
}
.gb-form button:active { transform: scale(0.94); }

.gb-board { position: relative; isolation: isolate; }
/* 6장씩 한 페이지를 같은 자리에 겹쳐 두고, 넘길 때 옆으로 밀어냄 (main.js) */
.gb-notes {
  display: grid;
  overflow: hidden;
  touch-action: pan-y; /* 세로 스크롤은 그대로, 가로 밀기만 방명록이 받음 */
  user-select: none;
  cursor: grab;
  margin: 0 -12px; /* 기울어진 메모 그림자가 잘리지 않게 여백 확보 */
  text-align: left;
}
.gb-notes.dragging { cursor: grabbing; }
.gb-page {
  grid-area: 1 / 1;
  will-change: transform;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 14px 14px;
  padding: 8px 12px 26px;
}
/* 메모지 뒤 공책 가로줄: 양옆은 페더처럼 흐려짐 */
.gb-board::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -20px; bottom: -20px;
  left: -28px; right: -28px;
  background: repeating-linear-gradient(to bottom, transparent 0 41px, rgba(60, 50, 70, 0.08) 41px 42px);
  -webkit-mask-image: linear-gradient(to right, transparent 4%, #000 30%, #000 70%, transparent 96%),
                      linear-gradient(to bottom, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 4%, #000 30%, #000 70%, transparent 96%),
              linear-gradient(to bottom, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-composite: intersect;
  pointer-events: none;
}
.gb-note {
  position: relative;
  padding: 30px 8px 8px; /* 위쪽 흰 여백에 압정이 꽂힘 */
  background: #fbfbfc;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(40, 30, 50, 0.1), 0 1px 2px rgba(40, 30, 50, 0.06);
  transform: rotate(var(--tilt, 0deg));
  animation: note-in 0.6s cubic-bezier(0.34, 1.4, 0.5, 1) both;
}
.gb-note:nth-child(even) { margin-top: 14px; } /* 지그재그 */
@keyframes note-in {
  from { opacity: 0; transform: translateY(14px) rotate(0deg) scale(0.92); }
}
/* 3D 압정 그림 (images/pin_*.png, 메모지 색마다) */
.gb-pin {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 42px;
  height: 42px;
  margin-left: -21px;
  z-index: 2;
  background: var(--pin-img) center / contain no-repeat;
}
.gb-note.c0 .gb-pin { --pin-img: url("images/pin_orange.png"); }
.gb-note.c1 .gb-pin { --pin-img: url("images/pin_blue.png"); }
.gb-note.c2 .gb-pin { --pin-img: url("images/pin_purple.png"); }
.gb-memo {
  padding: 10px 11px 9px;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--memo-a), var(--memo-b));
  border: 1px solid var(--memo-line);
  min-height: 112px;
  display: flex;
  flex-direction: column;
}
.gb-no {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 17px;
  line-height: 1;
  color: var(--pin);
  margin-bottom: 5px;
}
.gb-text {
  font-size: 13px; line-height: 1.55; color: #3a3238; flex: 1; word-break: break-all;
  /* 긴 글은 3줄까지만 (누르면 전체) */
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.gb-note.open .gb-text { -webkit-line-clamp: unset; }
.gb-note { cursor: pointer; }
.gb-meta {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed rgba(60, 50, 60, 0.2);
  font-size: 12px;
  color: #5a4f57;
  display: flex;
  justify-content: space-between;
}
.gb-meta b { font-weight: 400; color: #2f282d; }
/* 메모지 색 3가지가 번갈아 */
.gb-note.c0 { --pin-light: #ff9a78; --pin: #f06a43; --pin-dark: #c2401f; --pin-glow: rgba(240, 106, 67, 0.45); --memo-a: #fff2ea; --memo-b: #ffe6d8; --memo-line: #ffd9c4; }
.gb-note.c1 { --pin-light: #86a6ff; --pin: #4a76f0; --pin-dark: #2a4fc4; --pin-glow: rgba(74, 118, 240, 0.45); --memo-a: #eef1ff; --memo-b: #e0e6ff; --memo-line: #d2dbff; }
.gb-note.c2 { --pin-light: #b896ff; --pin: #8a5cf0; --pin-dark: #5f35c8; --pin-glow: rgba(138, 92, 240, 0.45); --memo-a: #f6eeff; --memo-b: #ecdfff; --memo-line: #e2d0ff; }
.gb-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 14px; }
.gb-dots { margin-top: 0; }

/* 내 자리 찾기 */
.seat-form { display: flex; gap: 8px; max-width: 300px; margin: 24px auto 0; }
.seat-form input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
}
.seat-form input:focus { border-color: var(--accent); font-size: 16px; }
.seat-form button {
  flex: none;
  padding: 0 18px;
  font-family: inherit;
  font-size: 14px;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  cursor: pointer;
}
.seat-result { min-height: 26px; margin: 16px 0 14px; font-size: 15px; white-space: pre-line; }
.seat-result b { font-weight: 400; color: var(--accent); font-size: 17px; }
.seat-result.miss { font-size: 13px; color: var(--muted); }
.seat-result small { font-size: 13px; color: var(--muted); }
/* 배치도: 그림을 넣으면 그림 위에, 없으면 config.js 좌표대로 그린 홀 위에 테이블 동그라미 */
.seat-map {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #fff center / contain no-repeat;
  border: 3px solid #a99d94; /* 벽 */
  --table: 12%;
}
.seat-shape {
  position: absolute;
  display: grid;
  place-items: center;
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted);
  border: 1px solid #d6cbc1;
  background: #f6efe8;
}
.seat-shape.step { background: repeating-linear-gradient(to bottom, #f6efe8 0 4px, #d6cbc1 4px 5px); }
.seat-shape.aisle {
  writing-mode: vertical-rl;
  letter-spacing: 0.4em;
  color: #b89c8f;
  background: #f4e4e4;
  border-color: #ead3d3;
}
.seat-shape.honju { font-size: 9px; border-radius: 3px; }
.seat-shape.round { border-radius: 50%; background: #fff; }
.seat-shape.door {
  /* 아래 벽이 뚫린 출입구 */
  top: auto !important;
  bottom: -3px;
  height: auto !important;
  padding: 2px 0 4px;
  background: #fff;
  border: none;
  border-bottom: 3px solid #fff;
  font-size: 10px;
}
.seat-table {
  position: absolute;
  width: var(--table);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  font-size: 10.5px;
  letter-spacing: -0.02em;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: background 0.3s, color 0.3s, transform 0.3s;
}
.seat-map.has-image .seat-table { color: transparent; background: none; border-color: transparent; }
.seat-table.on,
.seat-map.has-image .seat-table.on {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translate(-50%, -50%) scale(1.12);
  z-index: 2;
  animation: seat-pulse 1.6s ease-out infinite;
}
@keyframes seat-pulse {
  0% { box-shadow: 0 0 0 0 rgba(184, 134, 107, 0.55); }
  100% { box-shadow: 0 0 0 16px rgba(184, 134, 107, 0); }
}
/* 내 테이블 위에 뜨는 그룹 이름표 (config.js 의 groups) */
.seat-table.on[data-group]::after {
  content: attr(data-group);
  position: absolute;
  bottom: 100%;
  margin-bottom: 7px;
  padding: 4px 10px;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--ink);
  background: #f7e8e1;
  border: 1px solid #e6cbbf;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(150, 110, 90, 0.15);
}
.seat-table.on[data-group]::before {
  /* 말풍선 꼬리 */
  content: "";
  position: absolute;
  bottom: 100%;
  margin-bottom: 3px;
  width: 7px;
  height: 7px;
  background: #f7e8e1;
  border-right: 1px solid #e6cbbf;
  border-bottom: 1px solid #e6cbbf;
  transform: rotate(45deg);
  z-index: 1;
}
.seat-table.edge-l.on[data-group]::after { justify-self: start; }
.seat-table.edge-r.on[data-group]::after { justify-self: end; }

/* 오시는 길 */
.venue-name { font-size: 18px; }
.map-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 24px 0 8px; }
.map-links a {
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 0;
}
.transport { text-align: left; margin-top: 32px; }
.transport div { padding: 16px 0; border-top: 1px solid var(--line); }
.transport h4 { font-weight: 400; color: var(--accent); font-size: 14px; margin-bottom: 4px; }
.transport p { font-size: 14px; white-space: pre-line; }

/* 계좌 */
.accordion { margin-top: 28px; display: grid; gap: 10px; text-align: left; }
.acc { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.acc-head {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--tint);
  border: none;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}
.acc-head::after { content: "⌄"; transition: transform 0.3s; }
.acc.open .acc-head::after { transform: rotate(180deg); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s ease; }
.acc.open .acc-body { grid-template-rows: 1fr; }
.acc-body > div { overflow: hidden; }
.acc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.acc-row small { color: var(--muted); display: block; font-size: 12px; }
.acc-row button {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}

/* 공유 */
.share { display: grid; justify-items: center; gap: 10px; padding-bottom: 96px; }
.thanks { font-size: 17px; margin-bottom: 14px; }

/* 모달 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 16px;
}
.modal[hidden], .lightbox[hidden] { display: none; }
.modal-box {
  background: var(--card);
  border-radius: 16px;
  padding: 28px 24px 20px;
  width: 100%;
  max-width: 340px;
  position: relative;
  text-align: center;
}
.modal-box h3 { margin-bottom: 12px; font-size: 18px; }
.modal-close {
  position: absolute;
  top: 8px;
  right: 14px;
  border: none;
  background: none;
  font-size: 26px;
  color: var(--muted);
  cursor: pointer;
}
.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.contact-row a {
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  margin-left: 6px;
  font-size: 13px;
}

/* 라이트박스 */
.lightbox {
  /* 홈과 같은 폭(최대 430px) 가운데에만 띄움 — 휴대폰에선 화면 전체 */
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, 430px);
  transform: translateX(-50%);
  background: var(--card); /* 갤러리(우리의 순간) 섹션 배경과 같은 색 */
  z-index: 30;
  display: grid;
  place-items: center;
  touch-action: pan-y;
}
.lb-track {
  position: absolute;
  inset: 0;
  display: grid;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}
.lb-track.dragging { cursor: grabbing; }
.lb-slide {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  will-change: transform;
}
.lb-slide img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  box-shadow: 0 8px 24px rgba(60, 40, 30, 0.12);
}
.lb-close {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  border: none;
  background: none;
  color: var(--ink);
  font-size: 36px;
  cursor: pointer;
  padding: 8px 14px;
}
.lb-count { position: absolute; bottom: 24px; color: var(--muted); font-size: 13px; }

/* 배경음악 */
.bgm-toggle {
  position: fixed;
  top: 14px;
  right: max(14px, calc(50% - 215px + 14px));
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: var(--accent);
  font-size: 18px;
  z-index: 10;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.bgm-toggle.off { color: var(--muted); text-decoration: line-through; }

/* 토스트 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 20px);
  background: rgba(40, 34, 30, 0.88);
  color: #fff;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 40;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 꽃잎 */
#petals { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.petal {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 10px;
  background: #f3c9c3;
  border-radius: 10px 0;
  opacity: 0.7;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translate(var(--drift), 105vh) rotate(540deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal > .ri, .reveal > .ri .photo { opacity: 1; transform: none; filter: none; transition: none; }
  #petals { display: none; }
}
