/* 최애카드 — 공통 스타일 */
:root {
  --night: #17142B;
  --night-2: #221D3A;
  --cream: #F6EEDC;
  --cream-2: #EADFC4;
  --gold: #C9A24B;
  --gold-d: #B08A35;
  --gold-text: #7A5C16;
  --foil: #E8C66A;
  --ink: #2A2340;
  --ink-2: #4A4260;
  --lilac: #CFC6E8;
  --lilac-2: #A79FC2;
  --serif: 'Gowun Batang', 'Nanum Myeongjo', serif;
  --title: 'Nanum Myeongjo', 'Gowun Batang', serif;
  --roman: 'Cinzel', 'Nanum Myeongjo', serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--night);
  color: var(--cream);
  font-family: var(--serif);
  line-height: 1.65;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--foil); }
a:hover { color: #F3DC97; }
img, svg { display: block; }

.site-header {
  max-width: 720px; margin: 0 auto; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo {
  font-family: var(--title); font-weight: 800; font-size: 20px;
  color: var(--cream); text-decoration: none; letter-spacing: 0.02em;
}
.logo span { font-family: var(--roman); color: var(--foil); font-size: 14px; margin-left: 6px; letter-spacing: 0.15em; }
.site-header nav { display: flex; gap: 14px; font-size: 14px; }
.site-header nav a { color: var(--lilac); text-decoration: none; white-space: nowrap; }
.logo { white-space: nowrap; }
.site-header nav a:hover { color: var(--cream); }

main { max-width: 720px; margin: 0 auto; padding: 8px 20px 48px; }
.site-footer {
  max-width: 720px; margin: 0 auto; padding: 28px 20px 40px;
  border-top: 1px solid rgba(207, 198, 232, 0.18);
  font-size: 13px; color: var(--lilac-2); text-align: center;
}
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
.site-footer a { color: var(--lilac); }

h1, h2, h3 { font-family: var(--title); font-weight: 800; line-height: 1.35; margin: 0 0 12px; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 12px; }
.muted { color: var(--lilac); }
.eyebrow { font-size: 13px; letter-spacing: 0.2em; color: var(--lilac); margin-bottom: 6px; }
.center { text-align: center; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 22px; border-radius: 999px;
  font-family: var(--serif); font-weight: 700; font-size: 16px;
  border: 1.5px solid var(--foil); cursor: pointer; text-decoration: none;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-gold { background: var(--foil); color: var(--night); }
.btn-gold:hover { background: #F3DC97; color: var(--night); }
.btn-ghost { background: transparent; color: var(--foil); }
.btn-ghost:hover { background: rgba(232, 198, 106, 0.12); color: var(--foil); }
.btn-block { width: 100%; }
.btn:focus-visible, .option:focus-visible, input:focus-visible, .text-btn:focus-visible { outline: 3px solid #8FC6E8; outline-offset: 2px; }
.text-btn { background: none; border: none; color: var(--lilac); font-family: var(--serif); font-size: 14px; cursor: pointer; padding: 8px 4px; min-height: 44px; }
.text-btn:hover { color: var(--cream); }

/* 크림색 패널 */
.panel {
  background: var(--cream); color: var(--ink);
  border: 2px solid var(--gold); border-radius: 18px; padding: 8px;
}
.panel-inner { border: 1.5px solid var(--gold-d); border-radius: 11px; padding: 24px 22px; }
.panel a { color: var(--gold-text); }

/* 테스트 목록 카드 */
.test-card { display: flex; gap: 18px; align-items: center; text-decoration: none; color: var(--ink); }
.test-card .thumb { width: 110px; flex: 0 0 110px; aspect-ratio: 300 / 250; }
.test-card h2 { font-size: 20px; margin-bottom: 6px; }
.test-card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.test-card .go { margin-top: 10px; font-weight: 700; color: var(--gold-text); font-size: 14px; }

/* 입력 */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; text-align: left; }
.field label { font-size: 14px; font-weight: 700; color: var(--ink); }
.field input {
  min-height: 50px; padding: 10px 14px; border-radius: 12px;
  border: 1.5px solid var(--gold-d); background: #FFFDF7; color: var(--ink);
  font-family: var(--serif); font-size: 16px;
}
.field .hint { font-size: 12px; color: var(--ink-2); }
.error { color: #A3242A; font-size: 14px; min-height: 1.4em; margin: 0 0 8px; }

/* 질문 */
.progress { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.progress-bar { flex: 1; height: 6px; background: rgba(207, 198, 232, 0.2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--foil); width: 0; transition: width 0.25s ease; }
.progress-count { font-family: var(--roman); font-size: 14px; color: var(--foil); letter-spacing: 0.1em; min-width: 44px; text-align: right; }
.q-num { font-family: var(--roman); color: var(--foil); letter-spacing: 0.15em; font-size: 15px; margin-bottom: 8px; }
.q-text { font-family: var(--title); font-weight: 800; font-size: 22px; line-height: 1.45; margin-bottom: 22px; }
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  min-height: 56px; padding: 14px 18px; border-radius: 14px; text-align: left;
  background: var(--cream); color: var(--ink); border: 1.5px solid var(--gold-d);
  font-family: var(--serif); font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
}
.option:hover { background: #FFF6DE; }
.option:active { transform: scale(0.99); }

/* 결과 카드 (공유 이미지 600x750) */
.frame-wrap { width: 100%; max-width: 600px; margin: 0 auto; aspect-ratio: 4 / 5; position: relative; overflow: hidden; border-radius: 12px; }
.frame-scaler { position: absolute; left: 0; top: 0; width: 600px; height: 750px; transform-origin: 0 0; }
.share-frame {
  width: 600px; height: 750px; position: relative; overflow: hidden;
  background: #17142B; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  font-family: var(--serif); color: var(--cream);
}
.share-frame .dot { position: absolute; border-radius: 50%; }
.share-frame .head { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.share-frame .head p { margin: 0; }
.share-frame .head .sub { font-size: 13px; letter-spacing: 0.2em; color: var(--lilac); }
.share-frame .head .names { font-family: var(--title); font-weight: 700; font-size: 17px; color: #F3E9D2; }
.tarot { width: 400px; height: 600px; padding: 10px; background: var(--cream); border: 2px solid var(--gold); border-radius: 18px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); }
.tarot-inner { height: 100%; border: 1.5px solid var(--gold-d); border-radius: 11px; padding: 18px 24px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--ink); text-align: center; }
.tarot .numrow { display: flex; align-items: center; gap: 12px; }
.tarot .numrow i { display: block; width: 48px; height: 1px; background: var(--gold-d); }
.tarot .roman { margin: 0; font-family: var(--roman); font-weight: 700; font-size: 26px; letter-spacing: 0.12em; color: var(--gold-text); }
.tarot .art { width: 300px; height: 250px; }
.tarot .title { margin: 0; font-family: var(--title); font-weight: 800; font-size: 24px; line-height: 1.3; color: var(--ink); }
.tarot .line { margin: 0; font-weight: 700; font-size: 17px; line-height: 1.4; color: var(--gold-text); }
.tarot .rule { width: 36px; height: 1px; background: var(--gold-d); flex: 0 0 auto; }
.tarot .body { margin: 0; font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.tarot .badge { display: none; }
.share-frame .foot { margin: 0; font-size: 12px; color: var(--lilac-2); }

/* 희귀 카드 */
.tarot.rare { background: var(--night-2); border: 3px solid var(--foil); box-shadow: 0 0 0 6px rgba(232, 198, 106, 0.18), 0 18px 40px rgba(0, 0, 0, 0.5); }
.tarot.rare .tarot-inner { border-color: var(--gold); padding-top: 16px; gap: 8px; color: var(--cream); }
.tarot.rare .numrow i { background: var(--gold); }
.tarot.rare .roman { color: var(--foil); }
.tarot.rare .art { height: 232px; }
.tarot.rare .title { color: #F3E9D2; }
.tarot.rare .line { color: var(--foil); }
.tarot.rare .rule { background: var(--gold); }
.tarot.rare .body { color: #D9D2EE; }
.tarot.rare .badge { display: block; margin: 0; padding: 3px 12px; border: 1px solid var(--foil); border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--foil); }

.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 20px auto 0; max-width: 600px; }
.actions .wide { grid-column: 1 / -1; }
.toast { min-height: 1.4em; text-align: center; font-size: 14px; color: var(--foil); margin: 10px 0 0; }

/* 결과 해설 */
.result-entry { display: flex; gap: 16px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid rgba(207, 198, 232, 0.18); }
.result-entry .thumb { width: 120px; flex: 0 0 120px; aspect-ratio: 300 / 250; background: var(--cream); border-radius: 12px; overflow: hidden; }
.result-entry .roman { font-family: var(--roman); color: var(--foil); letter-spacing: 0.12em; font-size: 14px; margin: 0 0 2px; }
.result-entry h3 { margin-bottom: 4px; }
.result-entry .line { color: var(--foil); font-weight: 700; margin-bottom: 8px; }
.result-entry p { font-size: 15px; }
.rare-tag { display: inline-block; font-size: 12px; border: 1px solid var(--foil); color: var(--foil); border-radius: 999px; padding: 1px 10px; margin-left: 6px; vertical-align: middle; }

.prose h2 { margin-top: 28px; }
.prose ul { padding-left: 20px; margin: 0 0 12px; }
.prose li { margin-bottom: 6px; }

.ad-slot { margin: 28px auto; max-width: 600px; min-height: 100px; }
.ad-slot:empty { display: none; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
[hidden] { display: none !important; }

@media (max-width: 480px) {
  .logo span { display: none; }
  h1 { font-size: 24px; }
  .q-text { font-size: 20px; }
  .test-card { flex-direction: column; text-align: center; }
  .test-card .thumb { width: 160px; flex-basis: auto; }
  .result-entry { flex-direction: column; }
  .result-entry .thumb { width: 150px; flex-basis: auto; }
}
