/* 묘향사주타로 — 공통 스타일 (휴대폰 우선 · 보라 벨벳 · 금빛 글자) */
@font-face { font-family: "KJCMyungjo"; src: url(/fonts/KJCMyungjo-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Paperlogy"; src: url(/fonts/Paperlogy-6SemiBold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Paperlogy"; src: url(/fonts/Paperlogy-8ExtraBold.woff2) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --bg: #170c2a; --bg2: #24123f; --velvet: #2b1646; --panel: rgba(22, 10, 40, .72); --panel-2: rgba(255, 255, 255, .05);
  --gold: #d9b96a; --gold-2: #f1dba0; --ink: #f3eadb; --muted: #b9a7cc; --dim: #7f6d98; --line: rgba(217, 185, 106, .28);
  --danger: #ff8f8f; --ok: #9fe3b1;
  --serif: "KJCMyungjo", "Noto Serif KR", "Apple SD Gothic Neo", serif;
  --sans: "Paperlogy", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --radius: 14px; --card-ratio: 603 / 1000;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.65;
  background: var(--bg) url(/img/velvet.webp) center top / cover fixed no-repeat;
}
body::before { content: ""; position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 0%, rgba(217,185,106,.10), transparent 55%), linear-gradient(180deg, rgba(23,12,42,.35), rgba(23,12,42,.88) 70%); pointer-events: none; z-index: -1; }
a { color: var(--gold); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: .04em; color: var(--gold-2); margin: 0 0 .5em; }
h1 { font-size: 1.7rem; line-height: 1.3; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); font-size: .85rem; }
.wrap { max-width: 480px; margin: 0 auto; padding: 16px 16px 48px; }
.wrap.wide { max-width: 560px; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 0 14px; }
.brand { font-family: var(--serif); color: var(--gold); text-decoration: none; letter-spacing: .12em; font-size: 1.05rem; }
.topbar a.back { color: var(--muted); text-decoration: none; font-size: .9rem; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; backdrop-filter: blur(6px); margin-bottom: 14px; }
.panel.soft { background: var(--panel-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--gold);
  background: linear-gradient(180deg, #e7cc85, #c9a65a); color: #2a1740; font-weight: 800; font-size: 1.02rem; text-decoration: none; cursor: pointer; transition: transform .12s, filter .12s; }
.btn:active { transform: scale(.985); }
.btn:disabled { filter: grayscale(.6) brightness(.7); cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--gold-2); }
.btn.sm { min-height: 40px; padding: 8px 14px; font-size: .92rem; width: auto; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=date], input[type=time], textarea, select {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.28); color: var(--ink); font: inherit; font-size: 1rem; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217,185,106,.15); }
textarea { min-height: 110px; resize: vertical; }
.hint { font-size: .82rem; color: var(--dim); margin-top: 6px; }
.err { color: var(--danger); font-size: .9rem; min-height: 1.2em; margin: 6px 0; }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip { padding: 14px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.chip b { display: block; font-family: var(--serif); color: var(--gold-2); font-size: 1.05rem; }
.chip small { color: var(--muted); font-size: .8rem; }
.chip[aria-pressed=true] { border-color: var(--gold); background: rgba(217,185,106,.14); box-shadow: inset 0 0 0 1px var(--gold); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { flex: 1; padding: 10px; background: transparent; color: var(--muted); border: 0; font: inherit; cursor: pointer; }
.seg button[aria-pressed=true] { background: rgba(217,185,106,.2); color: var(--gold-2); }

.steps { display: flex; gap: 6px; margin: 4px 0 18px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.12); }
.steps i.on { background: var(--gold); }

.product { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(0,0,0,.25); text-decoration: none; color: inherit; margin-bottom: 10px; }
.product b { font-family: var(--serif); color: var(--gold-2); font-size: 1.08rem; }
.product .price { font-weight: 800; color: var(--gold); white-space: nowrap; }
.product small { color: var(--muted); display: block; }

.notice { font-size: .82rem; color: var(--dim); line-height: 1.6; }
.copy { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: transparent; color: var(--gold-2); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: .85rem; cursor: pointer; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; font-weight: 600; word-break: break-all; }
.big { font-family: var(--serif); font-size: 1.5rem; color: var(--gold-2); letter-spacing: .08em; }

/* ── 카드 뽑기 무대 ─────────────────────────────── */
.stage { position: relative; min-height: 70dvh; }
.slots { display: grid; gap: 10px 8px; justify-content: center; margin-bottom: 14px; }
.slots.r4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.slots.r1 { grid-template-columns: minmax(0, 150px); }
.slot { position: relative; aspect-ratio: var(--card-ratio); border-radius: 8px; border: 1px dashed var(--line); background: rgba(0,0,0,.2); perspective: 900px; }
.slot .lbl { position: absolute; left: 0; right: 0; bottom: -1.55em; font-size: .68rem; text-align: center; color: var(--dim); line-height: 1.2; }
.slot.now { border-style: solid; border-color: var(--gold); box-shadow: 0 0 18px rgba(217,185,106,.45); }
.slot.now .lbl { color: var(--gold-2); }
.slot .face { position: absolute; inset: 0; border-radius: 8px; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.slot .face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; backface-visibility: hidden; border-radius: 8px; }
.slot .face img.front { transform: rotateY(180deg); }
.slot .face.flipped { transform: rotateY(180deg); }
.slot.filled { border-color: transparent; }
.slots-gap { height: 1.6em; }

.fanwrap { margin-top: 26px; }
.fan-hint { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.fan { display: flex; overflow-x: auto; overflow-y: visible; padding: 18px 14px 26px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.fan::-webkit-scrollbar { display: none; }
.fan button { flex: 0 0 auto; width: 66px; aspect-ratio: var(--card-ratio); margin-right: -42px; border: 0; padding: 0; border-radius: 7px; background: #000 center / cover no-repeat;
  box-shadow: -2px 0 6px rgba(0,0,0,.6); transition: transform .18s; scroll-snap-align: center; cursor: pointer; }
.fan button:last-child { margin-right: 0; }
.fan button:hover, .fan button:focus-visible { transform: translateY(-14px); outline: 2px solid var(--gold); z-index: 2; }
.fan button.used { visibility: hidden; }
.flyer { position: fixed; z-index: 50; border-radius: 7px; background: #000 center / cover no-repeat; pointer-events: none; transition: all .75s cubic-bezier(.2,.7,.2,1); box-shadow: 0 12px 30px rgba(0,0,0,.6); }

.deckstack { position: relative; width: 120px; aspect-ratio: var(--card-ratio); margin: 28px auto 12px; }
.deckstack img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.55); }
.shuffling img:nth-child(odd) { animation: shufA 1.2s ease-in-out infinite; }
.shuffling img:nth-child(even) { animation: shufB 1.2s ease-in-out infinite; }
@keyframes shufA { 0%,100% { transform: translate(0,0) rotate(0) } 50% { transform: translate(-46px,-10px) rotate(-9deg) } }
@keyframes shufB { 0%,100% { transform: translate(0,0) rotate(0) } 50% { transform: translate(46px,8px) rotate(8deg) } }

.center { text-align: center; }
.intro-q { font-family: var(--serif); font-size: 1.15rem; color: var(--gold-2); text-align: center; margin: 12px 0 4px; }
.reveal-card { width: min(62vw, 240px); margin: 10px auto; border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.6); display: block; }
.card-name { font-family: var(--serif); color: var(--gold-2); font-size: 1.3rem; text-align: center; margin: 8px 0 2px; }
.card-sub { color: var(--muted); font-size: .9rem; text-align: center; margin-bottom: 14px; }
.reading { font-size: 1.02rem; line-height: 1.8; }
.reading .advice { margin-top: 10px; padding: 12px 14px; border-left: 3px solid var(--gold); background: rgba(217,185,106,.08); border-radius: 0 10px 10px 0; }
.fade-in { animation: fadeIn .6s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.hidden { display: none !important; }
footer.site { margin-top: 30px; text-align: center; font-size: .78rem; color: var(--dim); line-height: 1.7; }
footer.site a { color: var(--dim); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: rgba(0,0,0,.85); color: var(--ink); padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); font-size: .9rem; z-index: 99; opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.on { opacity: 1; }
@media (min-width: 560px) { .fan button { width: 76px; margin-right: -46px; } }
