/* ==========================================================================
   벽사신견(辟邪神犬) — "밤의 대문 앞, 노란 부적"
   설계 문서: docs/DESIGN.md
   바탕은 산골의 밤, 읽는 면은 한지, 메뉴는 대문에 붙은 괴황지 부적, 행동과 도장은 경면주사.
   ========================================================================== */

:root {
  /* 색 */
  --night: #1A1C2E;
  --night-2: #252840;
  --night-line: rgba(227, 179, 65, 0.22);
  --paper: #F1E7D3;
  --paper-deep: #E6D8BC;
  --paper-line: #D2C19D;
  --ink: #2B231D;
  --ink-soft: #5B4E42;
  --cinnabar: #A82A20;
  --cinnabar-deep: #861F17;
  --cinnabar-tint: #F6E1D6;
  --yellow: #E3B341;
  --yellow-deep: #C9952A;
  --moon: #F4EEE2;
  --moon-soft: #C9C2B4;

  /* 기존 템플릿과의 호환 이름 */
  --crimson: var(--cinnabar);
  --crimson-bright: #C0392B;
  --gold: #9A6A12;
  --gold-bright: #B7801C;
  --jade: #2F6B45;
  --text-main: var(--ink);
  --text-sub: #3F352C;
  --text-muted: var(--ink-soft);
  --card-bg: var(--paper);

  /* 오행 (한지 위에서 읽히는 목판 인출 배색) */
  --wood-bg: #E3EEDD;  --wood-text: #24502F;  --wood-border: #4F7F59;
  --fire-bg: #F6DED6;  --fire-text: #8C2219;  --fire-border: #B8473B;
  --earth-bg: #F2E3C2; --earth-text: #6B4A12; --earth-border: #B98A2E;
  --metal-bg: #E9E6E0; --metal-text: #3A3A40; --metal-border: #85838A;
  --water-bg: #DCE5EE; --water-text: #1D3A57; --water-border: #4D6F94;

  /* 글꼴 */
  --font-display: 'Song Myung', 'Noto Serif KR', serif;
  --font-body: 'Gowun Batang', 'Noto Serif KR', serif;

  /* 위계별 모서리 */
  --r-paper: 4px;
  --r-btn: 10px;
  --r-chip: 999px;

  /* 한지 결 (섬유 노이즈) */
  --paper-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .42  0 0 0 0 .33  0 0 0 0 .2  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='.012 .22' numOctaves='2' seed='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .55  0 0 0 0 .45  0 0 0 0 .28  0 0 0 .08 0'/></filter><rect width='100%' height='100%' filter='url(%23f)'/></svg>");
}

/* ── 바탕 ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--ink);
  background-color: var(--night);
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(227, 179, 65, 0.10), transparent 60%),
    radial-gradient(80% 40% at 50% 110%, rgba(168, 42, 32, 0.10), transparent 70%);
  background-attachment: fixed;
  display: flex;
  justify-content: center;
  padding: 0 18px calc(96px + env(safe-area-inset-bottom));   /* 하단 메뉴 높이만큼 */
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

::selection { background: var(--yellow); color: var(--ink); }

.app-container {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
}

.view-step {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  padding-top: 14px;
}

/* hidden 속성은 어떤 display 규칙보다 우선한다 (패 뒤집기 전 풀이 숨김 등) */
[hidden] { display: none !important; }

img { max-width: 100%; display: block; }

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }

:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

strong { font-weight: 700; }

.impact-red { color: var(--cinnabar); font-weight: 700; }
.impact-gold { color: var(--gold); font-weight: 700; }
.impact-green { color: var(--jade); font-weight: 700; }

/* ── 버튼 ─────────────────────────────────────────────────────────────── */
.btn-main, .btn-submit, .btn-pay, .btn-intro-yes, .btn-scroll-action, .btn-talisman-download {
  display: block;
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--r-btn);
  background: var(--cinnabar);
  color: var(--moon);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
  box-shadow: inset 0 0 0 1px rgba(244, 238, 226, 0.18), 0 6px 18px -8px rgba(168, 42, 32, 0.8);
  transition: background-color 0.15s ease, transform 0.12s ease;
}
.btn-main:hover, .btn-submit:hover, .btn-pay:hover, .btn-intro-yes:hover, .btn-scroll-action:hover, .btn-talisman-download:hover { background: var(--cinnabar-deep); }
.btn-main:active, .btn-submit:active, .btn-pay:active, .btn-intro-yes:active, .btn-scroll-action:active, .btn-talisman-download:active { transform: translateY(1px); }

.btn-landing-scroll, .btn-intro-no, .btn-scroll-close, .btn-close, .btn-nav-back, .btn-action, .btn-quiet {
  border-radius: var(--r-btn);
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.45;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* 밤 위의 보조 버튼 */
.btn-landing-scroll, .btn-intro-no, .btn-nav-back, .btn-action, .btn-quiet {
  color: var(--moon);
  background: rgba(244, 238, 226, 0.04);
  border: 1px solid rgba(244, 238, 226, 0.22);
}
.btn-landing-scroll:hover, .btn-intro-no:hover, .btn-nav-back:hover, .btn-action:hover, .btn-quiet:hover { background: rgba(244, 238, 226, 0.09); border-color: rgba(244, 238, 226, 0.4); }

.btn-landing-scroll { width: 100%; padding: 13px 16px; font-size: 15px; color: var(--yellow); border-color: var(--night-line); }
.btn-nav-back { align-self: flex-start; padding: 8px 14px; font-size: 14px; }

/* 한지 위의 보조 버튼 */
.btn-scroll-close, .btn-close {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--paper-line);
}
.btn-scroll-close:hover, .btn-close:hover { background: rgba(43, 35, 29, 0.05); }

/* ── 홈: 상단 표지 ───────────────────────────────────────────────────── */
.home-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  color: var(--moon);
}
.home-seal {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 3px;
  background: var(--cinnabar);
  color: var(--moon);
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1.05;
  writing-mode: vertical-rl;
  letter-spacing: 0.05em;
  box-shadow: inset 0 0 0 2px rgba(244, 238, 226, 0.5);
  transform: rotate(-4deg);
}
.home-brand { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.04em; }
.home-topbar-link {
  margin-left: auto;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--yellow);
  border-radius: var(--r-chip);
  border: 1px solid var(--night-line);
}

/* ── 홈: 대문 아치와 제목 ─────────────────────────────────────────────── */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.spirit-portrait-box {
  position: relative;
  width: min(78%, 300px);
  aspect-ratio: 4 / 5;
  margin-top: 6px;
  border-radius: 999px 999px 6px 6px;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 0 0 6px var(--night),
    0 0 0 7px rgba(227, 179, 65, 0.35),
    0 24px 60px -20px rgba(227, 179, 65, 0.35);
}
.spirit-portrait-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 28, 46, 0.75), transparent 45%);
  pointer-events: none;
}
.spirit-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  animation: lanternOn 1.6s ease-out both;
}
@keyframes lanternOn {
  from { filter: brightness(0.25) saturate(0.6); }
  to { filter: brightness(1) saturate(1); }
}

.spirit-title-box { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.spirit-sub-title { font-size: 14px; color: var(--yellow); letter-spacing: 0.02em; }
.spirit-main-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.1;
  color: var(--moon);
  letter-spacing: 0.02em;
}
.spirit-main-title span { color: var(--yellow); }
.hanja-definition { font-size: 13.5px; line-height: 1.7; color: var(--moon-soft); }
.hanja-definition span { font-family: var(--font-display); font-size: 17px; color: var(--moon); }

.landing-teaser-box {
  width: 100%;
  text-align: left;
  padding: 18px 18px 16px;
  border-radius: var(--r-paper);
  background-color: var(--paper);
  background-image: var(--paper-grain);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.landing-teaser-quote { font-family: var(--font-display); font-size: 18px; line-height: 1.65; color: var(--ink); }
.landing-teaser-sub { font-size: 15px; line-height: 1.75; color: var(--ink-soft); }

/* ── 홈: 부적 메뉴 (이 디자인의 단 하나의 주인공) ───────────────────── */
.slip-section { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.slip-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  color: var(--moon);
  text-align: center;
}
.slip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }

