/* 2026-11-29 2차: 먹색 머리 + 흰 종이 카드 + 가는 금선. 감정서의 겹테·모서리 장식·낙관을 가져온다.
   변수 이름은 옛 것 그대로 둔다(/2027/ 점수표 쪽이 같이 쓴다). */
:root {
  --ink: #15171c;
  --ink2: #20232b;
  --bg: #f3f3f1;
  --bg2: #fff;
  --card: #fff;
  --line: #e2dfd8;
  --hair: #e9e7e1;
  --soft: #f7f6f3;
  --text: #1b1c20;
  --muted: #6b6a66;
  --gold: #96732f;
  --goldl: #d8bf8a;
  --pink: #a8261c;
  --red: #a8261c;
  --wood: #1d6b3a;
  --fire: #c0281e;
  --earth: #b07d0b;
  --metal: #7a7f86;
  --water: #111;
  --sans: "Pretendard", -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --serif: "Nanum Myeongjo", "AppleMyungjo", "Noto Serif KR", "Batang", serif;
  --han: "Songti TC", "STSong", "Nanum Myeongjo", "AppleMyungjo", serif;
  --shadow: 0 1px 2px rgba(21, 23, 28, .05), 0 10px 28px rgba(21, 23, 28, .07);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.sky { display: none; }
main { position: relative; max-width: 600px; margin: 0 auto; padding: 0 16px 48px; }
a { color: var(--gold); }

/* 머리: 먹색 바탕, 금선 겹테 */
.hero {
  position: relative; text-align: center; color: #fff;
  margin: 0 -16px; padding: 30px 22px 64px;
  background: radial-gradient(120% 90% at 50% 0%, #2a2d38 0%, var(--ink) 70%);
  box-shadow: 0 0 0 100vmax var(--ink); clip-path: inset(0 -100vmax);
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--goldl), transparent); opacity: .6; }
.brand {
  display: inline-block; margin: 0 0 22px; padding: 9px 22px 8px;
  border: 1px solid rgba(216, 191, 138, .75); outline: 1px solid rgba(216, 191, 138, .35); outline-offset: 4px;
  font-family: var(--serif); font-size: 22px; font-weight: 800; letter-spacing: 9px; text-indent: 9px; line-height: 1.3; color: #fff;
}
.brand::before { content: "運 命 運 勢"; display: block; font-family: var(--han); font-size: 12px; font-weight: 400; letter-spacing: 5px; text-indent: 5px; color: var(--goldl); margin-bottom: 1px; }
.brand small { display: block; font-family: var(--sans); font-size: 12.5px; font-weight: 400; letter-spacing: 1.5px; text-indent: 1.5px; color: rgba(255, 255, 255, .62); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.42; margin: 0 0 12px; font-weight: 800; }
h1 { font-size: 27px; letter-spacing: -.3px; }
h1 em { font-style: normal; color: var(--goldl); }
h2 { font-size: 23px; }
h3 { font-size: 20px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
h3::before { content: ""; flex: none; width: 7px; height: 7px; transform: rotate(45deg) translateY(-3px); background: var(--gold); margin-right: 4px; }
h3 small { font-family: var(--sans); font-size: 13.5px; color: var(--muted); font-weight: 400; }
.sub { color: rgba(255, 255, 255, .6); margin: 0; font-size: 15px; letter-spacing: .5px; }
.hero + * { margin-top: -40px; position: relative; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 22px 20px; margin: 16px 0; box-shadow: var(--shadow); }
.card.accent { background: var(--soft); }
.eyebrow { color: var(--gold); font-size: 14px; font-weight: 600; letter-spacing: .3px; margin: 0 0 6px; }
.lead { font-size: 17.5px; }
.hidden { display: none !important; }

/* 입력 */
.form { border-top: 3px solid var(--gold); }
.form .row { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.date select { flex: 1; min-width: 0; }
select, input[type=time] {
  background: #fff; color: var(--text); border: 1px solid #cfccc4; border-radius: 6px;
  padding: 13px 10px; font: inherit; font-size: 17px; font-weight: 600;
  appearance: none; -webkit-appearance: none; text-align: center; text-align-last: center;
}
select:focus, input[type=time]:focus { outline: 2px solid var(--goldl); outline-offset: 1px; border-color: var(--gold); }
.time .tlabel { font-size: 16px; font-weight: 700; white-space: nowrap; }
.time input[type=time] { flex: 1; min-width: 0; min-height: 52px; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 16px; white-space: nowrap; margin-bottom: 12px; }
.check input { width: 21px; height: 21px; accent-color: #15171c; }
.time .check { margin: 0; }
.thint { margin: -4px 0 16px; color: var(--muted); font-size: 14px; line-height: 1.55; }

.seg label, .chips label { cursor: pointer; }
.seg label { flex: 1; }
.seg input, .chips input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .chips span {
  display: block; text-align: center; padding: 12px 12px; border: 1px solid #cfccc4; border-radius: 6px;
  background: #fff; color: var(--muted); font-size: 16px; transition: all .15s;
}
.seg input:checked + span, .chips input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; font-weight: 700; box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px rgba(216, 191, 138, .55); }
.seg input:focus-visible + span, .chips input:focus-visible + span { outline: 2px solid var(--goldl); outline-offset: 2px; }
.q { margin: 10px 0 8px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chips label { flex: 1; }
.chips span { padding: 11px 6px; font-size: 15.5px; white-space: nowrap; }

.btn {
  display: block; width: 100%; border: 0; border-radius: 6px; padding: 17px; cursor: pointer;
  font: inherit; font-size: 18px; font-weight: 700; letter-spacing: .3px; color: #fff;
  background: linear-gradient(180deg, #2b2e38, var(--ink));
  box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px rgba(216, 191, 138, .5), 0 8px 20px rgba(21, 23, 28, .22);
}
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--text); font-weight: 500; box-shadow: inset 0 0 0 1px #cfccc4; }
.err { color: var(--red); font-weight: 700; min-height: 1em; margin: 0 0 8px; font-size: 15px; }
.privacy { color: var(--muted); font-size: 13px; text-align: center; margin: 12px 0 0; }

/* 사주 원국: 감정서 명식표 */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); margin: 16px 0 18px; border: 1px solid #1b1c20; background: #fff; }
.pillar { text-align: center; padding: 0 0 8px; border-left: 1px solid #1b1c20; }
.pillar:first-child { border-left: 0; }
.pillar.unknown { color: #b5b3ad; }
.plabel { font-family: var(--serif); font-size: 13.5px; color: var(--muted); background: var(--soft); border-bottom: 1px solid #1b1c20; margin: 0 0 8px; padding: 3px 0; }
.plabel::before { font-family: var(--han); color: var(--text); font-weight: 700; margin-right: 4px; }
.pillar:nth-child(1) .plabel::before { content: "時"; } .pillar:nth-child(2) .plabel::before { content: "日"; }
.pillar:nth-child(3) .plabel::before { content: "月"; } .pillar:nth-child(4) .plabel::before { content: "年"; }
.char { font-family: var(--han); font-size: 40px; font-weight: 700; line-height: 1.18; }
.pko { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.el-목 { color: var(--wood); } .el-화 { color: var(--fire); } .el-토 { color: var(--earth); } .el-금 { color: var(--metal); } .el-수 { color: var(--water); }
.bg-목 { background: var(--wood); } .bg-화 { background: var(--fire); } .bg-토 { background: var(--earth); } .bg-금 { background: var(--metal); } .bg-수 { background: var(--water); }
.two { display: grid; gap: 10px; margin-top: 14px; }
.two > div { background: var(--soft); border-left: 2px solid var(--gold); border-radius: 0 6px 6px 0; padding: 10px 14px; }
.two b { font-size: 14px; color: var(--gold); letter-spacing: .3px; }
.two p { margin: 2px 0 0; }

/* 오행 막대 */
.bars { display: grid; gap: 10px; margin-bottom: 16px; }
.bar { display: grid; grid-template-columns: 58px 1fr 20px; gap: 10px; align-items: center; }
.bname { font-family: var(--serif); font-size: 16px; font-weight: 800; }
.track { height: 9px; background: #eceae5; border-radius: 99px; overflow: hidden; }
.fill { display: block; height: 100%; border-radius: 99px; }
.bnum { text-align: right; font-size: 15px; font-weight: 700; }
.weak p { margin: 0 0 10px; }
.lucky { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lucky li { background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 8px 4px 9px; text-align: center; font-weight: 700; font-size: 16px; }
.lucky span { display: block; color: var(--gold); font-size: 12.5px; font-weight: 600; margin-bottom: 1px; }

/* 운 흐름 */
.star { border-top: 1px solid var(--hair); padding-top: 14px; margin-top: 14px; }
.star:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.star.focus { background: var(--soft); border: 1px solid var(--line); border-left: 2px solid var(--gold); border-radius: 0 6px 6px 0; padding: 12px 14px; }
.star.focus + .star { border-top: 0; }
.star.focus .shead b::after { content: " · 궁금한 운"; color: var(--gold); font-size: 13px; font-weight: 600; font-family: var(--sans); }
.shead { display: flex; justify-content: space-between; align-items: center; }
.shead b { font-family: var(--serif); font-size: 18px; font-weight: 800; }
.star p { margin: 4px 0 0; color: #3b3c40; }
.lv { font-size: 13px; padding: 2px 11px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.lv-0 { background: #fff; color: var(--muted); }
.lv-low { background: #fff; color: var(--gold); border-color: var(--goldl); }
.lv-high { background: var(--ink); color: var(--goldl); border-color: var(--ink); }

/* 영상 */
.video { margin-top: 12px; }
.thumb { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 6px; overflow: hidden; cursor: pointer; background: #000; aspect-ratio: 16 / 9; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play { position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%; background: rgba(21, 23, 28, .75); border: 1px solid rgba(216, 191, 138, .7); color: #fff; display: grid; place-items: center; font-size: 20px; }
.frame { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vtitle { font-weight: 700; margin-top: 10px; font-size: 16px; line-height: 1.5; }
.vlink { font-size: 14px; text-decoration: none; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid .video { margin-top: 0; }

/* 잠긴 달 풀이 */
.locked { position: relative; margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); }
.blur { filter: blur(5px); padding: 14px; min-height: 250px; color: var(--muted); user-select: none; }
.blur p { margin: 0 0 8px; }
.lockbox { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 18px; text-align: center; background: rgba(247, 246, 243, .72); }
.lockbox p { margin: 0 0 10px; font-size: 15.5px; }
.lockt { font-family: var(--serif); font-weight: 800; font-size: 19px !important; }
.lockbox .btn { font-size: 17px; padding: 14px; }
.lockbox .hint { color: var(--muted); font-size: 14px !important; }

.actions { display: grid; gap: 10px; margin-top: 8px; }
footer { text-align: center; color: var(--muted); font-size: 14px; margin-top: 40px; }
footer::before { content: ""; display: block; width: 7px; height: 7px; margin: 0 auto 16px; transform: rotate(45deg); background: var(--goldl); }
footer a { text-decoration: none; font-weight: 600; }
footer p { margin: 4px 0 0; }

@media (max-width: 360px) {
  h1 { font-size: 24px; }
  .char { font-size: 34px; }
  .chips span { font-size: 14.5px; padding: 11px 2px; }
}

/* 단계식 입력: 해 → 띠 운세 한 줄 → 생일 */
.step-q { display: block; font-family: var(--serif); font-weight: 800; font-size: 18.5px; margin: 0 0 10px; }
.step-q em { font-style: normal; color: var(--gold); }
select.big { width: 100%; font-size: 20px; font-weight: 700; padding: 17px 12px; border: 1.5px solid var(--ink); }
.teaser { margin: 14px 0 20px; padding: 14px 16px; border: 1px solid var(--goldl); border-radius: 6px; background: linear-gradient(180deg, #fbf8f0, #fff); animation: rise .35s ease-out; }
.teaser .lead { margin: 0 0 8px; font-family: var(--serif); font-weight: 700; }
.tnext { margin: 0; color: var(--gold); font-size: 14.5px; font-weight: 700; }
#step2 { animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.share-box { text-align: center; font-size: 15px; color: var(--muted); }
.share-box p { margin: 4px 0 8px; }
.share-box input { width: 100%; padding: 12px; border: 1px solid #cfccc4; border-radius: 6px; background: #fff; color: var(--text); font-size: 15px; text-align: center; }

/* 감정서 안내: 먹색 바탕에 흰 문서가 놓인 모양, 금선 모서리 장식 */
.paper {
  position: relative; margin: 22px 0; padding: 26px 20px 20px; border-radius: 8px; color: #fff;
  background:
    linear-gradient(var(--goldl), var(--goldl)) 10px 10px / 22px 1px no-repeat,
    linear-gradient(var(--goldl), var(--goldl)) 10px 10px / 1px 22px no-repeat,
    linear-gradient(var(--goldl), var(--goldl)) calc(100% - 10px) 10px / 22px 1px no-repeat,
    linear-gradient(var(--goldl), var(--goldl)) calc(100% - 10px) 10px / 1px 22px no-repeat,
    linear-gradient(var(--goldl), var(--goldl)) 10px calc(100% - 10px) / 22px 1px no-repeat,
    linear-gradient(var(--goldl), var(--goldl)) 10px calc(100% - 10px) / 1px 22px no-repeat,
    linear-gradient(var(--goldl), var(--goldl)) calc(100% - 10px) calc(100% - 10px) / 22px 1px no-repeat,
    linear-gradient(var(--goldl), var(--goldl)) calc(100% - 10px) calc(100% - 10px) / 1px 22px no-repeat,
    radial-gradient(120% 80% at 50% 0%, #2a2d38 0%, var(--ink) 75%);
  box-shadow: 0 14px 34px rgba(21, 23, 28, .28); animation: rise .35s ease-out;
}
.ptitle { position: relative; text-align: center; padding: 0 0 12px; margin: 0 0 14px; border-bottom: 1px solid rgba(216, 191, 138, .4); }
.ptitle::before { content: "丁未年 新年運勢"; display: block; font-family: var(--han); font-size: 13px; letter-spacing: 5px; text-indent: 5px; color: var(--goldl); margin-bottom: 2px; }
.ptitle b { display: block; font-family: var(--serif); font-weight: 800; font-size: clamp(23px, 6.8vw, 28px); letter-spacing: 2px; line-height: 1.3; }
.ptitle span { display: block; font-size: 13.5px; letter-spacing: 1px; color: rgba(255, 255, 255, .6); }
.pwho { margin: 0 0 8px; font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--goldl); line-height: 1.6; }
.paper ul { margin: 0 0 14px; padding-left: 20px; font-size: 16px; line-height: 1.7; color: rgba(255, 255, 255, .9); }
.paper li::marker { color: var(--goldl); }
.pimg { display: block; border-radius: 4px; overflow: hidden; background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.pimg img { display: block; width: 100%; height: auto; }
.pbtn { display: block; margin-top: 14px; padding: 17px; border-radius: 6px; text-align: center; text-decoration: none; background: linear-gradient(180deg, #ecd9a8, #cdb072); color: #1b1c20; font-size: 19px; font-weight: 800; letter-spacing: .3px; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.pnote { margin: 10px 0 0; text-align: center; font-size: 14px; color: rgba(255, 255, 255, .6); }
.paperlink { position: relative; display: block; margin: 16px 0; padding: 14px 44px 14px 18px; border-radius: 8px; border: 1px solid var(--goldl); background: #fff; text-decoration: none; box-shadow: var(--shadow); }
.paperlink::after { content: "›"; position: absolute; right: 18px; top: 50%; transform: translateY(-54%); font-size: 26px; color: var(--gold); }
.paperlink b { display: block; font-family: var(--serif); font-weight: 800; font-size: 18px; color: var(--text); }
.paperlink span { display: block; font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 15px 12px calc(15px + env(safe-area-inset-bottom));
  text-align: center; text-decoration: none; font-size: 17.5px; font-weight: 700; letter-spacing: .3px;
  background: var(--ink); color: var(--goldl); border-top: 1px solid rgba(216, 191, 138, .5); box-shadow: 0 -6px 20px rgba(21, 23, 28, .25);
}
body.barpad { padding-bottom: 68px; }
