@font-face {
  font-family: "Maru Buri";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/MaruBuri-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "Maru Buri";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/MaruBuri-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "Pretendard";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/Pretendard-Medium.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --black-1000: #050504;
  --black-950: #080807;
  --black-900: #0c0b0a;
  --black-850: #11100e;
  --black-800: #171510;
  --gold-600: #9e7b35;
  --gold-500: #c5a152;
  --gold-400: #d8ba72;
  --gold-300: #e8d49a;
  --gold-200: #f0e2b8;
  --cream-100: #f7f2e9;
  --muted: #a39a8c;
  --muted-2: #746e64;
  --line: rgba(216, 186, 114, 0.22);
  --line-soft: rgba(247, 242, 233, 0.1);
  --seal: #8e3a29;
  --font-brand: Georgia, "Times New Roman", serif;
  --font-display: "Maru Buri", "Noto Serif KR", Batang, serif;
  --font-ui: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

html,
body {
  background: var(--black-1000);
}

body {
  overflow: hidden;
  color: var(--cream-100);
  font-family: var(--font-ui);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(232, 212, 154, 0.86);
  outline-offset: 3px;
}

.stage {
  display: flex;
  justify-content: center;
  min-height: 100dvh;
}

.phone {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(430px, 100%);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--black-950);
}

.destiny-appbar,
.bottom-nav {
  flex: 0 0 auto;
}

.destiny-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 66px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 8, 7, 0.96);
}

.app-brand {
  display: inline-grid;
  gap: 1px;
}

.app-brand span {
  color: var(--gold-300);
  font-family: var(--font-brand);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.1;
}

.app-brand b {
  color: var(--gold-500);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.app-actions {
  display: flex;
  gap: 8px;
}

.mini-action {
  display: inline-grid;
  min-width: 42px;
  height: 32px;
  padding: 0 10px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(216, 186, 114, 0.04);
  color: var(--gold-300);
  font-size: 10px;
  font-weight: 900;
}

.destiny-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 166px;
  scrollbar-width: none;
}

.destiny-scroll::-webkit-scrollbar {
  display: none;
}

.destiny-loading {
  display: grid;
  min-height: calc(100dvh - 214px);
  place-content: center;
  padding: 28px;
  text-align: center;
}

.destiny-loading span,
.record-kicker,
.section-kicker,
.story-card span,
.report-item small {
  color: var(--gold-400);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

/* 로딩 박스는 브랜드를 먼저 보여주는 자리라 글자 대신 로고를 놓는다. .destiny-loading
   이 grid 라서 기본값(stretch)으로는 로고가 늘어난다. 가운데로 붙여 원래 비율을 지킨다. */
.destiny-loading-logo {
  width: 132px;
  height: 50px;
  justify-self: center;
  object-fit: contain;
}

.destiny-loading strong {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 24px;
}

.destiny-loading p {
  max-width: 280px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  word-break: keep-all;
}

.destiny-gate {
  position: relative;
  display: grid;
  min-height: calc(100dvh - 214px);
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 42px 24px;
  overflow: hidden;
  text-align: center;
}

.destiny-gate::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(to bottom, rgba(8, 8, 7, 0.16), var(--black-950) 74%),
    url("/assets/chungi-manseryeok-bg.webp") center top / cover no-repeat;
  content: "";
  opacity: 0.38;
}

.destiny-gate > * {
  position: relative;
  z-index: 1;
}

.gate-mark {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 1px solid rgba(216, 186, 114, 0.32);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 30%, rgba(216, 186, 114, 0.2), transparent 62%),
    rgba(8, 8, 7, 0.78);
  color: var(--gold-300);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 900;
}

.destiny-gate h1 {
  max-width: 320px;
  margin: 0;
  color: var(--cream-100);
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
  word-break: keep-all;
}

.destiny-gate p {
  max-width: 318px;
  margin: 0;
  color: rgba(247, 242, 233, 0.76);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.65;
  word-break: keep-all;
}

.gate-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 318px);
  margin-top: 4px;
}

.gate-steps span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid rgba(216, 186, 114, 0.2);
  border-radius: 999px;
  background: rgba(8, 8, 7, 0.54);
  color: var(--gold-200);
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
}

.gate-actions {
  display: grid;
  gap: 8px;
  width: min(100%, 318px);
  margin-top: 6px;
}

.gate-actions a {
  display: grid;
  min-height: 46px;
  padding: 0 14px;
  place-items: center;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 950;
}

.gate-primary {
  background: var(--cream-100);
  color: var(--black-900);
}

