/* ================================================================
   골목점집 궁합점 — compat/styles.css (다크 프리미엄 v1)
   hub-premium-spec.md §3 토큰 기반. 홈·사주와 톤 통일.
   app.js / readings.js 로직 무변경 — id·class 셀렉터 전량 보존.
   ================================================================ */

/* ── 폰트 로드 ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&family=Noto+Serif+KR:wght@400;700&display=swap');

/* ── CSS 변수 — 프리미엄 다크 토큰 ── */
:root {
  /* 배경 계층 */
  --bg-base:        #0D0D0D;
  --bg-card:        #1A1A1A;
  --bg-card-deep:   #161616;
  --bg-section:     #111111;
  --bg-input:       #222222;

  /* 브랜드 그린 */
  --color-forest:        #1B4A3C;
  --color-forest-mid:    #245F4E;
  --color-forest-bright: #4A9B82;
  --color-forest-glow:   rgba(27, 74, 60, 0.25);
  --color-forest-deep:   #12352A;

  /* 텍스트 — 명암비 준수 (#0D0D0D 대비) */
  --text-primary:   #FAF9F5;                       /* 약 19:1 */
  --text-secondary: rgba(250, 249, 245, 0.75);     /* 약 14:1 */
  --text-tertiary:  rgba(250, 249, 245, 0.5);      /* 약 9:1 */
  --text-muted:     rgba(250, 249, 245, 0.3);
  --text-green:     #4A9B82;                       /* 다크배경 위 약 5.2:1 AA */

  /* 코랄 (에러·필수 표시) */
  --color-coral:    #E07070;

  /* 테두리 */
  --border-subtle:  rgba(250, 249, 245, 0.08);
  --border-card:    rgba(27, 74, 60, 0.35);
  --border-active:  rgba(27, 74, 60, 0.75);

  /* 카카오 */
  --kakao-yellow: #FEE500;
  --kakao-black:  #191919;

  /* 폰트 */
  --font-serif: 'Noto Serif KR', serif;
  --font-sans:  'Noto Sans KR', sans-serif;

  /* 타이포 스케일 */
  --text-xs:   10px;
  --text-sm:   12px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   17px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  30px;

  /* 행간 */
  --leading-tight:  1.4;
  --leading-body:   1.85;
  --leading-dialog: 2.2;

  /* 모션 */
  --dur-fast:   150ms;
  --dur-normal: 300ms;
  --dur-slow:   600ms;
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);

  /* 반경 */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* 컨테이너 */
  --container-max: 480px;
  --container-px:  20px;

  /* 레거시 호환 — app.js 간접 참조 가능성 */
  --color-bg-paper:        #0D0D0D;
  --color-bg-card:         #1A1A1A;
  --color-bg-section:      #111111;
  --color-text-primary:    #FAF9F5;
  --color-text-secondary:  rgba(250, 249, 245, 0.75);
  --color-text-muted:      rgba(250, 249, 245, 0.35);
  --color-border-subtle:   rgba(250, 249, 245, 0.1);
  --color-border-section:  rgba(250, 249, 245, 0.08);
  --color-nav-dark:        #0D0D0D;
  --color-forest-mid:      #245F4E;
  --color-forest-tint:     rgba(27, 74, 60, 0.15);
  --color-forest-mist:     rgba(27, 74, 60, 0.08);
  --shadow-input:          0 0 0 3px rgba(27, 74, 60, 0.25);
  --shadow-card:           0 2px 16px rgba(0, 0, 0, 0.4);
  --shadow-lifted:         0 8px 32px rgba(0, 0, 0, 0.55);
  --color-seal-green:      #1B4A3C;
  --color-seal-green-bg:   rgba(27, 74, 60, 0.15);
}

/* ── 리셋 & 기본 ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: var(--leading-body);
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }

/* ── 접근성 포커스 ── */
:focus-visible {
  outline: 2px solid var(--text-green);
  outline-offset: 2px;
}

/* ── 공통 헤더 (nav.js 삽입분) ── */
/* 기존 .site-header(HTML 내 레거시)는 완전 숨김 */
.site-header {
  display: none !important;
}

/* nav.js body padding 보정 — sticky 헤더 높이만큼 보정 불필요 (sticky이므로 흐름에 없음) */
body { padding-top: 0; }

