/* 신통 운명사주 — 규칙은 design-system.md. 색은 config.json theme 값이 :root 변수로 덮어씀 */
:root {
  --bg: #0a0e1f; --bg-deep: #070a17; --surface: #1b2134; --surface2: #272e44;
  --line: rgba(255,255,255,.14); --text: #f5f1ea; --muted: #9ba1b5; --faint: #5d6378;
  --primary: #d63a5a; --primary-hi: #ef4d6d; --primaryText: #ffffff; --ivory: #f3efe8; --accent: #ef4d6d;
  --wood: #2f7d5b; --fire: #d63a5a; --earth: #c69a32; --metal: #6b7387; --water: #26346e;
  --font: "Pretendard Variable", Pretendard, "Malgun Gothic", system-ui, sans-serif;
  --serif: "Nanum Myeongjo", "Noto Serif KR", "Noto Serif CJK KR", "Source Han Serif K", "AppleMyungjo", "Batang", serif;
  --pad: 24px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: break-word; }
body { min-height: 100vh; display: flex; justify-content: center; }
.app { width: 100%; max-width: 480px; min-height: 100vh; position: relative; background: var(--bg); overflow-x: clip; }
@media (min-width: 600px) { body { background: #04060d; } .app { box-shadow: 0 0 90px rgba(0,0,0,.6); } }
[data-c] { white-space: pre-line; }
img, video { display: block; }
button { font-family: inherit; -webkit-tap-highlight-color: transparent; }
.screen { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; position: relative; animation: screenIn .4s ease-out both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .55s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* 버튼 */
.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 60px; padding: 14px 20px; border: 0; border-radius: 16px; font: 700 17px/1.35 var(--font); letter-spacing: -0.01em; cursor: pointer; text-align: center; transition: transform .15s ease-out, background-color .2s ease-out, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: var(--primaryText); }
.btn.primary:hover { background: #c93352; }
.btn:disabled { background: #2b2f42; color: rgba(245,241,234,.4); cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.bar { border-radius: 0; min-height: 76px; padding-bottom: calc(14px + var(--safe-b)); font-size: 18px; position: sticky; bottom: 0; z-index: 3; }

/* 알약 선택지 */
.pill { min-height: 56px; padding: 12px 22px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font: 600 17px/1.3 var(--font); cursor: pointer; transition: background-color .2s ease-out, color .2s ease-out, transform .15s ease-out; }
.pill:active { transform: scale(.98); }
.pill.on { background: var(--ivory); color: var(--bg); border-color: transparent; }
.pills { display: flex; gap: 10px; }
.pills .pill { flex: 1; }

/* 진행 막대 */
.progress { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.14); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 2px; transition: width .5s ease-out; }
.back { flex: none; width: 36px; height: 36px; margin-left: -6px; border: 0; background: transparent; position: relative; cursor: pointer; }
.back::before { content: ""; position: absolute; left: 10px; top: 50%; width: 12px; height: 12px; border-left: 2px solid var(--text); border-bottom: 2px solid var(--text); transform: translateY(-50%) rotate(45deg); }
.back::after { content: ""; position: absolute; left: 10px; top: 50%; width: 18px; height: 2px; background: var(--text); transform: translateY(-50%); }

/* ---------- 랜딩 ---------- */
.landing { justify-content: flex-end; }
.landing-hero { position: absolute; top: 0; left: 0; right: 0; height: 70%; overflow: hidden; }
.landing-img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.landing-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,14,31,0) 48%, rgba(10,14,31,.75) 78%, var(--bg) 100%); }
.landing-body { position: relative; z-index: 1; padding: 0 var(--pad) calc(28px + var(--safe-b)); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.display-title { margin: 0; font: 700 31px/1.32 var(--serif); letter-spacing: -0.03em; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.landing-sub { margin: 0; font: 500 19px/1.5 var(--serif); color: var(--text); }
.landing-tags { margin: 2px 0 18px; font-size: 14px; color: var(--muted); letter-spacing: .02em; }

/* ---------- 질문 ---------- */
.q-screen { padding: 0 var(--pad) calc(32px + var(--safe-b)); overflow: hidden; }
.q-bg { position: absolute; top: 0; left: 0; right: 0; height: 56%; }
.q-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,14,31,.15) 0%, rgba(10,14,31,.55) 55%, var(--bg) 100%); }
.q-corner { position: absolute; top: 72px; right: 0; width: 58%; max-width: 300px; height: 300px; pointer-events: none; -webkit-mask-image: radial-gradient(ellipse 100% 100% at 100% 0%, #000 22%, rgba(0,0,0,.45) 48%, transparent 72%); mask-image: radial-gradient(ellipse 100% 100% at 100% 0%, #000 22%, rgba(0,0,0,.45) 48%, transparent 72%); opacity: .8; }
.q-corner .cover-img { object-position: 100% 0%; }
/* 진행 막대 아래에서 시작: 윗가장자리를 배경색으로 부드럽게 녹임 */
.q-corner::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 56px; background: linear-gradient(180deg, var(--bg) 0%, rgba(10,14,31,0) 100%); }
.q-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 14px; height: 64px; padding-top: 8px; }
.q-body { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; }
.q-title { margin: 0; font: 700 30px/1.38 var(--serif); letter-spacing: -0.03em; text-shadow: 0 2px 14px rgba(0,0,0,.5); }
.q-stack .q-title { margin: auto 0; text-align: center; padding: 0 8px; }
.q-stack .q-opts { display: flex; flex-direction: column; gap: 14px; }
.q-stack .pill { min-height: 64px; font-size: 18px; }
.q-chips .q-title { margin: 56px 0 30px; max-width: 300px; }
/* 선택지가 많을 때: 한 줄에 하나씩 */
.q-chips .q-opts { display: flex; flex-direction: column; gap: 12px; }
.q-chips .pill { width: 100%; padding: 12px 22px; }

