/* ============================================================
   FateSeer — Night theme (2026-10)
   밤하늘 네이비 + 금빛. 하람 일러스트 4장을 화면 배경으로 쓴다.
   result-styles.css 뒤에 로드되어 토큰을 덮어쓴다. 레이아웃·i18n·JS 는 건드리지 않는다.
   ============================================================ */
:root {
  --n-bg:      #0b1026;   /* 가장 깊은 밤 */
  --n-bg-2:    #10163a;
  --n-card:    #151c45;
  --n-card-2:  #1b2352;
  --n-line:    rgba(255,255,255,.14);
  --n-line-2:  rgba(255,255,255,.08);
  --n-ink:     #f3ecdc;   /* 본문 글자 — 크림 */
  --n-ink-2:   #e3dccb;
  --n-ink-3:   #c6c0b2;
  --n-mute:    #9d9ab0;
  --n-faint:   #6b6f8a;
  --n-gold:    #e6c56f;
  --n-gold-2:  #f3d78c;
  --n-gold-3:  #b9953f;
  --n-gold-tint: rgba(230,197,111,.14);
  --n-glow:    0 10px 30px rgba(230,197,111,.28);
}

/* ---------- 결과 페이지 토큰 덮어쓰기 ---------- */
#step-result {
  --r-paper:   var(--n-bg);
  --r-paper-2: var(--n-bg-2);
  --r-card:    var(--n-card);
  --r-card-2:  var(--n-card-2);
  --r-ink:     var(--n-ink);
  --r-ink-2:   var(--n-ink-2);
  --r-ink-3:   var(--n-ink-3);
  --r-mute:    var(--n-mute);
  --r-faint:   var(--n-faint);
  --r-deep:    #06091c;
  --r-brass:   var(--n-gold);
  --r-brass-2: var(--n-gold-2);
  --r-brass-3: var(--n-gold-3);
  --r-brass-pale: var(--n-gold-tint);
  --r-wood:  #86c78f;  --r-wood-bg:  rgba(134,199,143,.16);
  --r-fire:  #ff8f7f;  --r-fire-bg:  rgba(255,143,127,.16);
  --r-earth: #e6c56f;  --r-earth-bg: rgba(230,197,111,.16);
  --r-metal: #d9d3c4;  --r-metal-bg: rgba(217,211,196,.14);
  --r-water: #86b1ee;  --r-water-bg: rgba(134,177,238,.16);
  --r-line:        var(--n-line);
  --r-line-faint:  var(--n-line-2);
  --r-sh-1: 0 2px 8px rgba(0,0,0,.35);
  --r-sh-2: 0 6px 18px rgba(0,0,0,.4);
  --r-sh-3: 0 10px 28px rgba(0,0,0,.45);
  --r-sh-bubble: 0 12px 30px rgba(0,0,0,.45);
  background: var(--n-bg);
  color: var(--n-ink);
}
body { background: #06091c; }
#app-container { background: var(--n-bg); box-shadow: 0 0 80px rgba(0,0,0,.6); }

/* 카드류 — 유리판 느낌 */
#step-result .r-card,
#step-result .r-fate-card,
#step-result .r-wonder,
#step-result .r-testimonial,
#step-result .r-rating,
#step-result .r-contents,
#step-result .r-cta,
#step-result .r-locked-card,
#step-result .r-chart,
#step-result .r-letter {
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04));
  border: 1px solid var(--n-line);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  color: var(--n-ink);
}
#step-result .r-card--ink { background: linear-gradient(180deg, #1b2352, #11173b); border-color: rgba(230,197,111,.35); }
#step-result .r-card--accent { border-left: 3px solid var(--n-gold); }
#step-result .r-card--quote { border-color: rgba(230,197,111,.3); }
#step-result .r-card__title, #step-result h1, #step-result h2, #step-result h3 { color: var(--n-ink); }
#step-result .r-card__text, #step-result p { color: var(--n-ink-2); }
#step-result .r-overline { color: var(--n-gold); }
#step-result strong { color: var(--n-ink); }
#step-result .r-bubble { background: rgba(255,255,255,.08); color: var(--n-ink); border: 1px solid var(--n-line); backdrop-filter: blur(12px); }
#step-result .r-bubble::after, #step-result .r-bubble::before { background: rgba(255,255,255,.08); }
#step-result .r-identity { background: transparent; }
#step-result .r-identity__title, #step-result .r-identity__title em { color: var(--n-gold-2); }
#step-result .r-truth { background: rgba(255,255,255,.05); border: 1px solid var(--n-line-2); }
#step-result .r-truth__num { color: var(--n-gold); }
#step-result .r-tbl__cell { background: rgba(255,255,255,.05); border-color: var(--n-line-2); color: var(--n-ink); }
#step-result .r-tbl__cell.is-day { background: var(--n-gold-tint); outline: 1px solid rgba(230,197,111,.45); }
#step-result .r-tbl__colhead, #step-result .r-tbl__rowhead, #step-result .r-tbl__corner { background: rgba(0,0,0,.25); color: var(--n-mute); border-color: var(--n-line-2); }
#step-result .r-tbl__stem, #step-result .r-tbl__branch { color: var(--n-ink); }
#step-result .r-hid-pip { color: #fff; }
#step-result .r-tg-badge { background: rgba(0,0,0,.3); color: #fff; }
#step-result .r-star-row, #step-result .r-stars2__item { background: rgba(255,255,255,.05); border-color: var(--n-line-2); }
#step-result .r-star-row__name, #step-result .r-star-row__hanja { color: var(--n-ink); }
#step-result .r-star-row__mean, #step-result .r-star-row__pos { color: var(--n-ink-3); }
#step-result .r-tengods__bar, #step-result .r-meter__track, #step-result .r-el-bar__col { background: rgba(255,255,255,.1); }
#step-result .r-tengods__fill { background: var(--n-gold); }
#step-result .r-meter__fill { background: linear-gradient(90deg, var(--n-gold-3), var(--n-gold-2)); }
#step-result .r-meter__num, #step-result .r-tengods__count { color: var(--n-gold-2); }
#step-result .r-voids__pill, #step-result .r-tag { background: rgba(255,255,255,.08); color: var(--n-ink); border: 1px solid var(--n-line); }
#step-result .r-tag--brass { background: var(--n-gold-tint); color: var(--n-gold-2); border-color: rgba(230,197,111,.4); }
#step-result .r-chapter__title { color: var(--n-ink); }
#step-result .r-chapter__num, #step-result .r-chapter__sub { color: var(--n-gold); }
#step-result .r-chapter__rule { background: linear-gradient(90deg, transparent, var(--n-gold), transparent); }
#step-result .r-fate-card__hd { background: rgba(0,0,0,.22); }
#step-result .r-fate-blur-overlay { background: linear-gradient(to bottom, rgba(11,16,38,0), rgba(11,16,38,.92) 60%); }
#step-result .r-fate-blur-cta { color: var(--n-gold-2); }
#step-result .r-wonder__text { color: var(--n-ink-2); }
#step-result .r-cta { background: linear-gradient(180deg, #1b2352, #0f1536); border-color: rgba(230,197,111,.4); }
#step-result .r-cta__badge { background: var(--n-gold); color: #1a1405; }
#step-result .r-cta__title { color: #fff; }
#step-result .r-cta__title em { color: var(--n-gold-2); }
#step-result .r-cta__sub, #step-result .r-cta__list { color: var(--n-ink-3); }
#step-result .r-price-now { color: var(--n-gold-2); }
#step-result .r-price-strike { color: var(--n-mute); }
#step-result .r-countdown { background: rgba(0,0,0,.25); border-color: var(--n-line); }
#step-result .r-countdown__num { color: #fff; }
#step-result .r-pay-btn--brass { background: linear-gradient(180deg, #f1d27f, #d9ac3f); color: #1a1405; box-shadow: var(--n-glow); }
#step-result .r-pay-btn--pcard { background: rgba(255,255,255,.1); color: #fff; border: 1px solid var(--n-line); }
#step-result .r-pay-btn--kakao { background: #fee500; color: #191919; }
#step-result .r-pay-btn--usdt { background: rgba(255,255,255,.08); color: var(--n-ink); border: 1px solid var(--n-line); }
#step-result .r-pay-note, #step-result .r-assurance { color: var(--n-mute); }
#step-result .r-testimonial__quote { color: var(--n-ink-2); }
#step-result .r-testimonial__author { color: var(--n-mute); }
#step-result .r-rating__score { color: var(--n-gold-2); }
#step-result .r-footer { color: var(--n-faint); }
#step-result .r-scene__mascot img { filter: drop-shadow(0 10px 24px rgba(0,0,0,.5)); }
#step-result .r-mascot-portrait { display: none; }
#step-result .r-sticky-cta { background: rgba(11,16,38,.92); border-top: 1px solid rgba(230,197,111,.3); box-shadow: 0 -10px 30px rgba(0,0,0,.5); }
#step-result .r-sticky-cta__price { color: #fff; }
#step-result .r-sticky-cta__price strong { color: var(--n-gold-2); }
#step-result .r-sticky-cta__btn { background: linear-gradient(180deg, #f1d27f, #d9ac3f); color: #1a1405; box-shadow: var(--n-glow); }
/* 살짝 보기·모자이크·요약 블록 */
#step-result .r-peek__card { background: rgba(255,255,255,.05); border-color: var(--n-line); }
#step-result .r-peek__fd, #step-result .r-peek__fn { color: var(--n-ink); }
#step-result .r-peek__veil { background: linear-gradient(to bottom, rgba(21,28,69,0), var(--n-card) 70%); }
#step-result .r-peek__lock { background: var(--n-gold-tint); border-color: rgba(230,197,111,.4); color: var(--n-gold-2); }
#step-result .r-peek__cap { color: var(--n-mute); }
#step-result .r-tour__t { color: var(--n-ink); }
#step-result .r-tour__num { color: var(--n-gold); }
#step-result .r-tour__ph { border-color: #262d5a; background: #262d5a; }
#step-result .r-tour__cover { background: #0b1026 url("assets/night/haram-book-720.webp") 50% 12% / cover no-repeat; }   /* 표지 타일은 실데이터로 그림 */
#step-result .r-tour__lock { background: linear-gradient(180deg, #f1d27f, #d9ac3f); color: #1a1405; box-shadow: var(--n-glow); }
#step-result .r-contents-item { background: transparent; }
#step-result input, #step-result textarea { background: rgba(255,255,255,.06); color: var(--n-ink); border-color: var(--n-line); }
#step-result ::placeholder { color: var(--n-faint); }