.gate-secondary {
  border: 1px solid rgba(247, 242, 233, 0.13);
  background: rgba(247, 242, 233, 0.07);
  color: var(--cream-100);
}

.destiny-hero {
  position: relative;
  min-height: 244px;
  padding: 0 18px 20px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

.destiny-hero::after {
  position: absolute;
  inset: auto 0 0;
  height: 180px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(8, 8, 7, 0), var(--black-950) 74%);
  content: "";
}

.hero-media {
  position: absolute;
  inset: 0 0 auto;
  height: 168px;
  overflow: hidden;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.78;
}

.hero-media::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(5, 5, 4, 0.04), rgba(5, 5, 4, 0.76)),
    linear-gradient(to right, rgba(5, 5, 4, 0.6), rgba(5, 5, 4, 0.04), rgba(5, 5, 4, 0.7));
  content: "";
}

.identity-block {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 224px;
  align-content: end;
  justify-items: center;
  padding-top: 62px;
  text-align: center;
}

.record-kicker {
  display: inline-grid;
  min-height: 24px;
  padding: 0 10px;
  place-items: center;
  border: 1px solid rgba(216, 186, 114, 0.3);
  border-radius: 999px;
  background: rgba(5, 5, 4, 0.42);
}

.identity-block h1 {
  margin: 10px 0 0;
  color: #fffaf3;
  font-family: var(--font-display);
  font-size: clamp(28px, 9vw, 40px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.08;
}

.identity-block p {
  max-width: 292px;
  margin: 8px 0 0;
  color: rgba(247, 242, 233, 0.68);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
  word-break: keep-all;
}

.identity-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 14px;
}

.record-status-line {
  display: block;
  max-width: 292px;
  margin-top: 11px;
  color: var(--gold-300);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.45;
  word-break: keep-all;
}

.identity-tags span,
.record-tabs button,
.info-chip {
  display: inline-grid;
  min-height: 30px;
  padding: 0 11px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(247, 242, 233, 0.05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.identity-tags .is-primary {
  border-color: rgba(216, 186, 114, 0.44);
  background: rgba(216, 186, 114, 0.13);
  color: var(--gold-200);
}

.record-alert {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(216, 186, 114, 0.24);
  border-radius: 16px;
  background: rgba(12, 11, 10, 0.82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  text-align: left;
}

.record-alert strong {
  display: block;
  color: var(--cream-100);
  font-size: 13px;
  font-weight: 950;
  line-height: 1.45;
  word-break: keep-all;
}

.record-alert small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.5;
}

.record-alert a {
  align-self: center;
  display: inline-grid;
  min-width: 70px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--cream-100);
  color: var(--black-900);
  font-size: 11px;
  font-weight: 950;
}

.record-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 8, 7, 0.96);
  scrollbar-width: none;
}

.record-tabs::-webkit-scrollbar {
  display: none;
}

.record-tabs button {
  min-width: max-content;
}

.record-tabs button.is-active {
  border-color: rgba(216, 186, 114, 0.5);
  background: var(--gold-400);
  color: var(--black-950);
}

.record-section {
  padding: 22px 18px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 5px 0 0;
  color: var(--cream-100);
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.2;
}

.section-head p {
  max-width: 230px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.5;
  word-break: keep-all;
}

.panel-card,
.pillar-card,
.story-card,
.report-item,
.timeline-card {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(247, 242, 233, 0.045);
}

.pillar-grid {
  display: grid;
  gap: 10px;
}

.pillar-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 13px;
  overflow: hidden;
}

.pillar-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 860;
  line-height: 1.45;
}

.pillar-label b {
  display: block;
  color: var(--cream-100);
  font-size: 14px;
  font-weight: 950;
}

.pillar-stems {
  min-width: 0;
}

.pillar-stems strong {
  display: block;
  color: var(--gold-200);
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
}

.pillar-stems span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ten-god {
  display: inline-grid;
  min-width: 48px;
  height: 34px;
  padding: 0 10px;
  place-items: center;
  border: 1px solid rgba(216, 186, 114, 0.28);
  border-radius: 999px;
  color: var(--gold-300);
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.panel-card {
  padding: 14px;
}

.insight-stories {
  margin-top: 10px;
}

.balance-list {
  margin-top: 12px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.info-tile {
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(5, 5, 4, 0.34);
}

.info-tile span {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 900;
}

.info-tile strong {
  display: block;
  margin-top: 7px;
  color: var(--cream-100);
  font-size: 16px;
  font-weight: 950;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.element-list {
  display: grid;
  gap: 10px;
}

.element-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.element-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(247, 242, 233, 0.08);
}

.element-track span {
  display: block;
  width: var(--bar, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--gold-400);
}

.story-grid {
  display: grid;
  gap: 10px;
}

.story-card {
  position: relative;
  min-height: 124px;
  padding: 15px;
  overflow: hidden;
}

.story-card.is-image {
  display: grid;
  min-height: 184px;
  align-content: end;
}

.story-card.is-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.58;
}

.story-card.is-image::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(5, 5, 4, 0.08), rgba(5, 5, 4, 0.86));
  content: "";
}