.slip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 168px;
  padding: 24px 20px 20px;
  text-align: left;
  color: var(--ink);
  background-color: var(--yellow);
  background-image:
    var(--paper-grain),
    radial-gradient(120% 90% at 30% 20%, rgba(255, 236, 170, 0.55), transparent 60%),
    linear-gradient(180deg, #E8BD52, #D9A63A);
  /* 찢어낸 위아래 가장자리 */
  clip-path: polygon(0 2.2%, 7% 0.6%, 15% 2%, 24% 0.4%, 33% 1.8%, 41% 0.7%, 50% 2.1%, 59% 0.5%, 68% 1.6%, 77% 0.3%, 86% 1.9%, 94% 0.6%, 100% 1.7%,
                     100% 98.2%, 93% 99.6%, 85% 98%, 76% 99.5%, 67% 98.3%, 58% 99.7%, 49% 98.1%, 40% 99.4%, 31% 98.2%, 22% 99.6%, 13% 98.4%, 6% 99.5%, 0 98.3%);
  transition: transform 0.18s ease, filter 0.18s ease;
}
/* 부적 테: 가장자리에서 안쪽으로 들어간 주사 이중선 */
.slip::before, .slip::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 2px;
}
.slip::before { inset: 9px 7px; border: 1.6px solid rgba(168, 42, 32, 0.78); }
.slip::after { inset: 13px 11px; border: 0.8px solid rgba(168, 42, 32, 0.5); }
.slip > * { position: relative; z-index: 1; }
.slip:nth-child(odd) { transform: rotate(-1.1deg); }
.slip:nth-child(even) { transform: rotate(0.9deg) translateY(6px); }
.slip:hover { filter: brightness(1.05); }
.slip:active { transform: rotate(0deg) scale(0.98); }
.slip-title { font-family: var(--font-display); font-size: 22px; line-height: 1.25; color: var(--cinnabar-deep); }
.slip-desc { font-size: 13.5px; line-height: 1.6; color: #4A3613; }
.slip-seal {
  position: absolute;
  right: 18px;
  bottom: 19px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 3px;
  background: var(--cinnabar);
  color: #F7E3B0;
  font-family: var(--font-display);
  font-size: 19px;
  box-shadow: inset 0 0 0 2px rgba(247, 227, 176, 0.65);
  transform: rotate(6deg);
  opacity: 0.92;
}

.event-strip {
  white-space: normal;
  text-align: center;
  font-size: 14px;
  color: var(--yellow);
  padding: 10px 12px;
  border-top: 1px solid var(--night-line);
  border-bottom: 1px solid var(--night-line);
}

.site-footer { display: flex; flex-direction: column; gap: 8px; padding: 6px 2px 0; color: var(--moon-soft); font-size: 13px; line-height: 1.7; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.footer-links a { color: var(--moon); text-decoration: none; border-bottom: 1px solid rgba(244, 238, 226, 0.3); }
.footer-note, .footer-biz { color: var(--moon-soft); }
.footer-biz:empty { display: none; }

/* ── 첫 진입 문턱 모달 ─────────────────────────────────────────────── */
.intro-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
  background: rgba(14, 15, 26, 0.92);
  backdrop-filter: blur(6px);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.intro-modal-box {
  width: 100%;
  max-width: 400px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  border-radius: 14px;
  background: var(--night-2);
  box-shadow: 0 0 0 1px var(--night-line), 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  color: var(--moon);
}
.intro-modal-img-box { position: relative; height: 220px; }
.intro-modal-img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.intro-modal-img-box::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--night-2), transparent 55%); }
.intro-modal-img-tag {
  position: absolute;
  left: 16px;
  bottom: 12px;
  z-index: 1;
  font-size: 13px;
  color: var(--yellow);
}
.intro-modal-body { display: flex; flex-direction: column; gap: 14px; padding: 6px 20px 22px; text-align: center; }
.intro-badge { font-size: 14px; color: var(--yellow); }
.intro-question { font-family: var(--font-display); font-size: 25px; line-height: 1.45; color: var(--moon); }
.intro-question span { color: var(--yellow); }
.intro-desc { font-size: 15px; line-height: 1.75; color: var(--moon-soft); }
.intro-btn-row { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.btn-intro-no { padding: 13px 16px; font-size: 14.5px; color: var(--moon-soft); }
.intro-refusal-box {
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-paper);
  background: rgba(168, 42, 32, 0.12);
  border: 1px solid rgba(168, 42, 32, 0.5);
  text-align: left;
}
.refusal-title { font-family: var(--font-display); font-size: 17px; color: #F2B8AE; }
.intro-refusal-box p { font-size: 15px; line-height: 1.75; color: var(--moon); }

/* ── 설화 두루마리 모달 ───────────────────────────────────────────── */
.hanji-scroll-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background: rgba(14, 15, 26, 0.9);
  backdrop-filter: blur(5px);
  transition: opacity 0.3s ease;
}
.hanji-scroll-wrapper { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; }
.scroll-tassel { display: flex; flex-direction: column; align-items: center; margin-bottom: -2px; }
.tassel-string { width: 2px; height: 20px; background: var(--cinnabar); }
.tassel-knot { color: var(--cinnabar); font-size: 13px; line-height: 1; }
.scroll-roller {
  width: 100%;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-radius: 13px;
  background: linear-gradient(180deg, #6B4423, #3E2510);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.roller-cap { width: 12px; height: 12px; border-radius: 50%; background: #C9952A; box-shadow: inset 0 0 0 2px #7A5313; }
.scroll-paper {
  width: 94%;
  max-height: 78vh;
  max-height: 78dvh;
  overflow-y: auto;
  padding: 22px 18px;
  background-color: var(--paper);
  background-image: var(--paper-grain);
  border-left: 1px solid var(--paper-line);
  border-right: 1px solid var(--paper-line);
  transform-origin: top center;
}
@keyframes unfurlScroll {
  from { clip-path: inset(0 0 100% 0); opacity: 0.4; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}
.scroll-paper-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.scroll-baekgu-circle { width: 86px; height: 86px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--cinnabar); }
.scroll-baekgu-img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.scroll-badge { font-size: 13px; color: var(--cinnabar); }
.scroll-title { font-family: var(--font-display); font-size: 24px; line-height: 1.3; color: var(--ink); }
.scroll-subtitle { font-size: 14px; color: var(--ink-soft); }
.scroll-text { font-size: 15.5px; line-height: 1.95; color: var(--ink); text-align: left; }
.scroll-text strong { color: var(--cinnabar); }
.scroll-seal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 4px;
  background: var(--cinnabar);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.15;
  box-shadow: inset 0 0 0 3px rgba(241, 231, 211, 0.7);
  transform: rotate(-5deg);
}
.scroll-btn-row { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

/* ── 입력 화면 ─────────────────────────────────────────────────────── */
.gaze-header {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--moon);
}
.gaze-avatar-box {
  flex-shrink: 0;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--night), 0 0 0 3.5px var(--yellow);
}
.gaze-avatar-img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.gaze-speech { font-family: var(--font-display); font-size: 16.5px; line-height: 1.65; color: var(--moon); }

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 18px;
  border-radius: var(--r-paper);
  background-color: var(--paper);
  background-image: var(--paper-grain);
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.input-row { display: flex; gap: 8px; }
.input-row > input { min-width: 0; flex: 1; }

input, select {
  width: 100%;
  min-width: 0;
  padding: 12px 12px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: rgba(255, 252, 244, 0.7);
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
}
select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%235B4E42' stroke-width='1.6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
input::placeholder { color: #9C8E7C; }
input:focus, select:focus { outline: none; border-color: var(--cinnabar); box-shadow: 0 0 0 3px rgba(168, 42, 32, 0.15); }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
option:disabled { color: #9C8E7C; }

/* ── 결과: 공통 한지 카드 ───────────────────────────────────────────── */
.dream-fit-card, .daeun-card, .oheng-card, .mind-scan-card, .ghost-warning-card, .sniff-teaser-card,
.classified-dossier-box, .portfolio-section-card, .talisman-section-card, .kpi-dashboard, .feature-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 18px;
  border-radius: var(--r-paper);
  background-color: var(--paper);
  background-image: var(--paper-grain);
  color: var(--ink);
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.4;
  color: var(--cinnabar);
}
/* 카드 밖(밤 바탕)에 놓인 제목 */
.view-step > .section-title { color: var(--yellow); margin: 8px 2px -6px; }

.action-bar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.btn-action { padding: 10px 6px; font-size: 13px; line-height: 1.4; }

/* 결과 첫 카드: 밤 위에 뜬 일주 표지 */
.character-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 20px 24px;
  text-align: center;
  border-radius: 14px;
  background: var(--night-2);
  color: var(--moon);
  box-shadow: 0 0 0 1px var(--night-line);
}
.animal-tag {
  padding: 4px 12px;
  border-radius: var(--r-chip);
  font-size: 13.5px;
  color: var(--yellow);
  border: 1px solid var(--night-line);
}
.animal-emoji { font-size: 46px; line-height: 1.2; }
.animal-name { font-family: var(--font-display); font-size: 25px; line-height: 1.45; color: var(--moon); }
.animal-sub { font-size: 15.5px; line-height: 1.85; color: var(--moon-soft); text-align: left; }

.fit-header, .daeun-header, .mind-scan-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.fit-score-badge, .daeun-badge, .mind-badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: var(--r-chip);
  font-size: 13px;
  font-weight: 700;
  color: var(--cinnabar-deep);
  background: var(--cinnabar-tint);
  border: 1px solid rgba(168, 42, 32, 0.3);
}
.fit-content { font-size: 16px; line-height: 1.85; color: var(--ink); }
.fit-content strong { color: var(--ink); }

/* 원국 표 */
.saju-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  border-radius: var(--r-paper);
  overflow: hidden;
  background-color: var(--paper);
  background-image: var(--paper-grain);
  color: var(--ink);
}
.saju-table th, .saju-table td {
  padding: 9px 3px;
  text-align: center;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1.45;
  border-bottom: 1px solid var(--paper-line);
  border-right: 1px solid var(--paper-line);
}
.saju-table tr > *:last-child { border-right: none; }
.saju-table tbody tr:last-child > * { border-bottom: none; }
.saju-table th { font-weight: 700; font-size: 13px; color: var(--ink-soft); background: var(--paper-deep); }
.label-col { width: 64px; font-weight: 700; color: var(--cinnabar); background: rgba(168, 42, 32, 0.05); }

.ganji-tile {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 50px;
  border-radius: 6px;
  border: 1.5px solid;
}
.ganji-tile .main-char { font-family: var(--font-display); font-size: 21px; line-height: 1.1; }
.ganji-tile .sub-char { font-size: 11px; line-height: 1.2; opacity: 0.85; }
.ganji-tile.wood, .badge.wood { background: var(--wood-bg); color: var(--wood-text); border-color: var(--wood-border); }
.ganji-tile.fire, .badge.fire { background: var(--fire-bg); color: var(--fire-text); border-color: var(--fire-border); }
.ganji-tile.earth, .badge.earth { background: var(--earth-bg); color: var(--earth-text); border-color: var(--earth-border); }
.ganji-tile.metal, .badge.metal { background: var(--metal-bg); color: var(--metal-text); border-color: var(--metal-border); }
.ganji-tile.water, .badge.water { background: var(--water-bg); color: var(--water-text); border-color: var(--water-border); }

.jijanggan-box { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: nowrap;
}
.sinsal-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--cinnabar-deep);
  background: var(--cinnabar-tint);
}

.term-boundary-note {
  padding: 14px 16px;
  border-radius: var(--r-paper);
  font-size: 14.5px;
  line-height: 1.75;
  color: #3E2A06;
  background: #F6E4B5;
  border-left: 4px solid var(--yellow-deep);
}
.term-boundary-note strong { color: var(--cinnabar-deep); }