/* ---------- 장면 ---------- */
.story { overflow: hidden; }
.story-bg { position: absolute; inset: 0; }
.story-bg .cover-img { object-position: 50% 40%; }
.story-a .story-bg { top: 18%; }
.story-a .story-bg .cover-img { object-position: 50% 0%; }
.story-a .story-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--bg) 0%, rgba(10,14,31,0) 14%, rgba(10,14,31,0) 50%, rgba(10,14,31,.75) 68%, var(--bg) 86%); }
.st-top { position: relative; padding: 52px var(--pad) 0; text-align: center; }
.st-title { margin: 0; font: 700 32px/1.32 var(--serif); letter-spacing: -0.03em; text-shadow: 0 2px 20px rgba(0,0,0,.7); }
.st-bottom { position: relative; margin-top: auto; padding: 0 var(--pad) calc(28px + var(--safe-b)); display: flex; flex-direction: column; gap: 28px; text-align: center; }
.st-para { display: flex; flex-direction: column; gap: 2px; }
.st-line { margin: 0; font: 500 19px/1.6 var(--serif); text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.story-b .story-bg { bottom: auto; height: 68%; }
.story-b .story-bg .cover-img { object-position: 50% 25%; }
.story-b .story-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,14,31,0) 55%, rgba(10,14,31,.8) 85%, var(--bg) 100%); }
.st-text { position: relative; margin-top: auto; padding: 0 var(--pad) 36px; }
.story-b .st-line { text-align: left; font-size: 20px; }
.st-big { margin: 16px 0 0; font: 700 31px/1.3 var(--serif); letter-spacing: -0.03em; }

/* ---------- 입력 동기 ---------- */
.custom { padding: 40px var(--pad) calc(28px + var(--safe-b)); }
.avatar-lg { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; background: var(--surface); }
/* 담백하게: 왼쪽 정렬, 번호는 큰 빨간 숫자 대신 본문과 같은 크기의 회색 — 가는 선으로만 나눔 */
.custom .avatar-lg { align-self: center; width: 84px; height: 84px; }
/* 상담가 얼굴 + 제목 2줄은 가운데 정렬 (기획 요청), 아래 3가지 목록은 왼쪽 정렬 유지 */
.c-title { margin: 28px 0 0; text-align: center; font: 700 29px/1.38 var(--serif); font-size: min(29px, 7vw); letter-spacing: -0.03em; word-break: keep-all; }
.c-title-line { display: block; word-break: keep-all; }
.reasons { margin: 36px 0 0; display: flex; flex-direction: column; border-top: 1px solid rgba(255,255,255,.09); }
.reason { margin: 0; padding: 17px 2px; border-bottom: 1px solid rgba(255,255,255,.09); font: 500 18px/1.5 var(--serif); color: rgba(245,241,234,.9); letter-spacing: -0.01em; }
.reason::first-letter { color: var(--muted); font-weight: 400; margin-right: 6px; }
.c-foot { margin-top: auto; padding-top: 36px; display: flex; flex-direction: column; gap: 22px; }
.c-note { margin: 0; color: var(--muted); font: 500 15px/1.5 var(--serif); }

