@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;600;900&family=IBM+Plex+Sans+KR:wght@400;500&display=swap');

/* 홍실: 흰 종이, 먹, 가는 선. 색은 붉은 실 한 가닥뿐이다.
   참고한 화면: Co–Star(흑백·명조·겹친 두 원), The Pattern(등급 낱말·좌우 비교표). */
:root {
  --paper: #f3f3f1;
  --sheet: #ffffff;
  --ink: #0e0e0e;
  --ink-soft: #6c6c68;
  --rule: #c9c9c4;
  --thread: #c3203a;
  --wood: #2f7d56;
  --fire: #c3203a;
  --earth: #a97a1f;
  --metal: #8a8f92;
  --water: #27476e;
  --serif: 'Noto Serif KR', serif;
  --sans: 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
}
#app {
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 24px calc(40px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; line-height: 1.4; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.small { font-size: 12.5px; letter-spacing: .04em; color: var(--ink-soft); }

.masthead { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 0 14px; border-bottom: 1px solid var(--ink); font-size: 13px; letter-spacing: .06em; }
.masthead b { font-family: var(--serif); font-weight: 600; font-size: 16px; letter-spacing: .02em; }

/* 첫 화면 */
.home { flex: 1; display: flex; flex-direction: column; }
.home h1 { font-size: clamp(26px, 7.4vw, 31px); text-align: center; margin-top: 9vh; letter-spacing: -0.01em; }
.home .lead { text-align: center; color: var(--ink-soft); margin: 14px auto 0; max-width: 19em; font-size: 15px; }
.slips { position: relative; height: 250px; margin: 5vh -24px 0; padding: 0 24px; overflow: hidden; }
.slips svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.slip { position: absolute; width: 64%; background: var(--sheet); border: 1px solid var(--rule); padding: 14px 16px 16px; box-shadow: 0 10px 24px -18px rgba(0, 0, 0, .55); }
.slip h3 { font-size: 15px; font-weight: 600; }
.slip p { font-size: 12.5px; line-height: 1.65; color: var(--ink-soft); margin-top: 6px; }
.slip .dots { margin-top: 10px; }
.slip.a { left: 2%; top: 6px; transform: rotate(-5deg); }
.slip.b { right: 2%; top: 74px; transform: rotate(4deg); }
/* 풀이 고르기: 첫 화면과 풀이 끝에서 같이 쓴다 */
.topics { list-style: none; margin: 5vh 0 0; padding: 0; border-top: 1px solid var(--ink); }
.topics li { border-bottom: 1px solid var(--rule); }
.topics button { display: grid; grid-template-columns: 1.6em 1fr 1em; gap: 10px; align-items: baseline; width: 100%; text-align: left; border: 0; background: transparent; padding: 17px 2px; color: var(--ink); cursor: pointer; }
.topics button::after { content: '→'; color: var(--ink-soft); text-align: right; }
.topics button:active { background: var(--sheet); }
.topics .no { font-size: 12.5px; color: var(--ink-soft); }
.topics .tx b { display: block; font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.topics .tx small { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-soft); }
.more .topics { margin-top: 0; border-top: 0; }
/* 첫 화면의 대표 풀이(연애·궁합) 한 장과, 그 아래 작게 두는 나머지 풀이 */
.main-topic { position: relative; display: block; width: 100%; margin-top: 5vh; padding: 22px 20px 20px 24px; text-align: left; border: 1px solid var(--ink); border-radius: 2px; background: var(--sheet); color: var(--ink); cursor: pointer; box-shadow: 0 14px 28px -22px rgba(0, 0, 0, .6); }
.main-topic::before { content: ''; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 4px; background: var(--thread); }
.main-topic.tight { margin-top: 22px; }
.main-topic .tag { display: block; font-size: 12px; letter-spacing: .08em; color: var(--thread); }
.main-topic b { display: block; margin-top: 8px; font-family: var(--serif); font-weight: 600; font-size: 27px; letter-spacing: -0.01em; }
.main-topic small { display: block; margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.main-topic .go { display: block; margin-top: 18px; padding: 14px 16px; border-radius: 2px; background: var(--ink); color: #fff; font-size: 15px; letter-spacing: .06em; text-align: center; }
.main-topic .go::after { content: ' →'; }
.main-topic:active { background: var(--paper); }
.sub-head { margin-top: 34px; font-family: var(--sans); font-weight: 400; font-size: 12.5px; letter-spacing: .08em; color: var(--ink-soft); }
.topics.sub { margin-top: 10px; border-top-color: var(--rule); }
.topics.sub button { padding: 13px 2px; }
.topics.sub .tx b { font-size: 16.5px; }
.topics.sub .tx small { font-size: 12.5px; }
.more .topics button { grid-template-columns: 1fr 1em; padding: 15px 2px; }
.more .topics .tx b { font-size: 17px; }
/* 적어 둔 내 정보와 다시 입력 버튼. 풀이 목록 위에 눈에 띄게 둔다 */
.mecard { margin-top: 5vh; display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--ink); background: var(--sheet); padding: 14px 16px; }
.mecard p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.mecard small { display: block; font-size: 12px; letter-spacing: .04em; margin-bottom: 2px; }
.mecard b { font-family: var(--serif); font-weight: 600; font-size: 17px; color: var(--ink); margin-right: 4px; }
.mecard button { flex: none; border: 1px solid var(--ink); border-radius: 2px; background: var(--ink); color: var(--sheet); padding: 9px 12px; font-size: 13px; cursor: pointer; }
.mecard button[aria-pressed="true"] { background: transparent; color: var(--ink); }
.topics.tight { margin-top: 22px; }
.home > .fine { margin-top: 18px; text-align: center; font-size: 13px; color: var(--ink-soft); }
.home .thread-note { margin-top: auto; padding-top: 32px; text-align: center; font-size: 12.5px; color: var(--thread); letter-spacing: .02em; }
.home .foot { margin-top: auto; padding-top: 28px; text-align: center; }
.home .fine { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }

.btn {
  display: block; width: 100%;
  border: 1px solid var(--ink); border-radius: 2px;
  padding: 16px 20px;
  background: var(--ink); color: #fff;
  font-size: 15px; letter-spacing: .06em;
}
.btn:disabled { background: transparent; color: var(--ink-soft); border-color: var(--rule); cursor: default; }
.btn.outline { background: transparent; color: var(--ink); margin-top: 48px; }
.masthead a { color: inherit; text-decoration: none; }
.btn.quiet { background: transparent; border: 0; color: var(--ink); padding: 14px; font-size: 14px; text-decoration: underline; text-underline-offset: 5px; }

.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i { width: 7px; height: 7px; background: var(--rule); }
.dots i.on { background: var(--ink); }

/* 묻는 화면 */
.ask { flex: 1; display: flex; flex-direction: column; }
.progress { display: flex; align-items: center; gap: 12px; padding: 18px 0 0; }
.progress .back { border: 0; background: none; padding: 4px 6px 4px 0; font-size: 13px; letter-spacing: .06em; }
.progress .back:disabled { color: var(--rule); }
.progress .gohome { border: 1px solid var(--ink); border-radius: 2px; background: none; padding: 5px 10px; font-size: 12.5px; letter-spacing: .06em; color: var(--ink); cursor: pointer; }
.progress .line { flex: 1; height: 1px; background: var(--rule); position: relative; }
.progress .line i { position: absolute; left: 0; top: -0.5px; height: 2px; background: var(--thread); transition: width .45s ease; }
.progress .count { font-size: 12.5px; letter-spacing: .06em; color: var(--ink-soft); }
.ask .who { margin-top: 11vh; font-size: 12.5px; letter-spacing: .08em; color: var(--ink-soft); }
.ask h2 { font-size: 25px; margin-top: 8px; letter-spacing: -0.01em; }
.ask .hint { margin-top: 10px; color: var(--ink-soft); font-size: 14.5px; }
.ask .field { margin-top: 36px; }
.ask input[type=text] {
  width: 100%;
  border: 0; border-bottom: 1px solid var(--ink);
  background: transparent; border-radius: 0;
  font-family: var(--serif); font-size: 30px; color: var(--ink);
  padding: 4px 0 10px;
}
.ask .pick { position: relative; }
.ask .pick::after { content: ''; position: absolute; right: 6px; top: 14px; width: 9px; height: 9px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg); pointer-events: none; }
.ask select {
  width: 100%; appearance: none; -webkit-appearance: none;
  border: 0; border-bottom: 1px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink);
  font-family: var(--serif); font-size: 22px;
  padding: 6px 28px 12px 0;
}
.ask select:focus { outline: none; border-color: var(--thread); }
.ask textarea { width: 100%; font: inherit; font-size: 16px; line-height: 1.7; min-height: 140px; resize: none; border: 1px solid var(--ink); border-radius: 2px; padding: 14px 16px; background: var(--sheet); color: var(--ink); }
.ask input::placeholder, .ask textarea::placeholder { color: #b9b9b4; }
.ask input:focus, .ask textarea:focus { outline: none; border-color: var(--thread); }
.seg { display: flex; margin-top: 18px; }
.seg button { border: 1px solid var(--ink); background: transparent; border-radius: 0; padding: 7px 20px; font-size: 14px; }
.seg button + button { border-left: 0; }
.seg button[aria-pressed=true] { background: var(--ink); color: #fff; }
.choices { margin-top: 34px; border-top: 1px solid var(--ink); }
.choices button { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 18px 2px; font-family: var(--serif); font-size: 19px; }
.choices button small { font-family: var(--sans); color: var(--ink-soft); font-size: 13px; }
.choices button:active { background: var(--sheet); }
.ask .error { margin-top: 12px; color: var(--thread); font-size: 14px; min-height: 1.7em; }
.ask .foot { margin-top: auto; padding-top: 30px; }

/* 결과 */
.venn { width: 100%; height: auto; display: block; margin-top: 26px; }
.venn .ring { fill: none; stroke: var(--ink); stroke-width: 1; }
.venn .glyph { font-family: var(--serif); font-weight: 900; font-size: 40px; text-anchor: middle; dominant-baseline: central; fill: var(--ink); }
.venn .nm { font-family: var(--sans); font-size: 13px; text-anchor: middle; fill: var(--ink); letter-spacing: .04em; }
.venn .img { font-family: var(--sans); font-size: 11.5px; text-anchor: middle; fill: var(--ink-soft); }
.venn .mlabel { font-family: var(--serif); font-size: 13px; text-anchor: middle; fill: var(--ink); }
.venn .sq { fill: var(--rule); }
.venn .sq.on { fill: var(--ink); }
.thread-path { fill: none; stroke: var(--thread); stroke-width: 1.6; stroke-linecap: round; }
.draw { stroke-dasharray: var(--len, 900); stroke-dashoffset: var(--len, 900); animation: draw 2.4s cubic-bezier(.6, 0, .2, 1) .3s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .draw { animation: none; stroke-dashoffset: 0; } }

.verdict { text-align: center; margin-top: 22px; }
.verdict .grade { font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: -0.01em; }
.verdict .num { margin-top: 2px; font-size: 13px; letter-spacing: .06em; color: var(--ink-soft); }
.verdict h1 { font-size: 19px; margin: 18px auto 0; max-width: 16em; }

.block { margin-top: 52px; }
.block > h2 { font-family: var(--sans); font-weight: 500; font-size: 12.5px; letter-spacing: .1em; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }

.compare { width: 100%; border-collapse: collapse; table-layout: fixed; }
.compare th { font-family: var(--serif); font-weight: 600; font-size: 16px; padding: 14px 0 10px; text-align: left; }
.compare td { padding: 10px 0; border-top: 1px solid var(--rule); font-size: 14.5px; vertical-align: top; }
.compare td.k { text-align: center; font-size: 12px; letter-spacing: .06em; color: var(--ink-soft); padding: 10px 0 0; border-top: 1px solid var(--rule); }
.compare tr.label td { padding-bottom: 0; }
.compare tr.vals td { border-top: 0; padding-top: 2px; }
.compare td:last-child, .compare th:last-child { text-align: right; }
.compare td.k { text-align: center; }
.compare b { font-family: var(--serif); font-weight: 600; }
.compare.solo td { padding: 13px 0; }
.compare.solo tr:first-child td { border-top: 0; }
.compare.solo td.lab { width: 8.5em; text-align: left; font-size: 12.5px; letter-spacing: .06em; color: var(--ink-soft); }

.pillars { width: 100%; border-collapse: collapse; margin-top: 22px; text-align: center; table-layout: fixed; }
.pillars caption { text-align: left; font-family: var(--serif); font-weight: 600; font-size: 16px; padding-bottom: 6px; }
.pillars caption span { font-family: var(--sans); font-weight: 400; font-size: 12.5px; color: var(--ink-soft); margin-left: 8px; }
.pillars th { font-weight: 400; font-size: 12px; letter-spacing: .08em; color: var(--ink-soft); padding: 6px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.pillars td { padding: 10px 0 8px; border-bottom: 1px solid var(--rule); }
.pillars td + td { border-left: 1px solid var(--rule); }
.pillars .hj { font-family: var(--serif); font-weight: 900; font-size: 28px; line-height: 1.15; display: block; }
.pillars .rd { font-size: 12px; color: var(--ink-soft); display: block; }
.pillars .rd::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; background: currentColor; }
.pillars .god { font-size: 12px; display: block; margin-bottom: 3px; color: var(--ink-soft); }
.pillars td.me { background: var(--sheet); }
.pillars td.me .god { color: var(--ink); }
.pillars td.none { color: var(--ink-soft); font-size: 12.5px; }
.el-목 { color: var(--wood); } .el-화 { color: var(--fire); } .el-토 { color: var(--earth); } .el-금 { color: var(--metal); } .el-수 { color: var(--water); }

.bars { margin-top: 18px; }
.bars + .bars { margin-top: 26px; }
.bars .who { font-family: var(--serif); font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.bar { display: grid; grid-template-columns: 2.6em 1fr 3.6em 2.6em; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.bar .track { height: 8px; background: var(--rule); display: block; }
.bar .track i { display: block; height: 100%; }
.bar .pc { text-align: right; color: var(--ink-soft); font-size: 12.5px; }
.bar .lb { font-size: 12px; color: var(--ink-soft); }
.bar .lb.hot { color: var(--thread); }
.bg-목 { background: var(--wood); } .bg-화 { background: var(--fire); } .bg-토 { background: var(--earth); } .bg-금 { background: var(--metal); } .bg-수 { background: var(--water); }
.types { margin-top: 34px; display: grid; gap: 14px; }
.type { border: 1px solid var(--ink); background: var(--sheet); padding: 18px 18px 16px; }
.type .who { font-size: 12.5px; letter-spacing: .08em; color: var(--ink-soft); }
.type h3 { font-family: var(--serif); font-weight: 600; font-size: 20px; line-height: 1.4; margin-top: 4px; }
.type ul { list-style: none; margin: 10px 0 0; padding: 0; }
.type li { font-size: 14.5px; padding: 7px 0; border-top: 1px solid var(--rule); }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.facts h3 { font-size: 17px; font-weight: 600; }
.facts p { font-size: 14.5px; color: var(--ink-soft); margin-top: 3px; }

.writing { margin-top: 52px; border: 1px solid var(--ink); background: var(--sheet); padding: 22px 20px; }
.writing p { color: var(--ink-soft); font-size: 14.5px; }
.writing strong { display: block; font-family: var(--serif); font-weight: 600; font-size: 18px; color: var(--ink); margin-bottom: 4px; }
.writing .wait i { display: inline-block; width: 6px; height: 6px; background: var(--ink); margin: 14px 5px 0 0; animation: pulse 1.2s infinite ease-in-out; }
.writing .wait i:nth-child(2) { animation-delay: .2s; } .writing .wait i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .writing .wait i { animation: none; } }

.toc { margin-top: 56px; display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; letter-spacing: .1em; color: var(--ink-soft); padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.toc button { border: 0; background: none; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; }
.chapter { border-bottom: 1px solid var(--rule); }
.chapter summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1.6em 1fr 1em; gap: 10px; align-items: baseline; padding: 20px 0; }
.chapter summary::-webkit-details-marker { display: none; }
.chapter summary::after { content: '+'; color: var(--ink-soft); text-align: right; }
.chapter[open] summary::after { content: '−'; }
.chapter .no { font-size: 12.5px; color: var(--ink-soft); }
.chapter h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.45; }
.chapter .about { display: block; font-size: 11.5px; font-weight: 400; letter-spacing: .06em; color: var(--ink-soft); margin-bottom: 3px; }
.writing.more { margin-top: 28px; }
.chapter p { font-family: var(--serif); font-size: 16.5px; line-height: 2; margin: 0 0 18px; }
.chapter[open] { padding-bottom: 14px; }

.feedback { margin-top: 72px; padding-top: 26px; border-top: 1px solid var(--ink); }
.feedback h2 { font-size: 20px; font-weight: 600; }
.feedback .stars { display: flex; gap: 4px; margin-top: 16px; }
.feedback .stars button { border: 0; background: none; padding: 2px; font-size: 32px; line-height: 1; color: var(--rule); }
.feedback .stars button[aria-pressed=true] { color: var(--ink); }
.feedback textarea { width: 100%; margin-top: 16px; min-height: 96px; border: 1px solid var(--ink); border-radius: 2px; background: var(--sheet); padding: 12px 14px; font: inherit; color: inherit; resize: none; }
.feedback .btn { margin-top: 14px; }
.feedback .thanks { margin-top: 16px; font-family: var(--serif); font-size: 17px; }
.legal { margin-top: 40px; font-size: 12.5px; color: var(--ink-soft); }

.fold summary { font-size: 13.5px; letter-spacing: .04em; padding: 14px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: '+'; }
.fold[open] summary::after { content: '−'; }

/* 장마다 맞아요·아니에요 */
.vote { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; font-size: 13px; color: var(--ink-soft); }
.vote span { margin-right: auto; }
.vote button { border: 1px solid var(--rule); background: none; border-radius: 2px; padding: 6px 12px; font: inherit; font-size: 13px; color: inherit; }
.vote button[aria-pressed=true] { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.vote button:disabled:not([aria-pressed=true]) { opacity: .4; }

/* 조립식 풀이의 문단 위 작은 제목 */
.chapter p .lead { display: block; font-family: var(--sans, inherit); font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: var(--thread); line-height: 1.4; margin-bottom: 4px; }
/* 동의 화면 */
.consent .terms { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 14px; }
.consent .terms li { font-size: 14.5px; line-height: 1.7; color: var(--ink); }
.consent .terms b { display: block; font-size: 12.5px; letter-spacing: .04em; color: var(--thread); }
.consent .agree { display: flex; gap: 10px; align-items: flex-start; margin-top: 26px; font-size: 14.5px; line-height: 1.6; cursor: pointer; }
.consent .agree input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--thread); }
.consent a, .site-foot a, .legal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.home .site-foot { margin-top: 14px; text-align: center; font-size: 12px; line-height: 1.8; color: var(--ink-soft); }
.btn:disabled { opacity: .4; }

/* 공유 */
.share { margin-top: 18px; display: grid; gap: 10px; }
.share .btn.outline { margin-top: 0; }
.share .note { font-size: 12.5px; color: var(--ink-soft); text-align: center; word-break: break-all; }
.guest { margin-top: 18px; padding: 16px 18px; border: 1px solid var(--thread); background: var(--sheet); }
.guest p { font-size: 14.5px; margin: 0 0 12px; }
.home .fine a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* 무엇을 넣어서 본 풀이인지 */
.entered { list-style: none; margin: 16px 0 0; padding: 0; text-align: center; font-size: 13px; color: var(--ink-soft); }
.entered li + li { margin-top: 4px; }
.entered b { color: var(--ink); font-weight: 500; }
.entered small { display: block; margin-top: 6px; font-size: 12.5px; color: var(--thread); line-height: 1.6; }

.btn.kakao { background: #fee500; border-color: #fee500; color: #191600; }

.share { margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--ink); }
