:root {
  --zhu: #b5302a;
  --zhu-dark: #8a201c;
  --gold: #b8860b;
  --ink: #2b2520;
  --hanji: #f6edd8;
  --hanji-deep: #e6d8b8;
  --paper: #faf4e6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Noto Serif KR', 'Nanum Myeongjo', serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  position: relative;
  min-height: 100vh;
}
.paper-bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 20% 10%, rgba(184,134,11,0.06), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(181,48,42,0.05), transparent 40%),
    var(--paper);
}

/* 헤더 */
.brand-sub { font-size: 0.9rem; opacity: 0.75; margin-left: 0.4rem; font-weight: 400; }

.container { max-width: 820px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

/* 모드 전환 */
.mode-switch { display: flex; gap: 0.5rem; margin-bottom: 1.2rem; }
.mode-btn {
  flex: 1; padding: 0.85rem; border: 2px solid var(--hanji-deep); border-radius: 12px;
  background: #fff; color: var(--ink); font-family: inherit; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.mode-btn.active { background: var(--zhu); color: #fff8ec; border-color: var(--zhu); box-shadow: 0 3px 12px rgba(181,48,42,0.25); }

/* 입력 패널 */
.input-panel {
  background: rgba(255,255,255,0.7); border: 1px solid var(--hanji-deep);
  border-radius: 16px; padding: 1.5rem; box-shadow: 0 2px 14px rgba(0,0,0,0.06);
}
.panel-intro { margin: 0 0 1.2rem; color: #6b5e48; font-size: 0.95rem; }
.person-form { margin-bottom: 0.5rem; }
.person-title { font-weight: 800; color: var(--zhu-dark); margin-bottom: 0.7rem; font-size: 1.05rem; }
.field-row { display: flex; gap: 0.5rem; margin-bottom: 0.7rem; align-items: center; flex-wrap: wrap; }
.date-row { flex-wrap: nowrap; }
.inp {
  flex: 1; padding: 0.7rem 0.8rem; border: 1px solid var(--hanji-deep); border-radius: 10px;
  font-family: inherit; font-size: 1rem; background: #fffdf8; color: var(--ink); min-width: 0;
}
.inp:focus { outline: none; border-color: var(--zhu); }
.inp-sm { flex: 0 0 70px; }
.inp-name { flex: 0 0 120px; }
.seg { display: inline-flex; border: 1px solid var(--hanji-deep); border-radius: 10px; overflow: hidden; }
.seg-btn {
  padding: 0.6rem 1rem; border: none; background: #fffdf8; color: var(--ink);
  font-family: inherit; font-size: 0.95rem; cursor: pointer; transition: all 0.15s;
}
.seg-btn.active { background: var(--zhu); color: #fff8ec; }

/* 카테고리 */
.cat-block { margin: 1.2rem 0; }
.cat-label { font-weight: 700; color: var(--zhu-dark); margin-bottom: 0.6rem; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.cat-pill {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  padding: 0.7rem 0.4rem; border: 2px solid var(--hanji-deep); border-radius: 12px;
  background: #fffdf8; cursor: pointer; transition: all 0.15s; text-align: center;
}
.cat-pill input { display: none; }
.cat-pill i { font-size: 1.2rem; color: var(--zhu); }
.cat-name { font-size: 0.78rem; font-weight: 600; }
.cat-pill.active { background: var(--zhu); border-color: var(--zhu); color: #fff8ec; }
.cat-pill.active i { color: #ffe8b0; }

/* 궁합 폼 */
.compat-forms { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; }
.compat-forms .person-form { background: rgba(255,253,248,0.6); border: 1px dashed var(--hanji-deep); border-radius: 12px; padding: 1rem; }
.compat-amp { font-size: 1.8rem; color: var(--zhu); text-align: center; }

.submit-btn {
  width: 100%; margin-top: 0.8rem; padding: 1rem; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--zhu-dark), var(--zhu)); color: #fff8ec;
  font-family: inherit; font-size: 1.15rem; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 14px rgba(181,48,42,0.3); transition: transform 0.1s;
}
.submit-btn:hover { transform: translateY(-1px); }
.submit-btn:active { transform: translateY(1px); }
.ask-hint { margin: 0.9rem 0 0.2rem; padding: 0.6rem 0.8rem; font-size: 0.82rem; color: #7a6a4e; background: rgba(184,134,11,0.08); border: 1px dashed var(--hanji-deep); border-radius: 10px; line-height: 1.5; }
.ask-hint i { color: var(--zhu); margin-right: 0.3rem; }
.ask-hint b { color: var(--zhu-dark); }

/* 로딩 */
.loading { text-align: center; padding: 3rem 1rem; }
.spinner {
  width: 48px; height: 48px; margin: 0 auto 1rem; border: 4px solid var(--hanji-deep);
  border-top-color: var(--zhu); border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 결과 */
.result-area { margin-top: 1.5rem; }
.result-card {
  background: rgba(255,255,255,0.78); border: 1px solid var(--hanji-deep);
  border-radius: 16px; padding: 1.4rem 1.5rem; margin-bottom: 1.1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.card-title {
  font-size: 1.15rem; font-weight: 800; color: var(--zhu-dark);
  margin: 0 0 0.9rem; padding-bottom: 0.6rem; border-bottom: 2px solid var(--hanji-deep);
  display: flex; align-items: center; gap: 0.5rem;
}
.card-title i { color: var(--zhu); }
.body-text { font-size: 0.98rem; line-height: 1.95; color: var(--ink); white-space: pre-line; }

/* 프롤로그 */
.prologue-card {
  background: linear-gradient(135deg, rgba(138,32,28,0.04), rgba(184,134,11,0.06));
  border: 1px solid var(--gold); text-align: center;
}
.prologue-card .body-text { font-size: 1.02rem; }

/* 요약 카드 */
.summary-card { background: linear-gradient(135deg, #fff8ec, #f6edd8); border: 1px solid var(--gold); }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.8rem; }
.summary-item { background: rgba(255,255,255,0.7); border-radius: 10px; padding: 0.7rem 0.9rem; }
.summary-item .s-label { font-size: 0.78rem; color: #8a7a5c; font-weight: 600; }
.summary-item .s-value { font-size: 1.05rem; font-weight: 800; color: var(--zhu-dark); margin-top: 0.2rem; }

/* ───────────── 명조(命造) 등급 카드 ───────────── */
.grade-card { border: 2px solid var(--gold); background: linear-gradient(160deg, #fffdf6, #f6edd8); overflow: hidden; }

/* 등급 히어로(상단 배지 + 점수) */
.grade-hero {
  display: flex; align-items: center; gap: 1.4rem;
  padding: 1.4rem 1.3rem; border-radius: 14px; margin-bottom: 1.4rem;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #3a312a, #221c17);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.35);
}
.grade-hero::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 18% 30%, rgba(255,255,255,0.10), transparent 55%);
  pointer-events: none;
}

/* 등급 봉인 인장(원형 배지) */
.grade-seal-ring {
  flex: 0 0 auto; width: 100px; height: 100px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 3px double #d9c48a; position: relative; z-index: 1;
  background: radial-gradient(circle at 50% 38%, rgba(255,255,255,0.12), rgba(0,0,0,0.25));
  box-shadow: 0 0 0 5px rgba(217,196,138,0.18), 0 6px 20px rgba(0,0,0,0.4);
}
.grade-tier { font-family: 'Nanum Myeongjo', serif; font-size: 2.7rem; line-height: 1; font-weight: 800; color: #f4e7c4; text-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.grade-tier-ko { font-size: 0.72rem; letter-spacing: 0.25em; color: #c9b27e; margin-top: 0.35rem; }

/* 점수/희소도 텍스트 */
.grade-head-text { z-index: 1; color: #f6edd8; }
.grade-score-line { display: flex; align-items: baseline; gap: 0.4rem; }
.grade-score { font-size: 3.2rem; font-weight: 900; line-height: 1; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.grade-score-max { font-size: 1rem; color: #bdae8d; font-weight: 700; }
.grade-tierko { font-size: 1.05rem; font-weight: 800; color: #f4e7c4; margin-top: 0.45rem; }
.grade-rarity {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.6rem;
  padding: 0.35rem 0.8rem; border-radius: 999px; font-size: 0.85rem; font-weight: 800;
  background: rgba(184,134,11,0.28); color: #ffe9b0; border: 1px solid rgba(217,196,138,0.5);
}
.grade-rarity i { color: #ffd76a; }

/* 등급별 인장/히어로 색 변주 */
.grade-hero.g-heaven { background: linear-gradient(135deg, #5a3d10, #2a1d08); box-shadow: inset 0 0 50px rgba(255,200,80,0.18), 0 0 30px rgba(184,134,11,0.35); }
.grade-hero.g-heaven .grade-seal-ring { border-color: #ffd76a; box-shadow: 0 0 0 5px rgba(255,215,106,0.3), 0 0 24px rgba(255,200,80,0.5); animation: heavenGlow 2.6s ease-in-out infinite; }
.grade-hero.g-heaven .grade-tier { color: #ffe9b0; }
@keyframes heavenGlow {
  0%,100% { box-shadow: 0 0 0 5px rgba(255,215,106,0.25), 0 0 18px rgba(255,200,80,0.4); }
  50% { box-shadow: 0 0 0 7px rgba(255,215,106,0.4), 0 0 34px rgba(255,200,80,0.7); }
}
.grade-hero.g-high { background: linear-gradient(135deg, #7a221d, #3a110e); }
.grade-hero.g-high .grade-seal-ring { border-color: #e8b4a0; }
.grade-hero.g-midhigh { background: linear-gradient(135deg, #6a4a1a, #2f2410); }
.grade-hero.g-mid { background: linear-gradient(135deg, #3a4a3a, #1f261f); }
.grade-hero.g-mid .grade-seal-ring { border-color: #b9c9a8; }
.grade-hero.g-midlow { background: linear-gradient(135deg, #3a3a42, #1d1d22); }
.grade-hero.g-low { background: linear-gradient(135deg, #393939, #1d1d1d); }
.grade-hero.g-low .grade-seal-ring { border-color: #b0b0b0; }
.grade-hero.g-low .grade-tier { color: #e0e0e0; }

/* 요소별 점수 막대 */
.grade-factors { display: grid; gap: 0.95rem; margin-bottom: 1.3rem; }
.grade-factor { }
.gf-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.35rem; }
.gf-label { font-weight: 800; color: var(--ink); font-size: 0.97rem; }
.gf-num { font-weight: 800; color: var(--zhu-dark); font-size: 1.02rem; }
.gf-num small { font-size: 0.78rem; color: #9a8c6c; font-weight: 700; }
.gf-track { height: 11px; border-radius: 999px; background: rgba(139,32,28,0.10); overflow: hidden; border: 1px solid rgba(184,134,11,0.25); }
.gf-fill {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--zhu));
  box-shadow: 0 0 8px rgba(184,134,11,0.4);
  animation: gfGrow 1.1s cubic-bezier(0.2,0.8,0.2,1) forwards;
}
@keyframes gfGrow { from { width: 0; } }
.gf-note { font-size: 0.84rem; color: #7a6c50; margin-top: 0.35rem; line-height: 1.5; }

/* 도사 한줄평 */
.grade-oneline {
  position: relative; padding: 1.1rem 1.3rem; border-radius: 12px;
  background: rgba(181,48,42,0.06); border-left: 4px solid var(--zhu);
  font-size: 1.05rem; line-height: 1.8; color: var(--ink); font-weight: 600;
  font-family: 'Nanum Myeongjo', serif;
}
.grade-oneline i { color: var(--zhu); opacity: 0.5; margin-right: 0.4rem; }
.grade-disclaimer { font-size: 0.8rem; color: #9a8c6c; margin-top: 0.9rem; line-height: 1.6; }

@media (max-width: 520px) {
  .grade-hero { flex-direction: column; text-align: center; gap: 1rem; }
  .grade-score-line { justify-content: center; }
  .grade-rarity { margin-left: auto; margin-right: auto; }
}

/* 집중 풀이 */
.focused-card { border: 2px solid var(--zhu); }
.focused-answer { font-size: 1rem; line-height: 2; white-space: pre-line; }
.focused-action { margin-top: 1rem; }
.focused-action-title { font-weight: 700; color: var(--zhu-dark); margin-bottom: 0.5rem; }
.action-list { list-style: none; padding: 0; margin: 0; }
.action-list li { padding: 0.5rem 0.5rem 0.5rem 1.8rem; position: relative; border-bottom: 1px dashed var(--hanji-deep); font-size: 0.93rem; }
.action-list li::before { content: '❖'; font-family: 'Nanum Myeongjo', serif; font-weight: 700; position: absolute; left: 0.45rem; top: 0.5rem; color: var(--zhu); font-size: 0.85rem; line-height: 1.4; }
.timing-note { margin-top: 0.8rem; padding: 0.7rem 0.9rem; background: rgba(184,134,11,0.08); border-radius: 8px; font-size: 0.9rem; }

/* 사주 4기둥 */
.saju-grid-wrap { margin-top: 0.3rem; }
.saju-rowlabels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin-bottom: 0.35rem; }
.saju-rowlabels span { font-size: 0.66rem; color: #a99; letter-spacing: 0.02em; }
.saju-rowlabels span:nth-child(1) { display: none; }
/* row labels float on the left instead — use a left gutter */
.saju-rowlabels { display: none; }
.saju-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.55rem; text-align: center; }
.ganji-box { background: linear-gradient(180deg, #fffdf8, #fbf4e4); border: 1px solid var(--hanji-deep); border-radius: 14px; padding: 0.7rem 0.35rem 0.6rem; box-shadow: 0 1px 4px rgba(120,90,40,0.07); display: flex; flex-direction: column; align-items: center; }
.ganji-box.is-day { border: 2px solid var(--zhu); background: linear-gradient(180deg, #fff8f2, #fbeede); box-shadow: 0 3px 12px rgba(181,48,42,0.16); position: relative; }
.ganji-box.is-day::after { content: '本人'; position: absolute; top: -0.55rem; left: 50%; transform: translateX(-50%); background: var(--zhu); color: #fff8ec; font-size: 0.6rem; padding: 0.06rem 0.4rem; border-radius: 6px; letter-spacing: 0.05em; }
.gb-head { display: flex; align-items: baseline; gap: 0.25rem; }
.gb-head .gb-label { font-size: 0.82rem; font-weight: 700; color: var(--zhu-dark); }
.gb-head .gb-han { font-size: 0.62rem; color: #b0a085; }
.gb-role { font-size: 0.6rem; color: #ab9b80; margin-bottom: 0.3rem; }
.gb-ss { font-size: 0.66rem; color: #6b5e48; min-height: 0.9rem; line-height: 1.3; }
.gb-ss.top { color: var(--zhu); font-weight: 600; margin-bottom: 0.1rem; }
.ganji-box .gb-char { font-size: 1.95rem; font-weight: 800; font-family: 'Nanum Myeongjo', serif; line-height: 1.15; }
.ganji-box .gb-char.unknown { color: #c9bca0; }
.gb-meta { font-size: 0.6rem; color: #8a7a5c; margin: 0.05rem 0 0.25rem; line-height: 1.25; }
.gb-jjg { display: flex; flex-wrap: wrap; gap: 0.15rem; justify-content: center; margin-top: 0.4rem; padding-top: 0.35rem; border-top: 1px dotted var(--hanji-deep); width: 100%; }
.jjg-chip { font-size: 0.62rem; background: rgba(184,134,11,0.12); color: #7a5e1a; border-radius: 5px; padding: 0.04rem 0.28rem; font-family: 'Nanum Myeongjo', serif; }
.gb-jjg-empty { color: #c9bca0; font-size: 0.7rem; }
.oh-목 { color: #2f7d32; } .oh-화 { color: #b5302a; } .oh-토 { color: #b8860b; } .oh-금 { color: #6b6b6b; } .oh-수 { color: #1a3a5c; }

/* 오행 막대 */
.oh-bars { display: flex; gap: 0.5rem; align-items: flex-end; height: 100px; margin: 0.5rem 0; }
.oh-bar-col { flex: 1; text-align: center; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.oh-bar-fill { border-radius: 6px 6px 0 0; transition: height 0.5s; }
.bg-목 { background: linear-gradient(0deg,#256528,#4caf50); } .bg-화 { background: linear-gradient(0deg,#8a201c,#e25b54); }
.bg-토 { background: linear-gradient(0deg,#8a6508,#d4a72c); } .bg-금 { background: linear-gradient(0deg,#4a4a4a,#9a9a9a); } .bg-수 { background: linear-gradient(0deg,#0f2740,#3a6ea5); }

/* 십성 그룹 */
.sipseong-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; text-align: center; }
.ss-box { background: #fffdf8; border: 1px solid var(--hanji-deep); border-radius: 10px; padding: 0.6rem 0.3rem; }
.ss-box .ss-n { font-size: 0.85rem; font-weight: 700; }
.ss-box .ss-c { font-size: 1.3rem; font-weight: 800; color: var(--zhu); }

/* 대운 */
.daeun-scroll { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; }
.daeun-box { flex: 0 0 auto; min-width: 64px; text-align: center; background: #fffdf8; border: 1px solid var(--hanji-deep); border-radius: 10px; padding: 0.6rem 0.4rem; }
.daeun-box.daeun-current { background: var(--zhu); color: #fff8ec; border-color: var(--zhu); box-shadow: 0 2px 10px rgba(181,48,42,0.3); }
.daeun-box .d-age { font-size: 0.72rem; opacity: 0.8; }
.daeun-box .d-gj { font-size: 1.2rem; font-weight: 800; font-family: 'Nanum Myeongjo', serif; }
.daeun-box .d-ss { font-size: 0.7rem; }

/* 인생 그래프 */
.life-graph { display: flex; gap: 0.4rem; align-items: flex-end; height: 130px; margin: 0.8rem 0; }
.lg-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.lg-fill { width: 80%; border-radius: 5px 5px 0 0; background: linear-gradient(0deg, var(--gold), #e0b84e); transition: height 0.5s; }
.lg-fill.lg-cur { background: linear-gradient(0deg, var(--zhu-dark), var(--zhu)); }
.lg-age { font-size: 0.68rem; margin-top: 0.2rem; color: #6b5e48; }

/* 세운 표 */
.seun-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.seun-table th, .seun-table td { padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--hanji-deep); text-align: center; }
.seun-table th { color: #8a7a5c; font-size: 0.78rem; }
.verdict-길 { color: #2f7d32; font-weight: 700; } .verdict-주의 { color: var(--zhu); font-weight: 700; } .verdict-평 { color: #8a7a5c; }
.seun-tone { text-align: left; font-size: 0.82rem; }

/* 월별 */
.month-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.4rem; }
.month-box { text-align: center; border: 1px solid var(--hanji-deep); border-radius: 8px; padding: 0.5rem 0.2rem; background: #fffdf8; }
.month-box.m-good { background: rgba(47,125,50,0.08); border-color: #2f7d32; }
.month-box .m-n { font-weight: 700; }
.month-box .m-v { font-size: 0.72rem; }

/* 성격 카드 */
.persona-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.persona-col h4 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.persona-col.strong h4 { color: #2f7d32; }
.persona-col.weak h4 { color: var(--zhu); }
.persona-col ul { margin: 0; padding-left: 1.2rem; font-size: 0.9rem; line-height: 1.8; }

/* 직업 칩 */
.job-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.job-chip { background: rgba(184,134,11,0.1); border: 1px solid var(--gold); border-radius: 999px; padding: 0.35rem 0.9rem; font-size: 0.85rem; color: var(--zhu-dark); font-weight: 600; }

/* 개운법 */
.remedy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.remedy-item { background: #fffdf8; border: 1px solid var(--hanji-deep); border-radius: 10px; padding: 0.7rem 0.9rem; }
.remedy-item .r-label { font-size: 0.78rem; color: var(--zhu); font-weight: 700; }
.remedy-item .r-value { font-size: 0.9rem; margin-top: 0.2rem; }

/* 부적 */
.bujeok-card { text-align: center; }
.bujeok-svg-wrap { display: flex; justify-content: center; margin: 0.5rem 0; }
.bujeok-title { font-size: 0.9rem; color: #6b5e48; margin-top: 0.5rem; }

/* 인생 삼세 */
.life-story { position: relative; padding-left: 0.5rem; }
.life-story::before { content: ''; position: absolute; left: 1.35rem; top: 1.2rem; bottom: 1.2rem; width: 2px; background: linear-gradient(180deg, #9aa6b8, var(--gold), var(--zhu)); }
.ls-seg { position: relative; display: flex; gap: 1rem; padding: 0.6rem 0 1.4rem; }
.ls-seg:last-child { padding-bottom: 0.4rem; }
.ls-dot { flex: 0 0 auto; width: 2.7rem; height: 2.7rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 1; color: #fff8ec; font-size: 1.05rem; box-shadow: 0 3px 10px rgba(0,0,0,0.18); }
.ls-past .ls-dot { background: linear-gradient(135deg, #7d8aa0, #5c6678); }
.ls-present .ls-dot { background: linear-gradient(135deg, #d8932b, var(--gold)); box-shadow: 0 0 0 4px rgba(184,134,11,0.18), 0 3px 12px rgba(0,0,0,0.2); }
.ls-future .ls-dot { background: linear-gradient(135deg, var(--zhu), var(--zhu-dark)); }
.ls-body { flex: 1; background: rgba(255,255,255,0.55); border: 1px solid var(--hanji-deep); border-radius: 12px; padding: 0.85rem 1rem 0.95rem; }
.ls-present .ls-body { background: rgba(255,250,235,0.85); border-color: var(--gold); }
.ls-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.ls-badge { font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px; color: #fff8ec; }
.ls-past .ls-badge { background: #5c6678; } .ls-present .ls-badge { background: var(--gold); } .ls-future .ls-badge { background: var(--zhu); }
.ls-period { font-size: 0.78rem; color: var(--ink); opacity: 0.7; font-weight: 600; }
.ls-title { font-size: 1.02rem; font-weight: 800; color: var(--zhu-dark); margin-bottom: 0.45rem; line-height: 1.4; }
.ls-text { font-size: 0.94rem; line-height: 1.95; white-space: pre-line; }
.ls-overview { margin-top: 0.6rem; padding: 1rem 1.1rem; border-radius: 12px; background: linear-gradient(135deg, rgba(181,48,42,0.06), rgba(184,134,11,0.08)); border: 1px dashed var(--zhu); }
.ls-overview-label { font-weight: 800; color: var(--zhu-dark); margin-bottom: 0.5rem; }
.ls-overview p { font-size: 0.95rem; line-height: 1.95; white-space: pre-line; }

/* 궁합 결과 */
.compat-score-card { text-align: center; background: linear-gradient(135deg, var(--zhu-dark), var(--zhu)); color: #fff8ec; border: none; }
.compat-grade-icon { font-size: 2.6rem; color: #ffe8b0; }
.compat-score { font-size: 3rem; font-weight: 800; font-family: 'Nanum Myeongjo', serif; }
.compat-grade { font-size: 1.4rem; font-weight: 800; }
.compat-oneline { font-size: 1rem; margin-top: 0.8rem; line-height: 1.9; opacity: 0.95; }
.compat-people { display: flex; justify-content: center; gap: 1.5rem; margin: 1rem 0; }
.compat-person { background: rgba(255,255,255,0.15); border-radius: 12px; padding: 0.7rem 1.1rem; }
.compat-person .cp-name { font-weight: 800; }
.compat-person .cp-info { font-size: 0.82rem; opacity: 0.9; }
.breakdown-list { display: flex; flex-direction: column; gap: 0.9rem; }
.breakdown-item { background: #fffdf8; border: 1px solid var(--hanji-deep); border-radius: 12px; padding: 0.9rem 1rem; }
.bd-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.bd-head i { color: var(--zhu); font-size: 1.1rem; }
.bd-label { font-weight: 800; color: var(--zhu-dark); flex: 1; }
.bd-score { font-weight: 800; font-size: 1.1rem; }
.bd-bar { height: 8px; background: var(--hanji-deep); border-radius: 99px; overflow: hidden; margin-bottom: 0.5rem; }
.bd-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--zhu)); border-radius: 99px; }
.bd-desc { font-size: 0.9rem; line-height: 1.85; }

/* 툴바 */
.result-toolbar { display: flex; gap: 0.5rem; justify-content: flex-end; margin-bottom: 1rem; flex-wrap: wrap; }
.tb-btn { padding: 0.6rem 1rem; border: 1px solid var(--zhu); border-radius: 10px; background: #fff; color: var(--zhu); font-family: inherit; font-weight: 700; cursor: pointer; font-size: 0.9rem; }
.tb-btn:hover { background: var(--zhu); color: #fff8ec; }
.tb-btn:disabled { opacity: 0.5; cursor: wait; }

.err-card { background: rgba(181,48,42,0.08); border: 1px solid var(--zhu); color: var(--zhu-dark); padding: 1rem; border-radius: 12px; }

.fade-in { animation: fadeIn 0.5s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
body.capturing .fade-in { animation: none !important; opacity: 1 !important; transform: none !important; }

/* 푸터 */
.site-footer { text-align: center; padding: 2rem 1rem; color: #8a7a5c; font-size: 0.85rem; border-top: 1px solid var(--hanji-deep); margin-top: 2rem; }
.footer-sub { font-size: 0.78rem; opacity: 0.8; }
.footer-contact { font-size: 0.8rem; margin-top: 0.7rem; color: #9a8a6a; }
.footer-contact i { color: var(--zhu); margin-right: 0.3rem; }
.footer-contact a { color: var(--zhu-dark); font-weight: 700; text-decoration: none; border-bottom: 1px dotted var(--zhu); }
.footer-contact a:hover { color: var(--zhu); }

/* ── 상단 가로 배너 (광고 영역 · 현재 런칭 안내) ── */
.top-banner {
  position: relative; z-index: 5;
  background: linear-gradient(90deg, #2c2016, #3a2a18 50%, #2c2016);
  border-bottom: 1px solid rgba(184,134,11,.45);
}
.top-banner-inner {
  max-width: 920px; margin: 0 auto;
  min-height: 40px; padding: 0.45rem 1rem;
  display: flex; align-items: center; justify-content: center; gap: 0.7rem;
  flex-wrap: wrap; text-align: center;
}
.tb-badge {
  flex-shrink: 0;
  font-family: 'Nanum Myeongjo', serif; font-weight: 800;
  font-size: 0.72rem; letter-spacing: 0.06em;
  color: #1a1410;
  background: linear-gradient(135deg, #ffd76a, var(--gold));
  padding: 0.18rem 0.6rem; border-radius: 20px;
  box-shadow: 0 1px 6px rgba(184,134,11,.4);
}
.tb-badge i { margin-right: 0.25rem; }
.tb-text { font-size: 0.88rem; color: #ece2cc; line-height: 1.5; margin: 0; }
.tb-text b { color: #ffd76a; font-weight: 800; }
@media (max-width: 480px) {
  .top-banner-inner { padding: 0.4rem 0.8rem; gap: 0.45rem; }
  .tb-text { font-size: 0.8rem; }
  .tb-badge { font-size: 0.66rem; }
}

@media (max-width: 640px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 0.35rem; }
  .cat-name { font-size: 0.68rem; }
  .compat-forms { grid-template-columns: 1fr; }
  .compat-amp { transform: rotate(90deg); }
  .ganji-box .gb-char { font-size: 1.55rem; }
  .saju-grid { gap: 0.35rem; }
  .ganji-box { padding: 0.6rem 0.2rem 0.5rem; }
  .gb-head .gb-han { display: none; }
  .gb-meta { font-size: 0.55rem; }
  .jjg-chip { font-size: 0.56rem; padding: 0.03rem 0.2rem; }
  .sipseong-grid { gap: 0.3rem; }
  .ss-box { padding: 0.4rem 0.2rem; }
  .persona-grid, .remedy-grid { grid-template-columns: 1fr; }
  .month-grid { grid-template-columns: repeat(4, 1fr); }
  .result-card { padding: 1.1rem; }
  .life-story::before { left: 1.05rem; }
  .ls-dot { width: 2.1rem; height: 2.1rem; font-size: 0.85rem; }
  .ls-seg { gap: 0.7rem; }
  .compat-score { font-size: 2.4rem; }
}

/* ============================================================ */
/* 차별화 섹션: 숨겨진 본심 / 신살 */
/* ============================================================ */
.hidden-card {
  background: linear-gradient(160deg, #2b2018 0%, #3a2a1c 60%, #2b1f17 100%);
  border: 1px solid var(--gold);
  box-shadow: 0 6px 28px rgba(0,0,0,0.28), inset 0 0 60px rgba(181,48,42,0.12);
}
.hidden-card .card-title { color: #f3d98a; }
.hidden-card .card-title i { color: #e8b94a; }
.hidden-card .body-text { color: #e9dcc2; }
.hidden-lines { margin: 1rem 0 0.5rem; display: flex; flex-direction: column; gap: 0.85rem; }
.hidden-line {
  display: flex; gap: 0.8rem; align-items: flex-start;
  background: rgba(255,248,236,0.06); border-left: 3px solid var(--gold);
  padding: 0.85rem 1rem; border-radius: 0 8px 8px 0;
}
.hidden-num {
  flex: 0 0 auto; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--zhu); color: #fff8ec; font-weight: 800; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; margin-top: 0.15rem;
}
.hidden-line p { margin: 0; color: #efe4cd; line-height: 1.85; font-size: 0.97rem; }
.hidden-foot {
  margin-top: 1rem; text-align: right; color: #d4b06a; font-style: italic;
  font-size: 0.92rem; letter-spacing: 0.02em;
}
.hidden-foot i { margin-right: 0.4rem; opacity: 0.7; }

.sinsal-card .card-title i { color: var(--gold); }
.sinsal-list { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.9rem; }
.sinsal-item {
  background: #fffaf0; border: 1px solid #e6d6ad;
  border-radius: 10px; padding: 1rem 1.1rem;
  box-shadow: 0 2px 8px rgba(120,90,30,0.07);
}
.sinsal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.55rem; }
.sinsal-name { font-weight: 800; color: var(--zhu-dark); font-size: 1.05rem; }
.sinsal-hanja { color: var(--gold); font-weight: 700; }
.sinsal-tag {
  font-size: 0.74rem; background: var(--zhu); color: #fff8ec;
  padding: 0.15rem 0.55rem; border-radius: 999px; font-weight: 600;
}
.sinsal-pos { font-size: 0.74rem; color: #8a7a5c; margin-left: auto; }
.sinsal-body { margin: 0 0 0.5rem; line-height: 1.85; color: var(--ink); font-size: 0.95rem; }
.sinsal-tip {
  margin: 0; padding: 0.6rem 0.8rem; background: #f3ead2;
  border-radius: 7px; line-height: 1.75; color: #5b4a2e; font-size: 0.9rem;
}
.sinsal-tip i { color: var(--gold); margin-right: 0.35rem; }

/* ============================================================
   이갑룡 처사의 유산 섹션 (마케팅)
   ============================================================ */
.heritage {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(181,48,42,.07), transparent 60%),
    linear-gradient(180deg, #1a1410, #241a12 55%, #2c2016);
  padding: 3rem 1.2rem 3.2rem;
  overflow: hidden;
}
.heritage::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ctext x='6' y='30' font-size='22' fill='%23b8860b' opacity='0.05'%3E乾%3C/text%3E%3Ctext x='32' y='52' font-size='22' fill='%23b5302a' opacity='0.05'%3E坤%3C/text%3E%3C/svg%3E");
  pointer-events: none;
}
.heritage-inner { max-width: 920px; margin: 0 auto; position: relative; text-align: center; }
.heritage-brand {
  font-family: 'Nanum Myeongjo', serif; font-weight: 800; letter-spacing: .03em;
  font-size: 1.9rem; color: #f4e7c4; margin: 0 0 1.6rem;
  text-shadow: 0 2px 14px rgba(0,0,0,.5), 0 0 24px rgba(184,134,11,.25);
}
.heritage-brand i { color: #ffd76a; margin-right: .5rem; }
.heritage-brand .brand-sub { font-size: .85rem; opacity: .7; margin-left: .35rem; vertical-align: middle; color: #d9c48a; }
@media (max-width: 640px) { .heritage-brand { font-size: 1.45rem; } }
.heritage-eyebrow {
  font-family: 'Nanum Myeongjo', serif; letter-spacing: .22em;
  color: var(--gold); font-size: .76rem; margin: 0 0 .7rem;
}
.heritage-title {
  font-family: 'Nanum Myeongjo', serif; font-weight: 800;
  color: #f4ead2; font-size: 1.55rem; line-height: 1.5; margin: 0 0 .9rem;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.heritage-title b { color: var(--zhu); }
.heritage-lead {
  font-family: 'Noto Serif KR', serif; color: #cbbfa6;
  font-size: .95rem; line-height: 1.9; margin: 0 auto 1.8rem; max-width: 760px;
}
.heritage-lead b { color: #e9c46a; }
.heritage-figs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem;
  max-width: 760px; margin: 0 auto 1.6rem;
}
.heritage-fig { margin: 0; }
.hf-frame {
  position: relative; border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(184,134,11,.45);
  box-shadow: 0 8px 28px rgba(0,0,0,.5), inset 0 0 0 4px rgba(246,237,216,.06);
  background: #f6edd8;
  aspect-ratio: 3 / 4;
}
.hf-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s ease;
}
.heritage-fig:hover .hf-frame img { transform: scale(1.05); }
.heritage-fig figcaption {
  margin-top: .7rem; color: #cbbfa6; font-family: 'Noto Serif KR', serif;
  display: flex; flex-direction: column; gap: .25rem;
}
.heritage-fig figcaption b { color: var(--gold); font-size: .98rem; letter-spacing: .04em; }
.heritage-fig figcaption span { font-size: .8rem; line-height: 1.5; color: #b3a78d; }
.heritage-foot {
  font-family: 'Noto Serif KR', serif; color: #9d9078;
  font-size: .82rem; line-height: 1.7; margin: 0 auto 1.4rem; max-width: 680px;
}
.heritage-cta {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.7rem; border-radius: 999px;
  background: linear-gradient(135deg, var(--zhu-dark), var(--zhu));
  color: #fff8ec; font-weight: 800; font-size: 1rem; text-decoration: none;
  box-shadow: 0 6px 20px rgba(181,48,42,.4);
  transition: transform .12s, box-shadow .12s;
}
.heritage-cta:hover { transform: translateY(-2px); box-shadow: 0 9px 26px rgba(181,48,42,.5); }
@media (max-width: 640px) {
  .heritage { padding: 2.2rem 1rem 2.4rem; }
  .heritage-title { font-size: 1.25rem; }
  .heritage-lead { font-size: .86rem; }
  .heritage-lead .hb { display: none; }
  .heritage-figs { gap: .8rem; }
  .heritage-fig figcaption b { font-size: .88rem; }
  .heritage-fig figcaption span { font-size: .72rem; }
}