/* 대운 */
.daeun-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 2px 8px;
  margin: 0 -4px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--paper-line) transparent;
}
.daeun-item {
  position: relative;
  flex: 0 0 74px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 4px 8px;
  border-radius: 8px;
  background: rgba(255, 252, 244, 0.6);
  border: 1px solid var(--paper-line);
}
.daeun-item.current-daeun { border-color: var(--cinnabar); box-shadow: inset 0 0 0 1px var(--cinnabar); background: #FBEDE6; }
.daeun-current-tag {
  position: absolute;
  top: -9px;
  padding: 0 7px;
  border-radius: var(--r-chip);
  font-size: 11px;
  line-height: 18px;
  color: var(--moon);
  background: var(--cinnabar);
}
.daeun-age { font-size: 13px; font-weight: 700; color: var(--ink); }
.daeun-tiles { display: flex; gap: 3px; }
.daeun-tiles .badge { font-family: var(--font-display); font-size: 15px !important; padding: 2px 6px; }
.daeun-sub { font-size: 11.5px; line-height: 1.45; text-align: center; color: var(--cinnabar-deep); }
.daeun-comment { font-size: 15.5px; line-height: 1.85; color: var(--ink); }

/* 오행 */
.stacked-bar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; background: var(--paper-deep); }
.stacked-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
}
.stacked-segment.wood { background: var(--wood-border); }
.stacked-segment.fire { background: var(--fire-border); }
.stacked-segment.earth { background: var(--earth-border); }
.stacked-segment.metal { background: var(--metal-border); }
.stacked-segment.water { background: var(--water-border); }
.oheng-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.oheng-item {
  padding: 8px 2px;
  text-align: center;
  border-radius: 6px;
  background: rgba(255, 252, 244, 0.6);
  border: 1px solid var(--paper-line);
}
.oheng-item-name { font-size: 12px; font-weight: 700; line-height: 1.4; }
.oheng-item-val { font-family: var(--font-display); font-size: 17px; line-height: 1.3; color: var(--ink); }
.oheng-comment { font-size: 15.5px; line-height: 1.85; color: var(--ink); }

/* 영적 투시 */
.mind-item {
  padding: 16px 0 0;
  border-top: 1px solid var(--paper-line);
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink);
}
.mind-item:first-of-type { border-top: none; padding-top: 0; }
.mind-item p { margin: 8px 0 0; }

/* 악연 경고: 주사빛이 스민 한지 */
.ghost-warning-card { background-color: #F3DED2; box-shadow: inset 4px 0 0 var(--cinnabar); }
.ghost-header { font-family: var(--font-display); font-size: 19px; line-height: 1.45; color: var(--cinnabar-deep); }
.ghost-desc { font-size: 16px; line-height: 1.9; color: var(--ink); }

/* 후각 감별 */
.sniff-item { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--paper-line); }
.sniff-item:first-of-type { border-top: none; padding-top: 0; }
.sniff-item h4 { font-family: var(--font-display); font-weight: 400; font-size: 18px; color: var(--ink); }
.sniff-item p { font-size: 15.5px; line-height: 1.85; color: var(--ink); }
.sniff-lock-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: #5A420E;
  background: #F2DFA9;
}
.sniff-personal { display: block; margin-top: 8px; font-size: 14.5px; line-height: 1.75; color: var(--text-sub); }

/* ── 결제 안내 ───────────────────────────────────────────────────── */
.paywall-container { display: flex; flex-direction: column; gap: 20px; }
.paywall-overlay {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 18px;
  border-radius: 14px;
  background: var(--night-2);
  color: var(--moon);
  box-shadow: 0 0 0 1px var(--night-line);
}
.paywall-trust-banner { display: flex; flex-wrap: wrap; gap: 6px; }
.paywall-trust-banner > span {
  padding: 3px 10px;
  border-radius: var(--r-chip);
  font-size: 13px;
  color: var(--yellow);
  border: 1px solid var(--night-line);
}
.paywall-hook-title { font-family: var(--font-display); font-size: 23px; line-height: 1.5; color: var(--moon); }
.paywall-hook-title span { color: var(--yellow); }
.paywall-empathy-box { font-size: 15.5px; line-height: 1.9; color: var(--moon-soft); }
.paywall-empathy-box strong { color: var(--moon); }
.paywall-empathy-box em { color: var(--moon); }
.paywall-divider { width: 36px; height: 1px; margin: 12px 0; background: var(--yellow); opacity: 0.6; }
.paywall-reasons-list { display: flex; flex-direction: column; gap: 10px; }
.reason-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r-paper);
  background-color: var(--paper);
  background-image: var(--paper-grain);
  color: var(--ink);
}
.reason-num { flex: none; min-width: 1.5em; white-space: nowrap; font-family: var(--font-display); font-size: 22px; line-height: 1.2; color: var(--cinnabar); }
.reason-item strong { display: block; font-size: 15.5px; line-height: 1.55; color: var(--ink); }
.reason-item p { margin-top: 4px; font-size: 14.5px; line-height: 1.75; color: var(--ink-soft); }
.price-box { text-align: center; padding: 6px 0 0; }
.price-tag { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 10px; }
.price-tag .sale-event-name { font-size: 14px; color: var(--yellow); }
.price-tag strong { font-family: var(--font-display); font-weight: 400; font-size: 27px; color: var(--moon); }
.price-sub { margin-top: 6px; font-size: 13.5px; color: var(--moon-soft); }
.price-disclaimer { margin-top: 6px; font-size: 12.5px; line-height: 1.6; color: var(--moon-soft); }
.paywall-trust-banner .sale-event-badge { white-space: nowrap; }
.sale-event-name { font-weight: 700; }
.sale-price { font-variant-numeric: tabular-nums; }

/* ── 결제 후 리포트 ──────────────────────────────────────────────── */
.unlocked-report-container { display: none; flex-direction: column; gap: 20px; animation: fadeIn 0.4s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.classified-dossier-box { gap: 12px; box-shadow: inset 0 0 0 1px var(--paper-line), inset 0 0 0 5px var(--paper), inset 0 0 0 6px rgba(168, 42, 32, 0.45); padding: 24px 20px; }
.dossier-top-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.dossier-badge-secret { padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 700; color: var(--moon); background: var(--cinnabar); }
.dossier-doc-id { font-size: 12px; color: var(--ink-soft); }
.dossier-title-group { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.dossier-org-title { font-family: var(--font-display); font-size: 17.5px; line-height: 1.5; color: var(--cinnabar); }
.dossier-sub-title { font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); }
.dossier-info-table { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; border-radius: var(--r-paper); background: rgba(255, 252, 244, 0.65); border: 1px solid var(--paper-line); }
.dossier-info-cell { display: flex; flex-direction: column; gap: 2px; }
.dossier-label { font-size: 12px; color: var(--ink-soft); }
.dossier-val { font-size: 14.5px; font-weight: 700; color: var(--ink); }

.kpi-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kpi-grid { display: flex; flex-direction: column; gap: 14px; }
.kpi-row { display: flex; flex-direction: column; gap: 6px; }
.kpi-label-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kpi-bar-bg { height: 8px; border-radius: 4px; background: var(--paper-deep); overflow: hidden; }
.kpi-bar-fill { height: 100%; border-radius: 4px; }

.portfolio-section-badge {
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--cinnabar-deep);
  border: 1px solid rgba(168, 42, 32, 0.45);
}
.portfolio-section-title { font-family: var(--font-display); font-size: 21px; line-height: 1.45; color: var(--cinnabar); }
.portfolio-text { font-size: 16px; line-height: 1.9; color: var(--ink); }
.portfolio-highlight {
  padding: 16px;
  border-radius: var(--r-paper);
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--ink);
  background: rgba(255, 252, 244, 0.7);
  border-left: 4px solid var(--yellow-deep);
}

.timeline-box { display: flex; flex-direction: column; gap: 18px; padding-left: 18px; border-left: 2px solid var(--paper-line); margin-left: 6px; }
.timeline-step { position: relative; display: flex; flex-direction: column; gap: 6px; }
.timeline-dot { position: absolute; left: -25px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--cinnabar); box-shadow: 0 0 0 3px var(--paper); }
.timeline-title { font-family: var(--font-display); font-size: 17.5px; line-height: 1.45; color: var(--ink); }
.timeline-desc { font-size: 15.5px; line-height: 1.85; color: var(--ink); }
.timeline-relation {
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-sub);
  background: #F4E6C2;
}

/* 부적 */
.talisman-info-box { display: flex; flex-direction: column; gap: 14px; }
.talisman-info-item { display: flex; flex-direction: column; gap: 6px; }
.talisman-info-item > strong { font-family: var(--font-display); font-weight: 400; font-size: 17.5px; color: var(--ink); }
.talisman-info-item p, .talisman-info-item ul { font-size: 15px; line-height: 1.85; color: var(--ink); margin: 0; }
.talisman-info-item ul { padding-left: 2px; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.talisman-preview-frame {
  display: flex;
  justify-content: center;
  padding: 22px 16px;
  border-radius: var(--r-paper);
  background: var(--night);
}
.talisman-canvas {
  width: min(100%, 280px);
  height: auto;
  aspect-ratio: 3 / 5;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
}

/* ── 결제 모달 · 알림 ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 18px;
  background: rgba(14, 15, 26, 0.88);
  backdrop-filter: blur(4px);
}
.modal-box {
  width: 100%;
  max-width: 360px;
  max-height: calc(100vh - 36px);    /* 키 작은 휴대폰에서도 결제 버튼까지 스크롤로 닿게 */
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 20px;
  border-radius: var(--r-paper);
  text-align: center;
  background-color: var(--paper);
  background-image: var(--paper-grain);
  color: var(--ink);
}
.modal-box h3 { font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1.45; color: var(--cinnabar); }
.modal-box p { font-size: 15px; line-height: 1.8; color: var(--ink); }

.toast-msg {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));   /* 하단 메뉴 위 */
  z-index: 200;
  display: none;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 14.5px;
  line-height: 1.5;
  text-align: center;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  transform: translateX(-50%);
}

/* ── 확장 기능 공통 (궁합 · 오늘의 운세 · 벽사 패 · 묻기) ─────────────── */
.feature-nav { display: flex; }
.feature-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--moon); }
.feature-seal {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: var(--cinnabar);
  color: #F7E3B0;
  font-family: var(--font-display);
  font-size: 26px;
  box-shadow: inset 0 0 0 2.5px rgba(247, 227, 176, 0.6);
  transform: rotate(-4deg);
}
.feature-title { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.2; color: var(--moon); }
.feature-lead { font-family: var(--font-display); font-size: 16.5px; line-height: 1.7; color: var(--moon-soft); max-width: 34em; }
.feature-result { display: flex; flex-direction: column; gap: 16px; }
.feature-result:empty { display: none; }
.feature-card-title { font-family: var(--font-display); font-weight: 400; font-size: 19px; line-height: 1.4; color: var(--cinnabar); }
.feature-text { font-size: 16px; line-height: 1.9; color: var(--ink); }
.feature-note { font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); }
.view-step > .feature-result > .feature-note, .feature-result > .profile-line { color: var(--moon-soft); }
.form-error { min-height: 1.2em; font-size: 14px; color: var(--cinnabar); }
.form-error:empty { min-height: 0; }

