/* 사사사주(v2) — 검은 바탕 넷플릭스식 틀. 상품 화면은 설정 theme.bg/accent로 --bg/--accent를 바꿈 */
:root { --bg: #0b0b0f; --accent: #ff5d8f; --fg: #f4f2f0; --mute: #9a96a0; --card: #1a1a20; --line: #2a2a32; --w: 520px; }
* { box-sizing: border-box; margin: 0; }
html { background: #050507; }
body { background: var(--bg); color: var(--fg); font: 15px/1.6 "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  max-width: var(--w); margin: 0 auto; min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1 { font-size: 24px; line-height: 1.3; } h2 { font-size: 17px; margin-bottom: 10px; } h3 { font-size: 15px; margin: 16px 0 4px; }
.muted { color: var(--mute); } .center { display: block; text-align: center; }
.pad { padding: 18px 16px; }
#app { padding-bottom: 84px; }

/* 그림 자리: 그림이 없으면 단색 + 제목 */
.art { position: relative; overflow: hidden; width: 100%; display: flex; align-items: center; justify-content: center; }
.art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.12), transparent 55%); }
.art.has::before { display: none; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-label { color: rgba(255,255,255,.55); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-align: center; padding: 6px; }
.art.has .art-label { display: none; }
.art-face img, .art-logo img, .art-half img { object-fit: contain; }

/* 머리·칩 (타이트 구성: 투명 머리 + 칩이 위에 붙어 다님) */
.tophead { position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 62%, rgba(11,11,15,0)); padding-bottom: 6px; }
.top { display: flex; align-items: center; gap: 18px; padding: 14px 16px 8px; }
.logo { width: 92px; margin-right: auto; } .logo .art { background: transparent !important; justify-content: flex-start; } .logo .art img { object-position: left; } .logo .art-label { font-size: 16px; color: var(--fg); letter-spacing: .08em; }
.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }
.top-ico { color: var(--fg); }
.chips { display: flex; gap: 4px; overflow-x: auto; padding: 4px 16px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar, .rail::-webkit-scrollbar, .hero-track::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 16px; border-radius: 99px; font-size: 15px; color: #ddd; border: 1px solid transparent; }
.chip.on { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.55); color: #fff; font-weight: 700; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }

/* 큰 카드 슬라이드: 가운데 카드 + 양옆 살짝, 오른쪽 위 n / N */
.hband { position: relative; padding: 4px 0 8px; }
.hero-track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 0 16px; scroll-padding: 0 16px; }
.hcard { flex: none; width: calc(100% - 32px); scroll-snap-align: center; position: relative; border-radius: 18px; overflow: hidden; }
.hcap { position: absolute; left: 0; right: 0; bottom: 0; padding: 80px 18px 26px; background: linear-gradient(transparent, rgba(0,0,0,.8)); display: grid; justify-items: center; text-align: center; gap: 4px; }
.hcap strong { font-size: 30px; line-height: 1.2; font-weight: 900; } .hcap span { color: #ddd; font-size: 15px; }
.count { position: absolute; top: 16px; right: 28px; padding: 3px 10px; border-radius: 99px; background: rgba(0,0,0,.45); font-size: 12px; color: #eee; }

/* 분야 줄: 작은 분야 이름 + 질문 제목 + 큰 세로 포스터 */
.row { padding: 26px 0 6px; } .row h2, .row .eyebrow, .row .sub { padding: 0 16px; display: block; }
.row h2 { font-size: 18px; font-weight: 800; margin: 2px 0 14px; }
.eyebrow { color: var(--mute); font-size: 12px; } .row .sub { color: var(--mute); font-size: 14px; margin: -10px 0 16px; }
.rail { display: flex; gap: 12px; overflow-x: auto; padding: 0 16px; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding: 0 16px; }
.rail .poster { flex: none; width: 64%; scroll-snap-align: start; }
.poster-img { position: relative; border-radius: 14px; overflow: hidden; }
.poster-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 50px 14px 16px; background: linear-gradient(transparent, rgba(0,0,0,.85)); display: grid; justify-items: center; text-align: center; }
.poster-cap strong { font-size: 22px; line-height: 1.25; font-weight: 900; } .poster-cap small { font-size: 13px; color: #ddd; }
.soon-tag { position: absolute; z-index: 1; top: 10px; right: 10px; font-size: 11px; padding: 2px 8px; border-radius: 6px; background: rgba(0,0,0,.6); color: #ccc; }

/* 영상 칸 */
.vid { position: relative; margin-top: 26px; } .vid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vid-btn { position: absolute; bottom: 14px; color: #fff; opacity: .85; } .vid-btn.l { left: 24px; } .vid-btn.r { right: 24px; }

/* 만세력 칸 */
.manse { display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: 18px; border: 1px solid #2c2c33; background: #141418; margin-top: 18px; }
.manse > div:first-child { flex: 1; display: grid; gap: 2px; } .manse strong { font-size: 20px; font-weight: 800; } .manse small:last-child { color: var(--mute); font-size: 13px; }
.tiles { display: grid; grid-template-columns: 46px 46px; gap: 8px; } .tiles .art { border-radius: 12px; } .tiles .art-label { font-size: 10px; }

/* 번호 목록 */
.nlist { list-style: none; padding: 0 16px; display: grid; gap: 14px; }
.nlist a { display: flex; align-items: center; gap: 14px; } .nlist .art { width: 120px; flex: none; border-radius: 12px; }
.nlist b { font-size: 20px; font-weight: 800; width: 14px; } .nlist span { display: grid; } .nlist strong { font-size: 16px; } .nlist small { color: var(--mute); font-size: 13px; }

/* 후기 */
.rv { padding: 18px 16px 26px; } .rv p { margin: 14px 0; font-size: 15px; }
.rv-head { display: flex; align-items: center; gap: 12px; } .rv-head > div:nth-child(2) { flex: 1; display: grid; font-size: 13px; color: #ccc; } .rv-head i { color: #555; font-style: normal; }
.rv-ava { width: 44px !important; border-radius: 50%; flex: none; } .rv-ava .art-label { display: none; }
.stars { color: #f6c343; letter-spacing: 1px; } .rv-meta { display: grid; justify-items: end; gap: 4px; } .rv-meta small { color: var(--mute); font-size: 12px; }
.rv-meta em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #3a3216; color: #f6c343; }
.rv-prod { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; border: 1px solid #2c2c33; }
.rv-prod .art { width: 48px; flex: none; border-radius: 8px; } .rv-prod .art-label { display: none; } .rv-prod span { flex: 1; display: grid; } .rv-prod strong { font-size: 15px; } .rv-prod small { color: var(--mute); font-size: 13px; } .rv-prod b { color: var(--mute); font-size: 20px; }

/* 분류 탭: 가로 꽉 찬 카드 세로 나열 */
.stack { display: grid; gap: 12px; padding: 8px 16px; }
.wide { position: relative; border-radius: 16px; overflow: hidden; display: block; }
.wide-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 50px 80px 18px 18px; background: linear-gradient(transparent, rgba(0,0,0,.75)); display: grid; }
.wide-cap strong { font-size: 24px; font-weight: 900; line-height: 1.25; } .wide-cap small { color: #ddd; font-size: 14px; }
.play { position: absolute; right: 16px; bottom: 18px; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.8); display: grid; place-items: center; color: #fff; }
.foot { padding: 28px 16px; color: #555; font-size: 12px; }

/* 하단 탭: 떠 있는 둥근 막대, 고른 탭은 동그라미 */
#tabs { position: fixed; bottom: calc(12px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: calc(100% - 32px); max-width: calc(var(--w) - 32px);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; border-radius: 40px; background: rgba(38,38,42,.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.14); z-index: 20; }
#tabs a { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 0 6px; font-size: 10px; color: #ddd; border-radius: 30px; }
#tabs .ico { width: 22px; height: 22px; } #tabs a.on { background: rgba(255,255,255,.14); color: #fff; }
.tbadge { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: #f6c343; color: #3a2a00; white-space: nowrap; }
.empty { padding: 60px 24px; text-align: center; display: grid; gap: 16px; justify-items: center; color: var(--mute); }
.empty .art { width: 120px; border-radius: 50%; }
#app { padding-bottom: 110px; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; padding: 12px 18px; background: var(--accent); color: #111; font-weight: 800; }
.btn.big { width: 100%; padding: 16px; font-size: 16px; } .btn:disabled { background: #333; color: #777; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); font-weight: 600; } .btn.ghost.on { border-color: var(--accent); color: var(--accent); }
.cta-bar { position: fixed; left: 50%; bottom: 0; width: 100%; max-width: var(--w); padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%);
  transform: translate(-50%, 110%); transition: transform .35s; z-index: 15; }
.cta-bar.show { transform: translate(-50%, 0); }
.back { position: absolute; top: 10px; left: 12px; z-index: 6; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.45); display: grid; place-items: center; font-size: 22px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.12); color: #ddd; }

/* 포스터(상품 상세) */
.pstage { position: relative; padding-bottom: 40px; }
.hero .art { max-height: 78vh; }
.pinfo { padding: 0 16px; margin-top: -90px; position: relative; display: grid; gap: 4px; }
.cat { color: var(--accent); font-weight: 700; } .pinfo p { color: #ccc; } .meta { font-size: 13px; }
.price b { font-size: 20px; color: var(--accent); }
.toc { display: grid; gap: 14px; }
.toc-card { background: var(--card); border-radius: 12px; overflow: hidden; display: grid; } .toc-card strong { padding: 10px 14px 0; } .toc-card small { padding: 0 14px 12px; color: var(--mute); }
.taste { border-left: 3px solid var(--accent); padding: 6px 14px; color: #ddd; font-size: 16px; }

/* 인트로 장면 */
.scene { position: relative; min-height: 100vh; overflow: hidden; }
.scene-bg { position: absolute !important; inset: 0; height: 100%; }
.scene-fg { position: relative; min-height: 100vh; display: grid; align-content: end; gap: 14px; padding: 24px 16px 40px; background: linear-gradient(transparent 30%, rgba(0,0,0,.7)); }
.scene-face { width: 150px; justify-self: center; border-radius: 50%; }
.skip { position: absolute; top: 14px; right: 16px; z-index: 6; font-size: 13px; color: #ccc; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bubble { background: #fff; color: #111; border-radius: 18px; padding: 14px 16px; font-weight: 600; position: relative; }
.bubble.pop { animation: pop .35s both cubic-bezier(.3,1.6,.6,1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* 입력 */
.input { position: relative; min-height: 100vh; padding: 56px 16px 40px; display: grid; align-content: start; gap: 16px; }
.steps { position: absolute; top: 24px; left: 60px; right: 16px; display: flex; gap: 4px; } .steps i { flex: 1; height: 3px; border-radius: 2px; background: #333; } .steps i.on { background: var(--accent); }
.half { width: 62%; justify-self: center; transition: filter .6s; } .half .art { border-radius: 16px; }
.form { display: grid; gap: 10px; }
.form input:not([type=checkbox]), .form textarea { width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font: inherit; }
.form textarea { min-height: 110px; resize: vertical; }
.line { display: flex; gap: 10px; align-items: center; } .line input[type=time] { flex: 1; } .line label { font-size: 13px; color: var(--mute); white-space: nowrap; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .seg button { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); } .seg button.on { border-color: var(--accent); color: var(--accent); }
.shake { animation: shake .35s; } @keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* 기다리기 */
.loading { min-height: 90vh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 24px; text-align: center; }
.load-art { display: none; } .load-art.has { display: flex; width: 180px; } .load-art.has + .load-face { display: none; }
.load-face { width: 160px; border-radius: 50%; animation: bob 1.6s ease-in-out infinite; } @keyframes bob { 50% { transform: translateY(-8px); } }
.typing { min-height: 1.6em; font-size: 17px; font-weight: 600; }
.typing::after { content: "▍"; animation: blink 1s steps(1) infinite; color: var(--accent); } @keyframes blink { 50% { opacity: 0; } }
.bar { width: 240px; height: 6px; border-radius: 3px; background: #333; overflow: hidden; } .bar i { display: block; height: 100%; width: 0; background: var(--accent); }

/* 티저(웹툰 컷) */
.teaser { position: relative; padding-bottom: 100px; } .teaser > .badge { position: absolute; top: 18px; right: 16px; z-index: 6; }
.cut { position: relative; } .cut-say { position: absolute; left: 12px; right: 12px; bottom: 16px; display: flex; gap: 8px; align-items: flex-end; }
.mini { width: 56px; flex: none; border-radius: 50%; } .cut-say .bubble { flex: 1; }
.nick { margin: 20px 16px 0; padding: 22px; border-radius: 16px; background: linear-gradient(135deg, var(--accent), #222); display: grid; text-align: center; color: #111; }
.nick strong { font-size: 24px; }
.locked { display: grid; gap: 6px; } .lock-row { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 10px; background: var(--card); filter: blur(.4px); color: var(--mute); } .lock-row i { font-style: normal; }

/* 결제 시트 */
#sheet { position: fixed; inset: 0; z-index: 30; }
.sheet-dim { position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .3s; }
.sheet-box { position: absolute; left: 50%; bottom: 0; width: 100%; max-width: var(--w); background: #16161b; border-radius: 20px 20px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  display: grid; gap: 10px; transform: translate(-50%, 100%); transition: transform .35s cubic-bezier(.2,.9,.3,1); }
#sheet.open .sheet-dim { opacity: 1; } #sheet.open .sheet-box { transform: translate(-50%, 0); }
.grab { width: 40px; height: 4px; border-radius: 2px; background: #444; justify-self: center; margin-bottom: 6px; }
.opt-row { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "r l l" "r s b" "r e b"; column-gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.opt-row:has(input:checked) { border-color: var(--accent); }
.opt-row input { grid-area: r; accent-color: var(--accent); } .opt-row span { grid-area: l; font-weight: 600; } .opt-row s { grid-area: s; } .opt-row b { grid-area: b; align-self: center; font-size: 18px; } .opt-row em { grid-area: e; font-style: normal; color: var(--accent); font-size: 12px; font-weight: 700; }
.coupon { padding: 10px 14px; border-radius: 10px; background: #1f1f26; color: var(--mute); font-size: 13px; }

/* 결과 뷰어 */
.viewer { min-height: 100vh; padding-bottom: 80px; }
.vbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; height: 56px; color: var(--mute); font-size: 13px; } .vbar .back { position: static; } .vbar .badge { margin-left: auto; }
.vp { padding: 4px 16px 24px; } .vp p { margin: 10px 0; color: #e8e6e3; line-height: 1.8; }
.cover { padding: 0; position: relative; } .cover .art { aspect-ratio: 4/5 !important; }
.cover-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 80px 20px 28px; background: linear-gradient(transparent, rgba(0,0,0,.9)); } .cover-cap small { color: var(--accent); font-weight: 700; }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pil { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 0; display: grid; justify-items: center; gap: 4px; } .pil.none { color: #555; }
.pil small { color: var(--mute); } .pil b { font-size: 26px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px; background: #2a2a2a; } .pil span { font-size: 12px; color: var(--mute); }
.el-목 { background: #2e6b3c !important; } .el-화 { background: #a3362f !important; } .el-토 { background: #9a7a2e !important; } .el-금 { background: #8b8b8b !important; color: #111; } .el-수 { background: #24374f !important; }
.toc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toc-cell { text-align: left; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); display: grid; font-size: 13px; } .toc-cell small { color: var(--accent); font-weight: 700; }
.chapter > .art { border-radius: 12px; margin: 4px 0 14px; }
.answer { font-weight: 700; color: var(--accent) !important; }
.peek { color: var(--mute) !important; font-size: 13px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 24px !important; }
.end { display: grid; gap: 16px; justify-items: center; padding-top: 30px; } .end-face { width: 160px; border-radius: 50%; } .end .bubble { width: 100%; text-align: center; }
.after { display: grid; gap: 8px; width: 100%; } .after-box { padding: 14px; border-radius: 12px; border: 1px dashed var(--line); color: var(--mute); font-size: 13px; text-align: center; }
.pager { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: var(--w); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 40%); }
.pager button { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 20px; } .pager button:disabled { opacity: .3; }

/* PC: 가운데 휴대폰 폭 칸 + 바깥 어둡게 */
@media (min-width: 700px) { body { box-shadow: 0 0 0 100vmax #050507; } .rail .poster { width: 30%; } }
#tabs[hidden], #sheet[hidden] { display: none; }
.rank { flex: none; width: 52px; text-align: right; }
.rail.ranked .poster-img { flex: none; width: calc(100% - 38px); }
.logo .art img { object-position: left center; }
.hero { position: relative; } .hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 220px; background: linear-gradient(transparent, var(--bg)); }
/* 보관함 */
.box-row{display:flex;flex-direction:column;gap:4px;padding:14px 16px;margin-bottom:10px;border-radius:16px;background:#1b1b22;color:inherit;text-decoration:none}
.box-row small{color:#9a9aa6}.box-row strong{font-size:16px}
.vp h3 small{font-weight:400;font-size:12px}
.opt-row.off{opacity:.4}
.paybtns{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px}
.btn.kakao{background:#fee500;color:#191919}.btn.naver{background:#03c75a;color:#fff}.btn.card{background:#2a2a33;color:#fff}
