/* 호월당 공용 디자인 — prototype/howoldang.html 에서 옮겨옴 */
/* 레이아웃: 휴대폰 세로 한 단(최대 460px), 화면 4장(입장→정보→맛보기→잠금)을 차례로 넘긴다. 단일 다크 테마(밤의 신당). */
:root {
  --abyss: #030203;        /* 신당 바깥 어둠 */
  --night: #070508;        /* 신당의 밤 */
  --lacquer: #100b10;      /* 옻칠한 나무 */
  --crimson: #8a1c26;      /* 붉은 달, 등불 (낮춘 밝기) */
  --gold: #a8874d;         /* 노리개 금장 */
  --foxfire: #7fb6ea;      /* 여우불 */
  --bone: #d6ccbc;         /* 한지 (조금 어둡게) */
  --ash: #7d727b;          /* 재, 보조 글씨 */
  --line: rgba(168,135,77,.22);
  --f-brush: 'Song Myung', 'Nanum Myeongjo', serif;
  --f-serif: 'Nanum Myeongjo', 'Batang', serif;
  --f-body: 'Gowun Dodum', 'Malgun Gothic', sans-serif;
  color-scheme: dark;
}
html { height: 100%; background: var(--abyss); }
body {
  min-height: 100%; color: var(--bone); font-family: var(--f-body); font-size: 15px; line-height: 1.7;
  padding-inline: 16px; word-break: keep-all;
  /* 어두운 나무 벽: 세로 결 + 가운데만 희미하게 촛불이 닿는 빛 */
  background:
    radial-gradient(60% 45% at 50% 30%, rgba(90,24,32,.22), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 2px, transparent 2px 9px, rgba(0,0,0,.25) 9px 11px, transparent 11px 23px),
    linear-gradient(180deg, var(--night), var(--abyss));
  background-attachment: fixed;
}
/* 양옆에 걸린 바랜 부적 (넓은 화면에서만) */
body::before, body::after {
  content: ''; position: fixed; top: 0; width: 46px; height: 62vh; pointer-events: none; z-index: 0; opacity: .16;
  background:
    linear-gradient(transparent 14%, rgba(138,28,38,.9) 14% 15%, transparent 15% 22%, rgba(138,28,38,.8) 22% 23.5%, transparent 23.5%) center / 4px 100% no-repeat,
    linear-gradient(180deg, #8b7a5c, #4c3f2c 80%, transparent);
  clip-path: polygon(0 0, 100% 0, 100% 92%, 50% 100%, 0 92%);
  display: none;
}
body::before { left: max(16px, calc(50% - 360px)); transform: rotate(-2deg); }
body::after { right: max(16px, calc(50% - 360px)); height: 48vh; transform: rotate(3deg); }
@media (min-width: 640px) { body::before, body::after { display: block; } }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
/* 가장자리가 검게 먹히는 촛불 비네트 */
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(ellipse 75% 70% at 50% 42%, transparent 35%, rgba(0,0,0,.55) 75%, rgba(0,0,0,.9) 100%);
  animation: flicker 5s infinite ease-in-out; }
@keyframes flicker { 0%,100% { opacity: 1 } 42% { opacity: .9 } 47% { opacity: 1 } 70% { opacity: .93 } }
.wrap { position: relative; z-index: 1; max-width: 460px; margin: 0 auto; padding-block: 18px 40px; }
.screen { display: flex; flex-direction: column; gap: 18px; }
.screen[hidden] { display: none !important; }

/* 상단 간판 */
.sign { display: flex; align-items: center; justify-content: space-between; padding-block: 4px 2px; border-bottom: 1px solid var(--line); }
.sign .name { font-family: var(--f-brush); font-size: 22px; letter-spacing: .18em; color: var(--bone); }
.sign .name b { color: var(--crimson); font-weight: 400; }
.sign .tag { font-size: 11px; letter-spacing: .14em; color: var(--ash); }

/* 그림 자리 */
.art { position: relative; aspect-ratio: 9 / 13; max-width: 100%; border-radius: 4px; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 18%, #1c0d13 0%, var(--lacquer) 45%, var(--abyss) 100%);
  border: 1px solid var(--line); box-shadow: inset 0 0 60px 20px rgba(0,0,0,.7); }