/* ---------- 결과 히어로 (새 마크업) ---------- */
.n-hero { position: relative; margin: 0 0 6px; min-height: 560px; overflow: hidden; background: #0b1026; }
.n-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 16%; transform: scale(1.04); transition: transform 1.8s ease; }
.n-hero.in .n-hero__img { transform: scale(1); }
.n-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(11,16,38,.25) 0%, rgba(11,16,38,0) 28%, rgba(11,16,38,.82) 66%, #0b1026 100%); }
.n-hero__t { position: absolute; left: 22px; right: 22px; bottom: 26px; z-index: 2; }
.n-hero__k { font-size: 11px; letter-spacing: .3em; color: var(--n-gold); margin-bottom: 10px; font-weight: 800; }
.n-hero__h { font-family: var(--r-display); font-size: 32px; line-height: 1.22; font-weight: 700; color: #fff; margin: 0 0 8px; word-break: keep-all; }
.n-hero__h em { font-style: normal; color: var(--n-gold-2); }
.n-hero__m { font-size: 13.5px; color: var(--n-ink-3); line-height: 1.6; }
.n-hero__t > * { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.n-hero.in .n-hero__t > * { opacity: 1; transform: none; }
.n-hero.in .n-hero__t > :nth-child(2) { transition-delay: .15s; }
.n-hero.in .n-hero__t > :nth-child(3) { transition-delay: .3s; }

/* 점수 카운터 */
.n-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 16px 0; }
.n-sc { padding: 12px 6px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid var(--n-line); text-align: center; }
.n-sc b { display: block; font-family: var(--r-display); font-size: 26px; line-height: 1.1; color: var(--n-gold-2); font-variant-numeric: tabular-nums; }
.n-sc span { display: block; font-size: 10.5px; letter-spacing: .06em; color: var(--n-mute); margin-top: 4px; }

/* ---------- 스크롤 모션 ---------- */
/* 기본: 아래에서 떠오르며 또렷해짐 (블러 → 선명) */
.rv { opacity: 0; transform: translateY(40px); filter: blur(6px); transition: opacity .8s ease, transform .9s cubic-bezier(.2,.7,.2,1), filter .8s ease; }
.rv.in { opacity: 1; transform: none; filter: none; }
/* 변형: 왼쪽/오른쪽에서 밀려오기, 확대, 줌아웃 */
.rv.rv-l { transform: translateX(-56px); }
.rv.rv-r { transform: translateX(56px); }
.rv.rv-zoom { transform: scale(.88); }
.rv.rv-pop { transform: translateY(24px) scale(.96); }
.rv.in.rv-l, .rv.in.rv-r, .rv.in.rv-zoom, .rv.in.rv-pop { transform: none; }
/* 카드 안쪽 요소는 순차 등장 */
#step-result .rv.rv-stagger > * { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
#step-result .rv.rv-stagger.in > * { opacity: 1; transform: none; }
#step-result .rv.rv-stagger.in > :nth-child(1) { transition-delay: .1s; } #step-result .rv.rv-stagger.in > :nth-child(2) { transition-delay: .2s; }
#step-result .rv.rv-stagger.in > :nth-child(3) { transition-delay: .3s; } #step-result .rv.rv-stagger.in > :nth-child(4) { transition-delay: .4s; }
#step-result .rv.rv-stagger.in > :nth-child(5) { transition-delay: .5s; } #step-result .rv.rv-stagger.in > :nth-child(n+6) { transition-delay: .6s; }
/* 연속 항목(궁금증·후기·운세 카드)은 형제끼리 시차 */
#step-result .r-wonder.rv.in, #step-result .r-testimonial.rv.in, #step-result .r-fate-card.rv.in, #step-result .r-locked-card.rv.in { transition-delay: calc(var(--i, 0) * 90ms); }
/* 챕터 머리: 금선이 그어짐 */
#step-result .r-chapter__rule { transform: scaleX(0); transform-origin: 50% 50%; transition: transform 1s cubic-bezier(.2,.7,.2,1) .25s; }
#step-result .r-chapter.in .r-chapter__rule { transform: scaleX(1); }
/* 막대: 보일 때 차오름, 숫자: 보일 때 카운트업 */
#step-result .r-meter__fill, #step-result .r-tengods__fill { transition: width 1.3s cubic-bezier(.2,.7,.2,1) .15s; }
#step-result .r-el-bar__fill { transition: height 1.3s cubic-bezier(.2,.7,.2,1) .15s; }
#step-result .rv-bars:not(.in) .r-meter__fill, #step-result .rv-bars:not(.in) .r-tengods__fill { width: 0 !important; }
#step-result .rv-bars:not(.in) .r-el-bar__fill { height: 0 !important; }
/* 히어로 패럴랙스 (JS가 transform 을 준다) */
.n-hero__img { will-change: transform; }
.n-hero__t { will-change: transform, opacity; }
/* 상단 읽기 진행선 */
#n-progress { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; height: 3px; width: 0; background: linear-gradient(90deg, #d9ac3f, #f6e2a6); box-shadow: 0 0 10px rgba(230,197,111,.7); z-index: 60; pointer-events: none; transition: width .12s linear; }
/* 배경 별빛: 스크롤과 다른 속도로 흐르는 두 겹 */
#step-result { position: relative; isolation: isolate; }
#step-result::before, #step-result::after { content: ""; position: fixed; inset: -20% 0; z-index: -1; pointer-events: none; background-repeat: repeat; }
#step-result::before { background-image: radial-gradient(1.2px 1.2px at 12% 18%, rgba(255,255,255,.75) 50%, transparent 51%), radial-gradient(1px 1px at 64% 42%, rgba(255,255,255,.6) 50%, transparent 51%), radial-gradient(1.4px 1.4px at 38% 76%, rgba(246,226,166,.7) 50%, transparent 51%), radial-gradient(1px 1px at 86% 88%, rgba(255,255,255,.55) 50%, transparent 51%), radial-gradient(1px 1px at 78% 12%, rgba(255,255,255,.5) 50%, transparent 51%); background-size: 360px 360px; opacity: .55; animation: n-stars 90s linear infinite; }
#step-result::after { background-image: radial-gradient(1.6px 1.6px at 22% 58%, rgba(246,226,166,.6) 50%, transparent 51%), radial-gradient(1.2px 1.2px at 70% 22%, rgba(255,255,255,.5) 50%, transparent 51%), radial-gradient(1px 1px at 50% 92%, rgba(255,255,255,.45) 50%, transparent 51%); background-size: 520px 520px; opacity: .45; animation: n-stars 140s linear infinite reverse; }
@keyframes n-stars { from { background-position: 0 0; } to { background-position: 0 -1000px; } }
@media (prefers-reduced-motion: reduce) {
  .rv, .rv > *, .n-hero__t > *, #step-result .r-chapter__rule { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  #step-result .rv-bars:not(.in) .r-meter__fill, #step-result .rv-bars:not(.in) .r-tengods__fill { width: auto !important; }
  #step-result::before, #step-result::after, .n-hero__img { animation: none !important; }
}
}