.story-card > *:not(img) {
  position: relative;
  z-index: 1;
}

.story-card strong {
  display: block;
  margin-top: 7px;
  color: var(--cream-100);
  font-size: 16px;
  font-weight: 950;
  line-height: 1.36;
  word-break: keep-all;
}

.story-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.65;
  word-break: keep-all;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.info-chip {
  min-height: 32px;
  color: var(--gold-300);
}

.interaction-list {
  display: grid;
  gap: 10px;
}

.interaction-item {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(5, 5, 4, 0.32);
}

.interaction-item strong {
  color: var(--gold-200);
  font-size: 14px;
}

.interaction-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.interaction-item p {
  margin: 0;
  color: rgba(247, 242, 233, 0.76);
  font-size: 12px;
  line-height: 1.58;
  word-break: keep-all;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding: 12px;
}

.timeline-card span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
}

.timeline-card strong {
  color: var(--cream-100);
  font-family: var(--font-display);
  font-size: 23px;
}

.timeline-card em {
  display: inline-grid;
  min-width: 44px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: rgba(216, 186, 114, 0.12);
  color: var(--gold-300);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}

.timeline-card.is-current {
  border-color: rgba(216, 186, 114, 0.42);
  background: rgba(216, 186, 114, 0.1);
}

.report-list {
  display: grid;
  gap: 9px;
}

.report-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 76px;
  padding: 13px;
}

.report-item strong {
  display: block;
  color: var(--cream-100);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.report-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.45;
}

.report-item em {
  align-self: center;
  display: inline-grid;
  min-width: 44px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--cream-100);
  color: var(--black-900);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}

.empty-card {
  padding: 18px;
  border: 1px dashed rgba(216, 186, 114, 0.3);
  border-radius: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  word-break: keep-all;
}

.record-cta-bar {
  position: absolute;
  right: 10px;
  bottom: 82px;
  left: 10px;
  z-index: 8;
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(247, 242, 233, 0.12);
  border-radius: 18px;
  background: rgba(8, 8, 7, 0.92);
  box-shadow: 0 -18px 45px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

.record-cta-bar button,
.record-cta-bar a {
  display: grid;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  place-items: center;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.record-cta-bar button {
  background: rgba(247, 242, 233, 0.09);
  color: var(--cream-100);
}

.record-cta-bar button:disabled,
.destiny-appbar button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

/* 잠긴 상태에서는 안내(.destiny-gate)가 로그인·사주등록 버튼을 이미 들고 있다.
   떠 있는 바까지 두면 같은 버튼이 위아래로 두 번 보인다. */
.is-record-locked .record-cta-bar {
  display: none;
}

.is-record-locked .record-cta-bar button {
  display: none;
}

.record-cta-bar a {
  background: var(--cream-100);
  color: var(--black-900);
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  height: 74px;
  border-top: 1px solid var(--line-soft);
  background: rgba(8, 8, 7, 0.96);
}

.bottom-nav a,
.bottom-nav button {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 0;
  place-items: center;
  overflow: hidden;
  background: transparent;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.bottom-nav .is-active {
  color: var(--gold-300);
}

.bottom-nav .is-active::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--gold-400);
  content: "";
  transform: translateX(-50%);
}

.tab-label {
  max-width: 100%;
  overflow: hidden;
  padding: 0 3px;
  text-overflow: ellipsis;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 30;
  max-width: 394px;
  margin: 0 auto;
  padding: 13px 14px;
  border: 1px solid rgba(216, 186, 114, 0.22);
  border-radius: 14px;
  background: rgba(12, 11, 10, 0.96);
  color: var(--gold-200);
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 680px) {
  .phone {
    border-right: 1px solid var(--line-soft);
    border-left: 1px solid var(--line-soft);
  }
}

@media (max-width: 360px) {
  .destiny-appbar {
    padding-inline: 14px;
  }

  .destiny-hero,
  .record-section {
    padding-inline: 14px;
  }

  .pillar-card,
  .timeline-card {
    grid-template-columns: 62px minmax(0, 1fr) auto;
  }

  .record-cta-bar button,
  .record-cta-bar a {
    font-size: 11px;
  }
}
