/* 팩폭할매 – 조선 신당 테마 */
:root {
  --bg: #140D0B; --panel: #221714; --line: #4E3A2E; --line2: #6E523F;
  --text: #F1E6D2; --muted: #B5A288; --dim: #8C7A64;
  --red: #C8452F; --red2: #9E2B1F; --gold: #E0A93B; --gold2: #B9862A; --paper: #E9D6A6; --paperInk: #3A2418;
  --wood: #4F9A62; --fire: #D9533A; --earth: #D1A13A; --metal: #CFC8BC; --water: #3F5E86;
}
* { box-sizing: border-box; word-break: keep-all; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Gowun Dodum', system-ui, sans-serif; color: var(--text); line-height: 1.65; background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 85% 5%, rgba(224,140,60,.22), transparent 70%),
    radial-gradient(ellipse 50% 35% at 5% 40%, rgba(200,69,47,.12), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 85%, rgba(224,169,59,.08), transparent 70%),
    repeating-linear-gradient(115deg, rgba(255,240,210,.018) 0 2px, transparent 2px 7px);
  background-attachment: fixed; }
a { color: var(--gold); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 22px; }

/* 머리말 */
.head { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; padding-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Song Myung', 'Gowun Batang', serif; font-size: 24px; letter-spacing: 1px; }
.mark { width: 36px; height: 36px; border-radius: 6px; background: var(--red); color: #FBEBD0; display: grid; place-items: center; font-family: 'Noto Serif KR', serif; font-weight: 900; font-size: 19px; transform: rotate(-5deg); box-shadow: inset 0 0 0 2px rgba(251,235,208,.7), inset 0 0 0 4px var(--red); }
nav a { color: var(--muted); text-decoration: none; margin-left: 18px; font-size: 15px; border-bottom: 1px solid transparent; }
nav a:hover { color: var(--text); border-color: var(--gold); }

/* 첫 화면 */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 34px; align-items: center; padding: 38px 0 26px; }
.kicker { font-family: 'Song Myung', serif; color: var(--gold); letter-spacing: 3px; font-size: 15px; margin: 0 0 10px; }
.hero h1 { font-family: 'Nanum Brush Script', 'Song Myung', serif; font-weight: 400; font-size: clamp(56px, 9vw, 104px); line-height: 1; margin: 0; letter-spacing: 1px; text-shadow: 0 4px 24px rgba(0,0,0,.6); }
.hero h1 em { font-style: normal; color: var(--red); text-shadow: 0 0 30px rgba(200,69,47,.35); }
.lead { font-size: 18px; color: #E4D6BE; margin: 18px 0 22px; max-width: 30em; }
.cta { display: inline-block; font-family: 'Gowun Batang', serif; font-weight: 700; font-size: 18px; color: #1A100C; background: linear-gradient(180deg, #F0C25A, var(--gold)); padding: 13px 26px; border-radius: 4px; text-decoration: none; box-shadow: 0 0 0 1px #7A5A1E, 0 10px 30px rgba(224,169,59,.25); }
.cta:hover { filter: brightness(1.08); }
.privacy { font-size: 13px; color: var(--dim); margin: 18px 0 0; padding-left: 22px; position: relative; max-width: 34em; }
.privacy::before { content: '🔒'; position: absolute; left: 0; }
.privacy a { color: var(--muted); }
.heroPhoto { position: relative; }
.grannyBox { width: 100%; max-width: 380px; margin-left: auto; }
.grannyBox .halmaePhoto { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 25%; display: block; border-radius: 200px 200px 10px 10px; border: 3px solid var(--gold2); box-shadow: 0 0 0 8px rgba(224,169,59,.08), 0 30px 80px rgba(230,120,40,.28), 0 10px 30px rgba(0,0,0,.6); filter: contrast(1.05) saturate(.95); }
.grannyBox svg { width: 100%; }
.heroQuote { position: absolute; left: -10px; bottom: 26px; margin: 0; font-family: 'Nanum Brush Script', serif; font-size: 40px; color: var(--paperInk); background: var(--paper); padding: 4px 18px 2px; transform: rotate(-4deg); box-shadow: 0 8px 20px rgba(0,0,0,.5); }

/* 패널 */
.panel { position: relative; background: linear-gradient(180deg, rgba(255,240,210,.035), rgba(255,240,210,0) 40%), var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 28px; margin: 22px 0; box-shadow: 0 20px 50px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,240,210,.05); }
.panel::before, .panel::after { content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid var(--gold2); opacity: .7; }
.panel::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.panel::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.panel h2 { font-family: 'Song Myung', 'Gowun Batang', serif; font-weight: 400; margin: 0 0 18px; font-size: 26px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.panel h2 small { font-family: 'Gowun Dodum', sans-serif; font-size: 14px; color: var(--muted); }
.hj { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 4px; background: var(--red2); color: #FBEBD0; font-family: 'Noto Serif KR', serif; font-weight: 900; font-size: 18px; transform: rotate(-4deg); }

/* 입력 */
.seg { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.seg label span { display: inline-block; padding: 8px 22px; border: 1px solid var(--line2); border-radius: 4px; cursor: pointer; color: var(--muted); }
.seg input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { background: var(--gold); color: #1A100C; border-color: var(--gold); font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.leap { margin-left: 8px; display: none; color: var(--muted); }
.leap.show { display: inline-flex; gap: 6px; align-items: center; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; align-items: end; }
.grid3 label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 5px; letter-spacing: 1px; }
input[type=number], select { font: inherit; font-size: 19px; padding: 11px 13px; border: 1px solid var(--line2); border-radius: 4px; background: #150E0C; color: var(--text); width: 100%; }
input[type=number]:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224,169,59,.18); }
input::placeholder { color: #5E4E40; }
input[type=checkbox] { accent-color: var(--gold); width: 17px; height: 17px; }
label.check { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text) !important; font-size: 15px !important; padding-bottom: 12px; letter-spacing: 0 !important; }
.opts { margin: 6px 0 20px; font-size: 15px; color: var(--muted); }
.opts summary { cursor: pointer; }
.opts label { display: flex; gap: 8px; align-items: center; margin-top: 10px; color: var(--text); }
.opts .sel { flex-direction: column; align-items: stretch; }
.tiny { font-size: 13px; color: var(--dim); margin: 8px 0 0; }
.go { font: inherit; font-family: 'Song Myung', serif; font-size: 24px; padding: 14px 34px; border: 0; border-radius: 6px; background: var(--red); color: #FBEBD0; cursor: pointer; transform: rotate(-1.5deg); box-shadow: inset 0 0 0 3px rgba(251,235,208,.75), inset 0 0 0 6px var(--red), 0 12px 30px rgba(200,69,47,.35); letter-spacing: 2px; }
.go:hover { filter: brightness(1.08); }
.go:active { transform: rotate(-1.5deg) scale(.97); }
.err { color: #FF8A70; min-height: 1.4em; margin: 12px 0 0; }
.hidden { display: none; }

/* 사주팔자: 부적 */
.meta { color: var(--muted); margin: -8px 0 18px; font-size: 14px; }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; text-align: center; }
.pcol { background: linear-gradient(180deg, #EEDDB2, var(--paper)); color: var(--paperInk); border-radius: 3px; padding: 12px 6px 10px; box-shadow: inset 0 0 0 2px var(--red2), inset 0 0 0 5px var(--paper), inset 0 0 0 6px rgba(158,43,31,.5), 0 10px 24px rgba(0,0,0,.45); }
.pcol .lab { font-family: 'Song Myung', serif; font-size: 15px; color: var(--red2); }
.pcol .god { font-size: 12px; color: #6E4A34; min-height: 1.4em; }
.ch { margin: 6px auto; width: min(76px, 100%); aspect-ratio: 1; border-radius: 6px; display: grid; place-items: center; font-family: 'Noto Serif KR', serif; font-weight: 900; font-size: clamp(30px, 6vw, 42px); color: #FFF4E0; line-height: 1; position: relative; box-shadow: inset 0 0 0 2px rgba(255,244,224,.35); }
.ch small { position: absolute; bottom: 3px; right: 6px; font-family: 'Gowun Dodum', sans-serif; font-weight: 400; font-size: 11px; opacity: .85; }
.e0 { background: var(--wood); } .e1 { background: var(--fire); } .e2 { background: var(--earth); } .e3 { background: #9C9488; } .e4 { background: var(--water); }
.empty { background: rgba(58,36,24,.15); color: #8C6A50; font-size: 16px; box-shadow: inset 0 0 0 2px rgba(58,36,24,.25); }
.notes { margin: 16px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }

/* 오행 */
.elems { display: grid; gap: 10px; margin-bottom: 14px; }
.erow { display: grid; grid-template-columns: 58px 1fr 28px; align-items: center; gap: 12px; font-size: 15px; }
.bar { height: 12px; border-radius: 99px; background: #150E0C; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }
#elemText p { margin: 6px 0; color: #E4D6BE; }

/* 할매 말풍선 */
.talk { display: flex; gap: 16px; align-items: flex-start; }
.mini { width: 84px; flex: none; }
.mini svg { width: 100%; }
.mini .zoom { width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 2px solid var(--gold2); box-shadow: 0 0 0 4px rgba(224,169,59,.1), 0 8px 20px rgba(0,0,0,.5); }
.mini .zoom img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.9); transform-origin: 52% 27%; display: block; }
.bubble { position: relative; flex: 1; margin: 0; background: var(--paper); color: var(--paperInk); border-radius: 4px; padding: 16px 20px; font-family: 'Gowun Batang', serif; font-weight: 700; font-size: 18px; line-height: 1.65; box-shadow: 0 10px 24px rgba(0,0,0,.4); }
.bubble::before { content: ''; position: absolute; left: -12px; top: 26px; border: 7px solid transparent; border-right: 7px solid var(--paper); }
.gold { border-color: var(--gold2); background: radial-gradient(ellipse at 90% 0%, rgba(224,169,59,.16), transparent 60%), var(--panel); }
.zline { margin: 14px 0 0; font-size: 15px; color: var(--gold); }
.rows { display: grid; gap: 9px; margin-top: 16px; }
.row { display: flex; gap: 12px; font-size: 16px; align-items: baseline; }
.row b { flex: none; width: 52px; text-align: center; border: 1px solid var(--line2); border-radius: 3px; font-family: 'Song Myung', serif; font-weight: 400; color: var(--gold); }
.closing { font-family: 'Nanum Brush Script', serif; font-size: 34px; color: var(--red); margin: 16px 0 0; text-shadow: 0 0 20px rgba(200,69,47,.25); }

/* 띠별 */
.zgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.zc { border: 1px solid var(--line); border-radius: 4px; padding: 15px 16px; background: #1A110E; transition: border-color .2s; }
.zc:hover { border-color: var(--gold2); }
.zc h3 { margin: 0; font-family: 'Song Myung', serif; font-weight: 400; font-size: 20px; display: flex; justify-content: space-between; align-items: center; }
.zc .dots { color: var(--gold); letter-spacing: 2px; font-size: 13px; }
.zc p { margin: 6px 0 0; font-size: 15px; color: #E4D6BE; }
.zc .yrs { color: var(--dim); font-size: 12px; }

/* 기타 */
.ad { margin: 22px 0; min-height: 100px; text-align: center; }
.ad > span { display: block; font-size: 11px; color: var(--dim); letter-spacing: 2px; margin-bottom: 4px; }
.disclaimer { font-size: 13px; color: var(--dim); text-align: center; margin: 30px 0; }
.foot { text-align: center; font-size: 13px; color: var(--dim); padding-bottom: 34px; }
.foot a { color: var(--muted); }
.policy h1 { font-family: 'Song Myung', serif; font-weight: 400; font-size: 32px; margin: 24px 0 8px; }
.policy h2 { font-family: 'Song Myung', serif; font-weight: 400; font-size: 21px; margin: 24px 0 6px; color: var(--gold); }
.policy p, .policy li { font-size: 15px; color: #E4D6BE; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 18px; padding-top: 18px; }
  .heroPhoto { order: -1; }
  .grannyBox { max-width: 250px; margin: 0 auto; }
  .heroQuote { left: auto; right: 4px; bottom: 12px; font-size: 28px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid3 .check { grid-column: span 2; }
  .panel { padding: 22px 18px; }
  .pillars { gap: 8px; }
  .pcol { padding: 10px 3px 8px; }
  .mini { width: 64px; }
  .bubble { font-size: 16px; padding: 13px 15px; }
  nav a { margin-left: 12px; font-size: 14px; }
}

/* 읽을거리 페이지 */
.article { padding-bottom: 10px; }
.article h1 { font-family: 'Song Myung', serif; font-weight: 400; font-size: clamp(30px, 5vw, 44px); line-height: 1.25; margin: 26px 0 14px; }
.article h1 small { display: block; font-family: 'Gowun Dodum', sans-serif; font-size: 16px; color: var(--gold); margin-top: 6px; }
.article h2 { font-family: 'Song Myung', serif; font-weight: 400; font-size: 25px; margin: 38px 0 12px; padding-left: 14px; border-left: 4px solid var(--red); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.article h2 small { font-family: 'Gowun Dodum', sans-serif; font-size: 13px; color: var(--muted); }
.article h3 { font-family: 'Song Myung', serif; font-weight: 400; font-size: 20px; margin: 0 0 8px; color: var(--gold); }
.article p, .article li { font-size: 16.5px; color: #E4D6BE; }
.article .talk { margin: 14px 0 20px; }
.crumb { font-size: 13px; color: var(--dim); margin: 22px 0 0; }
.crumb a { color: var(--muted); }
.lead2 { font-family: 'Gowun Batang', serif; font-weight: 700; font-size: 21px !important; color: var(--text) !important; }
.scoreLine { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 8px 0 0; }
.dotsBig { color: var(--gold); font-size: 20px; letter-spacing: 3px; }
.scoreLine b { font-family: 'Song Myung', serif; font-weight: 400; background: var(--red); color: #FBEBD0; padding: 2px 12px; border-radius: 3px; }
.tag { border: 1px solid var(--gold); color: var(--gold); border-radius: 99px; padding: 1px 12px; font-size: 14px; }
.rows.big .row { font-size: 17px; }
.mtable { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 15px; }
.mtable th { text-align: left; font-family: 'Song Myung', serif; font-weight: 400; color: var(--gold); border-bottom: 1px solid var(--line2); padding: 8px 6px; }
.mtable td { border-bottom: 1px solid var(--line); padding: 9px 6px; color: #E4D6BE; vertical-align: top; }
.mtable td small { margin-left: 4px; color: var(--dim); font-size: 12px; }
.mtable td.dots { color: var(--gold); white-space: nowrap; letter-spacing: 1px; }
.mtable tr.g5 td:first-child, .mtable tr.g4 td:first-child { color: var(--gold); }
.mtable tr.g2 td:first-child { color: #FF8A70; }
.ylist { list-style: none; padding: 0; display: grid; gap: 8px; }
.ylist li { background: #1A110E; border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; }
.ylist b { font-family: 'Song Myung', serif; font-weight: 400; color: var(--gold); margin-right: 8px; }
.ylist .age { font-size: 12px; color: var(--dim); margin-right: 10px; }
.closingLine { font-family: 'Nanum Brush Script', serif; font-size: 32px !important; color: var(--red) !important; margin: 18px 0; }
.ctaBox { margin: 26px 0; }
.zlinks a { color: var(--muted); }
.zsec { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px 22px; margin: 16px 0; }
.zsec h2 { margin: 0 0 8px; border: 0; padding: 0; font-size: 23px; }
.zsec h2 .dots { color: var(--gold); font-size: 15px; letter-spacing: 2px; }
.head2 { font-family: 'Gowun Batang', serif; font-weight: 700; color: var(--text) !important; font-size: 18px !important; }
.lucky2 { font-size: 14px !important; color: var(--muted) !important; }
.zsec .closingLine { font-size: 28px !important; margin: 8px 0 0; }
a.zc { display: block; color: inherit; text-decoration: none; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin: 24px 0; }
.pager a { color: var(--gold); }
.dlist { columns: 2; padding-left: 18px; }
.dlist a { color: var(--muted); }
@media (max-width: 720px) { .dlist { columns: 1; } .mtable { font-size: 13.5px; } .mtable td:last-child { min-width: 9em; } }
.article .bubble { color: var(--paperInk); font-size: 17px; }
.head { flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) { .head nav { width: 100%; display: flex; gap: 14px; overflow-x: auto; white-space: nowrap; } .head nav a { margin-left: 0; font-size: 14px; } }