.profile-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 14px; color: var(--moon-soft); }
.link-btn { font-size: 13.5px; color: var(--yellow); text-decoration: underline; text-underline-offset: 3px; }

.score-block { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.score-num { font-family: var(--font-display); font-size: 64px; line-height: 1; color: var(--cinnabar); }
.score-unit { font-size: 18px; color: var(--ink-soft); }
.score-band {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: var(--r-chip);
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--moon);
  background: var(--cinnabar);
}

/* 궁합 */
.compat-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.compat-person { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.compat-name { font-size: 13.5px; color: var(--ink-soft); }
.compat-ilju { font-family: var(--font-display); font-size: 44px; line-height: 1.15; color: var(--ink); }
.compat-ilju-ko { font-size: 13.5px; color: var(--ink-soft); }
.compat-knot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--cinnabar);
  border: 1.5px solid var(--cinnabar);
}
.reason-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.reason {
  position: relative;
  padding: 12px 14px 12px 40px;
  border-radius: var(--r-paper);
  font-size: 15px;
  line-height: 1.8;
  background: rgba(255, 252, 244, 0.65);
  border: 1px solid var(--paper-line);
}
.reason::before {
  position: absolute;
  left: 13px;
  top: 12px;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.6;
}
.reason.plus::before { content: "合"; color: var(--jade); }
.reason.minus::before { content: "沖"; color: var(--cinnabar); }
.reason.neutral::before { content: "平"; color: var(--ink-soft); }

/* 오늘의 운세 */
.daily-date { font-size: 15px; color: var(--ink-soft); }
.relation-note { padding: 10px 12px; border-radius: 6px; background: #F4E6C2; font-size: 15px; }
.todo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.todo { padding: 12px; border-radius: var(--r-paper); background: rgba(255, 252, 244, 0.65); border: 1px solid var(--paper-line); }
.todo h4 { font-family: var(--font-display); font-weight: 400; font-size: 16px; margin-bottom: 6px; }
.todo.do h4 { color: var(--jade); }
.todo.avoid h4 { color: var(--cinnabar); }
.todo ul { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.65; }
.lucky-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.lucky-row > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 4px; border-radius: var(--r-paper); background: var(--paper-deep); }
.lucky-row span { font-size: 12.5px; color: var(--ink-soft); }
.lucky-row strong { font-size: 14.5px; line-height: 1.45; color: var(--ink); }

/* 벽사 패 */
.tarot-date { text-align: center; color: var(--moon-soft); }
.tarot-card {
  align-self: center;
  width: min(68vw, 250px);
  aspect-ratio: 5 / 8;
  perspective: 1200px;
  background: none;
  padding: 0;
}
.tarot-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tarot-card.is-flipped .tarot-inner { transform: rotateY(180deg); }
.tarot-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
}
.tarot-back {
  background-color: var(--night-2);
  background-image:
    repeating-linear-gradient(45deg, rgba(227, 179, 65, 0.09) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, rgba(227, 179, 65, 0.09) 0 2px, transparent 2px 14px);
  box-shadow: inset 0 0 0 8px var(--night-2), inset 0 0 0 9.5px rgba(227, 179, 65, 0.6), 0 18px 40px -16px rgba(0, 0, 0, 0.8);
}
.tarot-back-seal {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 6px;
  background: var(--cinnabar);
  color: #F7E3B0;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.05;
  writing-mode: vertical-rl;
  box-shadow: inset 0 0 0 3px rgba(247, 227, 176, 0.6);
}
.tarot-front {
  transform: rotateY(180deg);
  background-color: var(--paper);
  background-image: var(--paper-grain);
  color: var(--ink);
  box-shadow: inset 0 0 0 9px var(--paper), inset 0 0 0 10.5px var(--cinnabar), inset 0 0 0 14px var(--paper), inset 0 0 0 14.8px rgba(168, 42, 32, 0.5), 0 18px 40px -16px rgba(0, 0, 0, 0.8);
}
.tarot-hanja { font-family: var(--font-display); font-size: 104px; line-height: 1; color: var(--cinnabar); }
.tarot-front.is-reversed .tarot-hanja { transform: rotate(180deg); }
.tarot-name { font-family: var(--font-display); font-size: 26px; color: var(--ink); }
.tarot-key { font-size: 13.5px; color: var(--ink-soft); }
.tarot-hint { text-align: center; font-size: 14.5px; color: var(--yellow); }

/* 백구에게 묻기 */
.chat-panel { display: flex; flex-direction: column; gap: 14px; }
.chat-log { display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; align-items: flex-end; gap: 8px; }
.chat-msg.me { justify-content: flex-end; }
.chat-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: center 25%; flex-shrink: 0; box-shadow: 0 0 0 1.5px var(--yellow); }
.chat-bubble {
  max-width: 82%;
  padding: 12px 14px;
  font-size: 15.5px;
  line-height: 1.8;
  border-radius: 14px;
}
.chat-msg.dog .chat-bubble {
  color: var(--ink);
  background-color: var(--paper);
  background-image: var(--paper-grain);
  border-bottom-left-radius: 4px;
}
.chat-msg.me .chat-bubble { color: var(--ink); background: var(--yellow); border-bottom-right-radius: 4px; }
.chat-msg.typing .chat-bubble { display: flex; gap: 5px; padding: 16px 14px; }
.chat-msg.typing .chat-bubble span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); animation: typingDot 1s infinite ease-in-out; }
.chat-msg.typing .chat-bubble span:nth-child(2) { animation-delay: 0.15s; }
.chat-msg.typing .chat-bubble span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingDot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-chip {
  padding: 9px 13px;
  border-radius: var(--r-chip);
  font-size: 14.5px;
  color: var(--moon);
  border: 1px solid rgba(244, 238, 226, 0.3);
  background: rgba(244, 238, 226, 0.05);
}
.chat-chip.is-asked { color: var(--moon-soft); border-style: dashed; }
.chat-chip:disabled { opacity: 0.45; cursor: default; }
.chat-panel > .feature-note { color: var(--moon-soft); }

/* ── 좁은 화면 ──────────────────────────────────────────────────── */
@media (max-width: 380px) {
  body { padding: 0 14px 64px; }
  .spirit-main-title { font-size: 38px; }
  .slip { min-height: 160px; padding: 22px 17px 18px; }
  .slip-title { font-size: 20px; }
  .saju-table th, .saju-table td { padding: 8px 2px; font-size: 12px; }
  .label-col { width: 54px; }
  .ganji-tile { width: 38px; height: 44px; }
  .ganji-tile .main-char { font-size: 18px; }
  .badge { font-size: 10.5px; padding: 1px 4px; }
  .btn-action { font-size: 12px; }
}

/* 궁합 결과 카드는 점수와 항목 사이를 조금 더 띄우고, 패 풀이는 뒤집을 때 천천히 드러난다 */
.compat-card { gap: 16px; }
.tarot-reading { animation: fadeIn 0.45s ease; }

