/* 발도장사주: 크림 바탕 · 코코아 글자 · 인주색 도장. 원소 색은 그림과 카드에만 */
:root {
  --cream: #ffeee6; --paper: #fffbf8; --cocoa: #4a302a; --mute: #75594f; --line: #efcfc3;
  --inju: #c8372d; --inju-d: #a82a21; --blush: #ffd9cf;
  --head: Jua, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --body: 'Gowun Dodum', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--cocoa); font: 16px/1.7 var(--body); word-break: keep-all; overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--head); font-weight: 400; line-height: 1.25; margin: 0; }
h1 { font-size: clamp(42px, 11vw, 76px); }
h1 em { font-style: normal; color: var(--inju); }
h2 { font-size: clamp(28px, 7vw, 40px); }
h3 { font-size: 23px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--inju-d); }
.hidden { display: none !important; }
.center { text-align: center; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
section { padding: 52px 0; }

.nav { position: sticky; top: 0; z-index: 10; background: rgba(255,245,232,.93); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; font: 22px var(--head); color: var(--cocoa); text-decoration: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 12px 26px; border: 0; border-radius: 999px; background: var(--inju); color: #fff; font: 19px var(--head); text-decoration: none; cursor: pointer; box-shadow: 0 5px 0 var(--inju-d); transition: transform .12s, box-shadow .12s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--inju-d); }
.btn:focus-visible { outline: 3px solid var(--cocoa); outline-offset: 3px; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-lg { min-height: 60px; font-size: 21px; }
.btn-sm { min-height: 38px; padding: 6px 16px; font-size: 15px; box-shadow: 0 3px 0 var(--inju-d); }
.btn-block { width: 100%; }
.btn-soon { background: var(--cocoa); box-shadow: 0 5px 0 #2b1b17; }

.hero { padding-top: 34px; }
.hero .wrap { display: grid; gap: 34px; align-items: center; }
.eyebrow { margin: 0 0 8px; color: var(--inju-d); font: 16px var(--head); }
.lead { font-size: 17.5px; margin: 16px 0 24px; }
.ok { color: var(--mute); font-size: 14px; margin: 18px 0 0; }
.herocard { margin: 0 auto; width: min(100%, 400px); }
.herocard img { border-radius: 26px; box-shadow: 0 26px 50px -22px rgba(74,48,42,.45); transform: rotate(2deg); }
figcaption { text-align: center; color: var(--mute); font-size: 13.5px; margin-top: 12px; }
@media (max-width: 899px) { .hero .btn { width: 100%; } }
@media (min-width: 900px) { .hero { padding: 64px 0 72px; } .hero .wrap { grid-template-columns: 1fr 420px; gap: 70px; } .lead { font-size: 20px; } }

.friends { padding: 8px 0 20px; }
.friends ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.friends li { grid-column: span 2; border-radius: 22px; padding: 6px 4px 12px; text-align: center; }
.friends li:nth-child(4), .friends li:nth-child(5) { grid-column: span 3; }
.friends li img { width: min(100%, 170px); margin: 0 auto; }
.friends b { display: block; font: 19px var(--head); font-weight: 400; }
.friends span { display: block; font-size: 12.5px; color: var(--mute); }
.friends .wood { background: #e3f2e0; } .friends .fire { background: #ffe6d8; } .friends .earth { background: #fbeec9; }
.friends .metal { background: #e6e9f1; } .friends .water { background: #dfeefd; }
@media (min-width: 760px) { .friends ul { grid-template-columns: repeat(5, 1fr); } .friends li, .friends li:nth-child(4), .friends li:nth-child(5) { grid-column: auto; } }

.maker { display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) { .maker { grid-template-columns: 1fr 460px; gap: 48px; } }
.panel { background: var(--paper); border: 2px solid var(--line); border-radius: 28px; padding: 26px 20px; }
.sub { color: var(--mute); margin: 6px 0 20px; }
form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; font: 17px var(--head); border: 0; padding: 0; margin: 0; min-width: 0; }
.field legend { padding: 0; margin-bottom: 7px; float: left; width: 100%; }
.field legend + * { clear: both; }
.field i { font: normal 13px var(--body); color: var(--mute); }
.field small { font: 13px var(--body); color: var(--mute); }
.field > input { width: 100%; min-width: 0; min-height: 52px; padding: 11px 14px; border: 2px solid var(--line); border-radius: 15px; background: #fff; color: var(--cocoa); font: 16px var(--body); }
.field > input:focus { outline: 0; border-color: var(--inju); box-shadow: 0 0 0 4px var(--blush); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 50px; padding: 6px; border: 2px solid var(--line); border-radius: 15px; background: #fff; font-size: 16px; line-height: 1.3; }
.seg input:checked + span { border-color: var(--inju); background: var(--blush); }
.seg input:focus-visible + span { outline: 3px solid var(--cocoa); outline-offset: 2px; }
.err { color: #b7231d; margin: 0; font-size: 14.5px; }
.err:empty { display: none; }
.safe { margin: 4px 0 0; font-size: 13px; color: var(--mute); text-align: center; }

.cardbox canvas, .cardbox img { width: 100%; height: auto; aspect-ratio: 4/5; border-radius: 24px; box-shadow: 0 24px 46px -24px rgba(74,48,42,.5); }
.cardbox img { opacity: .8; }
.out { max-width: 460px; width: 100%; margin: 0 auto; }
.note { font-size: 13.5px; color: var(--mute); text-align: center; }
.result, .locked, .pay { background: var(--paper); border: 2px solid var(--line); border-radius: 24px; padding: 20px; margin-top: 16px; }
.tag { display: inline-block; margin: 0 0 8px; padding: 3px 14px; border-radius: 99px; background: var(--blush); font: 16px var(--head); }
blockquote { margin: 10px 0 16px; font: 21px/1.45 var(--head); }
.basis { margin: 0; font-size: 14.5px; border-top: 2px dashed var(--line); padding-top: 12px; }
.basis dt { color: var(--mute); font-size: 13px; }
.basis dd { margin: 0 0 8px; }
.fine { font-size: 13px; color: var(--mute); margin: 8px 0 0; }
.lk { border-top: 2px dashed var(--line); margin-top: 14px; padding-top: 14px; }
.lk h4 { font: 400 18px var(--head); margin: 0 0 4px; }
.lk h4 i { font: normal 13px var(--body); color: var(--mute); }
.lk-line { margin: 0; font-size: 17px; line-height: 1.85; font-weight: 700; }
.lk-hide b { display: inline-block; height: .8em; width: 3.2em; margin: 0 .3em 0 0; border-radius: .4em; background: #b99f92; filter: blur(4px); vertical-align: -.05em; }
.lk-hide b:nth-child(2) { width: 5em; } .lk-hide b:nth-child(3) { width: 2.2em; } .lk-hide b:nth-child(4) { width: 5.6em; } .lk-hide b:nth-child(5) { width: 2.8em; }
.btn-rest { margin-top: 10px; font-size: 18px; }
.lk-soon { margin: 10px 0 0; font-size: 12.5px; color: var(--mute); text-align: center; }
.lk-in { margin: 6px 0 0; font-size: 13.5px; color: var(--mute); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.plan { display: flex; align-items: center; gap: 12px; border: 2px solid var(--line); border-radius: 18px; padding: 13px 14px; margin-bottom: 10px; cursor: pointer; background: #fff; }
.plan:has(input:checked) { border-color: var(--inju); background: var(--blush); }
.plan input { width: 19px; height: 19px; accent-color: var(--inju); flex: none; }
.plan span { flex: 1; line-height: 1.4; }
.plan b { display: block; font: 17px var(--head); }
.plan small { color: var(--mute); font-size: 13px; }
.plan em { font: normal 22px var(--head); white-space: nowrap; }
.pay .btn { margin-top: 6px; }
.result h4 { font: 18px var(--head); margin: 18px 0 4px; }
.result p, .result ul { margin: 4px 0; }
.result ul { padding-left: 20px; }
#save { margin-top: 14px; }

.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gallery figure { margin: 0; }
.gallery img { border-radius: 18px; box-shadow: 0 18px 34px -20px rgba(74,48,42,.5); }
@media (min-width: 900px) { .gallery { grid-template-columns: repeat(4, 1fr); gap: 20px; } }

details { background: var(--paper); border: 2px solid var(--line); border-radius: 18px; padding: 0 18px; margin-top: 10px; }
summary { cursor: pointer; font: 18px var(--head); padding: 15px 0; }
details p { margin: 0 0 16px; font-size: 15px; }

.foot { background: var(--cocoa); color: #e8d6cc; font-size: 13px; padding: 30px 0 40px; }
.foot a { color: #ffd9a8; }
.foot .links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14.5px; margin-top: 0; }
.foot dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; }
.foot dt { color: #c4aca1; }
.foot dd { margin: 0; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); background: var(--cocoa); color: #fff; padding: 12px 20px; border-radius: 99px; font-size: 14.5px; text-align: center; z-index: 30; box-shadow: 0 10px 26px rgba(0,0,0,.3); }

/* 약관 화면 */
.doc { max-width: 780px; margin: 0 auto; padding: 24px 20px 60px; }
.doc section { padding: 20px 0; }
.doc h2 { font-size: 28px; }
.doc h3 { font-size: 19px; margin-top: 22px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--paper); }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc td:nth-child(2) { min-width: 4.6em; }
#terms td:nth-child(2) { white-space: nowrap; }
.draft { background: var(--blush); border: 2px solid var(--inju); border-radius: 14px; padding: 12px 16px; font-size: 14px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }

/* 12-01 궁금증 한 줄: 앞부분 + 글자 없는 빈칸 + 뒷말 */
.lk-line .lk-hide { display: inline-block; white-space: nowrap; padding: 0 .08em; border-bottom: 2px solid #b99f92; }
.lk-line .lk-hide b:nth-child(1) { width: 2.6em; margin-right: .2em; } .lk-line .lk-hide b:nth-child(2) { width: 3.8em; margin-right: .2em; } .lk-line .lk-hide b:nth-child(3) { width: 1.9em; margin-right: 0; }
.lk-tail { white-space: pre-wrap; }

/* 주문 · 결제 · 열람 화면 */
.shop { max-width: 560px; margin: 0 auto; padding: 28px 18px 60px; }
.shop h1 { font-size: 32px; }
.shop .box { background: var(--paper); border: 2px solid var(--line); border-radius: 22px; padding: 18px; margin-top: 14px; }
.shop .box h2 { font-size: 21px; margin-bottom: 10px; }
.plans { border: 0; padding: 0; margin: 0; min-width: 0; }
.rows { margin: 0; }
.rows div { display: flex; gap: 12px; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.rows div.hidden { display: none; }
.rows dt { color: var(--mute); flex: none; }
.rows dd { margin: 0; text-align: right; }
.rows .total dt, .rows .total dd { font: 20px var(--head); color: var(--cocoa); }
.rows small { font: 12px var(--body); color: var(--mute); }
.agree { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: 14.5px; cursor: pointer; }
.agree input { flex: none; width: 21px; height: 21px; margin-top: 3px; accent-color: var(--inju); }
.shop .err { margin: 8px 0; }
.shop .cardbox { margin: 16px 0 18px; }
.shop #copy { margin-top: 16px; }
.linkbox { width: 100%; padding: 10px; border: 2px solid var(--line); border-radius: 12px; font-size: 13px; }
.saved { list-style: none; padding: 0; }
.saved a { display: block; border: 2px solid var(--line); border-radius: 14px; padding: 12px; margin-top: 8px; }

/* 결과 전 진행 화면 (analysis.js) */
html.an-lock, html.an-lock body { overflow: hidden; }
dialog.analysis { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 24px 20px; border: 0; background: var(--cream); color: var(--cocoa); overflow: auto; }
dialog.analysis[open] { display: grid; place-items: center; animation: anIn .25s ease both; }
dialog.analysis.out { opacity: 0; transition: opacity .18s ease; }
dialog.analysis::backdrop { background: var(--cream); }
.an-box { width: min(380px, 100%); text-align: center; }
.an-paws { display: block; width: min(260px, 70vw); height: auto; margin: 0 auto 18px; overflow: visible; fill: var(--inju); }
.an-paw { opacity: 0; transform-box: fill-box; transform-origin: center; animation: anPaw 2.1s ease infinite both; }
.an-paws > g:nth-child(2) .an-paw { animation-delay: .24s; }
.an-paws > g:nth-child(3) .an-paw { animation-delay: .48s; }
.an-paws > g:nth-child(4) .an-paw { animation-delay: .72s; }
.an-paws > g:nth-child(5) .an-paw { animation-delay: .96s; }
.an-paws > g:nth-child(6) .an-paw { animation-delay: 1.2s; }
.an-box h2 { font-size: clamp(25px, 7vw, 32px); margin: 0 0 20px; outline: none; text-wrap: balance; }
.an-steps { list-style: none; margin: 0 0 20px; padding: 16px 16px; text-align: left; display: grid; gap: 12px; background: var(--paper); border: 2px solid var(--line); border-radius: 22px; }
.an-steps li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: center; color: #b39d94; font-size: 15.5px; line-height: 1.4; }
.an-steps li i { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 50%; font: normal 700 13px/1 var(--body); }
.an-steps li.on { color: var(--cocoa); font-weight: 700; }
.an-steps li.on i { border-color: var(--inju); border-top-color: transparent; animation: anSpin .8s linear infinite; }
.an-steps li.an-done { color: var(--mute); }
.an-steps li.an-done i { border-color: var(--inju); background: var(--inju); color: #fff; }
.an-steps li.an-done i::before { content: '✓'; }
.an-bar { height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; }
.an-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--inju); }
@keyframes anIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes anSpin { to { transform: rotate(360deg); } }
@keyframes anPaw { 0% { opacity: 0; transform: scale(1.35); } 9% { opacity: 1; transform: scale(.94); } 14% { transform: scale(1); } 55% { opacity: 1; } 78%, 100% { opacity: .14; transform: scale(1); } }
@media (max-height: 560px) { .an-paws { width: 180px; margin-bottom: 8px; } .an-steps { gap: 8px; padding: 12px; } }
@media (prefers-reduced-motion: reduce) { dialog.analysis[open] { animation: none; } .an-paw { animation: none; opacity: .85; } .an-steps li.on i { animation: none; border-top-color: var(--inju); } }
