/* ============================================================
   모바일 청첩장 — iOS 홈화면 컨셉
   ============================================================ */

:root {
  --bg: #FAF6F1;
  --bg-soft: #F2EBE2;
  --text: #2C2620;
  --text-soft: #6B5D52;
  --text-mute: #9C8E82;
  --accent: #B8907E;
  --accent-soft: #D9BFB3;
  --line: #E5DCD2;
  --white: #FFFFFF;
  --shadow: 0 4px 24px rgba(60, 40, 30, 0.06);
  --shadow-lift: 0 8px 32px rgba(60, 40, 30, 0.12);

  --font-serif-ko: 'Nanum Myeongjo', 'Gowun Batang', serif;
  --font-serif-en: 'Cormorant Garamond', serif;
  --font-body: 'Gowun Batang', 'Nanum Myeongjo', serif;
  --font-sf: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Noto Sans KR', 'Pretendard', sans-serif;

  --icon-radius: 22%;  /* iOS squircle 근사값 */
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: #000;
  color: var(--text);
  font-family: var(--font-sf);
  line-height: 1.5;
  font-size: 15px;
  word-break: keep-all;
  -webkit-text-size-adjust: 100%;
  overflow: hidden; /* 홈화면은 스크롤 없음 */
  height: 100vh;
  height: 100dvh;
}

img { max-width: 100%; display: block; }
button {
  font-family: inherit; cursor: pointer; border: none; background: none;
  color: inherit;
}

/* ============================================================
   이미지 보호 (long-press / 우클릭 저장 차단)
   CSS 1차 방어 — JS protect-img.js와 함께 작동
   ============================================================ */
img,
.wallpaper,
.person-photo,
.person-photo-large,
.timeline-photo,
.gallery-item,
.icon-bg,
.lightbox-image {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  -webkit-user-drag: none;
}

/* ============================================================
   PHONE FRAME (홈화면 컨테이너)
   ============================================================ */
.phone-frame {
  position: relative;
  width: 100%;
  max-width: 430px;
  /* 폴백 순서: 옛 브라우저 100vh → 새 브라우저 100dvh → 인앱 보정 var(--app-height) */
  /* (--app-height 는 inapp-helper.js 가 window.innerHeight / visualViewport 로 매번 갱신) */
  height: 100vh;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  margin: 0 auto;
  overflow: hidden;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
}

/* 데스크탑에서는 폰 액자처럼 가운데 정렬 */
@media (min-width: 768px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
  }
  .phone-frame {
    height: 90vh;
    max-height: 932px; /* iPhone 14 Pro Max */
    margin: 0 auto;
    border-radius: 48px;
    box-shadow: 0 20px 80px rgba(0,0,0,0.5);
    border: 12px solid #1a1a1a;
  }
}

/* 배경 사진 */
.wallpaper {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #2a2a2a;
}

/* ============================================================
   결혼식 당일 이스터에그 — 분홍 하트(꽃잎) 떨어짐
   JS가 .wedding-petals를 .phone-frame에 주입 + .petal n개 생성
   ============================================================ */