/* ── 레이아웃 컨테이너 ── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 24px var(--container-px) 0;
}

/* ── SPA 화면 전환 (app.js: .screen / .screen.active) ── */
.screen {
  display: none;
  min-height: 100dvh;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* ════════════════════════════════════════════════════════
   SCREEN A — 랜딩 (입력 화면)
   ════════════════════════════════════════════════════════ */

/* ── 히어로: 사주 스타일 시네마틱 이미지 히어로 ──
   compat-hero.png 생성 시 자동 적용 (img onerror 폴백 처리됨).
   이미지 없을 때는 딥그린 그라디언트 배경으로 깨지지 않음. */
.page-hero {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  /* compat-hero.png 생성 시 자동 적용 — img 태그 onerror로 처리 */
  background: linear-gradient(
    160deg,
    rgba(18, 53, 42, 0.98) 0%,
    rgba(13, 13, 13, 1) 100%
  );
}

.page-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.35;
}

.page-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(13, 13, 13, 0.0) 0%,
    rgba(13, 13, 13, 0.95) 100%
  );
  z-index: 1;
}

.page-hero__content {
  position: absolute;
  bottom: 32px;
  left: 24px;
  z-index: 2;
}

.page-hero__title {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: var(--leading-tight);
}

.page-hero__title span {
  font-size: 0.6em;
  opacity: 0.75;
}

.page-hero__subtitle {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: rgba(250, 249, 245, 0.6);
  margin-top: 6px;
}

/* g4.png 원형 페르소나 — 히어로 우하단 삐져나옴 */
.page-hero__persona {
  position: absolute;
  right: 20px;
  bottom: -20px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(27, 74, 60, 0.5);
  z-index: 3;
}

/* ── 페르소나 인사 블록 (사주 §B-2 동일) ── */
.persona-greeting {
  background: var(--bg-section);
  padding: 28px 24px 28px 80px;
  position: relative;
}

.persona-greeting__avatar {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(27, 74, 60, 0.5);
}

.persona-greeting__text {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 400;
  color: rgba(250, 249, 245, 0.9);
  line-height: var(--leading-dialog);
}

/* ── 입력 카드 (app.js: #compat-form) ── */
.input-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-top: 16px;
}

/* Person 섹션 */
.person-section {
  margin-bottom: 12px;
}

/* app.js: .section-person-label — "나" / "상대방" 라벨 */
.section-person-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-green);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

