/* ============================================================
   청오당 — 푸른 안개·은빛·까마귀 테마
   ============================================================ */
:root {
  --bg0: #030716;
  --bg1: #071232;
  --bg2: #0c1d4a;
  --ink: #e6ecff;
  --ink-dim: #9fb0d8;
  --ink-faint: #6b7aa3;
  --line: rgba(140, 175, 255, .18);
  --line-strong: rgba(150, 190, 255, .38);
  --glass: rgba(14, 28, 68, .55);
  --glass-strong: rgba(10, 20, 52, .82);
  --blue: #6fa8ff;
  --blue-hi: #a9cbff;
  --cyan: #7fe3ff;
  --glow: rgba(90, 150, 255, .55);
  --silver: #d6def2;
  --brass: #d8c48c;
  --danger: #ff9db1;
  --wood: #8fe0a6; --fire: #ff8f8f; --earth: #e8cf86; --metal: #e9eef9; --water: #6d8cff;
  --radius: 18px;
  --serif: 'Nanum Myeongjo', 'Noto Serif KR', serif;
  --sans: 'Gowun Dodum', 'Pretendard', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans); color: var(--ink); background: var(--bg0);
  overflow-x: hidden; line-height: 1.6; letter-spacing: -.01em;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* ─── 배경: 안개·별 ─── */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(1200px 800px at 70% -10%, rgba(60, 110, 255, .22), transparent 60%),
    radial-gradient(900px 700px at 0% 100%, rgba(40, 90, 220, .2), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0) 70%);
}
.sky .mist { position: absolute; width: 80vmax; height: 80vmax; border-radius: 50%; filter: blur(70px); opacity: .32; mix-blend-mode: screen; }
.sky .m1 { background: #2445a8; left: -30vmax; top: 10vh; animation: drift1 38s ease-in-out infinite alternate; }
.sky .m2 { background: #16307a; right: -35vmax; top: -20vh; animation: drift2 46s ease-in-out infinite alternate; }
.sky .m3 { background: #3a5fd0; left: 10vw; bottom: -55vmax; opacity: .22; animation: drift1 52s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(18vw, -8vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-14vw, 12vh) scale(.92); } }
.sky .stars { position: absolute; inset: 0; background-image:
  radial-gradient(1px 1px at 12% 22%, #cfe0ff 50%, transparent 51%), radial-gradient(1px 1px at 72% 12%, #fff 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 42% 68%, #a8c8ff 50%, transparent 51%), radial-gradient(1px 1px at 88% 48%, #dfe9ff 50%, transparent 51%),
  radial-gradient(1px 1px at 28% 84%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 58% 38%, #bcd4ff 50%, transparent 51%),
  radial-gradient(1px 1px at 6% 56%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 94% 82%, #cfe0ff 50%, transparent 51%);
  animation: twinkle 6s ease-in-out infinite alternate; opacity: .7; }
@keyframes twinkle { to { opacity: .35; } }

/* ─── 공통 레이아웃 ─── */
.app { position: relative; z-index: 1; min-height: 100%; }
.screen { min-height: 100vh; min-height: 100dvh; }
.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 16px; }

.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; background: linear-gradient(180deg, rgba(3,7,22,.88), rgba(3,7,22,.55) 70%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.brand { display: flex; align-items: baseline; gap: 6px; font-family: var(--serif); font-weight: 800; letter-spacing: .04em; cursor: pointer; border: 0; background: none; padding: 0; }
.brand b { font-size: 20px; color: var(--silver); text-shadow: 0 0 14px var(--glow); }
.brand small { font-size: 11px; color: var(--ink-dim); font-weight: 400; letter-spacing: .02em; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.btn { border: 1px solid var(--line-strong); background: var(--glass); color: var(--ink); border-radius: 999px; padding: 8px 14px; font-size: 14px;
  backdrop-filter: blur(6px); transition: transform .15s, background .2s, box-shadow .2s; }
.btn:hover { background: rgba(40, 70, 150, .55); box-shadow: 0 0 18px rgba(100, 160, 255, .25); }
.btn:active { transform: scale(.97); }
.btn-primary { position: relative; width: 100%; border: 0; border-radius: 16px; padding: 16px; font-size: 17px; font-weight: 700; font-family: var(--serif);
  letter-spacing: .06em; color: #fff; background: linear-gradient(135deg, #2c58d6, #4b7dff 50%, #2c58d6); background-size: 200% 100%;
  box-shadow: 0 8px 30px rgba(60, 110, 255, .45), inset 0 1px 0 rgba(255,255,255,.25); animation: shine 4s linear infinite; }
@keyframes shine { to { background-position: -200% 0; } }
.btn-primary:disabled { opacity: .5; animation: none; }
.btn-ghost { border: 0; background: none; color: var(--ink-dim); padding: 8px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.coin-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid rgba(216,196,140,.45);
  background: linear-gradient(180deg, rgba(60,50,20,.35), rgba(20,20,40,.6)); color: #f3e6bd; font-weight: 700; font-size: 14px; position: relative; }
.coin-pill .plus { margin-left: 2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(216,196,140,.25); font-size: 13px; }
.coin-ico { width: 22px; height: 22px; flex: none; filter: drop-shadow(0 0 4px rgba(255,220,140,.4)); }
.coin-delta { position: absolute; right: 8px; top: -4px; font-size: 13px; font-weight: 800; transition: transform .9s, opacity .9s; pointer-events: none; }

.card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04); }
.card + .card { margin-top: 14px; }
.card h3 { margin: 0 0 12px; font-family: var(--serif); font-size: 16px; color: var(--blue-hi); letter-spacing: .04em; display: flex; align-items: center; gap: 8px; }
.card h3::before { content: ''; width: 6px; height: 6px; transform: rotate(45deg); background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.muted { color: var(--ink-dim); font-size: 13px; }
.faint { color: var(--ink-faint); font-size: 12px; }

/* ─── 인트로 ─── */
#intro { position: relative; display: flex; flex-direction: column; overflow: hidden; height: 100vh; height: 100dvh; }
#intro .intro-top { position: absolute; top: 14px; right: 16px; z-index: 20; display: flex; align-items: center; gap: 8px; }
/* 청오 성별 고르기 — 모든 화면 위쪽에 같은 버튼(인트로 / 상단바) */
.guide-seg { display: inline-flex; flex: none; padding: 2px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--glass); }
.guide-seg button { border: 0; background: none; color: var(--ink-dim); font-size: 12.5px; line-height: 1; padding: 7px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.guide-seg button[aria-pressed="true"] { background: var(--blue); color: #fff; font-weight: 700; }
@media (max-width: 380px) { .guide-seg button { padding: 7px 8px; font-size: 12px; } .top-actions { gap: 6px; } }
.topbar .brand, .coin-pill { white-space: nowrap; flex: none; }
/* 뒤로 가기(인트로를 뺀 모든 화면의 상단바 왼쪽) */
.top-left { display: flex; align-items: center; gap: 6px; flex: none; min-width: 0; }
.back-btn { display: grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--glass); color: var(--ink); cursor: pointer; }
.back-btn svg { width: 16px; height: 16px; }
.back-btn:hover { border-color: var(--blue); }
@media (max-width: 380px) { .back-btn { width: 28px; height: 28px; } .topbar .brand b { font-size: 18px; } .topbar { gap: 6px; } }
@media (max-width: 360px) { .guide-seg button { padding: 6px 6px; font-size: 11.5px; } .coin-pill .plus { display: none; } .topbar .brand b { font-size: 16px; letter-spacing: 0; } .top-left, .top-actions { gap: 4px; } .topbar { padding-left: 10px; padding-right: 10px; } }
@media (max-width: 420px) { .topbar .brand small { display: none; } }
body.guide-f .intro-stage { aspect-ratio: 1145 / 1374; transform: translateX(-52%); }
body.guide-f .avatar { background-image: url('../images/cheongo-f-intro.webp'); background-position: 58% 23%; background-size: 380% auto; }
body.guide-f .avatar.scroll { background-image: url('../images/cheongo-f-writing-end.webp'); background-position: 71% 16%; background-size: 360% auto; }
.intro-stage { position: absolute; left: 50%; bottom: 0; transform: translateX(-48.5%); height: min(84vh, 84dvh); aspect-ratio: 1625 / 1374; }
.intro-stage .lp { height: 100%; width: auto; }
.intro-title { position: absolute; top: 16px; left: 16px; z-index: 10; font-family: var(--serif); opacity: 0; animation: fadeIn 2s .6s forwards; }
.intro-title b { display: block; font-size: 26px; letter-spacing: .2em; color: var(--silver); text-shadow: 0 0 20px var(--glow); }
.intro-title span { font-size: 12px; color: var(--ink-dim); letter-spacing: .12em; }
@keyframes fadeIn { to { opacity: 1; } }
.dialogue { position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: calc(100% - 32px); max-width: 560px; z-index: 15;
  background: linear-gradient(180deg, rgba(10,22,60,.78), rgba(5,12,36,.92)); border: 1px solid var(--line-strong); border-radius: 18px;
  padding: 20px 18px 16px; box-shadow: 0 0 40px rgba(40,90,220,.35), inset 0 0 30px rgba(80,140,255,.08); backdrop-filter: blur(6px); cursor: pointer; min-height: 132px;
  opacity: 0; animation: fadeIn 1s 1.2s forwards; }
.dialogue .who { position: absolute; top: -13px; left: 18px; padding: 3px 14px; border-radius: 999px; font-family: var(--serif); font-weight: 800; font-size: 14px; letter-spacing: .2em;
  background: linear-gradient(135deg, #1b3a9a, #3b67e0); border: 1px solid var(--line-strong); box-shadow: 0 0 14px var(--glow); }
.dialogue .line { font-family: var(--serif); font-size: 17px; line-height: 1.75; min-height: 3.5em; white-space: pre-wrap; padding-right: 36px; }
.dialogue .next { position: absolute; right: 16px; bottom: 10px; font-size: 12px; color: var(--ink-dim); animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(3px); } }
.dialogue .go { margin-top: 12px; }
.caw { position: absolute; z-index: 12; font-family: var(--serif); font-size: 13px; color: var(--ink-dim); padding: 4px 10px; border-radius: 12px; background: rgba(5,12,36,.7); border: 1px solid var(--line);
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; pointer-events: none; }
.caw.show { opacity: 1; transform: none; }

/* ─── 살아 있는 초상 ─── */
.lp { position: relative; aspect-ratio: var(--lp-ratio, 5 / 6); }
.lp .lp-static, .lp .lp-gl { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.lp.lp-live .lp-static { visibility: hidden; }
.lp .lp-wisps { position: absolute; inset: -6% -10%; width: 120%; height: 112%; pointer-events: none; mix-blend-mode: screen; z-index: 0; }   /* 캐릭터 뒤 배경 */
.lp .lp-static, .lp .lp-gl { z-index: 1; }
.lp:not(.lp-live) .lp-static { animation: breathe 5s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes breathe { 50% { transform: scale(1.006, 1.01); } }
.lp .lp-static, .lp .lp-gl { -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent 99%); mask-image: linear-gradient(180deg, #000 80%, transparent 99%); }
.lp-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent 99%); mask-image: linear-gradient(180deg, #000 80%, transparent 99%); }

/* ─── 입력 폼 ─── */
.hero-mini { display: flex; gap: 12px; align-items: flex-end; margin: 6px 0 14px; }
.avatar { width: 64px; height: 64px; flex: none; border-radius: 50%; overflow: hidden; border: 1px solid var(--line-strong); box-shadow: 0 0 16px var(--glow);
  background: url('../images/cheongo-intro.webp') 52% 23% / 380% auto no-repeat, var(--bg2); }
.avatar.scroll { background-image: url('../images/cheongo-scroll.webp'); background-position: 57% 18%; background-size: 360% auto; }
.bubble { position: relative; flex: 1; background: var(--glass-strong); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-family: var(--serif); font-size: 14px; }
.field { margin-bottom: 16px; }
.field > label, .field > .label { display: block; font-size: 13px; color: var(--ink-dim); margin-bottom: 6px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); background: rgba(6,14,40,.7); border-radius: 12px; padding: 12px; font-size: 16px; outline: none; transition: border .2s, box-shadow .2s; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(111,168,255,.18); }
.input:disabled { opacity: .4; }
textarea.input { resize: vertical; min-height: 70px; font-size: 15px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(6,14,40,.7); }
.seg button { flex: 1; border: 0; background: none; padding: 11px 6px; color: var(--ink-dim); font-size: 15px; transition: background .2s, color .2s; }
.seg button.on { background: linear-gradient(135deg, rgba(60,110,255,.55), rgba(100,150,255,.35)); color: #fff; font-weight: 700; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-dim); cursor: pointer; user-select: none; white-space: nowrap; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: rgba(6,14,40,.6); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--ink-dim); }
.chip.on { border-color: var(--blue); color: #fff; background: rgba(60,110,255,.35); }
details.more { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 4px; }
details.more summary { cursor: pointer; color: var(--blue-hi); font-size: 14px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: ' ▾'; }
details.more[open] summary::after { content: ' ▴'; }
details.more .inner { padding-top: 12px; }
.hint { font-size: 12px; color: var(--ink-faint); margin-top: 6px; }
.form-err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

/* ─── 만세력 표 ─── */
.profile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.profile-head .name { font-family: var(--serif); font-size: 22px; font-weight: 800; }
.profile-head .tag { font-size: 11px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 8px; color: var(--ink-dim); margin-left: 6px; vertical-align: middle; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin-top: 8px; }
.kv dt { color: var(--ink-faint); } .kv dd { margin: 0; color: var(--ink); }
.warn { margin-top: 10px; font-size: 12px; color: #ffd59a; background: rgba(255,200,120,.07); border: 1px solid rgba(255,200,120,.2); border-radius: 10px; padding: 8px 10px; }

.manse { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; text-align: center; }
.manse th { font-size: 12px; color: var(--ink-dim); font-weight: 400; padding: 2px 0; }
.manse td { font-size: 12px; color: var(--ink-dim); padding: 3px 0; }
.manse td.rowlabel { width: 44px; font-size: 11px; color: var(--ink-faint); text-align: left; }
.manse .god { color: var(--blue-hi); font-size: 12px; }
.gz { position: relative; border-radius: 14px; padding: 8px 0 6px; font-family: var(--serif); border: 1px solid rgba(255,255,255,.08); }
.gz .h { display: block; font-size: 30px; font-weight: 800; line-height: 1.15; }
.gz .k { display: block; font-size: 11px; opacity: .85; }
.gz.day { box-shadow: 0 0 0 1.5px var(--blue), 0 0 18px var(--glow); }
.e-목 { background: linear-gradient(160deg, rgba(60,170,110,.38), rgba(20,60,50,.5)); color: #d7ffe5; }
.e-화 { background: linear-gradient(160deg, rgba(220,80,90,.38), rgba(70,20,40,.55)); color: #ffe0e3; }
.e-토 { background: linear-gradient(160deg, rgba(200,160,70,.38), rgba(70,55,25,.55)); color: #fff1cf; }
.e-금 { background: linear-gradient(160deg, rgba(220,228,245,.35), rgba(80,90,120,.5)); color: #ffffff; }
.e-수 { background: linear-gradient(160deg, rgba(40,60,160,.55), rgba(8,12,40,.8)); color: #cfdcff; }
.empty-gz { border: 1px dashed var(--line); border-radius: 14px; padding: 18px 0; color: var(--ink-faint); font-size: 12px; }
.hidden-stems { display: flex; flex-direction: column; gap: 1px; font-size: 11px; line-height: 1.35; }
.hidden-stems span { white-space: nowrap; }

.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 34px 1fr 64px; align-items: center; gap: 8px; font-size: 13px; }
.bar .track { height: 10px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 999px; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.f-목 { background: var(--wood); } .f-화 { background: var(--fire); } .f-토 { background: var(--earth); } .f-금 { background: var(--metal); } .f-수 { background: var(--water); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-i { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(6,14,40,.6); }
.tag-i b { color: var(--blue-hi); font-weight: 700; }
.tag-i.good { border-color: rgba(127,227,255,.4); }
.tag-i.bad { border-color: rgba(255,157,177,.35); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-grid .it { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: rgba(6,14,40,.45); }
.info-grid .it .l { font-size: 11px; color: var(--ink-faint); }
.info-grid .it .v { font-family: var(--serif); font-weight: 800; font-size: 15px; }

.hscroll { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.luck { flex: none; width: 74px; scroll-snap-align: start; text-align: center; border: 1px solid var(--line); border-radius: 14px; padding: 8px 4px; background: rgba(6,14,40,.5); font-size: 11px; }
.luck .age { color: var(--ink-dim); }
.luck .hz { font-family: var(--serif); font-size: 20px; font-weight: 800; line-height: 1.2; }
.luck .hz span { display: block; border-radius: 6px; margin: 2px 6px; }
.luck.cur { border-color: var(--blue); box-shadow: 0 0 16px var(--glow); }
.luck.cur .age::after { content: ' · 지금'; color: var(--cyan); }

.today { display: flex; gap: 12px; align-items: flex-start; }
.today .bubble { font-size: 14px; }

.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-btn { position: relative; text-align: left; border: 1px solid var(--line-strong); border-radius: 16px; padding: 14px 12px 12px; min-height: 108px;
  background: linear-gradient(160deg, rgba(30,60,150,.45), rgba(8,16,44,.75)); overflow: hidden; transition: transform .15s, box-shadow .2s; }
.menu-btn:hover { box-shadow: 0 0 24px rgba(100,160,255,.3); }
.menu-btn:active { transform: scale(.98); }
.menu-btn .ic { position: absolute; right: -6px; bottom: -14px; font-family: var(--serif); font-size: 64px; font-weight: 800; color: rgba(150,190,255,.10); }
.menu-btn .t { display: block; font-family: var(--serif); font-weight: 800; font-size: 15px; }
.menu-btn .d { display: block; font-size: 11.5px; color: var(--ink-dim); margin-top: 4px; line-height: 1.45; }
.menu-btn .c { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 13px; color: #f3e6bd; font-weight: 700; }
.menu-btn .c .coin-ico { width: 16px; height: 16px; }
.menu-btn.done .c::after { content: '· 다시 보기 무료'; color: var(--cyan); font-weight: 400; font-size: 11px; margin-left: 2px; }
.menu-btn.wide { grid-column: 1 / -1; min-height: 84px; }

/* ─── 풀이 화면 ─── */
#reading .stage { position: relative; height: min(56vh, 520px); overflow: hidden; margin: 0 -16px; }

.speech { position: relative; z-index: 3; margin: -64px 0 0; background: linear-gradient(180deg, rgba(12,26,70,.9), rgba(6,14,40,.95)); border: 1px solid var(--line-strong); border-radius: 18px;
  padding: 18px 16px 14px; font-family: var(--serif); font-size: 16.5px; line-height: 1.8; box-shadow: 0 0 40px rgba(40,90,220,.35); }
.speech .who { position: absolute; top: -12px; left: 16px; padding: 2px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; letter-spacing: .2em; background: linear-gradient(135deg, #1b3a9a, #3b67e0); }
.reading-title { font-family: var(--serif); font-size: 22px; font-weight: 800; margin: 22px 0 4px; text-align: center; color: var(--silver); text-shadow: 0 0 18px var(--glow); }
.reading-summary { text-align: center; color: var(--blue-hi); font-size: 14px; margin-bottom: 10px; }
.kw { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.kw span { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(60,110,255,.22); border: 1px solid var(--line-strong); }
.scroll-sec { position: relative; margin: 14px 0; padding: 18px 18px 16px; border-radius: 6px;
  background: linear-gradient(180deg, rgba(236,228,206,.07), rgba(200,210,240,.04)), rgba(8,16,44,.7); border: 1px solid rgba(200,210,240,.14);
  box-shadow: inset 0 0 30px rgba(120,160,255,.06); opacity: 0; transform: translateY(14px); transition: opacity .7s, transform .7s; }
.scroll-sec.in { opacity: 1; transform: none; }
.scroll-sec::before, .scroll-sec::after { content: ''; position: absolute; left: -6px; right: -6px; height: 8px; border-radius: 6px; background: linear-gradient(180deg, #2b2f45, #12152a); border: 1px solid rgba(216,196,140,.25); }
.scroll-sec::before { top: -5px; } .scroll-sec::after { bottom: -5px; }
.scroll-sec h4 { margin: 0 0 10px; font-family: var(--serif); font-size: 17px; color: var(--blue-hi); }
.scroll-sec p { margin: 0 0 10px; font-size: 15.5px; line-height: 1.85; color: #dfe6fb; word-break: keep-all; }
.score { text-align: center; margin: 10px 0; }
.score b { font-family: var(--serif); font-size: 48px; color: var(--silver); text-shadow: 0 0 22px var(--glow); }
.lucky { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lucky div { border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; font-size: 12px; background: rgba(6,14,40,.5); }
.lucky div b { display: block; font-size: 13px; color: var(--ink); margin-top: 2px; word-break: keep-all; }
.closing { display: flex; gap: 10px; align-items: flex-end; margin: 18px 0; }
.followups { margin: 20px 0 40px; }
.followups h3 { font-family: var(--serif); font-size: 16px; color: var(--blue-hi); margin: 0 0 10px; }
.fq { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; text-align: left; margin-bottom: 8px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: rgba(14,30,80,.55); font-size: 14.5px; transition: background .2s; }
.fq:hover { background: rgba(40,70,160,.55); }
.fq .c { display: inline-flex; align-items: center; gap: 3px; color: #f3e6bd; font-size: 13px; white-space: nowrap; }
.fq .c .coin-ico { width: 15px; height: 15px; }
.ask { display: flex; gap: 8px; margin-top: 10px; }
.ask .input { flex: 1; }
.qa { margin-top: 18px; border-left: 2px solid var(--blue); padding-left: 12px; }
.qa .q { font-family: var(--serif); font-weight: 800; color: var(--cyan); margin-bottom: 6px; }

.loading-lines { text-align: center; font-family: var(--serif); color: var(--ink-dim); margin: 26px 0; min-height: 52px; }
.ink-dots { display: inline-flex; gap: 6px; margin-top: 8px; }
.ink-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: inkdot 1.2s ease-in-out infinite; }
.ink-dots i:nth-child(2) { animation-delay: .2s; } .ink-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes inkdot { 50% { transform: translateY(-6px); opacity: .4; } }

/* ─── 모달 ─── */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(2,5,16,.72); backdrop-filter: blur(4px); animation: fadeIn .2s forwards; opacity: 0; }
.sheet { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #0d1c4a, #060d2a); border: 1px solid var(--line-strong); border-bottom: 0; box-shadow: 0 -10px 60px rgba(40,90,220,.35);
  transform: translateY(30px); animation: up .28s cubic-bezier(.2,.8,.2,1) forwards; }
@media (min-width: 640px) { .modal { align-items: center; } .sheet { border-radius: 22px; border-bottom: 1px solid var(--line-strong); } }
@keyframes up { to { transform: none; } }
.sheet h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 20px; }
.sheet .x { position: absolute; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tabs { display: flex; gap: 4px; margin: 6px 0 16px; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; background: none; padding: 10px; color: var(--ink-dim); border-bottom: 2px solid transparent; }
.tabs button.on { color: #fff; border-color: var(--blue); font-weight: 700; }
.login-opts { display: flex; justify-content: flex-end; gap: 14px; margin: 4px 0 10px; }
.social-list { display: grid; gap: 10px; margin: 14px 0 12px; }
.social-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; border: 0; border-radius: 12px; padding: 0 16px; font-size: 16px; font-weight: 700; cursor: pointer; }
.social-btn svg { width: 22px; height: 22px; flex: none; }
.social-btn:disabled { opacity: .6; }
.social-btn em { position: absolute; right: 12px; font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.14); }
.social-kakao { background: #fee500; color: #191919; }
.social-naver { background: #03c75a; color: #fff; }
.social-google { background: #fff; color: #1f1f1f; }
.withdraw-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.55; color: var(--ink-dim); }
.withdraw-list b { color: #f3e6bd; }
.btn-danger { border-color: rgba(255,120,140,.55); color: #ff9db1; border-radius: 14px; padding: 14px; font-size: 16px; font-weight: 700; }
.btn-danger:disabled { opacity: .4; }
.dev-login .btn { flex: none; white-space: nowrap; }
.dev-login { display: grid; gap: 6px; margin: 0 0 12px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.list-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: rgba(6,14,40,.6); border-radius: 14px; padding: 12px; margin-bottom: 8px; }
.list-item:hover { border-color: var(--blue); }
.list-item .nm { font-family: var(--serif); font-weight: 800; }
.list-item .sm { font-size: 12px; color: var(--ink-dim); }
.list-item .grow { flex: 1; min-width: 0; }
.prod { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 1px solid rgba(216,196,140,.3); background: linear-gradient(160deg, rgba(60,50,20,.25), rgba(8,16,44,.7));
  border-radius: 14px; padding: 14px; margin-bottom: 8px; text-align: left; }
.prod:hover { border-color: var(--brass); }
.prod .l { display: flex; align-items: center; gap: 10px; }
.prod .n { font-weight: 800; font-size: 16px; color: #f3e6bd; }
.prod .b { font-size: 11px; color: var(--cyan); }
.prod .w { font-weight: 800; }
.badge { font-size: 10px; padding: 2px 6px; border-radius: 6px; background: var(--blue); color: #fff; margin-left: 6px; vertical-align: middle; }
.hist-item { display: flex; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.hist-item .amt.plus { color: var(--cyan); } .hist-item .amt.minus { color: var(--danger); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); z-index: 200; background: rgba(10,22,60,.95); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 10px 16px; font-size: 14px; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.drawer { position: fixed; top: 54px; right: 12px; z-index: 60; min-width: 180px; background: var(--glass-strong); border: 1px solid var(--line-strong); border-radius: 14px; padding: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.drawer button, .drawer a { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: var(--ink); text-decoration: none; }
.drawer button:hover, .drawer a:hover { background: rgba(60,110,255,.2); }
.foot { text-align: center; padding: 30px 16px 40px; font-size: 11px; color: var(--ink-faint); }
.foot a { color: var(--ink-dim); }
.foot .biz { margin-top: 8px; line-height: 1.6; color: #ffd59a; opacity: .75; }


/* ─── v2: 목소리 · 호감도 · 상세 일진 · 패스 · 초대 · 공유 ─── */
.voice-btn { position: absolute; top: 8px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(10,22,60,.7); font-size: 16px; line-height: 1; z-index: 2; }
.speech .voice-btn { top: 8px; }
.speech #speechText { padding-right: 34px; }
.play-closing { margin-left: 8px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(60,110,255,.25); color: #fff; font-size: 11px; vertical-align: middle; }
.btn-compact { padding: 11px 14px; font-size: 15px; }
.card.relation { padding: 14px 16px; }
.relation .rl-top { display: flex; justify-content: space-between; align-items: center; }
.relation .rl-name { font-family: var(--serif); font-weight: 800; font-size: 17px; color: var(--silver); margin: 2px 0 8px; }
.relation .track { height: 6px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; margin-bottom: 6px; }
.relation .fill { height: 100%; background: linear-gradient(90deg, #3b67e0, #7fe3ff); box-shadow: 0 0 10px var(--glow); }
.feathers { display: inline-flex; gap: 4px; }
.feathers i { width: 8px; height: 16px; border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%; background: rgba(150,180,255,.15); transform: rotate(18deg); }
.feathers i.on { background: linear-gradient(180deg, #a9cbff, #1b3a9a); box-shadow: 0 0 6px var(--glow); }
.hours { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 10px; }
.hr { display: flex; flex-direction: column; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 4px 0; font-size: 10.5px; color: var(--ink-dim); }
.hr b { font-family: var(--serif); font-size: 15px; color: var(--ink); }
.hr i { font-style: normal; font-size: 11px; }
.hr.good { border-color: rgba(127,227,255,.55); background: rgba(127,227,255,.08); } .hr.good i { color: var(--cyan); }
.hr.bad { border-color: rgba(255,157,177,.4); } .hr.bad i { color: var(--danger); }
.pass-teaser { display: block; width: 100%; margin-top: 10px; text-align: left; font-size: 12.5px; color: var(--ink-dim); border: 1px dashed var(--line-strong); background: rgba(6,14,40,.5); border-radius: 12px; padding: 9px 12px; }
.pass-teaser b { color: #f3e6bd; }
.pass-card { border: 1px solid rgba(216,196,140,.5); border-radius: 16px; padding: 14px; margin-bottom: 14px; background: linear-gradient(160deg, rgba(90,70,20,.28), rgba(10,20,52,.85)); }
.pass-card.glow { box-shadow: 0 0 0 2px var(--brass), 0 0 30px rgba(216,196,140,.35); }
.pass-card .pc-head { display: flex; justify-content: space-between; align-items: baseline; }
.pass-card .pc-title { font-family: var(--serif); font-weight: 800; font-size: 16px; color: #f3e6bd; }
.pass-card .pc-price { font-weight: 800; }
.pass-card ul { margin: 8px 0 10px; padding-left: 18px; font-size: 13px; color: var(--ink-dim); }
.pass-card .pc-on { font-size: 12.5px; color: var(--cyan); margin-bottom: 8px; }
.invite-url { word-break: break-all; font-size: 13px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(6,14,40,.7); }
.card.invite-done { display: flex; gap: 12px; border-color: var(--blue); box-shadow: 0 0 24px var(--glow); }
.share-btn { margin: 6px 0 14px; }
#scrollPortrait { position: absolute; left: 50%; transform: translateX(-50%); top: 0; width: min(112%, 600px); aspect-ratio: 1100 / 1144; }
#scrollPortrait .writing-live { position: absolute; inset: 0; }
#scrollPortrait .writing-live .lp, #scrollPortrait > .lp { width: 100%; }
#scrollPortrait .writing-video { position: absolute; inset: 0; z-index: 2; transition: opacity .4s; }
#scrollPortrait .writing-video.gone { opacity: 0; }
.legal-frame { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: 12px; background: #050b1f; }

/* ─── 청오에게 직접 물어보기: 금색 띠 ─── */
.menu-btn.premium { border: 1.5px solid rgba(216,196,140,.85); box-shadow: 0 0 0 1px rgba(255,230,160,.18) inset, 0 0 26px rgba(216,196,140,.22); padding-top: 26px; }
.menu-btn.premium::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,235,180,.16) 45%, transparent 60%); background-size: 250% 100%; animation: shine 5s linear infinite; }
.menu-btn.premium .ribbon { position: absolute; top: 0; left: 0; right: 0; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; letter-spacing: .2em;
  color: #2a1f05; background: linear-gradient(90deg, #8a6a2a, #f3e0a6 30%, #d8b866 50%, #f3e0a6 70%, #8a6a2a); border-radius: 15px 15px 0 0; }
.menu-btn.premium .t { color: #f3e6bd; }
.menu-btn.premium .ic { color: rgba(216,196,140,.16); }
.btn-primary.gold { color: #2a1f05; background: linear-gradient(135deg, #b8913f, #f3e0a6 50%, #b8913f); background-size: 200% 100%; box-shadow: 0 8px 30px rgba(216,196,140,.35); }
.ask-intro { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 12px; }

/* ─── v3: 배경음악 · 무료 기본 풀이 · 인연 할인 · 친구 초대 ─── */
.bgm-btn { position: relative; display: grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--glass); color: var(--blue-hi); transition: color .2s, box-shadow .2s, border-color .2s; }
.bgm-btn svg { width: 15px; height: 15px; }
.bgm-btn:hover { border-color: var(--blue); }
.bgm-btn[aria-pressed="true"] { box-shadow: 0 0 10px rgba(100,160,255,.35); }
.bgm-btn[aria-pressed="false"] { color: var(--ink-faint); }
.bgm-btn[aria-pressed="false"]::after { content: ''; position: absolute; left: 50%; top: 50%; width: 20px; height: 1.5px; border-radius: 2px; background: var(--ink-dim); transform: translate(-50%, -50%) rotate(-45deg); }
@media (max-width: 380px) { .bgm-btn { width: 28px; height: 28px; } }

details.card.basic { padding: 0; }
details.basic > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 18px; cursor: pointer; list-style: none; }
details.basic > summary::-webkit-details-marker { display: none; }
details.basic > summary h3 { margin: 0; }
details.basic .sum-hint { font-size: 12.5px; color: var(--blue-hi); white-space: nowrap; }
details.basic .sum-hint::after { content: '펼치기 ▾'; }
details.basic[open] .sum-hint::after { content: '접기 ▴'; }
.badge.free { margin-left: 0; font-family: var(--sans); letter-spacing: 0; background: rgba(127,227,255,.14); color: var(--cyan); border: 1px solid rgba(127,227,255,.45); }
.basic-body { padding: 0 18px 18px; }
.basic-lead { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.basic-lead .avatar { width: 48px; height: 48px; }
.basic-sec { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: rgba(6,14,40,.45); margin-bottom: 8px; }
.bs-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bs-tag { flex: none; font-family: var(--serif); font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--blue-hi); border: 1px solid var(--line-strong); border-radius: 6px; padding: 1px 6px; background: rgba(60,110,255,.18); }
.bs-title { font-family: var(--serif); font-weight: 800; font-size: 15px; color: var(--silver); }
.basic-sec p { margin: 0 0 6px; font-size: 14px; line-height: 1.75; color: #dfe6fb; word-break: keep-all; }
.basic-sec p:last-child { margin-bottom: 0; }
.basic-sec .tags { margin-top: 8px; }
.basic-outro { margin-top: 10px; font-family: var(--serif); font-size: 12.5px; line-height: 1.7; }

.relation .rl-perk { margin-top: 4px; font-size: 12px; color: var(--ink-faint); }
.relation .rl-perk.on { color: #f3e6bd; }
.was { color: var(--ink-faint); font-weight: 400; font-size: .85em; margin-right: 2px; }
.perk-note { font-size: 12.5px; color: #f3e6bd; border: 1px solid rgba(216,196,140,.4); background: rgba(90,70,20,.2); border-radius: 12px; padding: 8px 12px; margin: 0 0 10px; }

.share-wrap { position: relative; margin: 26px 0 14px; }
.share-wrap .share-btn { margin: 0; }
.invite-bubble { position: absolute; top: -17px; right: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px 5px 8px; border-radius: 14px; border: 1px solid rgba(216,196,140,.7);
  background: linear-gradient(180deg, #1a2550, #0b1436); color: #f3e6bd; font-size: 12px; font-weight: 800; line-height: 1; box-shadow: 0 4px 16px rgba(0,0,0,.45), 0 0 12px rgba(216,196,140,.25); animation: bob 1.8s ease-in-out infinite; }
.invite-bubble::after { content: ''; position: absolute; left: 16px; bottom: -5px; width: 8px; height: 8px; background: #0b1436; border-right: 1px solid rgba(216,196,140,.7); border-bottom: 1px solid rgba(216,196,140,.7); transform: rotate(45deg); }
.invite-bubble:hover { border-color: var(--brass); box-shadow: 0 4px 16px rgba(0,0,0,.45), 0 0 18px rgba(216,196,140,.45); }
.invite-ico { width: 16px; height: 16px; flex: none; }
.reward-box { display: flex; align-items: center; gap: 12px; border: 1px solid rgba(216,196,140,.5); border-radius: 16px; padding: 14px; margin-bottom: 12px; background: linear-gradient(160deg, rgba(90,70,20,.28), rgba(10,20,52,.85)); }
.reward-box .rb-ico { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(216,196,140,.55); color: #f3e6bd; background: rgba(216,196,140,.12); }
.reward-box .rb-ico .invite-ico { width: 24px; height: 24px; }
.reward-box .rb-text { font-family: var(--serif); font-size: 15px; line-height: 1.6; }
.reward-box .rb-text b { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; color: #f3e6bd; font-size: 18px; }
.reward-box .coin-ico { width: 18px; height: 18px; }
.menu-perk { color: #f3e6bd; font-size: 12px; font-weight: 700; margin-left: 4px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .scroll-sec { opacity: 1; transform: none; } .dialogue, .intro-title { opacity: 1; } }

/* 원국·대운 등 상세 정보 접기(처음 볼 때만 펼침) — 안의 카드는 테두리 없이 구역으로 */
details.chart-fold .basic-body > .card { background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 0; padding: 14px 0 4px; margin: 0; border-top: 1px dashed var(--line); }
details.chart-fold .basic-body > .card:first-child { border-top: 0; padding-top: 0; }
/* 오늘의 일진 카드 안의 '오늘의 운세 보기' — 풀이 메뉴와 같은 모양 */
.today-menu { margin-top: 12px; }
.today-menu .menu-btn { width: 100%; }

/* 첫 화면 사업자 정보(결제대행사 심사·전자상거래법 표기) — 대화창 아래 아주 작게 */
#intro .dialogue { bottom: calc(max(18px, env(safe-area-inset-bottom)) + 46px); }
.intro-biz { position: absolute; left: 0; right: 0; bottom: max(6px, env(safe-area-inset-bottom)); z-index: 16; padding: 0 12px; text-align: center; font-size: 9.5px; line-height: 1.45; color: rgba(205,220,255,.62); text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.intro-biz a { color: rgba(205,220,255,.8); }