/* ---------- 정보 입력 (토스식) ---------- */
.input-screen { overflow: hidden; }
.in-bg { position: absolute; top: 0; left: 0; right: 0; height: 60%; }
.in-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,14,31,.45) 0%, rgba(10,14,31,.6) 60%, var(--bg) 100%); }
.in-top { position: relative; z-index: 2; display: flex; align-items: center; height: 56px; padding: 8px var(--pad) 0; }
.stack { position: relative; z-index: 1; flex: 1; min-height: 120px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 16px var(--pad) 18px; overflow: hidden; }
.stack-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 11px 16px; border: 0; border-radius: 14px; background: rgba(10,14,31,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--text); text-align: left; cursor: pointer; animation: rise .35s ease-out both; }
.stack-row .sl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stack-row .sv { font-size: 15px; font-weight: 700; white-space: nowrap; }
.sheet { position: relative; z-index: 2; background: linear-gradient(180deg, #1e2539 0%, #111628 100%); border-radius: 28px 28px 0 0; box-shadow: 0 -16px 40px rgba(0,0,0,.35); padding: 30px var(--pad) calc(24px + var(--safe-b)); }
.sheet-in { display: flex; flex-direction: column; gap: 14px; animation: sheetIn .35s ease-out both; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.hint { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.hint.interlude { color: var(--primary-hi); font-weight: 700; }
.sheet-q { margin: 0 0 6px; font: 700 27px/1.35 var(--serif); letter-spacing: -0.03em; }
.field { width: 100%; height: 64px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font: 600 22px/1 var(--font); letter-spacing: .04em; text-align: center; outline: none; color-scheme: dark; transition: border-color .2s; }
.field:focus { border-color: rgba(255,255,255,.4); }
.field::placeholder { color: var(--faint); }
.field:disabled { opacity: .45; }
.name-note { margin: -4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }
.error-line { margin: 0; color: #ff8a9b; font-size: 13px; }

/* ---------- 분석 중 ---------- */
.loading-screen { padding: 20px var(--pad) calc(40px + var(--safe-b)); background: radial-gradient(ellipse 70% 30% at 90% 12%, rgba(70,82,140,.22), transparent 70%), radial-gradient(ellipse 60% 25% at 0% 68%, rgba(70,82,140,.16), transparent 70%), radial-gradient(ellipse 70% 25% at 100% 92%, rgba(70,82,140,.14), transparent 70%), var(--bg); }
.seg3 { display: flex; gap: 10px; padding-top: 16px; }
.seg3 i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.16); position: relative; overflow: hidden; }
.seg3 i::after { content: ""; position: absolute; inset: 0; background: var(--ivory); border-radius: 2px; transform: scaleX(0); transform-origin: left center; }
.seg3 i.run::after { animation: fill 2.3s linear forwards; }
.seg3 i.done::after { transform: scaleX(1); }
@keyframes fill { to { transform: scaleX(1); } }
.ld-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.ld-line-box { min-height: 120px; }
.ld-line { margin: 0; text-align: center; font: 700 22px/1.45 var(--serif); letter-spacing: -0.02em; animation: rise .45s ease-out both; }
.ld-line .v { color: var(--primary-hi); }

/* 사주 타일 */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.loading-screen .tiles { max-width: 320px; }
/* 사주 타일 — 달빛 판타지 톤: 오행 색 바탕 위 위쪽 달빛 번짐 + 라벤더 그늘 + 은은한 빛 테두리, 오른쪽 위 작은 초승달 */
.tile, .mini-tile { --tc: var(--metal); position: relative; overflow: hidden; color: #fff; background-color: var(--tc);
  background-image: radial-gradient(120% 75% at 50% -12%, rgba(255,236,248,.46) 0%, rgba(255,236,248,0) 62%), linear-gradient(172deg, rgba(255,255,255,0) 38%, rgba(52,30,92,.5) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,232,246,.3), 0 0 20px -6px var(--tc), 0 8px 20px -12px rgba(190,160,255,.55); }
.tile::before, .mini-tile::before { content: ""; position: absolute; top: 7px; right: 8px; width: 9px; height: 9px; border-radius: 50%; box-shadow: -2.5px 1.5px 0 0 rgba(255,242,250,.62); pointer-events: none; }
.tile { aspect-ratio: 1 / 1; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tile-h { font: 700 34px/1 var(--serif); text-shadow: 0 0 14px rgba(255,226,244,.55); }
.tile-k { margin-top: 6px; font-size: 12px; font-weight: 600; opacity: .92; }
.el-wood { --tc: var(--wood); } .el-fire { --tc: var(--fire); } .el-earth { --tc: var(--earth); } .el-metal { --tc: var(--metal); } .el-water { --tc: var(--water); }
.tile.unknown { background: rgba(255,236,248,.04); box-shadow: none; border: 1.5px dashed rgba(255,232,246,.38); color: rgba(255,255,255,.75); }
.tile.unknown::before { display: none; }
.tiles.pop .tile { animation: tilePop .45s ease-out both; }
@keyframes tilePop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.pair { display: flex; align-items: center; }
/* 두 타일 사이: 달빛 실 + 가운데 작은 달 */
.pair .link { position: relative; width: 44px; height: 1.5px; background: linear-gradient(90deg, rgba(255,226,244,.25), rgba(255,236,248,.9), rgba(255,226,244,.25)); }
.pair .link::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fdf0f7; box-shadow: 0 0 10px 3px rgba(255,200,232,.55); }
.mini-tile { width: 72px; height: 72px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mini-tile b { font: 700 30px/1 var(--serif); text-shadow: 0 0 14px rgba(255,226,244,.55); }
.mini-tile small { margin-top: 5px; font-size: 11.5px; font-weight: 600; }
.pop-pair .mini-tile { width: 104px; height: 104px; border-radius: 22px; animation: tilePop .5s ease-out both; }
.pop-pair .mini-tile b { font-size: 46px; }
.pop-pair .mini-tile small { font-size: 13px; margin-top: 8px; }
.pop-pair .mini-tile::before { top: 10px; right: 12px; width: 12px; height: 12px; box-shadow: -3px 2px 0 0 rgba(255,242,250,.62); }
.pop-pair .mini-tile:last-child { animation-delay: .25s; }
.pop-pair .link { width: 56px; transform-origin: left center; animation: grow .6s ease-out .45s both; }
.pop-pair .link::after { animation: moonIn .4s ease-out 1.05s both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes moonIn { from { opacity: 0; } to { opacity: 1; } }
/* 달빛 배경 무대 (무료 결과 일간 타일) */
.moon-stage { position: relative; display: flex; justify-content: center; padding: 24px 0; margin: 0 calc(var(--pad) * -1) 4px; }
.moon-bg { position: absolute; inset: 0; overflow: hidden; opacity: .75; -webkit-mask-image: radial-gradient(ellipse 62% 70% at 50% 50%, #000 30%, transparent 100%); mask-image: radial-gradient(ellipse 62% 70% at 50% 50%, #000 30%, transparent 100%); }
.moon-bg .cover-img { object-position: 50% 7%; }
.moon-stage .pair { position: relative; z-index: 1; margin: 0; }

/* ---------- 무료 결과 ---------- */
.free { padding: 0; }
.fr-hero { position: relative; height: 56vh; height: 56svh; min-height: 380px; max-height: 600px; overflow: hidden; }
.free-a .fr-hero .cover-img { object-position: 50% 30%; }
.fr-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,14,31,.8) 0%, rgba(10,14,31,.15) 28%, rgba(10,14,31,.1) 48%, rgba(10,14,31,.7) 78%, var(--bg) 100%); }
.fr-title { position: absolute; z-index: 1; left: var(--pad); right: var(--pad); top: 40px; margin: 0; text-align: center; font: 700 25px/1.42 var(--serif); letter-spacing: -0.03em; text-shadow: 0 2px 16px rgba(0,0,0,.7); }
/* case1: 제목은 그림 위 별도 칸, 그림은 그 아래부터 */
.fr-head { position: relative; z-index: 1; padding: 40px var(--pad) 0; }
.fr-head .fr-title { position: relative; left: auto; right: auto; top: auto; }
.free-a .fr-hero { margin-top: -4px; height: 52vh; height: 52svh; min-height: 360px; max-height: 560px; }
.free-a .fr-hero::after { background: linear-gradient(180deg, var(--bg) 0%, rgba(10,14,31,.12) 20%, rgba(10,14,31,.1) 48%, rgba(10,14,31,.7) 78%, var(--bg) 100%); }
.fr-prob { position: relative; z-index: 1; text-align: center; padding: 0 var(--pad); }
.free-a .fr-prob { position: absolute; left: 0; right: 0; bottom: 18px; }
.fr-prob-label { margin: 0; font: 600 19px/1.4 var(--serif); text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.fr-big { margin: 6px 0 0; font: 700 76px/1 var(--serif); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; text-shadow: 0 4px 24px rgba(0,0,0,.55); }
.free-b .fr-hero { height: 52vh; height: 52svh; min-height: 360px; }
.free-b .fr-hero::after { background: linear-gradient(180deg, rgba(10,14,31,0) 30%, rgba(10,14,31,.7) 72%, var(--bg) 100%); }
.free-b .fr-title { top: auto; bottom: 18px; }
.free-b .fr-prob { padding-top: 22px; }
.fr-body { padding: 12px var(--pad) 8px; display: flex; flex-direction: column; gap: 10px; }
.free-b .fr-body { align-items: center; text-align: center; }
.fr-body .pair { margin-bottom: 12px; }
.fr-line { margin: 0; font-size: 17px; line-height: 1.65; color: rgba(245,241,234,.92); }
.fr-line .v, .s2-line .v, .pd-p .v, .qa-a .v { font-weight: 700; color: var(--text); }
.fr-date { margin: 18px 0 0; font: 700 18px/1.5 var(--serif); white-space: nowrap; overflow: hidden; max-width: 100%; padding: 2px 8px 2px 0; letter-spacing: -0.02em; }
.free-b .fr-date { padding-left: 8px; }
.month-blur { display: inline-block; padding: 0 3px; color: var(--primary-hi); filter: blur(5px); user-select: none; -webkit-user-select: none; }
.mask { display: inline-block; color: var(--primary-hi); filter: blur(3.5px); transform: scale(1.2); margin: 0 2px; user-select: none; }
.cta-bar { position: sticky; bottom: 0; z-index: 5; margin-top: auto; padding: 24px 16px calc(16px + var(--safe-b)); background: linear-gradient(180deg, rgba(10,14,31,0) 0%, var(--bg) 24px); }

/* ---------- 결제 전 페이지 ---------- */
.paywall { padding: 0; }
.paywall .chip, .paid .chip { align-self: flex-start; display: inline-block; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); font: 600 13px/1.2 var(--serif); }
/* 큰 문장이 위, 그림은 그 아래부터 (겹치지 않게). 그림 높이는 화면 높이에 맞춰 '두 사람의 사주' 첫 줄이 가격 바 위로 보이게 */
.pw-s1 { position: relative; width: 100%; display: flex; flex-direction: column; overflow: hidden; }
.s1-text { position: relative; z-index: 1; margin: 0; padding: 24px var(--pad) 0; text-align: center; font: 700 35px/1.3 var(--serif); letter-spacing: -0.03em; text-shadow: 0 2px 20px rgba(0,0,0,.65); }
/* 그림 높이: 화면 높이에 맞춰 '두 사람의 사주' 두 줄 타일이 가격 바 위로 통째로 보이게 */
.s1-art { position: relative; margin-top: -6px; height: 240px; height: clamp(220px, calc(100svh - 610px), 420px); overflow: hidden; }
.s1-art .cover-img { object-position: 50% 82%; }
.s1-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--bg) 0%, rgba(10,14,31,0) 24%, rgba(10,14,31,0) 62%, rgba(10,14,31,.75) 84%, var(--bg) 100%); }
.s1-text .acc { color: var(--primary-hi); }
.s1-text .mask { filter: blur(5px); }
/* 안내 문구: 그림 아래 배경색 바탕 위 */
.s1-note { position: relative; z-index: 1; margin: -2px 0 0; padding: 0 var(--pad); text-align: center; color: rgba(245,241,234,.82); font: 500 16px/1.5 var(--serif); text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.pw-sec { position: relative; padding: 64px var(--pad) 0; }
.sec-h { margin: 0 0 24px; font: 700 26px/1.35 var(--serif); letter-spacing: -0.03em; }
.sec-h.underline { display: inline-block; padding-bottom: 12px; position: relative; margin-bottom: 20px; }
.sec-h.underline::after { content: ""; position: absolute; left: 0; bottom: 0; width: 48px; height: 3px; border-radius: 2px; background: var(--primary); }
.pw-sec.pw-s2 { padding-top: 32px; }
.pw-s2 .sec-h { margin-bottom: 18px; }
.pw-s2 > *:not(.s2-moon) { position: relative; z-index: 1; }
.s2-moon { position: absolute; left: 0; right: 0; top: 0; bottom: 0; overflow: hidden; opacity: .55; -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 70%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 70%, transparent 100%); }
.s2-moon .cover-img { object-position: 50% 20%; }
/* 문구 속 큰 숫자(예: 13800명) 올라가는 칸: 폭 고정으로 줄이 흔들리지 않게 */
.count-num { display: inline-block; text-align: right; font-variant-numeric: tabular-nums; color: var(--primary-hi); font-weight: 700; }
.who { margin: 0 0 12px; padding: 10px 16px; border-radius: 12px; background: rgba(255,255,255,.08); font: 600 16px/1.4 var(--serif); }
.tiles + .who { margin-top: 28px; }
.s2-line { margin: 28px 0 0; font: 500 19px/1.55 var(--serif); }
/* 문구 첫 단락: 화면에 들어오면 한 줄씩 로즈 밑줄이 왼쪽에서 그어짐 (한 번만) */
.s2-line .ln.ul { background-image: linear-gradient(var(--primary-hi), var(--primary-hi)); background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 2px; padding-bottom: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-size .7s ease-out; }
.s2-line.is-on .ln.ul { background-size: 100% 2px; }
/* 두 사주가 서로 반응: 일주 칸끼리 달빛 실 + 초승달 + 빛 물결 한 번 + 궤도 + 작은 별빛 (반복 없음) */
.s2-duo { position: relative; }
.s2-duo .tiles + .who-b { margin: 12px 0 0; }
.s2-react { position: relative; height: 96px; --dx: calc((100% - 30px) / 8 * 3 + 10px); pointer-events: none; }
.s2-react i { position: absolute; display: block; }
.s2-thread { left: var(--dx); top: 0; bottom: 0; width: 2px; margin-left: -1px; border-radius: 1px; background: linear-gradient(180deg, rgba(255,226,244,.35), rgba(255,240,250,.95) 50%, rgba(255,226,244,.35)); box-shadow: 0 0 8px rgba(255,200,232,.55); transform: scaleY(0); transform-origin: 50% 0; transition: transform .8s ease-out; }
.s2-moon { left: var(--dx); top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 36% 34%, #fff 0%, #fdf0f7 45%, #e6d6f2 100%); box-shadow: 0 0 14px 4px rgba(255,200,232,.5), 0 0 34px 8px rgba(190,160,255,.3); opacity: 0; transform: scale(.4); transition: opacity .5s ease-out .5s, transform .5s ease-out .5s; }
.s2-moon::after { content: ""; position: absolute; top: -4px; left: 8px; width: 100%; height: 100%; border-radius: 50%; background: #161c36; }
.s2-ring { left: var(--dx); top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 1.5px solid rgba(255,226,244,.85); opacity: 0; }
.s2-orbit { left: var(--dx); top: 50%; width: 180px; height: 34px; margin: -17px 0 0 -90px; border-radius: 50%; border: 1px dashed rgba(255,226,244,.34); opacity: 0; transform: rotate(-8deg) scale(.6); transition: opacity .7s ease-out .85s, transform .7s ease-out .85s; }
.s2-spark { width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #fdf0f7; box-shadow: 0 0 6px 2px rgba(255,200,232,.6); opacity: 0; transform: scale(.3); transition: opacity .5s ease-out, transform .5s ease-out; }
.s2-spark.a { left: calc(var(--dx) + 78px); top: 36%; transition-delay: 1.05s; }
.s2-spark.b { left: calc(var(--dx) - 72px); top: 64%; transition-delay: 1.2s; }
.s2-spark.c { left: calc(var(--dx) + 34px); top: 80%; width: 3px; height: 3px; transition-delay: 1.35s; }
.s2-duo .s2-tiles .tile:nth-child(4n+2) { transition: box-shadow .7s ease-out 1s, filter .7s ease-out 1s; }
.s2-duo .s2-tiles ~ .s2-tiles .tile:nth-child(4n+2) { transition-delay: 1.15s; }
.s2-duo.is-on .s2-thread { transform: scaleY(1); }
.s2-duo.is-on .s2-moon { opacity: 1; transform: none; }
.s2-duo.is-on .s2-ring { animation: s2Ring 1.2s ease-out .95s both; }
.s2-duo.is-on .s2-orbit { opacity: 1; transform: rotate(-8deg); }
.s2-duo.is-on .s2-spark { opacity: .85; transform: none; }
.s2-duo.is-on .s2-tiles .tile:nth-child(4n+2) { box-shadow: inset 0 0 0 1.5px rgba(255,240,250,.85), 0 0 26px 2px rgba(255,200,232,.5), 0 8px 20px -12px rgba(190,160,255,.55); filter: brightness(1.12); }
@keyframes s2Ring { 0% { opacity: 0; transform: scale(1); } 15% { opacity: .9; } 100% { opacity: 0; transform: scale(3.4); } }
.band { margin: 0 calc(var(--pad) * -1) 40px; padding: 14px var(--pad); text-align: center; color: var(--muted); font: 600 17px/1.4 var(--serif); background: linear-gradient(90deg, transparent, rgba(255,255,255,.07) 18%, rgba(255,255,255,.07) 82%, transparent); }
.qa-item + .qa-item { margin-top: 44px; }
.qa-q { margin: 0 0 12px; font: 700 22px/1.4 var(--serif); letter-spacing: -0.02em; }
.qa-a { margin: 0; font-size: 17px; line-height: 1.75; color: rgba(245,241,234,.92); }
.blur { filter: blur(5px); opacity: .75; user-select: none; -webkit-user-select: none; }
.blur .mask { filter: none; transform: none; }
.chapters { margin: 0 calc(var(--pad) * -1); }
.ch-card { position: relative; height: 232px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 var(--pad) 22px; }
.ch-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,14,31,.85) 0%, rgba(10,14,31,.45) 55%, rgba(10,14,31,.05) 100%), linear-gradient(180deg, rgba(10,14,31,0) 50%, rgba(10,14,31,.6) 100%); }
.ch-card > *:not(.cover-img) { position: relative; z-index: 1; }
.ch-card .chip { margin-bottom: 8px; }
/* 가장 인기 있는 챕터 강조: 포인트 색 띠 + 얇은 테두리 */
.ch-card.is-best::before { content: ""; position: absolute; inset: 0; z-index: 2; border: 2px solid var(--primary-hi); pointer-events: none; }
.ch-card > .best-badge { position: absolute; z-index: 3; top: 16px; left: var(--pad); padding: 7px 14px; border-radius: 999px; background: var(--primary); color: #fff; font: 700 13px/1.2 var(--serif); letter-spacing: -0.01em; box-shadow: 0 4px 16px rgba(214,58,90,.4); }
.ch-title { margin: 0 0 8px; font: 700 21px/1.38 var(--serif); letter-spacing: -0.02em; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.ch-blur { margin: 0; font-size: 14px; line-height: 1.6; color: rgba(245,241,234,.85); filter: blur(4px); user-select: none; -webkit-user-select: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ch-rows { padding-top: 20px; }
.ch-row { display: flex; align-items: center; gap: 10px; padding: 13px 0; font: 600 17px/1.4 var(--serif); }
.ch-no { flex: none; min-width: 22px; color: var(--muted); font-size: 14px; }
.ch-t { flex: 1; }
.lock { flex: none; position: relative; width: 14px; height: 17px; opacity: .8; }
.lock::before { content: ""; position: absolute; left: 2px; top: 0; width: 10px; height: 9px; border: 2px solid var(--muted); border-bottom: 0; border-radius: 6px 6px 0 0; box-sizing: border-box; }
.lock::after { content: ""; position: absolute; left: 0; bottom: 0; width: 14px; height: 10px; border-radius: 3px; background: var(--muted); }
.pw-s5 { position: relative; margin-top: 56px; padding: 72px var(--pad); overflow: hidden; }
.sec-bg { position: absolute; inset: 0; }
.sec-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--bg) 0%, rgba(10,14,31,.25) 22%, rgba(10,14,31,.25) 78%, var(--bg) 100%); }
/* 체크 목록 구간: 한옥 그림 위에 짙은 남색 막을 깔아 글자 대비 확보 (그림은 은은하게만) */
.pw-s5 .sec-bg::after { background: linear-gradient(180deg, var(--bg) 0%, rgba(10,14,31,.9) 18%, rgba(10,14,31,.9) 82%, var(--bg) 100%); }
.checks { position: relative; display: flex; flex-direction: column; gap: 18px; }
.check-line { position: relative; margin: 0; padding-left: 32px; font: 600 18px/1.5 var(--serif); text-shadow: 0 2px 14px rgba(0,0,0,.6); }
.check-line::before { content: ""; position: absolute; left: 6px; top: 4px; width: 7px; height: 14px; border-right: 2.5px solid var(--primary-hi); border-bottom: 2.5px solid var(--primary-hi); transform: rotate(45deg); }
.pw-s6 { position: relative; height: 290px; margin-top: 16px; overflow: hidden; }
.s6-img { position: absolute; left: -12%; top: 0; width: 72%; height: 100%; object-fit: cover; object-position: 50% 6%; -webkit-mask-image: radial-gradient(closest-side at 50% 45%, #000 58%, transparent 100%); mask-image: radial-gradient(closest-side at 50% 45%, #000 58%, transparent 100%); }
.say { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 58%; margin: 0; padding: 18px 18px; border-radius: 24px; background: rgba(27,33,52,.9); border: 1px solid var(--line); font: 600 17px/1.55 var(--serif); }
.say::before { content: ""; position: absolute; left: -8px; top: 50%; width: 14px; height: 14px; background: rgb(27,33,52); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateY(-50%) rotate(45deg); }
.pw-s7 { position: relative; margin-top: 0; padding: 40px var(--pad) 48px; text-align: center; overflow: hidden; }
/* 가격 구간: 한옥 그림은 아주 은은하게만, 짙은 남색 막으로 글자 대비 확보 */
.pw-s7 .sec-bg .cover-img { opacity: .35; }
.pw-s7 .sec-bg::after { background: rgba(10,14,31,.85); }
.pw-s7 .sec-bg { -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 32%, #000 78%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0%, #000 32%, #000 78%, transparent 100%); }
.btn-t { display: block; }
.price-in { position: relative; display: flex; flex-direction: column; align-items: center; }
.s7-name { margin: 0; font: 700 19px/1.4 var(--serif); }
.s7-list { margin: 18px 0 0; display: flex; gap: 6px; align-items: baseline; color: var(--muted); font: 500 17px/1 var(--serif); }
.s7-orig { text-decoration: line-through; }
.s7-sale { margin: 10px 0 0; display: flex; gap: 12px; align-items: baseline; justify-content: center; }
.s7-off { color: var(--primary-hi); font: 700 44px/1.1 var(--serif); }
.s7-amount { font: 700 44px/1.1 var(--serif); letter-spacing: -0.02em; }
.s7-desc { margin: 14px 0 28px; color: var(--muted); font-size: 14px; line-height: 1.5; }
/* 환불 안내와 약관 링크(2026-12-04 더함) */
.s7-notice { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; text-align: center; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 14px 0 0; font-size: 12.5px; line-height: 1.6; }
.legal-a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.legal-a:hover { text-decoration: underline; }
/* 하단 고정 가격 막대: 페이지와 같은 짙은 남색 불투명, 위쪽만 살짝 그라데이션. 가격 섹션이 보이면 숨김 */
.paybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; width: 100%; max-width: 480px; margin: 0 auto; padding: 10px 16px calc(12px + var(--safe-b)); background: var(--bg); display: flex; flex-direction: row; align-items: center; gap: 14px; transition: transform .3s ease, opacity .3s ease, visibility 0s linear 0s; }
.paybar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 18px; background: linear-gradient(180deg, rgba(10,14,31,0) 0%, var(--bg) 100%); pointer-events: none; }
.paybar.is-hidden { transform: translateY(calc(100% + 28px)); opacity: 0; visibility: hidden; pointer-events: none; transition: transform .3s ease, opacity .3s ease, visibility 0s linear .3s; }
.paybar-static + .paybar { position: sticky; }
.paywall .pw-s7 { padding-bottom: calc(48px + var(--safe-b)); }
.pb-price { flex: none; margin: 0; display: grid; grid-template-columns: auto auto; column-gap: 6px; row-gap: 6px; align-items: baseline; justify-content: start; }
.pb-orig { color: var(--muted); font-size: 13px; line-height: 1; }
.pb-off { color: var(--primary-hi); font: 700 15px/1 var(--serif); }
.pb-sale { grid-column: 1 / -1; font: 700 22px/1 var(--serif); white-space: nowrap; }
.paybar .btn { flex: 1; min-width: 0; width: auto; min-height: 56px; padding: 12px 14px; font-size: 16px; }

/* ---------- 결제 후 감정서 ---------- */
.paid { padding: 0 0 calc(40px + var(--safe-b)); }
.pd-hero { position: relative; height: 56vh; height: 56svh; min-height: 360px; max-height: 560px; overflow: hidden; }
.pd-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,14,31,0) 45%, rgba(10,14,31,.8) 80%, var(--bg) 100%); }
.pd-ch { position: relative; padding: 72px var(--pad) 0; }
.pd-ch.first { margin-top: -110px; padding-top: 0; z-index: 1; }
.pd-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.paid .chip.red { align-self: center; background: var(--primary); color: #fff; }
.pd-title { margin: 0; font: 700 29px/1.35 var(--serif); letter-spacing: -0.03em; }
.pd-block { margin-top: 32px; }
.pd-score { margin-top: 36px; text-align: center; }
.pd-month-label { margin: 22px 0 4px; color: var(--muted); font-size: 14px; }
.pd-month { margin: 0; font: 700 28px/1.3 var(--serif); color: var(--primary-hi); }
.pd-ch-img { position: relative; height: 210px; margin: 24px calc(var(--pad) * -1) 0; overflow: hidden; }
.pd-ch-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--bg) 0%, rgba(10,14,31,0) 20%, rgba(10,14,31,0) 75%, var(--bg) 100%); }
.pd-sub { display: flex; align-items: center; gap: 12px; margin: 34px 0 14px; }
.avatar-sm { flex: none; width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; background: var(--surface); }
.pd-sub-t { margin: 0; font: 700 20px/1.4 var(--serif); letter-spacing: -0.02em; }
.pd-p { margin: 0 0 14px; font-size: 17px; line-height: 1.8; color: rgba(245,241,234,.9); }
.btn.restart { width: auto; margin: 56px var(--pad) 0; }

/* 결제 창 (테스트) */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.6); animation: screenIn .25s ease-out both; }
.modal-card { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 12px; padding: 26px var(--pad) calc(28px + var(--safe-b)); border-radius: 24px 24px 0 0; background: var(--surface); animation: sheetIn .3s ease-out both; }
.modal-card h3 { margin: 0; font: 700 21px/1.4 var(--serif); }
.modal-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.pay-sel { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0 6px; color: var(--text) !important; }
.pay-amount { font: 700 20px/1.2 var(--serif); }

/* 기획이 아직 없는 자리 — 눈에 띄게 */
.todo { outline: 1.5px dashed #ff8fb1; outline-offset: 2px; background-color: rgba(255,92,138,.08); color: #ffb3c9 !important; }

@media (max-height: 700px) {
  .display-title { font-size: 27px; }
  .q-chips .q-title { margin-top: 32px; }
  .reasons { margin-top: 24px; }
  .reason { padding: 13px 2px; }
  .avatar-lg { width: 92px; height: 92px; }
  .custom .avatar-lg { width: 72px; height: 72px; }
  .c-title { font-size: min(26px, 6.8vw); margin-top: 24px; }
  .st-title { font-size: 28px; }
  .st-big { font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