.art.short { aspect-ratio: 9 / 10; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.moon { position: absolute; left: 50%; top: 12%; width: 46%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle at 42% 40%, #a8303b 0%, var(--crimson) 40%, #3a0910 100%);
  box-shadow: 0 0 50px 6px rgba(138,28,38,.3); opacity: .7; }
.lanterns { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 9%; }
.lanterns span { width: 16px; height: 26px; margin-top: 6%; border-radius: 40%; background: #6e141d;
  box-shadow: 0 0 14px 3px rgba(138,28,38,.4); }
.lanterns span:nth-child(2) { margin-top: 2%; } .lanterns span:nth-child(3) { margin-top: 9%; }
.art .hanja { position: absolute; left: 0; right: 0; bottom: 26%; text-align: center; font-family: var(--f-brush);
  font-size: clamp(54px, 18vw, 84px); letter-spacing: .12em; color: #b9ad9b; text-shadow: 0 0 24px rgba(127,182,234,.25); }
.art .slot-note { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.art .slot-note small { font-size: 11px; color: var(--ash); letter-spacing: .06em; }
.upload { font: inherit; font-size: 12.5px; color: var(--foxfire); background: rgba(12,10,14,.7); border: 1px dashed rgba(143,200,255,.5);
  padding: 5px 12px; border-radius: 30px; cursor: pointer; }
.upload:focus-visible { outline: 2px solid var(--foxfire); outline-offset: 2px; }
.art.has-img .moon, .art.has-img .lanterns, .art.has-img .hanja, .art.has-img .slot-note small { display: none; }
.art.has-img { aspect-ratio: 9 / 15; }
.art.short.has-img { aspect-ratio: 4 / 5; }
.art.short.has-img img { object-position: 50% 22%; }
/* 그림 아래쪽이 신당 어둠 속으로 녹아들게 */
.art.has-img::after { content: ''; position: absolute; inset: auto 0 0 0; height: 32%; pointer-events: none;
  background: linear-gradient(transparent, rgba(3,2,3,.92)); }
.art.has-img .slot-note { z-index: 1; }
.art.has-img .upload { opacity: .55; font-size: 11.5px; }

/* 월희의 말 */
.say { position: relative; background: linear-gradient(180deg, rgba(16,11,16,.94), rgba(5,3,6,.96));
  border: 1px solid var(--line); border-left: 3px solid var(--crimson); padding: 16px 18px 16px 18px; }
.say .who { display: flex; align-items: center; gap: 8px; font-family: var(--f-serif); font-weight: 800; font-size: 13px; color: var(--gold); letter-spacing: .1em; margin-bottom: 6px; }
.say .who i { width: 7px; height: 7px; border-radius: 50%; background: var(--foxfire); box-shadow: 0 0 8px var(--foxfire); }
.say p { font-family: var(--f-serif); font-size: 16.5px; line-height: 1.85; }
.say p + p { margin-top: 10px; }
.say em { font-style: normal; color: var(--foxfire); }
.say strong { color: #e0646d; font-weight: 800; }

/* 버튼 */
.btn { display: block; width: 100%; font-family: var(--f-serif); font-weight: 800; font-size: 17px; letter-spacing: .12em; color: var(--bone);
  background: linear-gradient(180deg, #7e1822, #4a0b12); border: 1px solid #9c2a35; padding: 15px; border-radius: 3px; cursor: pointer;
  box-shadow: 0 6px 22px rgba(0,0,0,.6), 0 0 18px rgba(138,28,38,.25), inset 0 1px 0 rgba(255,255,255,.08); }
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ash); box-shadow: none; font-size: 14px; letter-spacing: .06em; }

/* 입력 */
form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label, .field .lbl { font-size: 12.5px; letter-spacing: .1em; color: var(--gold); }
input[type=date], input[type=time], input[type=text] { font: inherit; font-size: 16px; color: var(--bone); background: var(--lacquer);
  border: 1px solid var(--line); border-radius: 3px; padding: 12px 12px; width: 100%; }
input:focus-visible { outline: 2px solid var(--foxfire); outline-offset: 1px; }
input:disabled { opacity: .4; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1 1 160px; min-width: 0; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ash); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--crimson); }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { text-align: center; padding: 11px; font-size: 15px; letter-spacing: .1em; color: var(--ash); cursor: pointer; background: var(--lacquer); }
.seg input:checked + label { background: #3a1419; color: var(--bone); box-shadow: inset 0 -2px 0 var(--crimson); }
.seg input:focus-visible + label { outline: 2px solid var(--foxfire); outline-offset: -2px; }
.err { color: #ff8a92; font-size: 13.5px; }

/* 사주 판 */
.chart { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pil { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 8px; background: var(--lacquer); border: 1px solid var(--line); }
.pil .k { font-size: 11px; color: var(--ash); letter-spacing: .12em; }
.pil .c { font-family: var(--f-serif); font-weight: 800; font-size: 28px; line-height: 1.15; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 3px; }
.pil.me { border-color: var(--gold); }
.pil.empty .c { color: var(--ash); font-size: 18px; }
.e0 { color: #7fd29a; } .e1 { color: #ff7a6e; } .e2 { color: #e2b76a; } .e3 { color: #d9dce2; } .e4 { color: #79a9ff; }
.five { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.five div { text-align: center; padding: 8px 0; border: 1px solid var(--line); background: rgba(23,18,26,.7); }
.five b { display: block; font-family: var(--f-serif); font-size: 15px; }
.five span { font-size: 12px; color: var(--ash); font-variant-numeric: tabular-nums; }
.meta { font-size: 12px; color: var(--ash); text-align: center; }

/* 잠긴 풀이 */
.locked { position: relative; border: 1px solid var(--line); background: var(--lacquer); padding: 18px; overflow: hidden; }
.locked ul { list-style: none; display: flex; flex-direction: column; gap: 12px; filter: blur(5px); user-select: none; }
.locked li { font-family: var(--f-serif); font-size: 15px; }
.locked li b { color: var(--gold); display: block; font-size: 13px; letter-spacing: .08em; filter: none; }
.lock-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: linear-gradient(180deg, rgba(12,10,14,.2), rgba(12,10,14,.75)); text-align: center; }
.lock-cover .seal { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--crimson); color: var(--crimson); font-family: var(--f-brush);
  font-size: 22px; display: flex; align-items: center; justify-content: center; transform: rotate(-10deg); background: rgba(12,10,14,.8); }
.lock-cover p { font-size: 13px; color: var(--bone); }
.price { display: flex; align-items: baseline; justify-content: center; gap: 10px; font-family: var(--f-serif); }
.price s { color: var(--ash); font-size: 14px; }
.price b { font-size: 26px; color: var(--bone); font-variant-numeric: tabular-nums; }
.toast { text-align: center; font-size: 13px; color: var(--foxfire); min-height: 1.2em; }
.foot { font-size: 11.5px; color: var(--ash); text-align: center; line-height: 1.6; border-top: 1px solid var(--line); padding-top: 14px; }
.steps { display: flex; justify-content: center; gap: 6px; }
.steps i { width: 22px; height: 3px; background: var(--line); }
.steps i.on { background: var(--crimson); }
.wrap { z-index: 3; }
@media (prefers-reduced-motion: reduce) { #fx { display: none; } .vignette { animation: none; } }

/* ── 실제 사이트용 추가 (기본 초기화 · 결제 · 풀이 화면) ── */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p, ul { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.btn:disabled { opacity: .55; cursor: progress; filter: none; }
.testpay { border: 1px dashed var(--foxfire); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: rgba(12,14,22,.6); }
.testpay p { font-size: 13px; color: var(--foxfire); }
.reading { display: flex; flex-direction: column; gap: 4px; }
.reading h2 { font-family: var(--f-serif); font-weight: 800; font-size: 18px; color: var(--gold); letter-spacing: .04em;
  padding-top: 22px; margin-bottom: 6px; border-top: 1px solid var(--line); }
.reading h2:first-child { border-top: 0; padding-top: 4px; }
.reading p { font-family: var(--f-serif); font-size: 16px; line-height: 1.95; margin-bottom: 10px; }
.reading strong { color: #e0646d; font-weight: 800; }
.reading .gesture { color: var(--foxfire); font-style: normal; opacity: .85; }
.writing { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--foxfire); }
.writing i { width: 8px; height: 8px; border-radius: 50%; background: var(--foxfire); box-shadow: 0 0 10px var(--foxfire); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.keep { border: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--ash); }
.keep code { font-size: 12px; color: var(--bone); word-break: break-all; user-select: all; }
@media (prefers-reduced-motion: reduce) { .writing i { animation: none; } }

/* 사업자 정보 (모든 화면 맨 아래, 전자상거래법 제10조) */
.biz { position: relative; z-index: 3; max-width: 460px; margin: 0 auto; padding: 16px 0 28px;
  border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.8; color: var(--ash); word-break: keep-all; }
.biz .links { margin-bottom: 6px; }
.biz .links a { margin-right: 12px; color: var(--bone); text-decoration: none; }

/* 결제 전 확인: 입력 정보 다시 보기 + 청약철회 제한 동의 */
.confirm { border: 1px solid var(--line); background: var(--lacquer); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.confirm h3 { font-family: var(--f-serif); font-size: 14px; color: var(--gold); margin: 0; }
.confirm dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.confirm dt { color: var(--ash); }
.confirm dd { margin: 0; color: var(--bone); }
.confirm .fix { align-self: flex-start; font: inherit; font-size: 12.5px; color: var(--foxfire); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.6; color: var(--bone); cursor: pointer; }
.agree input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--crimson); }
.agree a { color: var(--foxfire); }
.ai-note { font-size: 12px; color: var(--ash); text-align: center; line-height: 1.6; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* 토스 결제위젯은 밝은 화면으로 그려지므로 한지색 판 위에 올린다 */
.paybox { background: #fff; border-radius: 8px; overflow: hidden; }
.paybox[hidden] { display: none; }
/* 상품 정보: 무엇을, 어떻게 받는지, 환불 기준 (결제사 심사 항목) */
.provide { list-style: none; margin: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--line); font-size: 13px; line-height: 1.6; color: var(--bone); }
.provide b { display: inline-block; min-width: 34px; margin-right: 8px; color: var(--gold); font-weight: 700; }
.provide a { color: var(--foxfire); }
/* 가격 옆 "오픈 기념가" 꼬리표 (기준가 비교 없이 표시) */
.price .open { font-family: var(--f-body); font-size: 12px; letter-spacing: .06em; color: var(--gold);
  border: 1px solid var(--gold); border-radius: 999px; padding: 2px 10px; }