.person-section-inner {
  background: var(--bg-section);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.field-group {
  margin-bottom: 16px;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-group label {
  display: block;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  color: rgba(250, 249, 245, 0.45);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

/* 이름 텍스트 입력 */
.field-group input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid rgba(27, 74, 60, 0.35);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  -webkit-appearance: none;
  appearance: none;
}

.field-group input[type="text"]::placeholder {
  color: rgba(250, 249, 245, 0.2);
  font-weight: 400;
  font-size: 14px;
}

.field-group input[type="text"]:focus {
  border-color: var(--color-forest);
  box-shadow: var(--shadow-input);
}

/* ── 날짜 입력 그리드 (app.js: #year-a, #month-a, #day-a 등) ── */
.date-inputs {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 8px;
}

.date-inputs input,
.date-inputs select {
  padding: 11px 8px;
  background: var(--bg-input);
  border: 1px solid rgba(27, 74, 60, 0.35);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  outline: none;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  /* 드롭다운 화살표 (어두운 배경용) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(250,249,245,0.35)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-color: var(--bg-input);
  padding-right: 28px;
}

/* select에만 화살표, number input은 제거 */
.date-inputs input[type="number"] {
  background-image: none;
  padding-right: 8px;
}

.date-inputs input::placeholder {
  color: rgba(250, 249, 245, 0.2);
  font-weight: 400;
  font-size: 13px;
}

.date-inputs option {
  background: var(--bg-input);
  color: var(--text-primary);
}

.date-inputs input:focus,
.date-inputs select:focus {
  border-color: var(--color-forest);
  box-shadow: var(--shadow-input);
}

/* app.js: .error 클래스 추가 (유효성 실패 시) */
.date-inputs input.error,
.date-inputs select.error {
  border-color: var(--color-coral);
}

/* 날짜 라벨 (년/월/일) */
.date-labels {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.date-labels span {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* app.js: .field-error / .field-error.visible */
.field-error {
  font-size: 12px;
  color: var(--color-coral);
  margin-top: 4px;
  display: none;
}

.field-error.visible {
  display: block;
}

/* ── 구분선 + 하트 (app.js 구조 보존) ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(250, 249, 245, 0.08);
}

.divider-heart {
  color: var(--color-coral);
  font-size: 16px;
  line-height: 1;
}

/* ── CTA 버튼 (app.js: #btn-submit, .btn-primary, .btn-secondary) ── */
.btn-primary {
  display: block;
  width: 100%;
  padding: 17px 0;
  background: var(--color-forest);
  color: var(--text-primary); /* #FAF9F5 on #1B4A3C — 약 9.2:1 AAA */
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius-xl);
  border: none;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
  position: relative;
  overflow: hidden;
  margin-top: 20px;
}

.btn-primary:hover {
  background: var(--color-forest-mid);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  background: var(--color-forest-deep);
}

.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* app.js: .loading 상태 — 스피너 표시, 라벨 숨김 */
.btn-primary .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(250, 249, 245, 0.35);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}

.btn-primary.loading .btn-label {
  display: none;
}

.btn-primary.loading .spinner {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 결과 화면 버튼 그룹 내 margin 제거 */
.cta-group .btn-primary {
  margin-top: 0;
}

/* 보조 버튼 (공유 버튼) */
.btn-secondary {
  display: block;
  width: 100%;
  padding: 17px 0;
  background: transparent;
  color: rgba(250, 249, 245, 0.75); /* 약 14:1 AAA */
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius-xl);
  border: 1.5px solid rgba(250, 249, 245, 0.2);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: border-color var(--dur-fast), color var(--dur-fast),
              transform var(--dur-fast) var(--ease);
}

.btn-secondary:hover {
  border-color: rgba(250, 249, 245, 0.4);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* ── 면책 문구 (.disclaimer) ── */
.disclaimer {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
  line-height: var(--leading-body);
}

/* ── 풋터 네비 ── */
.footer-nav {
  background: var(--bg-base);
  border-top: 1px solid var(--border-subtle);
  padding: 14px var(--container-px);
  margin-top: auto;
}

.footer-nav-text {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.footer-nav-text a {
  color: var(--text-green);
  text-underline-offset: 2px;
}

.footer-nav-text a:hover {
  text-decoration: underline;
}

/* ════════════════════════════════════════════════════════
   SCREEN B — 결과 화면
   ════════════════════════════════════════════════════════ */

/* ── 결과 헤더 (결과 화면 상단 — nav.js 헤더와 다름) ── */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--container-px) 12px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-subtle);
}

/* 결과 화면 로고 영역 */
.result-header .header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-area {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.logo-area img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: block;
}

.logo-stamp {
  width: 36px;
  height: 36px;
  background: var(--color-forest);
  border-radius: 50%;
  border: 1.5px solid var(--color-forest-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex-shrink: 0;
}

.logo-stamp span {
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  display: block;
}

.logo-text {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-text .accent {
  color: var(--text-green);
}

/* 다시 하기 버튼 (app.js: #btn-back) */
.back-btn {
  background: none;
  border: none;
  color: var(--text-green); /* #4A9B82 — 약 5.2:1 AA */
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--dur-fast);
}

.back-btn:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ── 점수 히어로 (app.js: .score-hero) ── */
.score-hero {
  background: linear-gradient(
    180deg,
    rgba(18, 53, 42, 0.9) 0%,
    rgba(13, 13, 13, 1) 100%
  );
  padding: 36px var(--container-px) 32px;
  text-align: center;
  border-bottom: 1px solid rgba(27, 74, 60, 0.25);
}

/* app.js: #result-names */
.score-names {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ── SVG 원형 게이지 (app.js: #score-gauge-svg, #gauge-fill) ── */
.score-gauge-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
}

.score-gauge {
  position: relative;
  width: 160px;
  height: 160px;
}

.score-gauge svg {
  transform: rotate(-90deg);
  display: block;
}

/* 게이지 트랙 — 어두운 배경 위 반투명 */
.score-gauge-track {
  fill: none;
  stroke: rgba(250, 249, 245, 0.1);
  stroke-width: 10;
}

/* 게이지 채움 — 밝은 그린 */
.score-gauge-fill {
  fill: none;
  stroke: #4A9B82; /* 다크 배경 위 그린 — 약 5.2:1 AA */
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1200ms var(--ease);
}

.score-gauge-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

/* app.js: #result-score-num */
.score-number {
  font-family: var(--font-serif);
  font-size: clamp(32px, 8vw, 42px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  display: block;
}

.score-suffix {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  display: block;
  margin-top: 3px;
}

/* ── 점수 라벨 뱃지 (app.js: #result-badge, .score-badge.level-*) ── */
.score-badge {
  display: inline-block;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  margin-top: 16px;
  background: rgba(74, 155, 130, 0.12);
  border: 1px solid rgba(74, 155, 130, 0.35);
  color: #4A9B82; /* 약 5.2:1 AA */
  letter-spacing: 0.04em;
}

/* app.js가 동적으로 부여하는 level 클래스 — 각각 구분 */
.score-badge.level-seed {
  background: rgba(74, 155, 130, 0.07);
  border-color: rgba(74, 155, 130, 0.25);
  color: #4A9B82;
}

.score-badge.level-flow {
  background: rgba(74, 155, 130, 0.1);
  border-color: rgba(74, 155, 130, 0.3);
  color: #4A9B82;
}

.score-badge.level-deep {
  background: rgba(74, 155, 130, 0.14);
  border-color: rgba(74, 155, 130, 0.4);
  color: #4A9B82;
}

.score-badge.level-mature {
  background: rgba(139, 105, 20, 0.14);
  border-color: rgba(139, 105, 20, 0.35);
  color: #C9A23A; /* 앰버 — 다크 배경 위 약 5.4:1 AA */
}

/* ── 결과 바디 ── */
.screen-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-base);
}

.result-body {
  padding: 0 var(--container-px);
  padding-bottom: 48px;
}

/* ── 무료 리딩 카드 (app.js: #reading-first, #reading-comm, #reading-future-blur) ── */
.reading-card {
  background: var(--bg-section);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-top: 20px;
}

.reading-card-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.reading-divider {
  height: 1px;
  background: rgba(27, 74, 60, 0.2);
  margin: 18px 0;
}

.reading-section {
  margin-bottom: 18px;
}

.reading-section:last-child {
  margin-bottom: 0;
}

/* .reading-section-label — 섹션명 레이블 */
.reading-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-green); /* #4A9B82 — 약 5.2:1 AA */
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.reading-section-label::before {
  content: '';
  width: 2px;
  height: 13px;
  background: var(--text-green);
  flex-shrink: 0;
  border-radius: 1px;
}

/* app.js: .reading-text */
.reading-text {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: var(--leading-body);
  color: rgba(250, 249, 245, 0.82); /* 약 12.5:1 AAA */
}

/* ── 블러 클리프행어 (app.js: #reading-future-blur, .reading-blur-content) ── */
.reading-blur-wrap {
  position: relative;
}

.reading-blur-content {
  filter: blur(6px);
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}

.reading-blur-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.reading-lock-icon {
  color: var(--text-tertiary);
  display: block;
}

.reading-lock-text {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary); /* rgba(250,249,245,0.5) — 약 9:1 AA */
}

/* ── 클리프행어 박스 ── */
.cliffhanger {
  background: var(--bg-card);
  border-left: 2px solid var(--text-green);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 18px;
  margin-top: 14px;
}

.cliffhanger-lead {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-green);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.cliffhanger-body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: var(--leading-body);
}

