/* 성탄 말씀 스탬프 여정 · 공통 스타일
   간격은 8의 배수, 모서리 14px, 글자 크기 18/20/24/30 네 단계로 통일합니다. */
:root {
  --bg: #111b2e;
  --surface: #18243b;
  --surface-2: #1f2d47;
  --line: #2e3d5c;
  --gold: #f3cf7a;
  --gold-bright: #ffe39e;
  --gold-deep: #c9973a;
  --gold-soft: #ffe39e;
  --ink: #f4f1ea;
  --muted: #b9c2d3;
  --dim: #8794ab;
  --ok: #9fd8b0;
  --alert: #ff9b8f;
  --paper: #faf7ef;
  --paper-ink: #182235;
  --r: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --serif: "AppleMyungjo", "Noto Serif KR", "Nanum Myeongjo", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 20px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--gold-soft); }

.wrap { max-width: 520px; margin: 0 auto; padding: 24px 16px 48px; }
.wrap.with-dock { padding-bottom: 136px; }

h1, h2, h3 { margin: 0; line-height: 1.35; font-weight: 800; }
h1 { font-size: 30px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
p { margin: 0; }
.label { font-size: 18px; font-weight: 700; color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 18px; }
.center { text-align: center; }
.stack > * + * { margin-top: 16px; }
.stack-8 > * + * { margin-top: 8px; }

/* 카드 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.card.paper { background: var(--paper); color: var(--paper-ink); border-color: var(--paper); }
.card.paper .muted { color: #4b5568; }
.card.paper .label { color: #8a6412; }

/* 버튼: 높이 64px 하나로 통일 */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 64px;
  padding: 8px 24px; border: 0; border-radius: var(--r); cursor: pointer; text-decoration: none;
  font-size: 22px; font-weight: 800; background: var(--gold); color: #1a1406; }
.btn:active { opacity: .85; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.line { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.quiet { background: var(--surface-2); color: var(--ink); }
.btn + .btn { margin-top: 8px; }
.link { background: none; border: 0; padding: 8px 0; color: var(--muted); text-decoration: underline; font-size: 18px; cursor: pointer; }
.spin { width: 20px; height: 20px; border: 3px solid rgba(0,0,0,.2); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 입력 */
.field > label:not(.choice) { display: block; margin-bottom: 8px; font-weight: 700; }
.input, .textarea, .select { width: 100%; min-height: 64px; padding: 12px 16px; border-radius: var(--r);
  border: 2px solid var(--line); background: var(--paper); color: var(--paper-ink); font-size: 22px; outline: none; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--gold); }
.textarea { min-height: 160px; line-height: 1.6; resize: vertical; font-size: 20px; }
.digits { text-align: center; font-size: 40px; font-weight: 800; letter-spacing: 16px; padding-left: 32px; }
.check { display: flex; gap: 16px; align-items: flex-start; padding: 16px; border-radius: var(--r); background: var(--surface-2); cursor: pointer; }
.check input { flex: 0 0 28px; width: 28px; height: 28px; margin: 2px 0 0; accent-color: var(--gold); }
.err { min-height: 1.6em; color: var(--alert); font-weight: 700; font-size: 18px; }
.choice { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 0 16px; border-radius: var(--r);
  border: 2px solid var(--line); background: var(--surface-2); cursor: pointer; font-weight: 700; }
.choice { line-height: 1.4; padding: 12px 16px; }
.choice input { flex: 0 0 24px; width: 24px; height: 24px; margin: 0; accent-color: var(--gold); }
.choice.on { border-color: var(--gold); }
.choice + .choice { margin-top: 8px; }

/* 진행 */
.bar { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold); border-radius: 6px; transition: width .6s ease; }

/* 장소 목록: 모든 줄이 같은 높이와 같은 배치 */
.places { display: grid; gap: 8px; }
.place { display: grid; grid-template-columns: 72px 1fr 48px; gap: 16px; align-items: center; height: 104px;
  padding: 8px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%; }
.place .thumb { width: 72px; height: 72px; border-radius: 10px; background: var(--surface-2) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; color: var(--dim); }
.place .txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.place .t1 { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place .t2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.place .t3 { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place .t1 { font-size: 18px; font-weight: 700; color: var(--gold); }
.place .t2 { font-size: 20px; font-weight: 700; line-height: 1.4; }
.place .t3 { font-size: 18px; color: var(--muted); }
.place .state { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; color: var(--dim); }
.place.done { border-color: rgba(230,192,106,.5); }
.place.done .state { background: var(--gold); border-color: var(--gold); color: #1a1406; font-size: 26px; }

/* 아래 고정 버튼 */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(17,27,46,0), var(--bg) 32%); }
.dock .btn { max-width: 488px; margin: 0 auto; min-height: 72px; font-size: 24px; }

/* 말씀 */
.ref { font-weight: 800; color: var(--gold); }
.card.paper .ref { color: #8a6412; }
.verse { font-family: var(--serif); font-size: 22px; line-height: 1.8; }
.notice { padding: 16px; border-radius: var(--r); background: rgba(159,216,176,.12); border: 1px solid rgba(159,216,176,.4); font-size: 18px; }

/* 교환권 */
.voucher { text-align: center; }
.voucher .code { font-size: 36px; font-weight: 800; letter-spacing: 4px; font-family: "SF Mono", Menlo, Consolas, monospace; }
.badge { display: inline-block; padding: 4px 16px; border-radius: 99px; font-size: 18px; font-weight: 800; }
.badge.ok { background: rgba(159,216,176,.18); color: var(--ok); }
.badge.gold { background: rgba(230,192,106,.18); color: var(--gold-soft); }
.badge.alert { background: rgba(255,155,143,.18); color: var(--alert); }
.badge.dim { background: var(--surface-2); color: var(--muted); }

/* 창 */
.modal { position: fixed; inset: 0; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(6,10,20,.7); }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; max-height: calc(100dvh - 16px); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; overflow-y: auto; padding: 24px 16px 32px;
  border-radius: 20px 20px 0 0; background: var(--bg); border-top: 1px solid var(--line); padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.card-img { display: block; width: 100%; border-radius: var(--r); }
@media (min-width: 600px) { .modal { align-items: center; } .sheet { border-radius: 20px; padding: 32px 24px; } }
.photo-lg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); background: var(--surface-2); }

/* 알림 */
#toast { position: fixed; left: 16px; right: 16px; bottom: 112px; z-index: 99; max-width: 488px; margin: 0 auto; text-align: center;
  padding: 16px 24px; border-radius: var(--r); background: var(--paper); color: var(--paper-ink); font-weight: 700; font-size: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .25s; }
#toast.show { opacity: 1; }

.loading { min-height: 60vh; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.hero { height: 200px; margin: -24px -16px 24px; background: var(--surface) center 30% / cover no-repeat; position: relative; }
.hero::after { content: ""; position: absolute; inset: 0; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(180deg, rgba(17,27,46,.2), var(--bg)); }
video.scan { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--r); background: #000; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ============================================================
   성탄 꾸밈 (성도 화면) : 밤하늘 · 금빛 별 · 표어 조각 · 교환권
   ============================================================ */
body.member {
  background-color: var(--bg);
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 78% 9%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 63% 41%, rgba(255,240,200,.45), transparent 60%),
    radial-gradient(1px 1px at 28% 67%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 88% 78%, rgba(255,255,255,.35), transparent 60%),
    linear-gradient(180deg, #1d2b33 0%, #142235 45%, var(--bg) 100%);
  background-attachment: fixed;
}
.member .btn:not(.line):not(.quiet) {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 55%, #e2b75a); color: #111a2c;
  box-shadow: 0 6px 18px rgba(243,207,122,.25), inset 0 1px 0 rgba(255,255,255,.6); }
.member .btn svg { width: 28px; height: 28px; flex: 0 0 28px; }
.member .card { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.member .card.gold { border-color: rgba(243,207,122,.35); background: linear-gradient(180deg, rgba(243,207,122,.10), rgba(243,207,122,.03)); }
.member .card.paper { background: linear-gradient(180deg, #fbf8ef, #efe6cf); border: 0; }
.member .sheet { background: linear-gradient(180deg, #1b2a45, #111c30); border-top-color: rgba(243,207,122,.28); animation: sheetUp .35s ease both; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.member .modal { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }

/* 시작 화면 */
.welcome { position: relative; max-width: 520px; margin: 0 auto; overflow: hidden; padding-bottom: 8px;
  background: linear-gradient(180deg, #1d2b33 0%, #1d2b33 60%, rgba(29,43,51,0) 100%); }
.welcome .photo { position: relative; aspect-ratio: 572 / 900; max-height: 78vh; background: center top / cover no-repeat; }
.welcome .photo::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(180deg, rgba(10,18,32,.45) 0%, rgba(10,18,32,0) 18%, rgba(29,43,51,0) 55%, #1d2b33 100%); }
.welcome .glow { position: absolute; left: 49.8%; top: 14.4%; width: 150px; height: 150px; margin: -75px 0 0 -75px; z-index: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,240,190,.75) 0%, rgba(255,227,158,.25) 30%, rgba(255,227,158,0) 70%); animation: glowPulse 2.6s ease-in-out infinite; }
@keyframes glowPulse { 0%,100% { opacity: .8; transform: scale(1); } 50% { opacity: 1; transform: scale(1.18); } }
.welcome .pill { position: absolute; top: 16px; left: 16px; z-index: 2; background: rgba(255,255,255,.92); color: #13213a;
  font-weight: 800; font-size: 18px; padding: 8px 16px; border-radius: 99px; }
.welcome .body { position: relative; z-index: 2; margin-top: -40%; padding: 0 16px; text-align: center; }
.welcome .title { font-family: var(--serif); font-size: 38px; line-height: 1.25; color: var(--gold-bright); margin: 8px 0;
  text-shadow: 0 2px 16px rgba(0,0,0,.6), 0 0 22px rgba(243,207,122,.25); }
.welcome .lead { font-size: 20px; }

/* 표어 조각 */
.motto { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.motto .piece { position: relative; min-width: 96px; padding: 8px 16px; border-radius: 12px; text-align: center;
  font-family: var(--serif); font-weight: 800; font-size: 22px; line-height: 1.3;
  border: 1.5px dashed rgba(255,255,255,.28); color: transparent; background: rgba(14,23,38,.45); }
.motto .piece .ph { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 18px; font-weight: 700; color: var(--dim); }
.motto .piece.on { color: var(--gold-bright); border: 1.5px solid rgba(243,207,122,.55);
  background: radial-gradient(ellipse at 50% 120%, rgba(243,207,122,.28), rgba(243,207,122,.06)); text-shadow: 0 0 14px rgba(243,207,122,.55); }
.motto .piece.on .ph { display: none; }
.motto .piece.just { animation: pieceIn 1.1s cubic-bezier(.2,.9,.2,1.2) both; }
@keyframes pieceIn { 0% { transform: scale(.4) translateY(14px); opacity: 0; filter: blur(4px); } 60% { transform: scale(1.12); opacity: 1; filter: none; } 100% { transform: scale(1); } }

/* 진행 */
.progress-text { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 18px; }
.progress-text b { color: var(--gold-bright); font-size: 24px; }
.member .bar { height: 14px; border-radius: 99px; background: rgba(255,255,255,.12); }
.member .bar > i { background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright)); border-radius: 99px; }

/* 장소 줄의 별 */
.member .place { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.member .place.done { border-color: rgba(243,207,122,.5); }
.member .place .state svg { width: 30px; height: 30px; }
.member .place.done .state { background: radial-gradient(circle at 50% 40%, #fff3c9, var(--gold) 55%, var(--gold-deep)); border-color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(243,207,122,.5); }

/* 별 도장 */
.stamp-fx { position: relative; width: 168px; height: 168px; margin: 0 auto; }
.stamp-fx .ring { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 50%; border: 3px solid var(--gold); opacity: 0; animation: ring 1.1s .35s ease-out both; }
.stamp-fx .star { position: absolute; top: 16px; right: 16px; bottom: 16px; left: 16px; animation: stampDown .75s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes stampDown { 0% { transform: scale(2.6) rotate(-30deg); opacity: 0; } 70% { transform: scale(.9) rotate(4deg); opacity: 1; } 100% { transform: none; } }
@keyframes ring { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.big-title { font-family: var(--serif); color: var(--gold-bright); font-size: 30px; }

/* 완주 · 교환권 */
.celebrate { text-align: center; }
.celebrate svg { width: 56px; height: 56px; margin: 0 auto 8px; display: block; }
.ticket { position: relative; overflow: hidden; text-align: center; border-radius: var(--r); padding: 24px;
  background: linear-gradient(180deg, #fbf8ef, #efe6cf); color: #111a2c; }
.ticket::before, .ticket::after { content: ""; position: absolute; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; background: #142235; }
.ticket::before { left: -13px; } .ticket::after { right: -13px; }
.ticket .t-label { color: #8a5d00; font-weight: 800; font-size: 18px; }
.ticket .t-code { font-size: 36px; font-weight: 900; letter-spacing: .12em; font-family: "SF Mono", Menlo, Consolas, monospace; margin: 4px 0 8px; }
.ticket .barcode { height: 64px; max-width: 320px; margin: 0 auto 8px; }
.ticket .barcode svg { width: 100%; height: 100%; display: block; }
.ticket p { color: #374057; font-weight: 700; }
.ticket .t-done { position: absolute; right: 16px; top: 16px; transform: rotate(-12deg); border: 3px solid #2f7d4b; color: #2f7d4b;
  font-weight: 900; font-size: 20px; padding: 4px 12px; border-radius: 10px; background: rgba(255,255,255,.6); }
.ticket.used .t-code, .ticket.used .barcode { opacity: .35; }
.gift-ico { width: 72px; height: 72px; margin: 0 auto; display: block; }

.loading .twinkle { width: 56px; height: 56px; animation: twinkle 1.4s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { transform: scale(.85); opacity: .6; } 50% { transform: scale(1.1); opacity: 1; } }
.loading { flex-direction: column; gap: 16px; }