/* ---------- 인사 화면 (.scene) ---------- */
.scene { background: #0b1026; color: var(--n-ink); }
.scene::before { content: ""; position: absolute; inset: 0; background-size: cover; background-position: 50% 22%; background-repeat: no-repeat; z-index: 0; transform: scale(1.03); animation: n-drift 14s ease-in-out infinite alternate; }
.scene::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(to bottom, rgba(11,16,38,.08) 25%, rgba(11,16,38,.7) 58%, #0b1026 82%); }
#step-greet .scene::before { background-image: url("assets/night/haram-path-720.webp"); }
@keyframes n-drift { from { transform: scale(1.03) translateY(0); } to { transform: scale(1.06) translateY(-10px); } }
.scene > :not(.top-bar):not(.bottom-card) { position: relative; z-index: 1; }
.scene > .top-bar, .scene > .bottom-card { z-index: 10; }   /* 원래 absolute 배치 유지 — 버튼은 화면 맨 아래 */
.scene .stage img.char { display: none; }               /* 일러스트 안에 하람이 있으니 기존 캐릭터는 숨김 */
.scene { display: flex; flex-direction: column; }
.scene .stage { align-items: flex-end; flex: 1 1 auto; height: auto; max-height: none; min-height: 400px; }   /* 화면이 길어도 말풍선이 버튼 바로 위에 붙도록 */
.scene .stage .bubble-col { position: absolute !important; top: auto !important; bottom: 8px; left: 22px; right: 22px !important; align-items: flex-start; max-width: none; gap: 10px; }
.scene .bubble { background: rgba(255,255,255,.09); color: var(--n-ink); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(0,0,0,.35); text-align: left; max-width: 88%; border-radius: 18px 18px 18px 6px; padding: 14px 16px; font-size: 15.5px; font-weight: 500; line-height: 1.55; }
.scene .bubble.lg { font-size: 16.5px; max-width: 92%; padding: 16px 18px; }
.scene .bubble b { color: var(--n-gold-2); }
.scene .bubble::after, .scene .bubble::before { display: none; }
.scene .bubble-col .bubble { opacity: 0; transform: translateY(14px); animation: n-up .6s ease forwards; }
.scene .bubble-col .bubble:nth-child(2) { animation-delay: .45s; }
.scene .bubble-col .bubble:nth-child(3) { animation-delay: .9s; }
@keyframes n-up { to { opacity: 1; transform: none; } }
.scene .top-bar.light .back, .scene .top-bar.light .menu, .scene .top-bar.light .step-count { color: #fff !important; }
.scene .bottom-card { background: linear-gradient(180deg, rgba(11,16,38,0) 0%, rgba(11,16,38,.9) 35%, #0b1026 100%); }
.scene .scene-header h2 { color: #fff; }
.scene .scene-header p { color: var(--n-ink-3); }
.scene .field-label { color: var(--n-ink); }
.scene .field-label .opt { color: var(--n-mute); }
.scene select, .scene textarea, .scene input[type="text"] { background: rgba(255,255,255,.07); border-color: var(--n-line); color: var(--n-ink); }
.scene textarea::placeholder { color: var(--n-faint); }
.scene .ta-counter { color: var(--n-mute); }
.scene .ta-send { background: var(--n-gold); color: #1a1405; }
#step-3 .stage { height: 30vh; min-height: 200px; }
/* 버튼 — 전 화면 공통 */
/* 골드 버튼은 일러스트 장면(인사·사전·생년월일)에만 — 랜딩 CTA 는 원래 파란색 유지 */
.scene .btn { background: linear-gradient(180deg, #f1d27f, #d9ac3f); color: #1a1405; box-shadow: var(--n-glow); }
.scene .btn:hover { background: linear-gradient(180deg, #f6dc92, #e0b44a); }
.scene .btn-secondary { background: rgba(255,255,255,.06); color: var(--n-ink); border: 1px solid var(--n-line); box-shadow: none; }
.scene .btn-secondary:hover { background: rgba(255,255,255,.1); }
.gender-row .opt-box.active { background: var(--n-gold); border-color: var(--n-gold); color: #1a1405; }
.form-row label .opt .dot.on { background: var(--n-gold); border-color: var(--n-gold); }
/* ---------- 이름·생년월일 입력 화면 (.scene-form) — 하람 '책' 일러스트 (나침반은 분석 중 화면에서만) ----------
   한 화면에 담는다: 위쪽은 일러스트가 남는 만큼 차지하고, 입력 카드와 버튼은 아래에 붙는다 (flex). */
.scene-form { background: #0b1026; color: var(--n-ink); overflow: hidden; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding: 0; }
.scene-form::before { content: ""; position: absolute; inset: 0; z-index: 0; background: url("assets/night/haram-book-720.webp") 50% 12% / cover no-repeat; transform: scale(1.03); animation: n-drift 14s ease-in-out infinite alternate; }
.scene-form::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(to bottom, rgba(11,16,38,.05) 0%, rgba(11,16,38,.05) 28%, rgba(11,16,38,.55) 45%, rgba(11,16,38,.88) 60%, #0b1026 76%); }
.scene-form > :not(.top-bar) { position: relative; z-index: 1; }
.scene-form > .top-bar { z-index: 10; }
.scene-form .bg-char { display: none; }                   /* 일러스트 안에 하람이 있으니 기존 캐릭터는 숨김 */
.scene-form .form-card { margin: auto 14px 0; padding: 2px 16px 8px; background: rgba(13,18,44,.74); border: 1px solid var(--n-line); border-radius: 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.scene-form .form-row { padding: 11px 0; border-bottom-color: var(--n-line); }
.scene-form .form-row label { color: var(--n-ink); font-size: 14px; }
.scene-form .form-row .ghost-input, .scene-form .form-row .ghost-select { background: rgba(255,255,255,.06); border-color: var(--n-line); color: var(--n-ink); font-size: 16px; padding: 7px 10px; }
.scene-form .form-row .ghost-input.is-err { border-color: #ff8f7f; box-shadow: 0 0 0 3px rgba(255,143,127,.18); }
.scene-form .field-err { margin-top: 6px; font-size: 12px; line-height: 1.45; color: #ffb4a8; }
.scene-form .gender-row .opt-box { padding: 12px; }
.scene-form .form-nav { position: static; max-width: none; margin: 0; padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); background: none; }
.scene-form .btn { background: linear-gradient(180deg, #f1d27f, #d9ac3f); color: #1a1405; box-shadow: var(--n-glow); padding: 15px; }
.scene-form .btn:hover { background: linear-gradient(180deg, #f6dc92, #e0b44a); }
.scene-form .btn-secondary { background: rgba(255,255,255,.06); color: var(--n-ink); border: 1px solid var(--n-line); box-shadow: none; }
.scene-form .top-bar .back { color: #fff; }
/* 뒤로가기 — 밝은 배경 그림 위에서도 보이도록 어두운 원판 + 테두리 */
.scene .top-bar .back, .scene-form .top-bar .back, #step-result .top-bar .back, .top-bar .back {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(8, 12, 32, .62); border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
  color: #fff !important; font-size: 24px; font-weight: 400; line-height: 1; padding-bottom: 3px;
}
.top-bar .back:active { transform: scale(.94); }
@media (max-height: 640px) { .scene-form .form-row { padding: 8px 0; } .scene-form .gender-row .opt-box { padding: 9px; } }
.form-nav { background: linear-gradient(180deg, rgba(11,16,38,0) 0%, rgba(11,16,38,.95) 30%, #0b1026 100%); }
/* 로딩: 나침반 일러스트를 뒤에 은은히 */
/* ---------- 분석 중 화면 — 상단 '움직이는 배경', 하단 진행 바 ---------- */
#step-loading { background: #0b1026; }
#step-loading::before { content: none; }
#step-loading.active { justify-content: flex-start; align-items: stretch; }
#step-loading > * { position: relative; z-index: 1; }
.ld-visual { position: relative; width: 100%; height: 60vh; min-height: 380px; max-height: 640px; overflow: hidden; background: #0b1026; }
.ld-visual__img { position: absolute; inset: -7%; background: url("assets/night/haram-compass-720.webp") 50% 18% / cover no-repeat; animation: ld-kb 18s ease-in-out infinite alternate; will-change: transform; }
.ld-visual__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ld-visual__fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ld-visual::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at 62% 42%, rgba(246,226,166,.22) 0%, rgba(246,226,166,0) 45%); mix-blend-mode: screen; animation: ld-glow 4.5s ease-in-out infinite alternate; pointer-events: none; }
.ld-visual::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(to bottom, rgba(11,16,38,.35) 0%, rgba(11,16,38,0) 18%, rgba(11,16,38,0) 62%, rgba(11,16,38,.75) 84%, #0b1026 100%); pointer-events: none; }
/* 나침반 빛 연출 — --cx/--cy/--cr 는 JS 가 그림 좌표로 계산 */
.ld-aura { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.ld-aura > * { position: absolute; left: var(--cx, 65%); top: var(--cy, 30%); translate: -50% -50%; border-radius: 50%; }
.ld-aura__rays { width: calc(var(--cr, 120px) * 3.2); height: calc(var(--cr, 120px) * 3.2); background: conic-gradient(from 0deg, rgba(255,232,170,0) 0deg, rgba(255,232,170,.55) 14deg, rgba(255,232,170,0) 28deg, rgba(190,227,255,0) 70deg, rgba(190,227,255,.4) 82deg, rgba(190,227,255,0) 96deg, rgba(255,232,170,0) 150deg, rgba(255,232,170,.5) 165deg, rgba(255,232,170,0) 180deg, rgba(255,210,230,0) 230deg, rgba(255,210,230,.4) 242deg, rgba(255,210,230,0) 256deg, rgba(255,232,170,0) 300deg, rgba(255,232,170,.5) 316deg, rgba(255,232,170,0) 332deg); -webkit-mask: radial-gradient(circle, transparent 28%, #000 40%, rgba(0,0,0,.4) 60%, transparent 72%); mask: radial-gradient(circle, transparent 28%, #000 40%, rgba(0,0,0,.4) 60%, transparent 72%); mix-blend-mode: screen; opacity: .85; animation: ld-spin 22s linear infinite; }
.ld-aura__ring { width: calc(var(--cr, 120px) * 2.3); height: calc(var(--cr, 120px) * 2.3); border: 2px solid transparent; background: conic-gradient(from 90deg, rgba(246,226,166,0) 0 55%, rgba(246,226,166,.95) 78%, #fff 84%, rgba(246,226,166,0) 100%) border-box; -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); mask-composite: exclude; filter: drop-shadow(0 0 6px rgba(246,226,166,.9)); animation: ld-spin 7s linear infinite; }
.ld-aura__ring2 { width: calc(var(--cr, 120px) * 2.75); height: calc(var(--cr, 120px) * 2.75); border: 1px solid rgba(246,226,166,.28); animation: ld-spin 13s linear infinite reverse; }
.ld-aura__ring3 { width: calc(var(--cr, 120px) * 1.7); height: calc(var(--cr, 120px) * 1.7); border: 1px dashed rgba(190,227,255,.35); animation: ld-spin 9s linear infinite; }
.ld-aura__ring2 i, .ld-aura__ring3 i { position: absolute; left: 50%; top: -5px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 3px rgba(255,236,180,.95), 0 0 24px 8px rgba(246,226,166,.5); }
.ld-aura__ring3 i { width: 7px; height: 7px; top: -3.5px; margin-left: -3.5px; background: #dff1ff; box-shadow: 0 0 8px 3px rgba(190,227,255,.95), 0 0 20px 6px rgba(134,177,238,.5); }
.ld-aura__core { width: calc(var(--cr, 120px) * 1.3); height: calc(var(--cr, 120px) * 1.3); background: radial-gradient(circle, rgba(255,250,230,.95) 0%, rgba(255,236,180,.55) 22%, rgba(246,226,166,.18) 48%, rgba(246,226,166,0) 70%); mix-blend-mode: screen; animation: ld-pulse 2.6s ease-in-out infinite; }
@keyframes ld-spin { to { transform: rotate(360deg); } }
@keyframes ld-pulse { 0%,100% { opacity: .55; scale: .9; } 50% { opacity: 1; scale: 1.08; } }
@keyframes ld-kb { from { transform: scale(1) translate(0,0); } to { transform: scale(1.09) translate(-1.5%, -2%); } }
@keyframes ld-glow { from { opacity: .55; } to { opacity: 1; } }
#step-loading .ld-caption { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; margin: -24px auto 0; padding: 0 30px 10vh; text-align: center; width: 100%; max-width: 380px; }
#step-loading .ld-status { color: var(--n-ink); }
#step-loading .ld-sub { color: var(--n-ink-3); }
#step-loading .ld-progress { width: 260px; background: rgba(255,255,255,.12); }
#step-loading .ld-progress__bar { background: linear-gradient(90deg, #d9ac3f, #f6e2a6, #86b1ee); box-shadow: 0 0 14px rgba(230,197,111,.55); }
#step-loading .ld-percent { color: var(--n-gold-2); }
@media (prefers-reduced-motion: reduce) { .ld-visual__img, .ld-visual::before, .ld-aura > * { animation: none; } }

/* 운명의 4대 지표 — 블러 카드 */
#step-result .r-fate-blur-body { background: rgba(255,255,255,.05); color: var(--n-ink-2); }
#step-result .r-fate-blur-overlay { background: linear-gradient(135deg, rgba(11,16,38,.45), rgba(11,16,38,.7)); }
#step-result .r-fate-blur-overlay:hover { background: rgba(11,16,38,.75); }
#step-result .r-fate-blur-icon { filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
#step-result .r-scene__bubble .r-bubble { text-align: left; }
/* 별점·후기 블록의 잔여 밝은 배경 */
#step-result .r-rating__stars { color: var(--n-gold); }