/* ── CTA 버튼 그룹 (결과 화면) ── */
.cta-group {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── 핸드오프 배너 ── */
.handoff-banner {
  background: var(--bg-section);
  border: 1px solid rgba(27, 74, 60, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-top: 14px;
  text-align: center;
}

.handoff-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

/* 핸드오프 배너 소형 로고 */
.logo-area-sm {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.logo-area-sm img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: block;
}

.logo-stamp-sm {
  width: 30px;
  height: 30px;
  background: var(--color-forest);
  border-radius: 50%;
  border: 1px solid var(--color-forest-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex-shrink: 0;
}

.logo-stamp-sm span {
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 6px;
  font-weight: 700;
  line-height: 1.15;
  display: block;
  text-align: center;
}

.handoff-logo-text {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.handoff-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.handoff-sub {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: var(--leading-body);
}

.handoff-advisory {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* app.js: .handoff-link */
.btn-handoff {
  display: block;
  width: 100%;
  padding: 12px 0;
  background: var(--color-forest);
  color: var(--text-primary); /* #FAF9F5 on #1B4A3C — 약 9.2:1 AAA */
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius-xl);
  border: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
  text-decoration: none;
}

.btn-handoff:hover {
  background: var(--color-forest-mid);
}

/* ════════════════════════════════════════════════════════
   SCREEN C — 공유 카드 모달
   (app.js: #share-modal, .modal-overlay, .modal-overlay.active)
   ════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-inner {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px 16px 24px;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.modal-close button {
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  background: none;
  border: none;
  padding: 4px;
  transition: color var(--dur-fast);
}

.modal-close button:hover {
  color: var(--text-primary);
}

/* 공유 카드 (app.js: #share-card, #card-names, #card-score-num 등) */
/* 다크 프리미엄 버전 — 딥그린+거의검정 배경 */
#share-card {
  width: 360px;
  height: 480px;
  background: linear-gradient(
    160deg,
    rgba(18, 53, 42, 0.97) 0%,
    rgba(13, 13, 13, 0.99) 100%
  );
  border: 1.5px solid rgba(27, 74, 60, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lifted);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* 카드 배경 질감 */
#share-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 80% 110%, rgba(74, 155, 130, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.card-logo-area {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.card-logo-area img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: block;
}

.card-logo-stamp {
  width: 30px;
  height: 30px;
  background: var(--color-forest);
  border-radius: 50%;
  border: 1px solid var(--color-forest-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex-shrink: 0;
}

.card-logo-stamp span {
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 6px;
  font-weight: 700;
  line-height: 1.15;
  display: block;
  text-align: center;
}

.card-logo-text {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.card-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.card-divider-line {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.card-divider-line::before,
.card-divider-line::after {
  content: '';
  width: 30px;
  height: 1px;
  background: rgba(250, 249, 245, 0.1);
}

.card-divider-heart {
  color: var(--color-coral);
  font-size: 13px;
  line-height: 1;
}

/* app.js: #card-names */
.card-names {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

/* app.js: #card-names-sub */
.card-names-sub {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* 공유 카드 점수 박스 */
.card-score-box {
  background: rgba(27, 74, 60, 0.25);
  border: 1.5px solid rgba(74, 155, 130, 0.4);
  border-radius: 12px;
  padding: 18px 20px;
  text-align: center;
  width: 100%;
}

/* app.js: #card-score-num */
.card-score-num {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
  color: #4A9B82; /* 약 5.2:1 AA on #0D0D0D */
  line-height: 1;
  display: block;
}

/* app.js: #card-score-label */
.card-score-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  color: rgba(74, 155, 130, 0.8);
  margin-top: 4px;
  display: block;
  letter-spacing: 0.04em;
}

/* app.js: #card-teaser */
.card-teaser {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  line-height: var(--leading-body);
  padding: 0 8px;
}

/* 공유 카드 인장 */
.card-seal-wrap {
  display: flex;
  justify-content: center;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.card-seal {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(27, 74, 60, 0.2);
  border: 2px solid rgba(74, 155, 130, 0.5);
  box-shadow:
    0 0 0 3px rgba(13, 13, 13, 0.8),
    0 0 0 5px rgba(74, 155, 130, 0.25);
  transform: rotate(-6deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  animation: seal-drop 0.4s var(--ease) 0.3s both;
}

@keyframes seal-drop {
  0%   { transform: rotate(-6deg) translateY(-18px) scale(1.15); opacity: 0; }
  70%  { transform: rotate(-6deg) translateY(2px)   scale(1.02); opacity: 1; }
  100% { transform: rotate(-6deg) translateY(0)     scale(1);    opacity: 1; }
}

.card-seal-main {
  font-family: var(--font-serif);
  font-size: 10px;
  font-weight: 700;
  color: #4A9B82;
  letter-spacing: 2px;
  line-height: 1.4;
  text-align: center;
}

.card-seal-sub {
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 500;
  color: rgba(74, 155, 130, 0.65);
  letter-spacing: 1.5px;
}

.card-source {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

/* 공유 버튼 그룹 */
.share-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-download {
  display: block;
  width: 100%;
  padding: 13px 0;
  background: var(--color-forest);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius-xl);
  border: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}

.btn-download:hover {
  background: var(--color-forest-mid);
}

/* app.js: #btn-share-native (navigator.share 지원 시 JS로 show) */
.btn-share-native {
  display: none;
  width: 100%;
  padding: 13px 0;
  background: transparent;
  color: rgba(250, 249, 245, 0.7);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius-xl);
  border: 1.5px solid rgba(250, 249, 245, 0.2);
  cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}

.btn-share-native:hover {
  border-color: rgba(250, 249, 245, 0.4);
  color: var(--text-primary);
}

/* ════════════════════════════════════════════════════════
   유틸리티
   ════════════════════════════════════════════════════════ */
.mt-2  { margin-top:  8px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.pb-10 { padding-bottom: 40px; }

/* ── 페이드인 ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeInUp 400ms var(--ease) both;
}

/* ── 데스크탑 레이아웃 (사주 동일 모델) ── */
/* 폰 프레임 제거: body flex/center + screen 480 고정 삭제.
   히어로·페르소나 인사는 풀블리드, 폼·결과 콘텐츠는 .container / 내부 max-width로 중앙 정렬. */
@media (min-width: 520px) {
  .page-hero {
    min-height: 300px;
  }
}

/* ── 데스크탑 760px+ — 사주와 동일하게 --container-max 확장 ── */
@media (min-width: 760px) {
  :root {
    --container-max: 760px;
  }

  /* 결과 헤더: 풀블리드 배경 유지 + 내부 콘텐츠 max-width 중앙 정렬 */
  .result-header {
    padding-left:  max(var(--container-px), calc((100% - var(--container-max)) / 2 + var(--container-px)));
    padding-right: max(var(--container-px), calc((100% - var(--container-max)) / 2 + var(--container-px)));
  }

  /* 점수 히어로: 풀블리드 그라디언트 + 내부 콘텐츠 중앙 패딩 */
  .score-hero {
    padding-left:  max(var(--container-px), calc((100% - var(--container-max)) / 2 + var(--container-px)));
    padding-right: max(var(--container-px), calc((100% - var(--container-max)) / 2 + var(--container-px)));
  }

  /* 결과 바디: max-width + 중앙 정렬 */
  .result-body {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left:  var(--container-px);
    padding-right: var(--container-px);
  }
}

/* ── 헤더 반응형 보정 (nav.js .golmok-header) ──
   좁은 화면에서 로고 텍스트가 잘려도 nav 링크가 한 줄 유지.
   nav.js <style>보다 specificity가 낮으므로 !important로 보정. */
@media (max-width: 400px) {
  .golmok-header__inner {
    gap: 8px !important;
  }
  .golmok-logo__text {
    font-size: 13px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 110px !important;
  }
  .golmok-nav {
    gap: 10px !important;
    flex-shrink: 0 !important;
  }
  .golmok-nav__link {
    font-size: 12px !important;
    white-space: nowrap !important;
  }
}

/* ── 캐릭터 고지 (푸터 최하단) ── */
.character-notice {
  font-family: var(--font-sans);
  font-size: 10px;
  color: rgba(250, 249, 245, 0.15);
  text-align: center;
  padding: 16px 20px;
  background: var(--bg-base);
  border-top: 1px solid var(--border-subtle);
  margin: 0;
  display: block;
}

/* ── 양력/음력 토글 (사주 app.js 동일 방식) ── */
.calendar-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.toggle-btn {
  flex: 1;
  padding: 7px 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast);
}

.toggle-btn:hover {
  color: var(--text-secondary);
  border-color: var(--border-focus);
}

.toggle-btn.active,
.toggle-btn[aria-pressed="true"] {
  color: var(--text-primary);
  background: var(--color-forest);
  border-color: var(--color-forest-mid);
}

/* ── 윤달 체크박스 ── */
.leap-wrap {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.leap-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.leap-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-forest-bright);
}

/* ── reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