/* ── 하단 메뉴 (모든 화면) ─────────────────────────────────────────── */
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;   /* 모달(100~)과 알림(200) 아래 */
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  max-width: 460px;
  margin: 0 auto;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(26, 28, 46, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--night-line);
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 52px;
  padding: 5px 0 3px;
  border-radius: 10px;
  color: var(--moon-soft);
  font-family: var(--font-body);
}
.tab-seal {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1;
  color: var(--moon);
  border: 1px solid rgba(244, 238, 226, 0.28);
}
.tab-label { font-size: 11.5px; line-height: 1.2; white-space: nowrap; }
.tab-item.active { color: var(--yellow); }
.tab-item.active .tab-seal { background: var(--cinnabar); border-color: var(--cinnabar); color: #F7E3B0; }
.tab-item:focus-visible { outline: 2px solid var(--yellow); outline-offset: -2px; }

/* 결과 화면: 사이트 공유 버튼은 한 줄 전체 */
.btn-action-wide { grid-column: 1 / -1; }

/* 결과 화면: 결제 뒤 '리포트 다시 보기' */
.report-reopen { display: flex; flex-direction: column; gap: 10px; padding: 22px 18px; border-radius: var(--r-paper); background: var(--night-2); border: 1px solid var(--night-line); color: var(--moon); text-align: center; }
.report-reopen-title { font-family: var(--font-display); font-size: 20px; line-height: 1.4; color: var(--yellow); }
.report-reopen-desc { font-size: 14.5px; line-height: 1.7; color: var(--moon-soft); }

/* 리포트 첫머리: 무료 풀이 요약 */
.report-summary:empty { display: none; }
.rs-card { gap: 16px; }
.rs-meta { font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.rs-pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rs-pillar { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 6px; background: rgba(255, 252, 244, 0.7); border: 1px solid var(--paper-line); }
.rs-pillar-label { font-size: 12px; color: var(--ink-soft); }
.rs-char { font-family: var(--font-display); font-size: 26px; line-height: 1.15; color: var(--ink); }
.rs-char.wood { color: var(--wood-text); }
.rs-char.fire { color: var(--fire-text); }
.rs-char.earth { color: var(--earth-text); }
.rs-char.metal { color: var(--metal-text); }
.rs-char.water { color: var(--water-text); }
.rs-pillar-ko { font-size: 12.5px; color: var(--ink-soft); }
.rs-oheng { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rs-el { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 6px; border: 1px solid var(--paper-line); font-size: 12.5px; color: var(--ink-soft); }
.rs-el strong { font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1.1; color: var(--ink); }
.rs-el.is-weak { border-color: var(--cinnabar); background: rgba(168, 42, 32, 0.07); }
.rs-el.is-weak { color: var(--cinnabar); }
.rs-el.is-weak::after { content: '모자람'; margin-top: 1px; padding: 0 6px; border-radius: 8px; font-size: 10.5px; line-height: 1.6; color: #fff8ec; background: var(--cinnabar); }
.rs-list { display: grid; grid-template-columns: 5.6em 1fr; gap: 8px 12px; font-size: 14.5px; line-height: 1.7; }
.rs-list dt { font-weight: 700; color: var(--cinnabar); }
.rs-list dd { color: var(--ink); }

/* 리포트: 누재살 비방이 어떤 사주 값으로 골랐는지 */
.guard-basis { display: block; margin-bottom: 6px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }

/* 결제창: 상품 안내 */
.product-info { display: grid; grid-template-columns: 4.6em 1fr; gap: 6px 10px; padding: 12px; border-radius: 6px; border: 1px solid var(--paper-line); background: rgba(255, 252, 244, 0.6); font-size: 13.5px; line-height: 1.6; text-align: left; }
.product-info dt { font-weight: 700; color: var(--ink-soft); }
.product-info dd { color: var(--ink); }

/* 공유 할인 안내 줄 */
.coupon-line { display: block; margin-top: 6px; font-size: 13.5px; line-height: 1.6; color: var(--yellow); }
.coupon-line s { opacity: 0.7; }
.coupon-line .link-btn { margin-left: 4px; }
.product-info .coupon-line, .modal-box .coupon-line { color: var(--cinnabar); }

/* ── 백구의 비방 보따리 (대문 유료 진열) ─────────────────────────────── */
.shop-shelf { display: flex; flex-direction: column; gap: 12px; }
.shop-list { display: flex; flex-direction: column; gap: 10px; }
.shop-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: var(--r-paper);
  background-color: var(--paper);
  background-image: var(--paper-grain);
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 0 0 1px var(--paper-line);
}
.shop-item:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.shop-seal { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 4px; background: var(--cinnabar); color: #F7E3B0; font-family: var(--font-display); font-size: 24px; line-height: 1; transform: rotate(-3deg); }
.shop-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shop-name { font-family: var(--font-display); font-size: 18px; line-height: 1.35; }
.shop-hook { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.shop-price { font-weight: 700; font-size: 14.5px; color: var(--cinnabar); white-space: nowrap; }
.shop-price s { font-weight: 400; color: var(--ink-soft); margin-right: 2px; }
.shop-item-gold { box-shadow: inset 0 0 0 2px #C9A23A, inset 0 0 0 5px var(--paper), inset 0 0 0 6px rgba(201, 162, 58, 0.7); }
.shop-item-gold .shop-seal { background: linear-gradient(135deg, #8A6414, #F2DA86 45%, #B98A26); color: #5A2A10; }
.shop-coupon { text-align: center; }

/* ── 유료 상품 공통: 봉인 카드 ─────────────────────────────────────── */
.seal-card { position: relative; gap: 12px; box-shadow: inset 0 0 0 1px var(--paper-line), inset 0 0 0 5px var(--paper), inset 0 0 0 6px rgba(168, 42, 32, 0.45); }
.seal-card-head { display: flex; align-items: center; gap: 10px; }
.seal-card-stamp { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 3px; background: var(--cinnabar); color: #F7E3B0; font-family: var(--font-display); font-size: 19px; transform: rotate(-6deg); }
.seal-hook { font-size: 15.5px; line-height: 1.85; color: var(--ink); }
.seal-list { list-style: none; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 6px; background: rgba(255, 252, 244, 0.6); border: 1px dashed rgba(168, 42, 32, 0.35); }
.seal-list li { position: relative; padding-left: 20px; font-size: 14.5px; line-height: 1.65; color: var(--ink); }
.seal-list li::before { content: '🔒'; position: absolute; left: 0; top: 0; font-size: 12px; }
.seal-fog { display: flex; flex-direction: column; gap: 7px; padding: 4px 2px; filter: blur(3px); opacity: 0.55; }
.seal-fog span { height: 10px; border-radius: 5px; background: var(--ink-soft); }
.seal-fog span:nth-child(1) { width: 92%; } .seal-fog span:nth-child(2) { width: 78%; } .seal-fog span:nth-child(3) { width: 60%; }
.seal-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.seal-price strong { font-family: var(--font-display); font-weight: 400; font-size: 28px; color: var(--cinnabar); }
.seal-price s { color: var(--ink-soft); font-size: 15px; }
.seal-price-note { font-size: 13px; color: var(--ink-soft); }
.seal-card .coupon-line { color: var(--cinnabar); margin-top: 0; }

/* ── 신년운세 ───────────────────────────────────────────────────── */
.ny-head { gap: 12px; }
.ny-year { font-size: 14.5px; color: var(--ink-soft); }
.ny-bars { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ny-bar { display: grid; grid-template-columns: 4.4em 1fr 2em; grid-template-areas: 'm t s' '. k k'; align-items: center; gap: 0 8px; }
.ny-bar-m { grid-area: m; font-weight: 700; font-size: 14px; }
.ny-bar-track { grid-area: t; height: 10px; border-radius: 5px; background: rgba(43, 35, 29, 0.1); overflow: hidden; }
.ny-bar-fill { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #C9A23A, var(--cinnabar)); }
.ny-bar-s { grid-area: s; font-size: 13px; text-align: right; color: var(--ink-soft); }
.ny-bar-k { grid-area: k; font-size: 12.5px; line-height: 1.4; color: var(--ink-soft); }
.ny-bar.is-chung .ny-bar-fill { background: linear-gradient(90deg, #7C6A5A, #4D4038); }
.ny-picks { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.ny-pick-tag { display: inline-block; padding: 1px 8px; margin-right: 4px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.ny-pick-tag.good { background: rgba(201, 162, 58, 0.25); color: #6B4A08; }
.ny-pick-tag.bad { background: rgba(77, 64, 56, 0.15); color: var(--ink); }
.ny-months { display: flex; flex-direction: column; gap: 12px; }
.ny-month { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 6px; background: rgba(255, 252, 244, 0.6); border: 1px solid var(--paper-line); }
.ny-month header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.ny-month-m { font-family: var(--font-display); font-size: 22px; color: var(--cinnabar); }
.ny-month-g { font-size: 13px; color: var(--ink-soft); }
.ny-month-s { font-size: 13px; font-weight: 700; color: var(--ink); margin-left: auto; }
.ny-month p { font-size: 14.5px; line-height: 1.75; color: var(--ink); }
.ny-tag { display: inline-block; min-width: 2.6em; margin-right: 6px; padding: 0 6px; border-radius: 3px; font-size: 12px; font-weight: 700; text-align: center; vertical-align: 1px; }
.ny-tag.do { background: rgba(201, 162, 58, 0.28); color: #6B4A08; }
.ny-tag.avoid { background: rgba(168, 42, 32, 0.14); color: var(--cinnabar-deep); }
.ny-tag.rel { background: rgba(43, 90, 120, 0.14); color: #23485E; }
.ny-tag.fill { background: rgba(40, 110, 70, 0.14); color: #1E5234; }
.ny-say { font-family: var(--font-display); font-size: 16px; line-height: 1.7; color: var(--cinnabar-deep); }
.ny-fields { padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.75; color: var(--ink); }

/* ── 궁합 상세 ──────────────────────────────────────────────────── */
.compat-detail { gap: 10px; }
.cd-h { margin-top: 6px; font-size: 15.5px; font-weight: 700; color: var(--cinnabar); }
.cd-years { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; line-height: 1.7; }
.cd-years li { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--paper-line); }
.cd-years li.good { background: rgba(201, 162, 58, 0.18); }
.cd-years li.bad { background: rgba(77, 64, 56, 0.1); }

/* ── 소원 부적 ──────────────────────────────────────────────────── */
.feature-seal-gold { background: linear-gradient(135deg, #8A6414, #F2DA86 45%, #B98A26); color: #5A2A10; }
.wish-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wish-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: 6px; text-align: left; color: var(--ink); background: rgba(255, 252, 244, 0.65); border: 1px solid var(--paper-line); }
.wish-card.is-on { border-color: #C9A23A; box-shadow: 0 0 0 2px #C9A23A; background: #FFF6DA; }
.wish-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.wish-seal { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 3px; background: var(--cinnabar); color: #F7E3B0; font-family: var(--font-display); font-size: 19px; }
.wish-name { font-family: var(--font-display); font-size: 18px; }
.wish-desc { font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.wish-owned { position: absolute; top: 8px; right: 8px; padding: 0 6px; border-radius: 3px; background: #C9A23A; color: #3A2606; font-size: 11.5px; font-weight: 700; }
.wish-stage { position: relative; align-items: center; overflow: hidden; background: radial-gradient(120% 80% at 50% 0%, #2A2C45, var(--night) 70%); box-shadow: inset 0 0 0 1px rgba(201, 162, 58, 0.5); }
.wish-throw { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; border: 2px solid #C9A23A; animation: dogArrive 0.7s ease-out both; }
.wish-throw img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.wish-talisman-wrap { position: relative; width: min(70%, 260px); animation: talismanThrow 0.9s 0.45s cubic-bezier(.2, .8, .25, 1) both; }
.wish-talisman { display: block; width: 100%; height: auto; border-radius: 3px; box-shadow: 0 0 0 1px rgba(201, 162, 58, 0.6), 0 18px 40px -12px rgba(227, 179, 65, 0.55); }
.wish-stage.is-sealed .wish-talisman { filter: blur(7px) saturate(0.7) brightness(0.85); }
.wish-seal-band { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 4px; background: var(--cinnabar); color: #F7E3B0; font-family: var(--font-display); font-size: 42px; transform: translate(-50%, -50%) rotate(-8deg); box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.6); }
.wish-caption { font-size: 14.5px; line-height: 1.7; color: var(--moon); text-align: center; }
.wish-caption strong { color: var(--yellow); }
@keyframes dogArrive { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes talismanThrow {
  0% { transform: translateY(-120px) rotate(-420deg) scale(0.15); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}

/* 결제창: 할인 코드 */
.promo-row { display: flex; gap: 8px; }
.promo-input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--paper-line); background: #FFFCF4; font-size: 16px; color: var(--ink); }
.promo-apply { flex: none; padding: 0 16px; border-radius: 8px; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 14.5px; }

/* ── 분위기: 안개 · 불티 · 어둠 (모든 화면 뒤) ───────────────────────── */
.ambience { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.app-container { position: relative; z-index: 1; }
.fog { position: absolute; inset: -20% -60%; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='.006 .012' numOctaves='3' seed='7'/><feColorMatrix values='0 0 0 0 .78  0 0 0 0 .8  0 0 0 0 .9  0 0 0 .55 -.18'/></filter><rect width='100%' height='100%' filter='url(%23f)'/></svg>"); background-size: 600px 600px; opacity: 0.22; mix-blend-mode: screen; }
.fog-a { animation: fogDrift 70s linear infinite; }
.fog-b { opacity: 0.14; background-size: 900px 900px; animation: fogDrift 110s linear infinite reverse; top: 30%; }
@keyframes fogDrift { from { transform: translateX(0); } to { transform: translateX(600px); } }
.embers i { position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; background: #F08A3C; box-shadow: 0 0 6px 2px rgba(240, 120, 50, 0.6); opacity: 0; animation: ember 14s linear infinite; }
.embers i:nth-child(1) { left: 8%; animation-delay: 0s; }  .embers i:nth-child(2) { left: 21%; animation-delay: 3.2s; animation-duration: 17s; }
.embers i:nth-child(3) { left: 34%; animation-delay: 6.1s; } .embers i:nth-child(4) { left: 47%; animation-delay: 1.4s; animation-duration: 19s; }
.embers i:nth-child(5) { left: 59%; animation-delay: 8.3s; } .embers i:nth-child(6) { left: 71%; animation-delay: 4.6s; animation-duration: 16s; }
.embers i:nth-child(7) { left: 83%; animation-delay: 10.2s; } .embers i:nth-child(8) { left: 93%; animation-delay: 2.5s; animation-duration: 20s; }
.embers i:nth-child(9) { left: 15%; animation-delay: 12s; animation-duration: 18s; } .embers i:nth-child(10) { left: 40%; animation-delay: 9s; }
.embers i:nth-child(11) { left: 65%; animation-delay: 13.5s; animation-duration: 21s; } .embers i:nth-child(12) { left: 88%; animation-delay: 7s; }
@keyframes ember {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 0.9; }
  60% { opacity: 0.5; }
  100% { transform: translate(-30px, -105vh); opacity: 0; }
}
.vignette { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(5, 5, 12, 0.75) 100%); }

/* 대문 초상화: 등불이 흔들리는 빛 */
.spirit-portrait-box { position: relative; }
.spirit-portrait-box::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(60% 45% at 50% 85%, rgba(240, 150, 60, 0.28), transparent 70%); mix-blend-mode: screen; animation: lanternFlicker 3.2s ease-in-out infinite; }
@keyframes lanternFlicker { 0%, 100% { opacity: 0.9; } 20% { opacity: 0.55; } 23% { opacity: 0.95; } 50% { opacity: 0.7; } 74% { opacity: 1; } 77% { opacity: 0.6; } }

/* 벽사신견이란 */
.lore-strip { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-left: 3px solid var(--cinnabar); background: linear-gradient(90deg, rgba(168, 42, 32, 0.16), transparent); color: var(--moon); text-align: left; }
.lore-line { font-family: var(--font-display); font-size: 19px; line-height: 1.5; }
.lore-line strong { color: var(--yellow); font-weight: 400; }
.lore-sub { font-size: 14.5px; line-height: 1.8; color: var(--moon-soft); }
.lore-sub strong { color: var(--moon); }
.lore-hook { font-size: 14.5px; line-height: 1.8; color: var(--moon); }
.lore-hook em { font-style: normal; color: #E58A7E; }

/* ── 첫 진입 연출 ───────────────────────────────────────────────── */
body.veil-on { overflow: hidden; }
.opening-veil { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 26px; padding: 32px 26px 90px; background: #06060C; color: var(--moon); transition: opacity 0.9s ease; }
.opening-veil[hidden] { display: none !important; }
.opening-veil.is-leaving { opacity: 0; }
.opening-lantern { position: absolute; top: 12%; left: 50%; width: 180px; height: 180px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(240, 150, 60, 0.35), rgba(240, 150, 60, 0.05) 50%, transparent 70%); animation: lanternFlicker 2.6s ease-in-out infinite; }
.opening-lines { position: relative; display: flex; flex-direction: column; gap: 18px; max-width: 26em; }
.opening-lines p { font-family: var(--font-display); font-size: 18px; line-height: 1.75; text-align: center; opacity: 0; animation: lineIn 1.6s ease forwards; }
.opening-lines p strong { color: var(--yellow); font-weight: 400; }
.opening-lines .opening-last { font-size: 21px; color: #F2DDD8; }
.opening-lines .opening-last strong { color: #E0574A; }
.opening-veil.is-short .opening-lines p:not(.opening-last) { display: none; }
@keyframes lineIn { 0% { opacity: 0; filter: blur(6px); transform: translateY(6px); } 100% { opacity: 1; filter: none; transform: none; } }
.opening-eyes, .ritual-eyes { display: flex; gap: 34px; }
.opening-eyes span, .ritual-eyes span { width: 16px; height: 7px; border-radius: 50%; background: #F5C04A; box-shadow: 0 0 12px 4px rgba(245, 192, 74, 0.7), 0 0 34px 10px rgba(245, 160, 40, 0.25); animation: eyesOpen 7.5s ease forwards; transform: scaleY(0); }
.opening-veil.is-short .opening-eyes span { animation-duration: 1.4s; }
@keyframes eyesOpen { 0%, 88% { transform: scaleY(0); opacity: 0; } 92% { transform: scaleY(1); opacity: 1; } 95% { transform: scaleY(0.1); } 100% { transform: scaleY(1); opacity: 1; } }
.opening-skip { position: absolute; bottom: calc(28px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 10px 20px; border-radius: 999px; border: 1px solid rgba(244, 238, 226, 0.25); color: var(--moon-soft); font-size: 14px; background: rgba(244, 238, 226, 0.04); }

/* ── 풀이 의식 ──────────────────────────────────────────────────── */
.ritual-veil { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 28px; background: rgba(6, 6, 12, 0.985); transition: opacity 0.6s ease; }
.ritual-veil[hidden] { display: none !important; }
.ritual-veil.is-leaving { opacity: 0; }
.ritual-eyes span { animation: eyesBlink 1.4s ease-in-out infinite; transform: none; }
@keyframes eyesBlink { 0%, 80%, 100% { transform: scaleY(1); } 85% { transform: scaleY(0.1); } }
.ritual-line { font-family: var(--font-display); font-size: 18px; color: var(--moon); text-align: center; padding: 0 24px; }
.ritual-line.flick { animation: lineIn 0.5s ease; }

/* ── 음산한 실내: 제목과 도장에 등불빛, 한지 카드에 그을음 ───────────── */
.feature-title, .spirit-main-title, .slip-heading { text-shadow: 0 0 18px rgba(224, 87, 74, 0.25); }
.feature-seal { animation: sealGlow 4s ease-in-out infinite; }
@keyframes sealGlow { 0%, 100% { box-shadow: inset 0 0 0 2.5px rgba(247, 227, 176, 0.6), 0 0 0 rgba(224, 87, 74, 0); } 50% { box-shadow: inset 0 0 0 2.5px rgba(247, 227, 176, 0.6), 0 0 22px rgba(224, 87, 74, 0.45); } }
.feature-card, .dream-fit-card, .daeun-card, .oheng-card, .mind-scan-card, .ghost-warning-card, .sniff-teaser-card, .portfolio-section-card, .kpi-dashboard { box-shadow: inset 0 0 40px rgba(90, 50, 20, 0.16), 0 14px 34px -18px rgba(0, 0, 0, 0.8); }
.ghost-warning-card { position: relative; }
.ghost-warning-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(168, 42, 32, 0.5); animation: dangerPulse 2.8s ease-in-out infinite; }
@keyframes dangerPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ── 결제 안내 · 약관 페이지 ─────────────────────────────────────────── */
.payment-notice { text-align: left; font-size: 13.5px !important; line-height: 1.7 !important; color: var(--ink-soft) !important; padding: 10px 12px; border-radius: 6px; background: rgba(168, 42, 32, 0.06); border: 1px solid rgba(168, 42, 32, 0.18); }
.payment-notice a { color: var(--cinnabar); text-underline-offset: 3px; }

.legal-page { gap: 18px; padding-top: 14px; }
.legal-page a.btn-nav-back { display: inline-flex; text-decoration: none; }
.legal-head { display: flex; flex-direction: column; gap: 14px; padding: 8px 0 4px; color: var(--moon); }
.legal-toc { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.legal-toc a { padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(244, 238, 226, 0.22); color: var(--moon); font-size: 13.5px; text-decoration: none; }
.legal-toc a:hover { background: rgba(244, 238, 226, 0.08); }
.legal-section { scroll-margin-top: 16px; gap: 10px; }
.legal-section h3 { margin-top: 8px; font-size: 15.5px; font-weight: 700; line-height: 1.5; color: var(--ink); }
.legal-section p, .legal-section li { font-size: 15px; line-height: 1.85; color: var(--ink); }
.legal-section ol, .legal-section ul { padding-left: 1.3em; display: flex; flex-direction: column; gap: 4px; }
.legal-section strong { color: var(--cinnabar-deep); }
.legal-meta { font-size: 13px !important; color: var(--ink-soft) !important; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.6; }
.legal-table th, .legal-table td { padding: 8px 6px; border-bottom: 1px solid rgba(43, 35, 29, 0.15); text-align: left; vertical-align: top; }
.legal-table th { font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.legal-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14.5px; line-height: 1.6; }
.legal-dl dt { font-weight: 700; color: var(--ink-soft); }
.legal-dl dd { color: var(--ink); }

/* ── 고객센터 ─────────────────────────────────────────────────────────── */
.help-card { gap: 12px; }
.help-faq { border-top: 1px solid var(--paper-line); padding: 10px 0 2px; }
.help-faq:first-of-type { border-top: none; padding-top: 2px; }
.help-faq summary { cursor: pointer; font-weight: 700; font-size: 15.5px; line-height: 1.55; color: var(--ink); list-style: none; padding-right: 22px; position: relative; }
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary::after { content: '+'; position: absolute; right: 2px; top: 0; font-size: 18px; color: var(--cinnabar); }
.help-faq[open] summary::after { content: '−'; }
.help-faq p { margin-top: 8px; font-size: 14.5px; line-height: 1.8; color: var(--text-sub); }
.help-faq a, .help-agree a, .help-dl a { color: var(--cinnabar); text-decoration: underline; text-underline-offset: 3px; }
.help-optional { font-weight: 400; color: var(--ink-soft); font-size: 13px; }
.help-reply { border: none; padding: 0; margin: 0; min-width: 0; }
.help-reply legend { padding: 0; margin-bottom: 6px; }
.help-reply-row { display: flex; gap: 18px; margin-bottom: 4px; }
.help-radio, .help-agree { display: flex; align-items: flex-start; gap: 8px; color: var(--ink); cursor: pointer; }
.help-radio { align-items: center; font-size: 15.5px; }
.help-agree { font-size: 13.5px; line-height: 1.65; color: var(--ink-soft); }
.help-radio input, .help-agree input {
  -webkit-appearance: auto; appearance: auto; width: 20px; height: 20px; flex: 0 0 20px; padding: 0; margin: 0;
  accent-color: var(--cinnabar); box-shadow: none;
}
.help-agree input { margin-top: 2px; }
#helpBody {
  width: 100%; min-width: 0; padding: 12px; resize: vertical; min-height: 120px;
  font-family: var(--font-body); font-size: 16px; line-height: 1.6; color: var(--ink);
  background: rgba(255, 252, 244, 0.7); border: 1px solid var(--paper-line); border-radius: 8px;
}
#helpBody::placeholder { color: #9C8E7C; }
#helpBody:focus { outline: none; border-color: var(--cinnabar); box-shadow: 0 0 0 3px rgba(168, 42, 32, 0.15); }
.help-count { align-self: flex-end; font-size: 12.5px; color: var(--ink-soft); }
.help-copy { align-self: center; color: var(--ink-soft); padding: 4px 8px; }
.help-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14.5px; line-height: 1.6; }
.help-dl dt { font-weight: 700; color: var(--ink-soft); }
.help-dl dd { color: var(--ink); overflow-wrap: anywhere; }
.legal-section:target { box-shadow: 0 0 0 2px var(--yellow); }

/* 좁은 화면: 전공·취미 칸을 한 줄씩 (예시 문구가 잘리지 않게), 약관 표는 카드처럼 */
@media (max-width: 400px) {
  .input-row:has(> .form-group) { flex-direction: column; gap: 18px; }
  .legal-table thead { display: none; }
  .legal-table tr { display: block; padding: 10px 0; border-bottom: 1px solid rgba(43, 35, 29, 0.15); }
  .legal-table td { display: grid; grid-template-columns: 4.2em 1fr; gap: 8px; padding: 2px 0; border: 0; }
  .legal-table td::before { content: attr(data-label); font-weight: 700; color: var(--ink-soft); }
}

/* 키 작은 휴대폰(아이폰 SE 등): 첫 안내창 사진을 줄여 두 버튼이 한 화면에 들어오게 */
@media (max-height: 700px) {
  .intro-modal-img-box { height: 150px; }
}

/* ── 움직임 줄이기 ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .opening-lines p { opacity: 1; }
  .opening-eyes span, .ritual-eyes span { transform: none; opacity: 1; }
  .embers, .fog { display: none; }
}

/* ── 인쇄(PDF 저장) ────────────────────────────────────────────── */
/* ── 📖 리포트 책 넘김 ── */
.book-bar { position: sticky; top: 0; z-index: 20; margin: 4px -4px 12px; padding: 10px 12px 9px; border-radius: 0 0 10px 10px;
  background: rgba(250, 245, 232, 0.96); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--paper-line); border-top: 0; box-shadow: 0 6px 14px -10px rgba(40, 20, 10, 0.45); }
.book-bar-top { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.book-count { flex: none; font-weight: 800; font-size: 13px; color: var(--cinnabar); letter-spacing: 0.04em; }
.book-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.book-dots { display: flex; gap: 5px; margin-top: 8px; }
.book-dot { flex: 1; height: 5px; min-width: 0; padding: 0; border: 0; border-radius: 3px; background: rgba(120, 90, 60, 0.18); cursor: pointer; transition: background 0.25s; }
.book-dot.is-read { background: rgba(178, 34, 34, 0.38); }
.book-dot.is-on { background: var(--cinnabar); }
/* 손가락으로 누르기 쉽게 점 위아래로 터치 영역 확대 */
.book-dot { position: relative; }
.book-dot::after { content: ""; position: absolute; inset: -9px 0; }
.report-book { min-height: calc(100svh - 150px); perspective: 1400px; }
.report-book .book-off { display: none !important; }
.report-book > .unlocked-report-container { margin-top: 0; }
.is-book .report-book > .report-summary.book-off + .unlocked-report-container { margin-top: 0; }
.book-nav { position: sticky; bottom: var(--book-nav-bottom, 0px); z-index: 20; display: flex; align-items: center; gap: 8px; margin: 14px -4px 0; padding: 10px 8px;
  background: rgba(250, 245, 232, 0.97); border: 1px solid var(--paper-line); border-bottom: 0; border-radius: 10px 10px 0 0; box-shadow: 0 -6px 14px -10px rgba(40, 20, 10, 0.45); }
.book-btn { flex: none; min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--paper-line); background: #fffaf0; color: var(--ink); font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.book-btn.book-prev { padding: 0 14px; }
.book-btn.book-next { margin-left: auto; background: var(--cinnabar); border-color: var(--cinnabar); color: #fff8ec; }
.book-btn:disabled { opacity: 0.35; cursor: default; }
.book-hint { flex: 1; min-width: 0; text-align: center; font-size: 11.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 넘김 연출: 종이가 한쪽 모서리를 축으로 젖혀지며 넘어간다 */
.report-book.turn-out-next { transform-origin: left center; animation: bookOutNext 0.26s ease-in forwards; }
.report-book.turn-out-prev { transform-origin: right center; animation: bookOutPrev 0.26s ease-in forwards; }
.report-book.turn-in-next  { transform-origin: right center; animation: bookInNext 0.38s cubic-bezier(.2,.8,.25,1) both; }
.report-book.turn-in-prev  { transform-origin: left center; animation: bookInPrev 0.38s cubic-bezier(.2,.8,.25,1) both; }
@keyframes bookOutNext { to { transform: rotateY(-28deg) translateX(-14%); opacity: 0; filter: brightness(0.9); } }
@keyframes bookOutPrev { to { transform: rotateY(28deg) translateX(14%); opacity: 0; filter: brightness(0.9); } }
@keyframes bookInNext  { from { transform: rotateY(24deg) translateX(12%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bookInPrev  { from { transform: rotateY(-24deg) translateX(-12%); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .report-book[class*="turn-"] { animation: none !important; } }

/* ── 📦 전부 묶음 보따리 ── */
.btn-bundle { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 10px; min-height: 46px; padding: 9px 12px;
  border-radius: 8px; border: 1.5px solid #B98A26; background: linear-gradient(135deg, #FFF6D8, #F6E3A6 55%, #FBEFC6); color: #5A2A10;
  font: inherit; font-size: 13.5px; line-height: 1.45; text-align: left; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55); }
.btn-bundle strong { color: var(--cinnabar); white-space: nowrap; }
.bundle-list { list-style: none; margin: 10px 0 6px; padding: 0; border-top: 1px dashed var(--paper-line); text-align: left; }
.bundle-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--paper-line); font-size: 13.5px; line-height: 1.5; }
.bundle-each { flex: none; color: var(--ink-soft); }
.bundle-sum { margin: 8px 0 4px; font-size: 15px; text-align: right; }
.bundle-sum s { color: var(--ink-soft); }
.bundle-sum strong { color: var(--cinnabar); font-size: 18px; }
.shop-item-bundle { box-shadow: inset 0 0 0 2px #C9A23A, inset 0 0 0 5px var(--paper), inset 0 0 0 6px rgba(201, 162, 58, 0.7); background: linear-gradient(135deg, #FFF8E2, #F7E8B8); }
.shop-item-bundle .shop-seal { background: linear-gradient(135deg, #8A1F1F, #C0392B 50%, #7A1414); color: #F6E3A6; }
.shop-item-bundle .shop-price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; }
.shop-list-price { font-size: 12px; }

/* ── 액막이 헌화비: 두 가지 고르기 ── */
.plan-lead { margin: 6px 0 12px; font-size: 14px; color: var(--moon-soft); }
.plan-list { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.plan-card { position: relative; padding: 16px 14px 14px; border-radius: 10px; border: 1px solid var(--paper-line); background: #F6EFDF; }
.plan-bundle { padding-top: 22px; border: 1.5px solid #B98A26; background-color: #FBEFC6; background-image: linear-gradient(135deg, #FFF8E2, #F7E8B8);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.6), 0 6px 18px -10px rgba(120, 80, 10, 0.6); }
.plan-ribbon { position: absolute; top: -11px; left: 14px; padding: 3px 10px; border-radius: 999px; background: var(--cinnabar); color: #FFF3DC; font-size: 12px; font-weight: 800; letter-spacing: 0.02em; }
.plan-name { margin: 0 0 4px; font-size: 16.5px; color: var(--ink); }
.plan-price { margin: 0 0 8px; font-size: 14px; color: var(--ink-soft); }
.plan-price s { margin-right: 4px; }
.plan-price strong { font-size: 22px; color: var(--cinnabar); }
.plan-items { margin: 0 0 12px; padding-left: 18px; font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.plan-card .btn-pay { width: 100%; margin: 0; }
.btn-pay.btn-pay-bundle { font-size: 16px; }
.plan-ny-year { font-variant-numeric: tabular-nums; }
.plan-singles { padding: 12px 12px 10px; }
.plan-name-sm { font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.plan-rows { list-style: none; margin: 0; padding: 0; }
.plan-rows li + li { border-top: 1px dashed var(--paper-line); }
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 48px; padding: 8px 2px;
  border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.plan-row-name { min-width: 0; font-size: 14px; font-weight: 700; line-height: 1.4; }
.plan-row-name small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-soft); }
.plan-row-price { flex: none; font-size: 14px; font-weight: 700; color: var(--cinnabar); white-space: nowrap; }
.plan-rows-note { margin: 6px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-soft); }
.btn-pay.btn-pay-single { background: #fffaf0; color: var(--cinnabar); border: 1.5px solid var(--cinnabar); box-shadow: none; }

@media print {
  body { background: #fff !important; color: #000 !important; padding: 0 !important; }
  .app-container { max-width: 100% !important; }
  header, .home-topbar, .slip-section, .event-strip, .site-footer, .action-bar, .btn-submit, .btn-nav-back, .btn-pay,
  .paywall-overlay, .modal-overlay, .intro-modal-overlay, .book-bar, .book-nav, .btn-bundle, .hanji-scroll-overlay, .toast-msg, .btn-talisman-download, .feature-nav, .tab-bar, .report-reopen, .seal-card, .shop-shelf, #nyPrint, .wish-throw, #wishSave {
    display: none !important;
  }
  .character-card, .paywall-overlay { background: #fff !important; color: #000 !important; }
  .animal-name, .animal-sub { color: #000 !important; }
  .dream-fit-card, .saju-table, .daeun-card, .oheng-card, .mind-scan-card, .ghost-warning-card, .sniff-teaser-card,
  .classified-dossier-box, .portfolio-section-card, .talisman-section-card, .kpi-dashboard {
    background: #fff !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
  }
  .view-step > .section-title { color: #000 !important; }
  .report-book { min-height: 0; }
}

/* 👹 백구가 등 뒤에서 본 것 — 사람마다 다른 귀신 그림 5종 */
.ghost-portrait-wrap { margin: 14px 0 16px; }
.ghost-portrait { margin: 0 auto; max-width: 260px; text-align: center; }
.ghost-portrait-frame { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #050302; box-shadow: 0 0 0 1px rgba(168, 42, 32, 0.55), 0 0 0 5px #1a0e0a, 0 0 0 6px rgba(168, 42, 32, 0.35), 0 18px 40px -16px rgba(0, 0, 0, 0.9); }
.ghost-portrait-frame svg { display: block; width: 100%; height: 100%; opacity: 0; transform: scale(1.08); filter: brightness(0.2) blur(2px); transition: opacity 0.9s ease, transform 2.4s cubic-bezier(.2,.7,.2,1), filter 1.6s ease; }
.ghost-portrait-frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 45%, transparent 38%, rgba(0, 0, 0, 0.75) 100%); }
.ghost-portrait.is-seen .ghost-portrait-frame svg { opacity: 1; transform: scale(1); filter: none; animation: ghostFlicker 5.5s 2.4s steps(1) infinite; }
.ghost-portrait .gp-eyes { opacity: 0; }
.ghost-portrait.is-seen .gp-eyes { animation: ghostEyes 3.6s 1.2s ease-in-out infinite both; }
.ghost-portrait.is-seen .gp-ash { animation: ghostAsh 4s ease-in-out infinite alternate; }
.ghost-portrait figcaption { margin-top: 10px; font-family: var(--font-display); color: var(--cinnabar-deep); letter-spacing: 0.04em; }
.ghost-portrait-name { font-size: 20px; }
.ghost-portrait-hanja { font-size: 15px; opacity: 0.75; margin-left: 4px; }
.ghost-lore { font-size: 15.5px; line-height: 1.85; color: var(--ink); margin: 12px 0 0; }
@keyframes ghostEyes { 0%, 100% { opacity: 0.55; } 45% { opacity: 1; } 47% { opacity: 0.05; } 50% { opacity: 1; } }
@keyframes ghostFlicker { 0%, 86%, 100% { filter: none; } 87% { filter: brightness(1.8) contrast(1.4); } 88% { filter: brightness(0.3); } 90% { filter: none; } }
@keyframes ghostAsh { from { transform: translateY(0); } to { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  .ghost-portrait-frame svg { transition: none; }
  .ghost-portrait.is-seen .ghost-portrait-frame svg, .ghost-portrait.is-seen .gp-eyes, .ghost-portrait.is-seen .gp-ash { animation: none; }
  .ghost-portrait.is-seen .gp-eyes { opacity: 1; }
}
@media print { .ghost-portrait-frame svg { opacity: 1; transform: none; filter: none; } .ghost-portrait .gp-eyes { opacity: 1; } }
.ghost-portrait.is-seen .gp-drip { animation: ghostDrip 2.6s ease-in infinite; }
.ghost-portrait.is-seen .gp-fog { animation: ghostFog 7s ease-in-out infinite alternate; }
@keyframes ghostDrip { 0% { transform: translateY(0); opacity: 0.8; } 80% { opacity: 0.6; } 100% { transform: translateY(12px); opacity: 0; } }
@keyframes ghostFog { from { transform: translateX(-10px); } to { transform: translateX(10px); } }
@media (prefers-reduced-motion: reduce) { .ghost-portrait.is-seen .gp-drip, .ghost-portrait.is-seen .gp-fog { animation: none; } }
.ghost-lore-wrap { margin-top: 6px; padding-top: 12px; border-top: 1px dashed rgba(168, 42, 32, 0.35); }
/* 귀신 그림(이미지가 있으면 그림, 없으면 SVG) */
.ghost-portrait { max-width: 300px; }
.ghost-portrait-frame .ghost-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.1); filter: brightness(0.15) blur(3px); transition: opacity 1.1s ease, transform 3s cubic-bezier(.2,.7,.2,1), filter 2s ease; }
.ghost-portrait-frame.has-img svg { visibility: hidden; }
.ghost-portrait.is-seen .ghost-img { opacity: 1; transform: scale(1); filter: sepia(0.15) contrast(1.05); animation: ghostImgFlicker 6.5s 3s steps(1) infinite; }
@keyframes ghostImgFlicker { 0%, 88%, 100% { filter: sepia(0.15) contrast(1.05); } 89% { filter: brightness(1.7) contrast(1.4); } 90% { filter: brightness(0.25); } 92% { filter: sepia(0.15) contrast(1.05); } }
@media (prefers-reduced-motion: reduce) { .ghost-portrait-frame .ghost-img { transition: none; } .ghost-portrait.is-seen .ghost-img { animation: none; } }
@media print { .ghost-portrait-frame .ghost-img { opacity: 1; transform: none; filter: none; } }
.ghost-portrait-note { display: block; margin-top: 4px; font-size: 11.5px; letter-spacing: 0; color: var(--ink); opacity: 0.55; }
/* 악연 경고 카드: 어두운 방 (귀신 그림과 어울리게) */
#ghostWarningCard { background: radial-gradient(120% 90% at 50% 20%, #24130f 0%, #120a08 55%, #070403 100%); color: var(--moon); box-shadow: inset 0 0 0 1px rgba(168, 42, 32, 0.45), inset 0 0 60px rgba(0, 0, 0, 0.85), 0 14px 34px -18px rgba(0, 0, 0, 0.9); }
#ghostWarningCard .ghost-header { color: #E0574A; }
#ghostWarningCard .ghost-desc, #ghostWarningCard .ghost-lore { color: #D9D0C2; }
#ghostWarningCard strong { color: #EFE6D6; }
#ghostWarningCard .impact-red { color: #E35B4C; }
#ghostWarningCard .impact-gold { color: var(--yellow); }
#ghostWarningCard .ghost-portrait figcaption { color: #C9473A; }
#ghostWarningCard .ghost-lore-wrap { border-top-color: rgba(227, 91, 76, 0.3); }
.ghost-portrait-frame { box-shadow: 0 0 0 1px rgba(168, 42, 32, 0.5), 0 0 30px rgba(0, 0, 0, 0.9); }
.ghost-warn { margin: 0 0 12px; padding: 9px 12px; font-size: 13px; line-height: 1.6; color: #E8C9A0; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(227, 179, 65, 0.28); border-radius: 4px; text-align: left; }
.ghost-ai-note { margin: 6px 0 0; font-size: 11.5px; color: #8E857A; }
.ghost-portrait-note { display: none; }
.ghost-gate { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; background: radial-gradient(circle at 50% 50%, rgba(20, 10, 8, 0.55), rgba(5, 3, 2, 0.95)); color: #E8DCC6; font-family: var(--font-display); font-size: 18px; }
.ghost-gate small { font-family: inherit; font-size: 12px; opacity: 0.6; }
.ghost-gate:focus-visible { outline: 2px solid var(--yellow); outline-offset: -4px; }
.ghost-portrait:not(.is-seen) figcaption { visibility: hidden; }
/* 🪞 거울에 비친 귀신: 낡은 청동 손거울, 금 간 유리, 얼룩진 은박 */
.ghost-mirror-title { margin: 4px 0 14px; font-family: var(--font-display); font-size: 14px; color: #A89A86; letter-spacing: 0.06em; }
#ghostWarningCard .ghost-portrait { max-width: 270px; padding: 18px 16px 4px; }
#ghostWarningCard .ghost-portrait-frame { aspect-ratio: 4 / 5; border-radius: 50%; background: #030202;
  box-shadow: 0 0 0 2px #0d0905, 0 0 0 9px #4a3820, 0 0 0 10px #2a1e10, 0 0 0 13px #6e5532, 0 0 0 15px #1a1209, 0 0 34px 16px rgba(0, 0, 0, 0.85), 0 0 60px 10px rgba(168, 42, 32, 0.18); }
#ghostWarningCard .ghost-portrait-frame::after { z-index: 1; border-radius: 50%;
  background:
    linear-gradient(128deg, rgba(220, 230, 235, 0.16) 0%, rgba(220, 230, 235, 0.05) 22%, transparent 38%, transparent 70%, rgba(220, 230, 235, 0.06) 86%, transparent 100%),
    radial-gradient(14% 10% at 22% 78%, rgba(120, 100, 70, 0.35), transparent 70%),
    radial-gradient(9% 7% at 80% 18%, rgba(120, 100, 70, 0.3), transparent 70%),
    radial-gradient(6% 5% at 66% 88%, rgba(90, 80, 60, 0.35), transparent 70%),
    radial-gradient(closest-side, transparent 62%, rgba(10, 14, 12, 0.55) 86%, rgba(0, 0, 0, 0.92) 100%);
  box-shadow: inset 0 0 22px 6px rgba(0, 0, 0, 0.85); }
#ghostWarningCard .ghost-img { filter: brightness(0.15) blur(4px); }
#ghostWarningCard .ghost-portrait.is-seen .ghost-img { filter: blur(0.3px) contrast(1.05) saturate(0.85); animation: ghostImgFlicker 6.5s 3s steps(1) infinite, mirrorBreath 9s 1.5s ease-in-out infinite; }
.ghost-mirror-crack { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
#ghostWarningCard .ghost-gate { border-radius: 50%; z-index: 3; }
@keyframes mirrorBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03) translateY(-1%); } }
#ghostWarningCard .ghost-portrait figcaption { margin-top: 22px; }
.scare-notice { margin: 4px 0 12px; padding: 9px 12px; font-size: 13px; line-height: 1.6; color: #EBD3AE; background: #1a0f0b; border: 1px solid rgba(227, 179, 65, 0.25); border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { #ghostWarningCard .ghost-portrait.is-seen .ghost-img { animation: none; } }

/* 아이폰 사파리: 넘김 연출(3D) 층이 위·아래 고정 띠 위로 비쳐 보이는 문제 → 띠를 불투명하게 하고 별도 층으로 올림 */
.report-book { position: relative; z-index: 0; }
.book-bar, .book-nav { -webkit-transform: translateZ(0); transform: translateZ(0); }
.book-bar { background: #FAF5E8; backdrop-filter: none; -webkit-backdrop-filter: none; }
.book-nav { background: #FAF5E8; }
#viewReport .report-book > * { scroll-margin-top: 90px; }