.wedding-petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 7;  /* status bar(10) 아래 / dock(6)·icons(5) 위 */
}
.petal {
  position: absolute;
  top: -28px;
  width: 18px; height: 18px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21C12 21 3 14 3 8.5C3 5 5.5 3 8 3C10 3 11 4 12 5.5C13 4 14 3 16 3C18.5 3 21 5 21 8.5C21 14 12 21 12 21Z' fill='%23FF8FA3'/></svg>") no-repeat center;
  background-size: contain;
  opacity: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.18));
  animation-name: petal-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes petal-fall {
  0%   { transform: translateY(-30px) rotate(var(--rot-start, 0deg)) scale(var(--scale, 1)); opacity: 0; }
  10%  { opacity: 0.92; }
  90%  { opacity: 0.92; }
  100% { transform: translateY(110vh) rotate(var(--rot-end, 540deg)) scale(var(--scale, 1)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .petal { animation: none; display: none; }
}

/* ============================================================
   상태바 (iOS 스타일)
   ============================================================ */
.status-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 14px) 28px 0;
  padding-top: max(env(safe-area-inset-top, 14px), 14px);
  height: 54px;
  color: #000;
  font-family: var(--font-sf);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-time {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Dynamic Island = 음악 토글 버튼 (button 태그). 별도 BGM 버튼 없음 */
.status-dynamic-island {
  width: 110px;
  height: 32px;
  background: #000;
  border: none;
  padding: 0;
  border-radius: 20px;
  position: absolute;
  left: 50%;
  top: max(env(safe-area-inset-top, 12px), 12px);
  transform: translateX(-50%);
  cursor: pointer;
  /* 음악 재생 시 확장 */
  transition: width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.12s ease;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.status-dynamic-island:active {
  transform: translateX(-50%) scale(0.94);
}

/* 안의 라이브 액티비티 — 기본은 숨김 */
.island-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 0 8px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.island-art {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(255, 59, 48, 0.5));
  animation: island-heart-pulse 1.4s ease-in-out infinite;
}

@keyframes island-heart-pulse {
  0%, 100% { transform: scale(1); }
  15%      { transform: scale(1.2); }
  30%      { transform: scale(0.95); }
  45%      { transform: scale(1.12); }
  60%      { transform: scale(1); }
}

.island-eq {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 14px;
}

.island-eq span {
  width: 2.5px;
  height: 100%;
  background: #fff;
  border-radius: 2px;
  transform-origin: center;
  animation: island-eq-bounce 0.9s ease-in-out infinite;
}
.island-eq span:nth-child(1) { animation-delay: 0s;    }
.island-eq span:nth-child(2) { animation-delay: 0.15s; }
.island-eq span:nth-child(3) { animation-delay: 0.30s; }
.island-eq span:nth-child(4) { animation-delay: 0.45s; }

@keyframes island-eq-bounce {
  0%, 100% { transform: scaleY(0.3); }
  50%      { transform: scaleY(1); }
}

/* 재생 중일 때 확장 + 컨텐츠 표시 */
.status-dynamic-island.playing {
  width: 150px;
}
.status-dynamic-island.playing .island-content {
  opacity: 1;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-icon {
  width: 18px;
  height: 12px;
  color: #000;
}

.status-battery { width: 27px; }

.status-text {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* ============================================================
   앱 아이콘 그리드 — status-bar 바로 아래 (진짜 iPhone처럼)
   하단 dock(약 92px + margin)을 위해 padding-bottom 확보
   ============================================================ */
.app-grid {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: min-content;
  gap: 22px 14px;
  padding: 24px 24px 130px;
  align-content: start;
  flex: 0 0 auto;
}

/* ============================================================
   하단 Dock — iPhone 진짜 dock 같은 글래스모피즘 영역 (라벨 없음)
   ============================================================ */
.app-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 22px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-radius: 28px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  z-index: 6;
  border: 0.5px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.app-icon-dock {
  gap: 0; /* 라벨 없으므로 간격 제거 */
}
.app-icon-dock .icon-label {
  display: none;
}
/* dock 아이콘은 살짝 작게 — 그리드 아이콘과 시각적 위계 */
.app-icon-dock .icon-bg {
  max-width: 60px;
  margin: 0 auto;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: none;
  padding: 0;
  transition: transform 0.08s ease;
}

.app-icon:active { transform: scale(0.92); }

.icon-bg {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--icon-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  position: relative;
  overflow: hidden;  /* scale 확대된 아이콘이 둥근 모서리 밖으로 새는 것 방지 */
  overflow: hidden;
}

/* 실제 PNG 아이콘 로직:
   기본: SVG 보임, img 숨김
   onload(성공): img 보임, SVG 숨김, 그라데이션 배경 제거 (PNG에 squircle 포함)
   onerror(404): img 제거 → SVG 그대로 보임 */
.icon-real {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  object-fit: cover;
}
.icon-bg.has-real-icon .icon-real { display: block; }
.icon-bg.has-real-icon .icon-art { display: none; }
.icon-bg.has-real-icon {
  background: transparent !important;
}

.icon-art {
  width: 70%;
  height: 70%;
}

.icon-label {
  font-family: var(--font-sf);
  font-size: 11.5px;
  color: #000;
  font-weight: 500;
  text-align: center;
  text-shadow: 0 1px 4px rgba(255,255,255,0.85);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* 아이콘별 배경 그라데이션 (iOS 네이티브 앱 톤 흉내) */
.icon-story    { background: linear-gradient(135deg, #FF6B9D, #C5184D); }
.icon-map      { background: linear-gradient(180deg, #C9E6FF 0%, #75C1FF 35%, #4A90E2 100%); }
.icon-gallery  { background: #fff; }
.icon-mail     { background: linear-gradient(180deg, #51A9FF, #0A6EE3); }
.icon-account  { background: linear-gradient(135deg, #3D2F2A, #6B4F40); }
.icon-selfsnap { background: linear-gradient(135deg, #F4D4B8, #C97852); }
.icon-message  { background: linear-gradient(180deg, #5DDC4D, #1FB332); }
.icon-share    { background: linear-gradient(135deg, #B8907E, #8C6B58); }
.icon-music    { background: linear-gradient(135deg, #FF6B9D 0%, #FA2D54 60%, #C5184D 100%); }
/* 음악 아이콘은 재생 중일 때 살짝 펄스 효과 (다이내믹 아일랜드와 동기화) */
.app-icon[data-app="music"].playing .icon-bg {
  box-shadow: 0 0 0 0 rgba(250, 45, 84, 0.6), 0 4px 16px rgba(0,0,0,0.18);
  animation: music-icon-pulse 1.6s ease-in-out infinite;
}
@keyframes music-icon-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(250, 45, 84, 0.5), 0 4px 16px rgba(0,0,0,0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(250, 45, 84, 0), 0 4px 16px rgba(0,0,0,0.18); }
}

/* 일부 실사 아이콘은 원본에 흰 여백/직사각형이 있어 시각적 크기가 작게 보임 → 살짝 확대 */
.icon-bg.has-real-icon.icon-gallery .icon-real { transform: scale(1.18); }
.icon-bg.has-real-icon.icon-mail .icon-real    { transform: scale(1.22); }

/* ============================================================
   페이지 인디케이터 + 홈 인디케이터
   ============================================================ */
.page-dots {
  position: absolute;
  bottom: 28px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 5;
}
.page-dots .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
}
.page-dots .dot.active { background: #fff; }

.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: #fff;
  border-radius: 3px;
  opacity: 0.95;
  z-index: 5;
}

/* ============================================================
   앱 뷰 (탭하면 오른쪽에서 슬라이드인 — iOS 네비게이션 push 스타일)
   뒤로 = 오른쪽으로 슬라이드 아웃하며 홈이 다시 나타남
   ============================================================ */
.app-view {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 430px;
  margin: 0 auto;
  left: 0; right: 0;

  /* 닫힘 상태: 화면 오른쪽 밖에 대기 */
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  will-change: transform;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);

  /* Apple 표준 navigation curve */
  transition:
    transform 0.36s cubic-bezier(0.32, 0.72, 0, 1),
    visibility 0s linear 0.36s;
}

.app-view.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition:
    transform 0.36s cubic-bezier(0.32, 0.72, 0, 1),
    visibility 0s linear 0s;
}

/* 앱 열려있을 때 홈화면이 살짝 왼쪽으로 밀려나는 패럴랙스 (iOS push 느낌) */
.phone-frame.app-open .wallpaper,
.phone-frame.app-open .status-bar,
.phone-frame.app-open .app-grid,
.phone-frame.app-open .app-dock,
.phone-frame.app-open .home-indicator {
  transform: translateX(-30%);
}

.phone-frame .wallpaper,
.phone-frame .status-bar,
.phone-frame .app-grid,
.phone-frame .app-dock,
.phone-frame .home-indicator {
  transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1);
}

.app-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(250, 246, 241, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.back-btn {
  font-family: var(--font-sf);
  color: var(--accent);
  font-size: 17px;
  padding: 12px 4px;
  font-weight: 400;
  min-width: 80px;
  min-height: 44px;
  text-align: left;
  letter-spacing: -0.02em;
}

.back-btn:active { opacity: 0.5; }

.app-view-title {
  font-family: var(--font-sf);
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.02em;
}

.header-spacer { min-width: 80px; }

.app-view-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 24px 40px;
}

.app-view-description {
  font-size: 14px;
  color: var(--text-soft);
  margin: 0 0 24px;
  line-height: 1.7;
  text-align: center;
}

/* ============================================================
   "우리 이야기" 앱뷰
   ============================================================ */
.story-hero {
  text-align: center;
  padding: 20px 0 40px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}

.eyebrow {
  font-family: var(--font-serif-en);
  font-size: 12px;
  letter-spacing: 0.35em;
  color: var(--accent);
  margin: 0 0 12px;
  font-weight: 400;
}

.story-hero h3 {
  font-family: var(--font-serif-ko);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 24px;
  letter-spacing: 0.05em;
}

.story-message {
  white-space: pre-line;
  font-size: 14px;
  line-height: 2;
  color: var(--text-soft);
  margin: 0;
}

.people-wrap {
  margin: 0 0 32px;
}

.person {
  text-align: center;
  padding: 24px 0;
}

.person-photo {
  width: 130px;
  height: 130px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: var(--shadow);
}

.person-photo img {
  width: 100%; height: 100%; object-fit: cover;
}

.person-parents {
  font-size: 12px;
  color: var(--text-mute);
  margin: 0 0 6px;
}

.person-name {
  font-family: var(--font-serif-ko);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: 0.06em;
}

.person-intro {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
  font-style: italic;
}

.person-divider {
  text-align: center;
  color: var(--accent-soft);
  font-size: 20px;
  padding: 8px 0;
}

.when-block {
  border-top: 1px solid var(--line);
  padding-top: 32px;
}

.calendar {
  background: var(--white);
  border-radius: 16px;
  padding: 20px 14px;
  margin: 0 0 16px;
  box-shadow: var(--shadow);
}
.calendar-month {
  font-family: var(--font-serif-en);
  font-size: 18px;
  letter-spacing: 0.15em;
  margin: 0 0 14px;
  text-align: center;
  font-weight: 400;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-day-name {
  font-family: var(--font-serif-en);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  padding: 6px 0;
  text-align: center;
  font-weight: 500;
}
.calendar-day-name.sun { color: #C97070; }
.calendar-day-name.sat { color: #7A95B8; }
.calendar-day {
  font-size: 12px;
  padding: 8px 0;
  text-align: center;
  border-radius: 50%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar-day.empty { color: transparent; }
.calendar-day.sun { color: #C97070; }
.calendar-day.sat { color: #7A95B8; }
.calendar-day.today {
  position: relative;
  color: var(--white) !important;
  font-weight: 700;
  background: transparent;
  border-radius: 0;
  z-index: 0;
}
/* 하트 모양 배경 (SVG 인라인) — 결혼식 날짜 강조 */
.calendar-day.today::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path d='M16 28C16 28 4 20 4 12C4 7 8 4 12 4C14 4 15 5 16 7C17 5 18 4 20 4C24 4 28 7 28 12C28 20 16 28 16 28Z' fill='%23B8907E'/></svg>") no-repeat center;
  background-size: 100% 100%;
  z-index: -1;
}

.when-text {
  text-align: center;
  font-size: 14px;
  color: var(--text);
  margin: 0;
  line-height: 1.7;
}
.when-text .when-venue {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-soft);
}

/* ============================================================
   확장 인물 카드 (v2) — MBTI / 해시태그 / 다짐 (사용자 디자인 레퍼런스 기반)
   ============================================================ */
.people-wrap-v2 { margin: 0 0 16px; }

.person-v2 {
  text-align: center;
  padding: 24px 0;
}

.person-photo-large {
  width: 160px;
  height: 160px;
  margin: 0 auto 18px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: 0 8px 24px rgba(60, 40, 30, 0.12);
}
.person-photo-large img { width: 100%; height: 100%; object-fit: cover; }

.person-label {
  font-family: var(--font-serif-ko);
  font-size: 14px;
  color: var(--text-soft);
  margin: 0 0 4px;
  letter-spacing: 0.08em;
}
.person-name-inline {
  font-size: 18px;
  color: var(--text);
  font-weight: 700;
  margin-left: 4px;
  letter-spacing: 0.04em;
}

.person-highlight {
  display: inline-block;
  background: #FBE8A6;
  color: #8C6B58;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
  margin: 8px 0 16px;
  letter-spacing: 0.02em;
}
.hl-emoji { font-style: normal; }

.person-birthinfo,
.person-mbti,
.person-hashtags {
  font-size: 13.5px;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.7;
}

.person-hashtags {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.person-v2 .person-intro {
  font-size: 13px;
  color: var(--text-soft);
  margin: 6px 0 0;
  font-style: italic;
  line-height: 1.7;
}

.person-vow {
  margin: 14px auto 0;
  padding: 12px 18px 0;
  max-width: 260px;
  border-top: 1px dashed var(--line);
  color: var(--text-soft);
  font-size: 13.5px;
  font-style: italic;
  line-height: 1.7;
}

.person-v2 .person-parents {
  font-size: 11px;
  color: var(--text-mute);
  margin: 12px 0 0;
  opacity: 0.85;
  letter-spacing: 0.01em;
}

/* 빈 필드는 숨김 (textContent='' 인 경우 ios-main.js에서 hidden 토글) */
.person-birthinfo:empty,
.person-mbti:empty,
.person-hashtags:empty,
.person-vow:empty,
.person-intro:empty,
.person-label:empty { display: none; }

/* ============================================================
   타임라인 (zigzag) — 좌우 번갈아 원형 사진 + 연도 + 한줄 메시지
   ============================================================ */
.timeline-section {
  padding: 36px 0 8px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  text-align: center;
}
.timeline-title {
  font-family: var(--font-serif-ko);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 32px;
  letter-spacing: 0.05em;
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
/* 중앙 점선 */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 24px;
  bottom: 24px;
  border-left: 1px dashed var(--accent-soft);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 32px;
  min-height: 110px;
}

.timeline-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-soft);
  box-shadow: 0 4px 12px rgba(60, 40, 30, 0.14);
}
.timeline-photo img { width: 100%; height: 100%; object-fit: cover; }
/* 사진 로드 실패 시 placeholder 색상만 보이도록 */
.timeline-photo img[data-broken] { opacity: 0; }

.timeline-content { padding: 0 6px; }

.timeline-message {
  font-family: var(--font-serif-ko);
  font-size: 13.5px;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.timeline-year {
  font-family: var(--font-serif-en);
  font-size: 13px;
  color: var(--text-mute);
  letter-spacing: 0.2em;
  margin: 0;
  font-weight: 400;
}

/* zigzag — 홀수번째: 사진 왼쪽, 텍스트 오른쪽 */
.timeline-item:nth-child(odd) .timeline-photo { justify-self: end; }
.timeline-item:nth-child(odd) .timeline-content {
  text-align: left;
  justify-self: start;
}

/* zigzag — 짝수번째: 사진 오른쪽, 텍스트 왼쪽 (DOM 순서를 grid 컬럼으로 뒤집음) */
.timeline-item:nth-child(even) .timeline-photo {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
}
.timeline-item:nth-child(even) .timeline-content {
  grid-column: 1;
  grid-row: 1;
  text-align: right;
  justify-self: end;
}

/* ============================================================
   "오시는 길" 앱뷰
   ============================================================ */
.map-container {
  width: 100%;
  height: 240px;
  border-radius: 12px;
  background: var(--bg-soft);
  overflow: hidden;
  margin: 0 0 20px;
  box-shadow: var(--shadow);
}
.map-address { text-align: center; margin: 0 0 20px; }
.map-venue-name {
  font-family: var(--font-serif-ko);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
}
.map-venue-address {
  font-size: 14px; color: var(--text-soft); margin: 0 0 4px;
  display: inline-flex; align-items: center; gap: 8px;
  flex-wrap: wrap; justify-content: center;
}
.btn-copy-addr {
  padding: 4px 10px;
  font-size: 11px;
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.btn-copy-addr:active { background: var(--accent); color: var(--white); }
.map-venue-detail { font-size: 12px; color: var(--text-mute); margin: 0; }

.directions-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 28px;
}
.btn-direction {
  display: block;
  text-align: center;
  padding: 12px 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--white);
  transition: opacity 0.15s;
}
.btn-direction:active { opacity: 0.7; }
.btn-kakao { background: #FAE100; color: #3C1E1E; }
.btn-naver { background: #03C75A; }
.btn-tmap { background: #EA1B16; }

.transport-list { border-top: 1px solid var(--line); padding-top: 20px; }
.transport-item {
  display: flex; gap: 14px; padding: 12px 0; align-items: flex-start;
}
.transport-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.transport-icon svg {
  width: 20px;
  height: 20px;
}
.transport-icon-fallback {
  font-family: var(--font-serif-en);
  font-weight: 700;
  font-size: 14px;
}
.transport-type { font-size: 13px; font-weight: 700; margin: 0 0 2px; }
.transport-description { font-size: 13px; color: var(--text-soft); margin: 0; line-height: 1.5; white-space: pre-line; }

/* ============================================================
   갤러리 앱뷰
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.gallery-item {
  aspect-ratio: 1;
  background: var(--bg-soft);
  overflow: hidden;
  cursor: pointer;
  border-radius: 6px;
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-item:active img { transform: scale(0.96); }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.lightbox[hidden] { display: none; }
.lightbox-image {
  max-width: 92vw;
  max-height: 80vh;
  object-fit: contain;
  /* 핀치줌 / 더블탭 줌 차단 — 스와이프(좌우)는 허용 */
  touch-action: pan-x;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.lightbox {
  touch-action: pan-x;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  color: white;
  font-size: 28px;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
}
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
  position: absolute; bottom: 30px;
  color: white;
  font-family: var(--font-serif-en);
  letter-spacing: 0.2em;
}

/* ============================================================
   폼 (RSVP / 방명록)
   ============================================================ */
.form-group { margin: 0 0 22px; }
.form-group > label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: 0.02em;
}
.form-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-mute);
  margin-left: 4px;
}
.radio-group { display: flex; gap: 8px; }
.radio { flex: 1; position: relative; cursor: pointer; }
.radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio span {
  display: block;
  padding: 12px;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-soft);
  transition: all 0.15s;
}
.radio input:checked + span {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-row .form-group { margin: 0 0 22px; }

.btn-submit {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: var(--white);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  margin-top: 8px;
  transition: opacity 0.15s;
}
.btn-submit:active { opacity: 0.8; }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.form-message {
  text-align: center;
  font-size: 13px;
  color: var(--accent);
  margin: 16px 0 0;
  min-height: 18px;
}

/* ============================================================
   계좌
   ============================================================ */
.account-group { margin: 0 0 12px; }
.account-toggle {
  width: 100%;
  padding: 18px 20px;
  background: var(--white);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: background 0.15s;
}
.account-toggle:active { background: var(--bg-soft); }
.toggle-icon {
  font-size: 20px;
  color: var(--accent);
  font-weight: 300;
  transition: transform 0.2s;
}
.account-toggle.open .toggle-icon { transform: rotate(45deg); }

.account-list {
  background: var(--white);
  border-radius: 0 0 10px 10px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 20px;
  margin-top: -8px;
  box-shadow: var(--shadow);
}
.account-list.open {
  max-height: 800px;
  padding: 0 20px 16px;
}

.account-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.account-item:last-child { border-bottom: none; }
.account-info { flex: 1; min-width: 0; }
.account-role { font-size: 12px; color: var(--text-mute); margin: 0 0 4px; }
.account-name { font-size: 14px; font-weight: 700; margin: 0 0 4px; }
.account-number {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
  font-family: var(--font-serif-en);
  letter-spacing: 0.02em;
}
.btn-copy {
  flex-shrink: 0;
  padding: 8px 14px;
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 12px;
}
.btn-copy:active { background: var(--accent); color: var(--white); }

/* ============================================================
   셀프 스냅 앱뷰
   ============================================================ */
.selfsnap-hero,
.event-hero {
  text-align: center;
  padding: 12px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.selfsnap-title,
.event-title {
  font-family: var(--font-serif-ko);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: 0.04em;
}
.selfsnap-intro,
.event-intro {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.8;
  white-space: pre-line;
  margin: 0;
}

.selfsnap-missions {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mission-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.mission-emoji {
  font-size: 22px;
  flex-shrink: 0;
}
.mission-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}

.selfsnap-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 0 0 28px;
}
.hashtag {
  display: inline-block;
  padding: 6px 12px;
  background: var(--bg-soft);
  border-radius: 20px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.selfsnap-share {
  text-align: center;
  padding: 20px;
  background: var(--bg-soft);
  border-radius: 12px;
}
.share-desc {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0 0 14px;
}
.btn-share-link {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: var(--white);
  border-radius: 24px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}
.share-pending {
  font-size: 12px;
  color: var(--text-mute);
  margin: 0;
  font-style: italic;
}

/* ============================================================
   셀프스냅 — 베스트 포토그래퍼 안내 + 업로드 폼 + 갤러리
   ============================================================ */
.selfsnap-prize {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #FDF4D6 0%, #FBE8A6 100%);
  border-radius: 16px;
  margin: 0 0 24px;
  box-shadow: 0 2px 12px rgba(184, 144, 126, 0.12);
}
.prize-emoji { font-size: 32px; flex-shrink: 0; }
.prize-text {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}
.prize-text strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: #8C6B58;
}
.prize-text p { margin: 0; color: var(--text-soft); }

/* 업로드 폼 */
.selfsnap-form {
  background: var(--white);
  border-radius: 16px;
  padding: 22px 18px;
  margin: 0 0 28px;
  box-shadow: var(--shadow);
}
.selfsnap-form-title {
  font-family: var(--font-serif-ko);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 18px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.form-title-sub,
.form-label-hint {
  font-size: 11px;
  color: var(--text-mute);
  font-weight: 400;
  margin-left: 4px;
}

/* 파일 input — 모바일 친화 큰 영역 */
#snap-photos {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--bg-soft);
  border: 1.5px dashed var(--accent-soft);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  box-sizing: border-box;
}
#snap-photos::file-selector-button {
  margin-right: 12px;
  padding: 6px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* 미리보기 썸네일 */
.snap-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.preview-thumb {
  position: relative;
  width: calc((100% - 16px) / 3);
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
}
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview-size {
  position: absolute;
  bottom: 4px; right: 4px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

/* 사용자 quota */
.snap-quota {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-soft);
}
.quota-full { color: #C97070; font-weight: 600; }

/* form-message 색상 */
.form-message.success { color: #2D9F4F; }
.form-message.error   { color: #C97070; }

/* 갤러리 */
.selfsnap-gallery-wrap { margin: 0 0 24px; }
.selfsnap-gallery-title {
  font-family: var(--font-serif-ko);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.snap-count {
  font-size: 12px;
  color: var(--text-mute);
  font-weight: 400;
  margin-left: 6px;
}

.snap-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.snap-filter-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--text-soft);
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.snap-filter-btn.active {
  background: var(--accent);
  color: #fff;
}

.snap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.snap-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
  padding: 28px 0;
  margin: 0;
  font-style: italic;
}
.snap-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
  display: block;
  text-decoration: none;
}
.snap-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.2s ease;
}
.snap-item:active img { transform: scale(0.96); }
.snap-item-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 6px 4px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.55));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}
.snap-item-side {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 100px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.snap-item-side-groom { background: #4A90E2; }
.snap-item-side-bride { background: #FF6B9D; }
.snap-item-uploader {
  font-size: 10px;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

/* selfsnap.js가 .snap-item 안에 <a class="snap-item-link"> + <button class="snap-delete">
   두 자식을 만들기 때문에, a 태그가 div(.snap-item) 전체를 채우도록 */
.snap-item-link {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
}
.snap-item-link img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.2s ease;
}
.snap-item:active .snap-item-link img { transform: scale(0.96); }

/* X 삭제 버튼 (사진 우측 상단 작은 원) — 비밀번호 일치해야 실제 삭제됨 */
.snap-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.snap-delete:hover  { background: #C97070; }
.snap-delete:active { transform: scale(0.88); background: #C97070; }

/* 1인 1회 안내 — 폼 위에 노란 박스 */
.selfsnap-notice {
  font-size: 12px;
  line-height: 1.7;
  color: #8C6B58;
  background: #FFF6E0;
  border: 1px solid #FBE8A6;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 18px;
}
.selfsnap-notice strong { color: #C97852; }

/* 이미 업로드한 사용자 안내 (폼 자리 대체) */
.selfsnap-done {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px;
  background: var(--bg-soft);
  border: 1px dashed var(--accent-soft);
  border-radius: 16px;
  margin: 0 0 28px;
}
.done-emoji { font-size: 28px; flex-shrink: 0; }
.done-text  { flex: 1; font-size: 13px; color: var(--text); line-height: 1.6; }
.done-text strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text);
}
.done-text p { margin: 0; color: var(--text-soft); }

/* 비밀번호 input */
#snap-password {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}
#snap-password:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

/* ============================================================
   추첨 이벤트 앱뷰
   ============================================================ */
.event-time-chip {
  display: inline-block;
  margin: 0 auto 24px;
  padding: 8px 18px;
  background: linear-gradient(135deg, #FF6B9D, #C5184D);
  color: #fff;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.event-section-title {
  font-family: var(--font-serif-ko);
  font-size: 15px;
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--text);
}

.event-prizes {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prize-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.prize-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border-radius: 50%;
  flex-shrink: 0;
}
.prize-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.prize-rank {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.1em;
}
.prize-name {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
}

.event-howto {
  padding-left: 20px;
  margin: 0;
  color: var(--text);
}
.event-howto li {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 6px;
}

/* ============================================================
   방명록 리스트
   ============================================================ */
.guestbook-list { margin-top: 32px; }
.guestbook-item {
  background: var(--white);
  border-radius: 10px;
  padding: 16px;
  margin: 0 0 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.guestbook-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 8px;
}
.guestbook-name { font-size: 14px; font-weight: 700; }
.guestbook-date { font-size: 11px; color: var(--text-mute); }
.guestbook-message {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
  margin: 0;
  word-break: break-word;
  white-space: pre-wrap;  /* 작성자가 친 줄바꿈 그대로 표시 */
}
.btn-delete-gb {
  align-self: flex-end;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-mute);
  padding: 4px 8px;
}
.btn-delete-gb:active { color: var(--text); }
.empty-message {
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
  padding: 40px 0;
}

.guestbook-form input,
.guestbook-form textarea { margin: 0 0 10px; }
.guestbook-form .form-row { margin: 0 0 10px; }
.guestbook-form .form-row input { margin: 0; }
.char-counter {
  text-align: right;
  font-size: 11px;
  color: var(--text-mute);
  margin: -4px 0 10px;
  letter-spacing: 0.02em;
}
.char-counter.near-limit { color: var(--accent); }

/* ============================================================
   토스트
   ============================================================ */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(44, 38, 32, 0.95);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 13px;
  z-index: 3000;
  animation: toastIn 0.2s ease;
}
.toast[hidden] { display: none; }

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

/* ============================================================
   "공유하기" 앱 — 별도 뷰 없이 즉시 공유 액션
   (앱 아이콘 클릭 시 navigator.share 또는 링크 복사)
   ============================================================ */

/* ============================================================
   잠금화면 (첫 진입) — iPhone Lock Screen 미러
   상단: 결혼식 날짜·D-day (작게)
   가운데: 큰 시계 + "한상기 ♥ 김서연"
   하단: "청첩장 입장하기" 글래스 버튼
   클릭 시 위로 fade-up 사라짐 → 아래 홈(앱 그리드) 노출
   ============================================================ */

/* phone-frame.locked 일 땐 홈 콘텐츠(아이콘 그리드 + dock)를 숨겨서
   진짜 iPhone 잠금화면처럼 wallpaper + status-bar + 시계만 보이게 */
.phone-frame.locked .app-grid,
.phone-frame.locked .app-dock {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0s, visibility 0s;
}
/* 잠금 해제 시: 아이콘이 부드럽게 페이드인 (잠금화면 사라지는 동안) */
.phone-frame:not(.locked) .app-grid,
.phone-frame:not(.locked) .app-dock {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease-out 0.15s, visibility 0s linear 0s;
}
.lock-screen {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  /* status-bar(상단 54px) 비우고 + home-indicator(하단 ~20px) 비움 */
  padding: 110px 24px calc(env(safe-area-inset-bottom, 0px) + 60px);
  pointer-events: auto;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 가독성용 옅은 비네팅 (사진이 너무 밝아서 흰 글씨가 안 보일 때 대비) */
.lock-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.18) 0%,
    rgba(0, 0, 0, 0.05) 30%,
    rgba(0, 0, 0, 0.10) 70%,
    rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
}

/* 잠금 해제 — 위로 슬쩍 사라짐 */
.lock-screen.unlocked {
  opacity: 0;
  transform: translateY(-12%);
  pointer-events: none;
}

.lock-content {
  position: relative;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

/* 순서: 시계 → 신랑신부 → D-day */
.lock-time {
  font-family: var(--font-sf);
  font-size: 92px;
  font-weight: 200;       /* SF Pro Display Ultralight 같은 얇은 시계 */
  letter-spacing: -0.04em;
  margin: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.lock-names {
  font-family: var(--font-serif-ko);
  font-size: 18px;
  font-weight: 600;
  margin: 14px 0 0;
  letter-spacing: 0.06em;
}

/* D-day pill — 시계+이름 아래 둥근 글래스 뱃지로 강조 */
.lock-date {
  display: inline-block;
  font-family: var(--font-serif-en);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
  margin: 18px 0 0;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 0.5px solid rgba(255, 255, 255, 0.34);
  border-radius: 100px;
}
.lock-heart {
  color: #FF6B6B;
  margin: 0 6px;
  font-size: 17px;
  text-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
  animation: lock-heart-beat 1.6s ease-in-out infinite;
  display: inline-block;
}
@keyframes lock-heart-beat {
  0%, 100% { transform: scale(1); }
  15%      { transform: scale(1.2); }
  30%      { transform: scale(0.95); }
  45%      { transform: scale(1.12); }
  60%      { transform: scale(1); }
}

/* 입장 버튼 — 글래스모피즘 (iPhone 잠금화면 손전등 버튼 느낌) */
.lock-unlock-btn {
  position: relative;
  z-index: 2;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 100px;
  font-family: var(--font-sf);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  /* 시선 유도 — 부드러운 호흡 */
  animation: lock-btn-breathe 2.4s ease-in-out infinite;
}
.lock-unlock-btn:hover  { background: rgba(255, 255, 255, 0.24); }
.lock-unlock-btn:active { background: rgba(255, 255, 255, 0.32); transform: scale(0.96); animation: none; }
.lock-arrow {
  font-size: 22px;
  line-height: 1;
  font-weight: 300;
  margin-left: 2px;
}

@keyframes lock-btn-breathe {
  0%, 100% { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25),  0 0 0 0   rgba(255,255,255,0.25); }
  50%      { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25),  0 0 0 8px rgba(255,255,255,0);    }
}

/* ============================================================
   인앱 브라우저 안내 배너 (카카오톡 / 인스타 / 페북 등)
   inapp-helper.js 가 동적으로 삽입.
   상단 고정, 한 줄 + 노출 직후 자동 fade-in.
   닫기 누르면 그 세션 동안만 숨김 (다음 페이지 로드 시 다시 표시).
   ============================================================ */
#inapp-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top, 10px));
  background: #FFF8DC;
  border-bottom: 1px solid #FBE8A6;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Noto Sans KR', sans-serif;
  font-size: 12px;
  line-height: 1.4;
  color: #6B4F40;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: inapp-banner-in 0.3s ease-out;
}
#inapp-banner.hide { display: none; }
@keyframes inapp-banner-in {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.inapp-icon { font-size: 18px; flex-shrink: 0; }
.inapp-text { flex: 1; min-width: 0; }
.inapp-sub  { color: #9C8E82; font-size: 11px; }
.inapp-open {
  padding: 6px 12px;
  background: #B8907E;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.inapp-open:active { opacity: 0.85; transform: scale(0.96); }
.inapp-close {
  width: 26px; height: 26px;
  background: none;
  border: none;
  color: #9C8E82;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  font-family: inherit;
}
