/* Gate — 차원문이 서 있는 밤  ·  Dark Mythic Editorial (2026-10-10 리디자인)
   바탕 · 글자 · 금색은 고정이다(아래 :root). 문을 넘기면 바뀌는 것은 강조색 셋뿐이다 —
   --world(그 세계의 대표 색) · --haze-1 · --haze-2(배경에 번지는 안개).
   index.html 의 GATES[].world · theme 이 이 셋을 덮어쓴다.
   금색(--gold · --foil-*)은 중요한 제목, 고른 상태, 핵심 단추와 아이콘에만 쓴다.
   그 밖의 선은 --hair. 색은 이 파일의 변수로만 쓰고, 반투명은 color-mix(var(--…) n%, transparent).
   글꼴은 두 가지 — 제목 Noto Serif KR, 본문과 UI 는 Pretendard.
   이전 판(문마다 바탕까지 바뀌던 판)은 _archive/gate/before_redesign_20261010/ */

@property --world { syntax: "<color>"; inherits: true; initial-value: #e9cb8b; }
@property --haze-1 { syntax: "<color>"; inherits: true; initial-value: #000; }
@property --haze-2 { syntax: "<color>"; inherits: true; initial-value: #000; }

:root {
  /* 고정 — 바탕과 글자 */
  --night: #100d10;                          /* 배경 */
  --deep: #080608;                           /* 가장 깊은 그늘 (모달 뒤) */
  --velvet: #1b151b;                         /* 보조 배경 */
  --velvet-2: #261d25;
  --burgundy: #32131f;                       /* 딥 버건디 — 판의 깊은 면 */
  --crimson: #8b2538;                        /* 강조용 크림슨 */
  --ivory: #eee5d7;                          /* 본문 */
  --mist: #aaa1a0;                           /* 보조 글자 */
  --gold: #bba071;                           /* 앤티크 골드 */
  --gold-deep: #8c744c;
  --sky: #171117;                            /* 바탕 맨 위의 색 */
  --foil-1: #efe3c8;                         /* 금박의 위 · 가운데 · 아래 */
  --foil-2: #cdb486;
  --foil-3: #a88c5b;
  --on-gold: #17110e;                        /* 금색 위에 얹는 글자 */
  --rose: #e0788a;                           /* 어두운 바탕 위에서 읽히는 크림슨 — 19+ · 오류 */
  --hair: color-mix(in srgb, var(--mist) 22%, transparent);          /* 보통의 선 */
  --line: color-mix(in srgb, var(--gold) 42%, transparent);          /* 금색 선 — 고른 것에만 */
  --foil: linear-gradient(180deg, var(--foil-1) 0%, var(--foil-2) 46%, var(--foil-3) 100%);

  /* 문을 따라 바뀌는 것 — 강조색 셋 (기본값은 황자) */
  --world: #e9cb8b;
  --haze-1: #de8e2c;
  --haze-2: #8b2538;
  --world-soft: color-mix(in srgb, var(--world) 72%, #fff);

  --serif: "Noto Serif KR", "Nanum Myeongjo", "Batang", serif;
  --latin: var(--serif);                      /* 영문 표제도 같은 명조 */
  /* 인물 대화에만 — 인물의 말은 고운바탕, 손님의 말과 입력은 고운돋움 */
  --voice: "Gowun Batang", var(--serif);
  --guest: "Gowun Dodum", var(--ui);
  --ui: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;

  --t-xs: .8125rem;
  --t-s: .9375rem;
  --t-m: 1rem;

  /* 간격 — 4의 배수 */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 72px; --s-9: 112px;
  --r-s: 4px;                                 /* 단추 · 입력 칸 */
  --r-m: 8px;                                 /* 카드 · 판 */
  --r-pill: 999px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --col: 460px;
  --read: 520px;                              /* 글과 대화가 넘지 않는 폭 */
  --gutter: 16px;

  transition: --world .8s ease, --haze-1 .8s ease, --haze-2 .8s ease;
}
@media (min-width: 768px) { :root { --col: 720px; --gutter: 24px; } }
@media (min-width: 1024px) { :root { --col: 960px; } }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--ivory);
  font-family: var(--ui);
  font-size: var(--t-m);
  line-height: 1.6;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

/* 밤하늘 — 문에서 번지는 빛은 위쪽에 옅게만, 나머지는 보랏빛 어둠과 별 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1.2px 1.2px at 24px 38px, color-mix(in srgb, var(--ivory) 80%, transparent) 50%, transparent 52%),
    radial-gradient(1px 1px at 96px 14px, rgba(255, 255, 255, .6) 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 150px 92px, color-mix(in srgb, var(--mist) 70%, transparent) 50%, transparent 52%),
    radial-gradient(1px 1px at 62px 128px, rgba(255, 255, 255, .45) 50%, transparent 52%),
    radial-gradient(1px 1px at 188px 170px, rgba(255, 255, 255, .5) 50%, transparent 52%),
    radial-gradient(1px 1px at 12px 196px, rgba(255, 255, 255, .4) 50%, transparent 52%),
    radial-gradient(70% 40% at 50% 0%, color-mix(in srgb, var(--world) 24%, transparent), transparent 70%),
    radial-gradient(60% 34% at 100% 42%, color-mix(in srgb, var(--haze-1) 20%, transparent), transparent 70%),
    radial-gradient(60% 34% at 0% 74%, color-mix(in srgb, var(--haze-2) 14%, transparent), transparent 70%),
    linear-gradient(var(--sky), var(--night) 60%);
  background-size: 220px 220px, 220px 220px, 220px 220px, 220px 220px, 220px 220px, 220px 220px, auto, auto, auto, auto;
}

h1, h2, h3, h4, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: var(--r-s); }

/* 화면은 고정하고, 그 안에서 세 쪽을 옆으로 넘긴다 */
html, body { height: 100%; overflow: hidden; }
.app { display: flex; flex-direction: column; height: 100dvh; max-width: var(--col); margin: 0 auto; overflow: hidden; }
.pages {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.pages::-webkit-scrollbar { display: none; }
.page {
  position: relative;
  flex: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 116px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}
.page::-webkit-scrollbar { display: none; }
/* 대화 쪽은 화면 높이를 채우고, 기록만 안에서 스크롤한다 */
.page-talk { display: flex; flex-direction: column; }
.page-talk > .sec { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.page-talk .chamber { flex: 1; min-height: 300px; display: flex; flex-direction: column; width: 100%; }
.page-talk .log { flex: 1; min-height: 120px; max-height: none; align-content: start; }
.page-talk .aside-note { margin-top: 12px; }

.foil {
  background: var(--foil);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px color-mix(in srgb, var(--deep) 80%, transparent));
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── 머리 ─────────────────────────────── */
.top {
  position: relative;
  z-index: 20;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 var(--gutter);
  background: linear-gradient(color-mix(in srgb, var(--night) 92%, transparent), color-mix(in srgb, var(--night) 60%, transparent));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); }
.brand svg { width: 26px; height: 26px; }
.brand b { font-family: var(--latin); font-weight: 700; font-size: 1.25rem; letter-spacing: .3em; line-height: 1; }
.menu-btn { width: 44px; height: 44px; margin-right: -10px; display: grid; place-items: center; color: var(--ivory); border-radius: 50%; }
.menu-btn:hover { color: var(--gold); }
.menu-btn svg { width: 22px; height: 22px; }

/* ── 첫 화면 ───────────────────────────── */
.hero { padding: 6px var(--gutter) 0; text-align: center; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.5rem, 6.9vw, 1.875rem);
  line-height: 1.34;
  letter-spacing: -.02em;
}
.hero .lede { margin-top: 6px; font-size: var(--t-s); color: var(--mist); }

/* 차원문 — 뾰족 아치와 금박 테두리가 주인공. 마법진은 뒤에서 희미하게만 돈다 */
.portal { position: relative; width: min(100%, 372px); margin: 30px auto 0; touch-action: pan-y; }
.portal::before {
  content: "";
  position: absolute;
  inset: -6% -10% 22%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--world) 30%, transparent), transparent);
  pointer-events: none;
}
.halo {
  position: absolute;
  left: 50%;
  top: -11%;
  width: 124%;
  aspect-ratio: 1;
  margin-left: -62%;
  color: var(--mist);
  opacity: .2;
  pointer-events: none;
  animation: spin 200s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.arch, .arch-gap, .arch-line, .arch-art { clip-path: url(#ogive); }
.arch {
  position: relative;
  aspect-ratio: 4 / 5;
  /* 낮은 화면에서도 금박 버튼이 떠 있는 내비 위에 남도록 */
  min-height: 300px;
  max-height: calc(100dvh - 376px);
  margin: 0 auto;
  padding: 2px;
  background: var(--foil);
  -webkit-mask-image: linear-gradient(#000 74%, transparent 99%);
  mask-image: linear-gradient(#000 74%, transparent 99%);
}
.arch-gap { height: 100%; padding: 5px; background: var(--night); }
.arch-line { height: 100%; padding: 1px; background: color-mix(in srgb, var(--world) 55%, transparent); }
.arch-art { position: relative; height: 100%; overflow: hidden; background: #000; }
.arch-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity .7s ease, transform 1.4s cubic-bezier(.2, .7, .1, 1);
}
.arch-art img.on { opacity: 1; transform: none; }
.arch-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--night) 4%, color-mix(in srgb, var(--night) 88%, transparent) 28%, color-mix(in srgb, var(--night) 30%, transparent) 50%, transparent 64%);
}
/* 문이 바뀌는 순간의 섬광 */
.arch-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(closest-side, #fff, color-mix(in srgb, var(--world) 70%, #fff) 40%, transparent);
  opacity: 0;
  pointer-events: none;
}
.portal.flare .arch-art::before { animation: flare .8s ease-out; }
@keyframes flare { 0% { opacity: 0; } 22% { opacity: .6; } 100% { opacity: 0; } }

.keystone { position: absolute; left: 50%; top: -12px; width: 24px; height: 24px; margin-left: -12px; color: var(--foil-1); filter: drop-shadow(0 0 6px var(--world)); }
.spark { position: absolute; color: var(--ivory); animation: twinkle 4.2s ease-in-out infinite; pointer-events: none; }
.spark.s1 { left: -1%; top: 30%; width: 10px; }
.spark.s2 { right: -2%; top: 17%; width: 13px; animation-delay: -1.6s; }
@keyframes twinkle { 0%, 100% { opacity: .1; transform: scale(.6); } 50% { opacity: .75; transform: scale(1); } }

/* 화살표 — 누르는 자리는 44px, 보이는 것은 작고 얇게 */
.arrow {
  position: absolute;
  top: 38%;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--ivory) 82%, transparent);
}
.arrow::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--ivory) 24%, transparent);
  background: color-mix(in srgb, var(--night) 42%, transparent);
  transition: border-color .15s, background .15s;
}
.arrow:hover::before { border-color: color-mix(in srgb, var(--ivory) 60%, transparent); background: color-mix(in srgb, var(--night) 70%, transparent); }
.arrow svg { position: relative; width: 13px; height: 13px; }
.arrow.prev { left: -8px; }
.arrow.next { right: -8px; }

.plate { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 14px 2px; }
.en { font-family: var(--latin); font-weight: 500; font-size: .6875rem; letter-spacing: .34em; text-indent: .34em; color: var(--world-soft); }
.summon { font-size: var(--t-xs); font-weight: 600; letter-spacing: .02em; color: var(--world-soft); }
.plate h2 {
  margin-top: 4px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2rem, 10vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -.025em;
}
/* 훅은 설명이 아니라 그 존재가 건넨 말처럼 */
.plate .hook { margin-top: 10px; font-family: var(--serif); font-weight: 700; font-size: 1rem; line-height: 1.55; text-wrap: balance; color: var(--ivory); }
.tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hair);
  background: color-mix(in srgb, var(--night) 50%, transparent);
  font-size: .75rem;
  line-height: 1;
  color: var(--mist);
  white-space: nowrap;
}
.tag-19 { border-color: var(--rose); color: var(--rose); font-weight: 700; }

.act { margin-top: 16px; }
.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  padding: 0 24px;
  border-radius: var(--r-pill);
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
}
.btn svg { width: 16px; height: 16px; }
.btn-gold {
  background: linear-gradient(180deg, var(--foil-1) 0%, var(--foil-2) 40%, var(--foil-3) 100%);
  color: var(--on-gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -2px 0 color-mix(in srgb, var(--gold-deep) 35%, transparent), 0 10px 26px -10px color-mix(in srgb, var(--gold) 55%, transparent);
  transition: transform .12s, filter .15s;
}
.btn-gold:hover { filter: brightness(1.06); }
.btn-gold:active { transform: scale(.98); }
/* 금박 위를 한 번씩 지나가는 빛 */
.btn-gold::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 34%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent);
  transform: skewX(-18deg);
  opacity: 0;
}
.btn-gold:hover::after { opacity: 1; animation: shine .9s ease-out; }
@keyframes shine { from { left: -40%; } to { left: 120%; } }
.btn-line { border: 1px solid color-mix(in srgb, var(--ivory) 34%, transparent); color: var(--ivory); min-height: 52px; font-weight: 700; font-size: var(--t-m); transition: border-color .15s, background .15s; }
.btn-line:hover { border-color: var(--world); background: color-mix(in srgb, var(--world) 9%, transparent); }
.btn-soon { border: 1px solid var(--hair); color: var(--mist); font-weight: 600; cursor: default; }
.act .btn { max-width: 372px; margin-inline: auto; }
.act .note { margin-top: 10px; font-size: var(--t-xs); color: var(--mist); }

.dots { display: flex; justify-content: center; margin-top: 4px; }
.dots button { width: 44px; height: 44px; display: grid; place-items: center; }
.dots button::before { content: ""; width: 6px; height: 6px; transform: rotate(45deg); border: 1px solid color-mix(in srgb, var(--ivory) 50%, transparent); transition: background .2s, border-color .2s; }
.dots button[aria-current="true"]::before { background: var(--world); border-color: var(--world); }

/* ── 구획 ─────────────────────────────── */
.sec { padding: 56px var(--gutter) 0; text-align: center; }
.page > .sec:first-child { padding-top: 22px; }
.sec > h2, .lobby > h2 { font-family: var(--serif); font-weight: 900; font-size: 1.4375rem; line-height: 1.38; letter-spacing: -.02em; text-wrap: balance; }
.sec > .sub, .lobby > .sub { margin-top: 8px; font-size: var(--t-s); color: var(--mist); text-wrap: balance; }
.narrow { max-width: var(--read); margin-inline: auto; }

/* 존재 고르기 — 이야기, 도감, 대화가 같은 단추 줄을 쓴다 */
.who { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.who button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hair);
  font-size: var(--t-s);
  font-weight: 600;
  color: var(--mist);
  transition: color .15s, border-color .15s;
}
.who button small { margin-left: 6px; font-size: .75rem; font-weight: 500; font-variant-numeric: tabular-nums; opacity: .8; }
.who button:hover { color: var(--ivory); border-color: color-mix(in srgb, var(--ivory) 40%, transparent); }
.who button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); font-weight: 700; }

/* 순서 */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 24px; }
.steps li { position: relative; padding: 0 4px; }
.steps li + li::before { content: ""; position: absolute; top: 20px; left: calc(-50% + 26px); right: calc(50% + 26px); height: 1px; background: var(--hair); }
.steps i {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--mist) 40%, transparent);
  font-family: var(--latin);
  font-style: normal;
  font-weight: 500;
  font-size: .9375rem;
  color: var(--ivory);
}
.steps b { display: block; font-family: var(--serif); font-size: var(--t-m); font-weight: 700; line-height: 1.4; }
.steps span { display: block; margin-top: 4px; font-size: var(--t-xs); line-height: 1.45; color: var(--mist); }

/* 문 너머의 이야기 — 기록서의 한 쪽 */
.dossier {
  margin-top: 16px;
  padding: 26px 16px 20px;
  border-radius: 14px;
  border: 1px solid var(--hair);
  background: radial-gradient(120% 50% at 50% 0%, color-mix(in srgb, var(--world) 13%, var(--velvet-2)), var(--velvet) 72%);
}
.realm { font-size: var(--t-xs); font-weight: 600; color: var(--world-soft); }
.dossier h3 { margin-top: 6px; font-family: var(--serif); font-weight: 900; font-size: 1.5rem; line-height: 1.32; letter-spacing: -.025em; text-wrap: balance; }
.tale { margin-top: 12px; font-size: var(--t-s); line-height: 1.75; color: color-mix(in srgb, var(--ivory) 90%, transparent); text-align: left; }

/* 여정의 순서 */
.path { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-top: 20px; }
.path li { position: relative; padding: 20px 2px 0; font-size: .75rem; font-weight: 600; line-height: 1.35; color: var(--ivory); }
.path li::before { content: ""; position: absolute; top: 3px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; transform: rotate(45deg); background: var(--world); }
.path li + li::after { content: ""; position: absolute; top: 6px; left: calc(-50% + 8px); right: calc(50% + 8px); height: 1px; background: var(--hair); }

/* ── 영혼 도감 — 인물마다 한 갈래, 갈래 안에 영혼 카드와 인물 그림 ─────
   수집 게임의 인물 목록처럼: 제목 판, 연 카드 수, 갈래 탭, 고르기 줄, 네 줄 카드 판.
   금박은 열린 카드와 고른 것에만, 잠긴 카드는 흐리게 가리고 자물쇠를 올린다. */
.dex-title { display: flex; align-items: center; justify-content: center; gap: 12px; color: color-mix(in srgb, var(--gold) 70%, transparent); }
.dex-title::before, .dex-title::after { content: ""; flex: 0 1 56px; height: 1px; background: linear-gradient(90deg, transparent, var(--line)); }
.dex-title::after { transform: scaleX(-1); }
.dex-title svg { flex: none; width: 9px; }
.dex-title h2 { font-family: var(--serif); font-weight: 900; font-size: 1.4375rem; line-height: 1.38; letter-spacing: .04em; color: var(--ivory); }

.ledger { margin-top: 16px; }
.ledger-n { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 16px; border-radius: var(--r-pill); border: 1px solid var(--hair); background: color-mix(in srgb, var(--velvet) 70%, transparent); font-size: var(--t-xs); font-variant-numeric: tabular-nums; color: var(--mist); }
.ledger-n span { color: var(--ivory); }
.ledger-n b { font-family: var(--serif); font-weight: 900; font-size: 1.125rem; line-height: 1; color: var(--gold); }
.bar { width: min(220px, 60%); height: 2px; margin: 10px auto 0; background: var(--hair); }
.bar i { display: block; height: 100%; background: var(--gold); transition: width .6s ease; }

/* 카드 판 — 겹선 테두리와 네 귀퉁이 */
.dex-frame {
  position: relative;
  margin-top: 16px;
  padding: 10px 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--velvet-2) 72%, transparent), color-mix(in srgb, var(--velvet) 50%, transparent));
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--night) 60%, transparent), inset 0 0 0 4px var(--hair);
}
@media (min-width: 768px) { .dex-frame { padding: 14px 14px 18px; } }

.dex-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dex-tabs button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--hair);
  background: color-mix(in srgb, var(--night) 45%, transparent);
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--t-s);
  color: var(--mist);
  transition: color .2s, border-color .2s, background-color .2s;
}
.dex-tabs button small { margin-left: 6px; font-family: var(--ui); font-size: .75rem; font-weight: 500; font-variant-numeric: tabular-nums; opacity: .8; }
.dex-tabs button:hover { color: var(--ivory); }
.dex-tabs button[aria-pressed="true"] { border-color: var(--gold); background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 18%, transparent), color-mix(in srgb, var(--gold) 5%, transparent)); color: var(--gold); }

.dex-realm { margin-top: 10px; font-size: var(--t-xs); font-variant-numeric: tabular-nums; color: var(--mist); }
.dex-realm b { font-weight: 600; color: var(--world-soft); }

.dex { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 6px; margin-top: 10px; }
@media (min-width: 768px) { .dex { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 10px; } }
@media (min-width: 1024px) { .dex { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.dex-none { grid-column: 1 / -1; padding: 36px 12px; font-size: var(--t-s); color: var(--mist); }

/* 카드 한 칸 — 그림, 번호, 이름, 아래 가운데의 원소 */
.slot {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 3px 3px 12px;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--mist) 30%, transparent);
  background: linear-gradient(180deg, var(--velvet-2), var(--night));
  text-align: center;
  transition: transform .25s cubic-bezier(.2, .7, .1, 1), border-color .2s, box-shadow .2s;
  animation: tile-in .4s cubic-bezier(.2, .7, .1, 1) both;
}
@keyframes tile-in { from { opacity: 0; transform: translateY(6px); } }
.slot:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--ivory) 45%, transparent); }
.slot:active { transform: scale(.97); }
.slot-art { position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 4px; background: #000; }
.slot-art img { width: 100%; height: 100%; object-fit: cover; }
.slot-art::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ivory) 14%, transparent), inset 0 -22px 18px -14px color-mix(in srgb, var(--night) 80%, transparent); pointer-events: none; }
.slot-no { position: absolute; top: 3px; left: 3px; z-index: 1; padding: 2px 4px; border-radius: 3px; background: color-mix(in srgb, var(--night) 70%, transparent); font-family: var(--latin); font-size: .5625rem; line-height: 1; letter-spacing: .06em; color: var(--mist); }
.slot-nm {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  height: 2.6em;
  margin-top: 5px;
  padding: 0 1px;
  font-size: .6875rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.02em;
  color: var(--ivory);
}
@media (min-width: 768px) { .slot-nm { font-size: .75rem; } }

/* 명식 — 이름 아래, 가는 금선 사이에 놓인 두 글자 */
.pillar { display: flex; align-items: center; justify-content: center; gap: .18em; margin-top: 4px; font-family: var(--ui); font-weight: 600; font-size: .75rem; line-height: 1.2; letter-spacing: .14em; color: var(--mist); }
.pillar::before, .pillar::after { content: ""; flex: 0 1 14px; height: 1px; background: linear-gradient(90deg, transparent, currentColor); opacity: .7; }
.pillar::after { transform: scaleX(-1); }
.pillar i { font-style: normal; }
.slot.got .pillar { color: transparent; background: var(--foil); -webkit-background-clip: text; background-clip: text; }
.slot.got .pillar::before, .slot.got .pillar::after { color: var(--gold); }
.slot .pillar { margin-bottom: 4px; }
.sheet .pillar { margin-top: 6px; gap: .3em; font-size: 1rem; color: var(--gold); }
.sheet .pillar::before, .sheet .pillar::after { flex-basis: 34px; }

/* 원소 — 칸 아래 테두리에 걸친 둥근 표식 */
.el { position: absolute; left: 50%; bottom: -9px; z-index: 1; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid currentColor; background: var(--night); transform: translateX(-50%); }
.el svg { width: 11px; height: 11px; }
.el-wood { color: #86cf9a; }
.el-fire { color: #ff8a73; }
.el-earth { color: #dcb070; }
.el-metal { color: #dfe3ea; }
.el-water { color: #7fb2ee; }

/* 열린 카드 — 금박 테두리 */
.slot.got { border-color: color-mix(in srgb, var(--gold) 60%, transparent); box-shadow: 0 0 18px -8px var(--gold); }
.slot.got .slot-nm { color: var(--gold); }
.slot.got .slot-no { color: var(--gold); }
/* 잠긴 카드 — 흐린 그림(x_)만 싣고, 그 위를 한 번 더 흐려 색의 덩어리만 남긴다 */
.slot.not .slot-art img, .sheet .big.not img { filter: blur(3px) brightness(.8) saturate(.9); transform: scale(1.08); }
.slot.not .slot-nm { color: var(--mist); }
.slot-lock { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; color: color-mix(in srgb, var(--ivory) 78%, transparent); }
.slot-lock svg { width: 30%; max-width: 40px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .7)); }
/* 인물 그림 — 문을 구매하면 모두 열린다 */
.slot.scene.got { border-color: color-mix(in srgb, var(--mist) 30%, transparent); box-shadow: none; }
.slot.scene.got .slot-nm { color: var(--ivory); }
/* 방금 펼쳐 본 카드 — 그 차원의 색 */
.slot.is-on { border-color: var(--world); box-shadow: 0 0 0 1px var(--world), 0 0 22px -10px var(--world); }

/* 고르기 줄 — 탭 아래, 카드 판 위. 왼쪽에 모습, 오른쪽에 열린 카드만 · 원소 · 순서 */
.dex-tools { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dex-tools[hidden] { display: none; }
.dex-tools > button, .dex-tools .pick select, .seg {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--hair);
  background: color-mix(in srgb, var(--night) 55%, transparent);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--ivory);
}
.dex-tools > button { flex: none; padding: 0 8px; }
.dex-tools > button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.dex-tools .pick { position: relative; display: block; }
.dex-tools .pick select { height: 40px; padding: 0 22px 0 8px; font-family: inherit; -webkit-appearance: none; appearance: none; cursor: pointer; }
.dex-tools .pick::after { content: ""; position: absolute; right: 9px; top: 50%; width: 6px; height: 6px; border: solid var(--mist); border-width: 0 1.5px 1.5px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.dex-tools .pick option { background: var(--velvet); color: var(--ivory); }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; margin-right: auto; }
.seg button { min-width: 38px; padding: 0 7px; border-radius: 5px; font-size: var(--t-xs); font-weight: 600; color: var(--mist); }
.seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }

.aside-note { max-width: var(--read); margin: 18px auto 0; font-size: var(--t-xs); line-height: 1.6; color: var(--mist); text-wrap: balance; }

/* 카드를 펼쳐 본다 */
.unfold { width: min(420px, calc(100vw - 24px)); max-width: none; max-height: none; padding: 0; border: 0; background: none; color: var(--ivory); overflow: visible; }
.unfold::backdrop { background: color-mix(in srgb, var(--deep) 82%, transparent); }
.unfold[open] .sheet { animation: unfold .5s cubic-bezier(.2, .7, .1, 1); }
@keyframes unfold { from { opacity: 0; transform: perspective(900px) rotateX(-10deg) translateY(18px) scale(.95); } }
.sheet {
  position: relative;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 26px 20px 20px;
  border-radius: 14px;
  border: 1px solid var(--hair);
  background: radial-gradient(120% 46% at 50% 0%, color-mix(in srgb, var(--world) 16%, var(--velvet-2)), var(--velvet) 70%);
  text-align: center;
}
.sheet-x { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; display: grid; place-items: center; color: var(--mist); }
.sheet-x:hover { color: var(--ivory); }
.sheet-x svg { width: 16px; height: 16px; }
.sheet .big {
  position: relative;
  width: 54%;
  max-width: 200px;
  aspect-ratio: 2 / 3;
  margin: 6px auto 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--world);
  background: #000;
  box-shadow: 0 0 40px -14px var(--world), 0 18px 30px -14px rgba(0, 0, 0, .9);
}
.sheet .big img { width: 100%; height: 100%; object-fit: cover; }
.sheet .big.not { border-color: var(--hair); box-shadow: 0 18px 30px -14px rgba(0, 0, 0, .9); }
.sheet .big.wide { width: 72%; max-width: 260px; }
.sheet .seg { margin: 12px auto 0; min-height: 36px; }
.sheet .facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: baseline; }
.sheet .facts dd { margin: 0; }
.sheet .kind { margin-top: 18px; font-size: var(--t-xs); font-weight: 600; color: var(--world-soft); }
.sheet h3 { margin-top: 4px; font-family: var(--serif); font-weight: 900; font-size: 1.75rem; line-height: 1.25; letter-spacing: -.025em; }
.sheet .title { margin-top: 2px; font-family: var(--serif); font-weight: 700; font-size: var(--t-s); color: var(--mist); }
.sheet .line { margin-top: 14px; font-size: var(--t-s); line-height: 1.7; color: var(--ivory); text-wrap: balance; }
.sheet dl { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hair); text-align: left; }
.sheet dt { font-size: .75rem; color: var(--mist); }
.sheet dd { margin: 2px 0 12px; font-size: var(--t-s); line-height: 1.65; }
.sheet .why {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 4px;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--t-s);
  text-align: left;
  color: var(--ivory);
}
.sheet .why:hover { color: var(--world-soft); }
.sheet .why svg { flex: none; width: 14px; height: 14px; color: var(--mist); }
.sheet .btn { margin-top: 14px; min-height: 52px; font-size: var(--t-m); }

/* ── 인물과 대화 — 문 너머의 접견실 ─────────────────── */
.chamber {
  margin-top: 16px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--hair);
  background: linear-gradient(color-mix(in srgb, var(--world) 7%, var(--velvet-2)), var(--velvet) 46%);
  text-align: left;
}
.lobby[hidden], .chamber[hidden] { display: none; }
/* 대화방이 열리면 화면 높이를 기록에 내어 준다 */
.page-talk > .sec:has(> .chamber:not([hidden])) { padding-top: 10px; }
.page-talk .lobby[hidden] + .chamber { margin-top: 0; }
.host { display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 2px; border-bottom: 1px solid var(--hair); }
.host .back { flex: none; width: 44px; height: 44px; display: grid; place-items: center; color: var(--mist); }
.host .back:hover { color: var(--ivory); }
.host .back svg { width: 18px; height: 18px; transform: rotate(180deg); }
.host .host-id { flex: 1; min-width: 0; }
.host .card-btn { flex: none; min-height: 44px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--hair); font-size: var(--t-xs); font-weight: 600; color: var(--ivory); transition: border-color .15s, color .15s; }
.host .card-btn:hover { border-color: var(--world); color: var(--world-soft); }
.host .por { flex: none; width: 50px; aspect-ratio: 4 / 5; padding: 1px; background: var(--world); clip-path: url(#ogive); }
.host .por img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; clip-path: url(#ogive); }
.host .rel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-xs); font-weight: 600; color: var(--world-soft); }
.host .nm { font-family: var(--serif); font-weight: 900; font-size: 1.375rem; line-height: 1.25; letter-spacing: -.02em; }

/* 대화는 말풍선이 아니라 받아 적은 기록처럼 */
.log { display: grid; gap: 18px; max-height: min(520px, 62vh); overflow-y: auto; padding: 20px 16px 8px; scrollbar-width: thin; scrollbar-color: var(--hair) transparent; }
.log:focus-visible { outline-offset: -3px; }
.say .by { font-size: .6875rem; font-weight: 600; letter-spacing: .08em; color: var(--mist); }
.say p { margin-top: 4px; padding-left: 13px; border-left: 1px solid var(--hair); }
.say.them .by { color: var(--world-soft); }
.say.them p { border-left-color: color-mix(in srgb, var(--world) 70%, transparent); font-family: var(--voice); font-weight: 400; font-size: 1.0625rem; line-height: 1.9; letter-spacing: -.005em; word-break: keep-all; color: var(--ivory); }
.say.me p { font-family: var(--guest); font-size: var(--t-s); line-height: 1.7; word-break: keep-all; color: var(--mist); }
.say { animation: say-in .4s ease both; }
@keyframes say-in { from { opacity: 0; transform: translateY(6px); } }
.say.wait p { color: var(--mist); font-family: var(--ui); font-weight: 400; font-size: var(--t-s); }
.say.wait i { display: inline-block; width: 4px; height: 4px; margin-left: 4px; border-radius: 50%; background: var(--world); vertical-align: middle; animation: dot 1.2s ease-in-out infinite; }
.say.wait i:nth-child(2) { animation-delay: .2s; }
.say.wait i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
/* 답 위의 이름표 옆 — 어느 갈래로 답했는지 */
.say .by i { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--hair); font-style: normal; font-weight: 500; letter-spacing: 0; color: var(--mist); }
.say.them p { white-space: pre-line; }
/* 인물이 아니라 Gate 가 직접 하는 말 */
.say.gate p { border-left-color: var(--rose); font-size: var(--t-s); line-height: 1.7; color: var(--ivory); }
/* 잘 아는 인물에게 넘기는 단추 */
.say .hand { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: 8px 0 0 13px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line); font-size: var(--t-xs); font-weight: 700; color: var(--gold); transition: background .15s; }
.say .hand:hover { background: color-mix(in srgb, var(--gold) 9%, transparent); }
.say .hand svg { width: 12px; height: 12px; }
.say.fail p { border-left-color: var(--rose); color: var(--ivory); font-family: var(--ui); font-weight: 400; font-size: var(--t-s); }
.say.fail button { display: inline-flex; align-items: center; min-height: 44px; margin-left: 13px; font-size: var(--t-xs); font-weight: 600; color: var(--rose); text-decoration: underline; text-underline-offset: 4px; }

/* 인물이 잘 알려 주는 것 — 갈래를 고르면 아래 질문이 바뀐다 */
.topics { display: flex; gap: 18px; padding: 4px 16px 0; border-top: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
.topics::-webkit-scrollbar { display: none; }
.topics button { flex: none; min-height: 44px; border-bottom: 2px solid transparent; font-size: var(--t-xs); font-weight: 600; color: var(--mist); white-space: nowrap; transition: color .15s, border-color .15s; }
.topics button:hover { color: var(--ivory); }
.topics button[aria-pressed="true"] { border-bottom-color: var(--gold); color: var(--gold); font-weight: 700; }
.topics button:focus-visible { outline-offset: -2px; }

.asks { display: flex; gap: 8px; padding: 10px 16px 4px; overflow-x: auto; scrollbar-width: none; }
.asks::-webkit-scrollbar { display: none; }
.asks button {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--hair);
  font-size: var(--t-xs);
  color: var(--ivory);
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.asks button:hover { border-color: var(--world); color: var(--world-soft); }
.asks button:disabled, .ask-form button:disabled { opacity: .4; cursor: default; }

.ask-form { display: flex; align-items: flex-end; gap: 10px; padding: 8px 16px 6px; }
.ask-form input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--mist) 34%, transparent);
  border-radius: 0;
  background: none;
  font-size: 1rem;
  outline: none;
  transition: border-color .15s;
}
.ask-form input, .asks button, .quota { font-family: var(--guest); }
.ask-form input::placeholder { color: color-mix(in srgb, var(--mist) 70%, transparent); }
.ask-form input:focus { border-bottom-color: var(--world); }
.ask-form input:focus-visible { outline: none; box-shadow: 0 1px 0 var(--world); }
.ask-form button { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--foil); color: var(--on-gold); }
.ask-form button svg { width: 18px; height: 18px; }
.quota { padding: 4px 16px 16px; font-size: .75rem; color: var(--mist); }

/* 무료로 건넬 수 있는 질문을 다 쓴 뒤 */
.toll { margin: 6px 16px 16px; padding: 16px; border-radius: 10px; border: 1px solid var(--line); text-align: center; }
.toll b { display: block; font-family: var(--serif); font-weight: 700; font-size: var(--t-m); color: var(--gold); }
.toll p { margin-top: 4px; font-size: var(--t-xs); color: var(--mist); }
.toll .btn { margin-top: 12px; min-height: 48px; font-size: var(--t-s); }

/* ── 인물 목록 — 한 줄이 한 인물 ───────────────────────────
   줄의 색 --w 는 그 인물의 세계 색(index.html 이 줄마다 넣는다) */
.ask-pass { margin-top: 12px; font-size: var(--t-xs); color: var(--mist); }
.ask-pass b { margin: 0 1px 0 4px; font-size: var(--t-m); font-variant-numeric: tabular-nums; color: var(--gold); }
.cast { display: grid; gap: 10px; margin-top: 18px; text-align: left; }
.cast-row {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--hair);
  background: linear-gradient(100deg, color-mix(in srgb, var(--w) 10%, var(--velvet-2)), var(--velvet) 62%);
  transition: border-color .15s;
}
.cast-row:hover { border-color: color-mix(in srgb, var(--w) 55%, transparent); }
.cast-row.is-on { border-color: var(--line); }
.cast-face { flex: none; width: 88px; padding: 12px 0 12px 14px; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--w) 42%, transparent)); }
.cast-face img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 8%; clip-path: url(#ogive); transition: transform .2s; }
.cast-face:hover img { transform: scale(1.04); }
.cast-main { flex: 1; min-width: 0; display: grid; align-content: center; gap: 6px; padding: 14px 16px 14px 14px; text-align: left; }
.cast-face:focus-visible, .cast-main:focus-visible { outline-offset: -3px; }
.cast-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cast-top b { flex: none; font-family: var(--serif); font-weight: 900; font-size: 1.25rem; line-height: 1.25; letter-spacing: -.02em; }
.cast-top i { flex: none; align-self: center; padding: 0 6px; border-radius: var(--r-pill); border: 1px solid var(--rose); font-style: normal; font-size: .6875rem; font-weight: 700; line-height: 16px; color: var(--rose); }
.cast-top small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-xs); font-weight: 600; color: color-mix(in srgb, var(--w) 72%, #fff); }
.cast-last { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-family: var(--voice); font-weight: 400; font-size: var(--t-s); line-height: 1.55; color: var(--ivory); }
.cast-knows { display: flex; flex-wrap: wrap; gap: 6px; }
.cast-knows em { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-pill); border: 1px solid var(--hair); font-style: normal; font-size: .75rem; line-height: 1; color: var(--mist); white-space: nowrap; }

/* ── 인물 카드 — 카드를 펼치는 판 안에 그린다 ───────────────── */
.sheet .pcard {
  position: relative;
  width: 62%;
  max-width: 230px;
  aspect-ratio: 3 / 4;
  margin: 6px auto 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--world);
  background: var(--deep);
  box-shadow: 0 0 40px -14px var(--world), 0 18px 30px -14px color-mix(in srgb, var(--deep) 90%, transparent);
}
.pcard img { width: 100%; height: 100%; object-fit: cover; }
.pcard::after { content: ""; position: absolute; inset: 5px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); pointer-events: none; }
.pcard-no { position: absolute; top: 11px; left: 14px; font-family: var(--latin); font-weight: 700; font-size: .875rem; color: var(--gold); text-shadow: 0 1px 6px var(--deep); }
.pcard-realm { position: absolute; inset: auto 0 0; padding: 26px 12px 12px; background: linear-gradient(transparent, color-mix(in srgb, var(--deep) 90%, transparent)); font-size: .75rem; font-weight: 600; color: var(--ivory); }
.sheet .quote { margin-top: 12px; font-family: var(--serif); font-weight: 700; font-size: var(--t-s); line-height: 1.7; color: var(--ivory); text-wrap: balance; }
.sheet .quote::before { content: "\201C"; }
.sheet .quote::after { content: "\201D"; }
.sheet .knows-h { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hair); text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .04em; color: var(--world-soft); }
.sheet .facts + .knows-h { margin-top: 4px; }
.knows, .passes { text-align: left; }
.knows button { position: relative; display: grid; gap: 2px; width: 100%; min-height: 44px; padding: 11px 26px 11px 0; border-bottom: 1px solid var(--hair); text-align: left; }
.knows li:last-child button { border-bottom: 0; }
.knows b { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 700; font-size: var(--t-m); color: var(--ivory); }
.knows b i { padding: 0 7px; border-radius: var(--r-pill); border: 1px solid var(--line); font-family: var(--ui); font-style: normal; font-size: .6875rem; font-weight: 700; line-height: 18px; color: var(--gold); white-space: nowrap; }
.knows span { font-size: var(--t-xs); line-height: 1.55; color: var(--mist); }
.knows button:hover b { color: var(--world-soft); }
.knows svg, .passes svg { position: absolute; top: 50%; right: 4px; width: 14px; height: 14px; margin-top: -7px; color: var(--mist); }
.passes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.passes button { position: relative; display: grid; width: 100%; min-height: 50px; align-content: center; padding: 6px 24px 6px 10px; border-radius: 8px; border: 1px solid var(--hair); text-align: left; transition: border-color .15s; }
.passes button:hover { border-color: var(--world); }
.passes span { font-size: .75rem; color: var(--mist); }
.passes b { font-size: var(--t-xs); font-weight: 700; color: var(--ivory); }

/* 묻고 답하기 */
.faq { margin-top: 14px; text-align: left; }
.faq details { border-bottom: 1px solid var(--hair); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-right: 1.5px solid var(--mist);
  border-bottom: 1.5px solid var(--mist);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.faq p { padding: 0 24px 18px 0; font-size: var(--t-s); color: var(--mist); }

/* 마지막 부름 */
.last {
  max-width: var(--read);
  margin: 56px auto 0;
  padding: 30px 18px 22px;
  border-radius: 14px;
  border: 1px solid var(--hair);
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--world) 18%, var(--velvet-2)), var(--velvet) 70%);
  text-align: center;
}
@media (max-width: 552px) { .last { margin-inline: var(--gutter); } }
.last > svg { width: 36px; margin: 0 auto 10px; color: var(--gold); }
.last h2 { font-family: var(--serif); font-weight: 900; font-size: 1.375rem; line-height: 1.38; letter-spacing: -.02em; }
.last p { margin-top: 6px; font-size: var(--t-s); color: var(--mist); }
.last .btn { margin-top: 18px; }
.last .other { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; font-size: var(--t-xs); color: var(--mist); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--hair); }
.last .other:hover { color: var(--ivory); }

/* 발 */
.foot { margin-top: 44px; padding: 24px var(--gutter) 0; border-top: 1px solid var(--hair); font-size: var(--t-xs); line-height: 1.75; color: var(--mist); }
.foot .brand { margin-bottom: 12px; color: var(--mist); }
.foot .brand b { font-size: 1rem; }
.foot .brand svg { width: 22px; height: 22px; }
.foot a { text-decoration: underline; text-underline-offset: 3px; }
.foot p + p { margin-top: 10px; }

/* 떠 있는 내비 — 세 쪽을 넘기는 탭: 문 · 도감 · 대화 */
.dock {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 30;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(320px, calc(100% - 28px));
  padding: 5px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hair);
  background: color-mix(in srgb, var(--velvet) 86%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
.dock button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 50px;
  border-radius: var(--r-pill);
  font-size: .75rem;
  line-height: 1;
  color: var(--mist);
  transition: color .15s, background .15s;
}
.dock svg { width: 20px; height: 20px; }
.dock button:hover { color: var(--ivory); }
.dock button[aria-selected="true"] { background: color-mix(in srgb, var(--gold) 10%, transparent); color: var(--gold); }

/* ── 메뉴 서랍 — 오른쪽에서 나온다 ─────────────────────── */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  width: min(340px, 86vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--hair);
  background: linear-gradient(var(--velvet-2), var(--velvet) 40%);
  color: var(--ivory);
  box-shadow: -22px 0 60px rgba(0, 0, 0, .55);
  overflow-y: auto;
}
.drawer::backdrop { background: color-mix(in srgb, var(--deep) 66%, transparent); }
.drawer[open] { animation: drawer-in .28s cubic-bezier(.22, .7, .3, 1); }
@keyframes drawer-in { from { transform: translateX(100%); } }
.drawer-in { padding: 8px 18px 30px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; height: 48px; margin-bottom: 8px; }
.drawer-head .brand b { font-size: 1rem; }
.drawer-head .brand svg { width: 22px; height: 22px; }
.drawer-x { width: 44px; height: 44px; margin-right: -12px; display: grid; place-items: center; color: var(--mist); }
.drawer-x:hover { color: var(--ivory); }
.drawer-x svg { width: 16px; height: 16px; }

/* 로그인 */
.drawer .me { padding: 16px; border-radius: 12px; border: 1px solid var(--hair); background: color-mix(in srgb, var(--night) 40%, transparent); }
.drawer .me b { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.0625rem; line-height: 1.4; }
.drawer .me p { margin-top: 2px; font-size: var(--t-xs); line-height: 1.55; color: var(--mist); }
.kakao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border-radius: 8px;
  background: #fee500;
  font-size: var(--t-s);
  font-weight: 700;
  color: #191600;
}
.kakao:hover { background: #ffeb3b; }
.kakao svg { width: 18px; height: 18px; }
.drawer .me .out { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; font-size: var(--t-xs); color: var(--mist); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--hair); }
.drawer .me .out:hover { color: var(--ivory); }

/* 접는 줄 — 한 번에 하나만 펼친다 */
.rows { margin-top: 14px; }
.row-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  border-top: 1px solid var(--hair);
  font-size: var(--t-m);
  font-weight: 600;
  text-align: left;
  color: var(--ivory);
}
.row-btn:hover { color: var(--gold); }
.row-btn > svg:first-child { flex: none; width: 20px; height: 20px; color: var(--mist); }
.row-btn .cv { flex: none; width: 12px; height: 12px; margin-left: auto; color: var(--mist); transform: rotate(90deg); transition: transform .2s; }
.row-btn[aria-expanded="true"] .cv { transform: rotate(-90deg); }
.fold { padding: 2px 0 18px; font-size: var(--t-s); color: var(--mist); }
.fold p { line-height: 1.65; }
.fold p + p { margin-top: 8px; }
.fold ol { counter-reset: n; }
.fold ol li { position: relative; padding: 0 0 10px 30px; line-height: 1.55; counter-increment: n; }
.fold ol li::before { content: counter(n, upper-roman); position: absolute; left: 0; top: 1px; width: 22px; font-family: var(--latin); font-size: .8125rem; color: var(--ivory); }
.fold ol b { display: block; font-weight: 600; color: var(--ivory); }
.fold .item { display: block; padding: 11px 12px; margin-bottom: 8px; border-radius: 8px; border: 1px solid var(--hair); color: var(--ivory); }
.fold .item:hover { border-color: var(--gold); }
.fold .item b { display: block; font-weight: 600; font-size: var(--t-s); }
.fold .item span { font-size: .75rem; color: var(--mist); }
.fold .empty { padding: 16px 12px; border-radius: 8px; border: 1px dashed var(--hair); font-size: var(--t-xs); line-height: 1.7; text-align: center; }
.fold .go { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: var(--t-s); font-weight: 600; color: var(--ivory); }
.fold .go:hover { color: var(--gold); }
.fold .go svg { width: 12px; height: 12px; }
.fold a.mail { color: var(--ivory); text-decoration: underline; text-underline-offset: 3px; }
.drawer-foot { margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--hair); font-size: .75rem; line-height: 1.7; color: var(--mist); }

/* 알림 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 100;
  transform: translateX(-50%);
  max-width: min(420px, 90vw);
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid var(--hair);
  background: var(--velvet-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  font-size: var(--t-xs);
  line-height: 1.6;
  text-align: center;
  color: var(--ivory);
  animation: say-in .3s ease both;
}
.toast[hidden] { display: none; }
.toast.has-act { display: grid; gap: 10px; padding: 14px 18px; text-align: left; border-color: var(--line); }
.toast.has-act[hidden] { display: none; }
.toast button { justify-self: start; min-height: 44px; padding: 0 16px; border-radius: var(--r-s); background: var(--gold); font-size: var(--t-xs); font-weight: 700; color: var(--on-gold); }
.toast button:hover { filter: brightness(1.06); }

/* ── 편의 — 이어 읽기 · 공유 ─────────────── */
.share { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; font-size: var(--t-xs); color: var(--mist); }
.share:hover { color: var(--ivory); }
.share svg { width: 15px; height: 15px; }

.resume-box { max-width: 372px; margin: 14px auto 0; }
.resume-box[hidden] { display: none; }
.resume {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--gold) 6%, transparent);
  text-align: left;
}
.resume:hover { background: color-mix(in srgb, var(--gold) 11%, transparent); }
.resume small { display: block; font-size: .75rem; color: var(--gold); }
.resume b { display: block; font-weight: 600; font-size: var(--t-s); line-height: 1.4; }
.resume svg { flex: none; width: 14px; height: 14px; color: var(--gold); }
.resume-more { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--t-xs); color: var(--mist); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--hair); }
.resume-more:hover { color: var(--ivory); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  :root { transition: none; }
  .halo, .spark, .btn-gold::after, .portal.flare .arch-art::before, .say.wait i { animation: none; }
  .slot, .say, .unfold[open] .sheet, .drawer[open], .toast { animation: none; }
  .page { scroll-behavior: auto; }
  .arch-art img, .slot:hover, .slot:active, .card:hover img { transform: none; }
  * { transition-duration: 0s !important; }
}

/* ── 내 명식 — 태어난 순간을 맡겨 두는 창 (카드 판 .unfold · .sheet 를 함께 쓴다) ── */
.soul-line { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 6px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--hair); font-size: var(--t-xs); color: var(--mist); transition: border-color .15s; }
.soul-line:hover { border-color: var(--line); }
.soul-line b { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold); white-space: nowrap; }
.soul-line svg { flex: none; width: 12px; height: 12px; color: var(--gold); }
.soul-mark { width: 44px; margin: 4px auto 0; color: var(--gold); }
.soul-mark svg { display: block; width: 100%; }
.sheet .soul-mark + .kind { margin-top: 10px; font-family: var(--latin); letter-spacing: .18em; }
.soul-saved { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.soul-saved li { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: color-mix(in srgb, var(--gold) 7%, transparent); font-family: var(--serif); font-weight: 700; font-size: var(--t-s); font-variant-numeric: tabular-nums; color: var(--ivory); }
.soul-form { display: grid; gap: 14px; margin-top: 18px; text-align: left; }
.soul-f { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.soul-f > span, .soul-f > legend { padding: 0; font-size: .75rem; font-weight: 600; color: var(--world-soft); }
.soul-f > legend { margin-bottom: 6px; }
.soul-f input[type="date"], .soul-f select {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--mist) 34%, transparent);
  background: color-mix(in srgb, var(--night) 55%, transparent);
  font: inherit;
  font-size: 1rem;
  color: var(--ivory);
  color-scheme: dark;
}
.soul-f input[type="date"]:focus-visible, .soul-f select:focus-visible { outline: none; border-color: var(--world); box-shadow: 0 0 0 1px var(--world); }
.soul-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.soul-pick label { position: relative; display: grid; }
.soul-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.soul-pick span { display: grid; place-items: center; height: 48px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--mist) 34%, transparent); font-size: var(--t-s); font-weight: 600; color: var(--mist); transition: border-color .15s, color .15s, background .15s; }
.soul-pick input:checked + span { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 9%, transparent); color: var(--gold); font-weight: 700; }
.soul-pick input:focus-visible + span { outline: 2px solid var(--ivory); outline-offset: 3px; }
.soul-note { margin-top: 12px; font-size: .75rem; line-height: 1.65; color: var(--mist); text-wrap: pretty; }
.soul-form .soul-note { margin-top: 0; }
.soul-note a { color: var(--ivory); text-decoration: underline; text-underline-offset: 3px; }
.soul-err { margin-top: 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--rose); font-size: var(--t-xs); color: var(--ivory); }
.soul-form .soul-err { margin-top: 0; }
.soul-form .btn { margin-top: 0; }
.soul-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.soul-two .btn { margin-top: 0; min-height: 48px; font-size: var(--t-s); }
.soul-two .soul-drop { border-color: var(--rose); color: var(--rose); }
.sheet .kakao { margin-top: 16px; }

/* 내 명식 — 맡겨 둔 값으로 세운 명식 (네 기둥 · 원소와 힘 · 흐름). 원소의 색은 .el-<원소> 의 글자색을 물려받는다 */
.sheet .soul-tabs { display: grid; margin: 16px 0 0; min-height: 44px; border-radius: 8px; border: 1px solid var(--hair); }
.soul-chart { text-align: left; }
.soul-chart .knows-h small { margin-left: 6px; font-weight: 400; letter-spacing: 0; color: var(--mist); }
.soul-chart .line { margin-top: 6px; }
.soul-chart .facts dd small { margin-left: 6px; font-size: .75rem; color: var(--mist); }
.soul-chart .soul-note b { color: var(--gold); }
.mp { width: 100%; margin-top: 12px; table-layout: fixed; border-collapse: separate; border-spacing: 6px 3px; }
.mp th { font-size: .75rem; font-weight: 600; text-align: center; color: var(--mist); }
.mp th[scope="row"] { width: 30px; text-align: left; font-size: .6875rem; font-weight: 400; }
.mp thead td { width: 30px; }
.mp td { padding: 0; text-align: center; }
.mp .f { display: block; min-height: 18px; font-size: .6875rem; line-height: 18px; color: var(--mist); }
.mp tbody tr:first-child .me .f { color: var(--gold); font-weight: 700; }
.mp .t { display: grid; justify-items: center; padding: 8px 0 6px; border-radius: 8px; border: 1px solid color-mix(in srgb, currentColor 44%, transparent); background: color-mix(in srgb, currentColor 9%, transparent); }
.mp .t b { font-family: var(--serif); font-weight: 900; font-size: 1.625rem; line-height: 1.2; }
.mp .t small { font-size: .6875rem; opacity: .86; }
.mp tr:nth-child(2) .me .t { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.mp .none .t { border-style: dashed; color: var(--mist); }
.sself { margin-top: 10px; font-size: var(--t-s); color: var(--mist); }
.sself b { margin-right: 8px; font-family: var(--serif); font-weight: 900; font-size: 1.25rem; }
.sbars { display: grid; gap: 9px; margin-top: 12px; }
.sbars li { display: grid; grid-template-columns: 40px 1fr 36px; align-items: center; gap: 10px; font-size: var(--t-xs); font-weight: 600; }
.sbars li:not([class*="el-"]) { color: var(--mist); }
.sbars li.lead { color: var(--gold); }
.sbars i { display: block; height: 6px; border-radius: 3px; background: var(--hair); overflow: hidden; }
.sbars i::before { content: ""; display: block; width: var(--w); height: 100%; border-radius: 3px; background: currentColor; }
.sbars em { font-style: normal; font-weight: 400; font-variant-numeric: tabular-nums; text-align: right; color: var(--mist); }
.sguard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 16px; }
.sguard li { display: grid; gap: 2px; padding: 10px 8px; border-radius: 8px; border: 1px solid color-mix(in srgb, currentColor 36%, transparent); background: color-mix(in srgb, currentColor 7%, transparent); text-align: center; }
.sguard small { font-size: .6875rem; color: var(--mist); }
.sguard b { font-family: var(--serif); font-weight: 900; font-size: 1.125rem; }
.sguard span { font-size: .6875rem; line-height: 1.45; color: var(--mist); text-wrap: balance; }
.sflow { display: grid; margin-top: 6px; }
.sflow li { display: grid; grid-template-columns: 68px auto 1fr auto; align-items: center; gap: 10px; min-height: 52px; padding: 6px 8px; border-bottom: 1px solid var(--hair); }
.sflow li:last-child { border-bottom: 0; }
.sflow li.now { border-radius: 8px; border: 1px solid var(--line); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.sflow .when, .sflow .what { display: grid; min-width: 0; }
.sflow b { font-size: var(--t-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.sflow small { font-size: .6875rem; font-variant-numeric: tabular-nums; color: var(--mist); }
.sflow .gj { display: flex; gap: 3px; }
.sflow .gj i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; border: 1px solid color-mix(in srgb, currentColor 44%, transparent); background: color-mix(in srgb, currentColor 9%, transparent); font-family: var(--serif); font-style: normal; font-weight: 900; font-size: .875rem; }
.sflow em { padding: 0 7px; border-radius: var(--r-pill); background: var(--gold); font-style: normal; font-size: .6875rem; font-weight: 700; line-height: 18px; color: var(--on-gold); }
.row-btn small { margin-left: auto; padding: 0 8px; border-radius: var(--r-pill); border: 1px solid var(--line); font-size: .6875rem; font-weight: 700; line-height: 18px; color: var(--gold); }
.row-btn small + .cv { margin-left: 0; }

/* ── 마력석 — Gate 의 재화 (2026-10-10) ─────────────────────
   도감의 보유 수 옆 알약, 카드 판 · 대화방의 버튼 안 돌, 충전 창 */
.gem { flex: none; width: 16px; height: 16px; color: var(--gold); }
.btn-gold .gem { color: currentColor; }
.ledger { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.ledger .bar { flex-basis: 100%; }
.stone-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: color-mix(in srgb, var(--gold) 7%, transparent); font-size: var(--t-xs); color: var(--ivory); transition: border-color .15s, background .15s; }
.stone-chip:hover { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.stone-chip b { font-family: var(--serif); font-weight: 900; font-size: 1.125rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--gold); }
.stone-chip i { padding: 0 10px; border-radius: var(--r-pill); background: var(--gold); font-style: normal; font-size: .6875rem; font-weight: 700; line-height: 26px; color: var(--on-gold); }
#stoneLine { margin-left: 6px; }
.row-btn > .gem { width: 20px; height: 20px; color: var(--mist); }
.quota button { min-height: 44px; margin-left: 6px; padding: 0 4px; color: var(--ivory); text-decoration: underline; text-underline-offset: 3px; }
.toll .btn + p { margin-top: 8px; font-variant-numeric: tabular-nums; }
.sheet .btn .gem, .toll .btn .gem { width: 18px; height: 18px; }
.sheet .soul-two .btn { margin-top: 0; }
.stone-mark svg { width: 100%; height: auto; }
.sheet .title .stone-n { margin: 0 2px 0 4px; font-weight: 900; font-size: 1.375rem; font-variant-numeric: tabular-nums; color: var(--gold); }
.stone-uses { display: grid; gap: 6px; margin-top: 14px; text-align: left; }
.stone-uses li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--hair); font-size: var(--t-s); }
.stone-uses b { flex: none; font-family: var(--serif); font-weight: 700; color: var(--gold); }
.stone-packs { margin-top: 18px; text-align: left; }
.soul-form .stone-packs { margin-top: 0; }
.stone-packs .soul-pick { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stone-packs .soul-pick span { height: 60px; align-content: center; gap: 2px; }
.stone-packs .soul-pick b { font-family: var(--serif); font-weight: 900; font-size: var(--t-m); line-height: 1.2; }
.stone-packs .soul-pick small { font-size: .6875rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.stone-agree { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; font-size: .75rem; line-height: 1.65; color: var(--mist); cursor: pointer; }
.stone-agree input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--gold); }
.stone-agree a { color: var(--ivory); text-decoration: underline; text-underline-offset: 3px; }

/* ═══════════════════════════════════════════════════════════════════
   Dark Mythic Editorial (2026-10-10 리디자인)
   위의 규칙 위에 얹는 층 — 공통 부품(작은 표제 · 단추 · 꼬리표 · 판)을 먼저 정리하고,
   머리줄 → 첫 화면 → 세계관 → 이야기 → 영혼 카드 미리보기 → 도감 · 대화 → 첫 장 열기 → 넓은 화면 순서로 적는다.
   ═══════════════════════════════════════════════════════════════════ */

/* ── 공통 부품 ─────────────────────────── */
.skip { position: absolute; left: 8px; top: -60px; z-index: 300; padding: 10px 14px; border-radius: var(--r-s); background: var(--gold); font-weight: 700; color: var(--on-gold); }
.skip:focus { top: 8px; }

/* 작은 표제 — 구획 제목 위의 한 줄. 금색은 여기와 제목의 이름에만 */
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 14px; font-family: var(--serif); font-weight: 500; font-size: .75rem; letter-spacing: .32em; text-indent: .32em; color: var(--gold); }
.eyebrow::before, .eyebrow::after { content: ""; width: 32px; height: 1px; background: linear-gradient(90deg, transparent, var(--line)); }
.eyebrow::after { transform: scaleX(-1); }

.sec { padding-top: var(--s-8); }
.sec > h2, .lobby > h2, .dex-title h2 { font-weight: 700; font-size: 1.5rem; line-height: 1.36; letter-spacing: -.02em; }
.sec > .sub, .lobby > .sub { max-width: 36em; margin-inline: auto; line-height: 1.7; }

/* 단추 — 각진 모서리. 금색 채움은 그 화면의 가장 중요한 행동 하나에만 */
.btn { min-height: 54px; border-radius: var(--r-s); font-size: var(--t-m); font-weight: 700; letter-spacing: .01em; }
.btn-gold { background: var(--foil); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--foil-1) 80%, transparent), 0 14px 30px -16px var(--gold); }
.btn-gold:hover { filter: brightness(1.05); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--foil-1) 80%, transparent), 0 0 34px -8px var(--gold); }
.btn-line { border-color: color-mix(in srgb, var(--ivory) 30%, transparent); }
.btn-line:hover { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); color: var(--foil-1); }
.btn-soon { border-style: dashed; font-size: var(--t-s); }
.btn:disabled { opacity: .5; cursor: default; }
.text-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-size: var(--t-xs); color: var(--mist); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--hair); }
.text-link:hover { color: var(--ivory); }

.tag { border-radius: 2px; }
.tag-open { border-color: var(--line); color: var(--gold); font-weight: 700; }
.tag-soon { border-style: dashed; }

/* 상태 표시 — 발견한 카드 · 새 카드 · 잠긴 카드 */
.legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: .75rem; color: var(--mist); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend li::before { content: ""; width: 10px; height: 14px; border-radius: 2px; border: 1px solid var(--hair); }
.legend .lg-got::before { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 26%, transparent); }
.legend .lg-new::before { border-color: var(--world); background: var(--world); }
.legend .lg-lock::before { border-style: dashed; }

/* 구획이 떠오르는 움직임 (index.html 14.) */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s var(--ease); }
.rv.in { opacity: 1; transform: none; }

/* 배경 — 별은 줄이고, 그 세계의 빛은 위쪽에 옅게만 */
body::before {
  background:
    radial-gradient(1px 1px at 24px 38px, color-mix(in srgb, var(--ivory) 55%, transparent) 50%, transparent 52%),
    radial-gradient(1px 1px at 150px 92px, color-mix(in srgb, var(--mist) 50%, transparent) 50%, transparent 52%),
    radial-gradient(1px 1px at 62px 168px, color-mix(in srgb, var(--ivory) 32%, transparent) 50%, transparent 52%),
    radial-gradient(64% 38% at 50% 0%, color-mix(in srgb, var(--world) 13%, transparent), transparent 70%),
    radial-gradient(56% 34% at 100% 36%, color-mix(in srgb, var(--haze-1) 11%, transparent), transparent 70%),
    radial-gradient(60% 36% at 0% 78%, color-mix(in srgb, var(--haze-2) 16%, transparent), transparent 70%),
    linear-gradient(var(--sky), var(--night) 55%);
  background-size: 220px 220px, 220px 220px, 220px 220px, auto, auto, auto, auto;
}

/* ── 머리줄 ───────────────────────────── */
.top { height: 60px; border-bottom: 1px solid var(--hair); background: color-mix(in srgb, var(--night) 86%, transparent); }
.brand b { font-weight: 700; font-size: 1.125rem; letter-spacing: .34em; }
.brand svg { width: 24px; height: 24px; }
.nav { display: none; }
.top-end { display: flex; align-items: center; gap: 6px; }
.nav-cta { min-height: 44px; padding: 0 2px; font-size: var(--t-xs); font-weight: 700; color: var(--gold); }
.nav-cta::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 7px; transform: rotate(45deg) translateY(-2px); background: var(--gold); }
.nav-cta:hover { color: var(--foil-1); }

/* ── 첫 화면 — 글이 먼저, 그 아래(넓은 화면에서는 옆)에 차원문. 그림 위에 글을 얹지 않는다 ── */
.hero { display: grid; gap: 30px; padding: 30px var(--gutter) 0; text-align: center; }
.hero-copy, .hero-stage { min-width: 0; }
.hero h1 { font-size: clamp(1.75rem, 7.4vw, 2.375rem); line-height: 1.32; letter-spacing: -.025em; text-wrap: balance; }
.hero .lede { max-width: 33em; margin: 14px auto 0; font-size: var(--t-s); line-height: 1.75; color: var(--mist); text-wrap: pretty; }
.act { margin-top: 22px; }
.cta-row { display: grid; gap: 10px; max-width: 372px; margin-inline: auto; }
.act .btn { max-width: none; }
.act .note { margin-top: 12px; text-wrap: balance; }
.hero .resume-box { margin-top: 16px; }

.portal { width: min(100%, 320px); margin-top: 8px; }
.arch { min-height: 0; max-height: none; -webkit-mask-image: linear-gradient(#000 80%, transparent 100%); mask-image: linear-gradient(#000 80%, transparent 100%); }
.arch-art::after { background: linear-gradient(to top, var(--night) 2%, color-mix(in srgb, var(--night) 40%, transparent) 14%, transparent 30%); }
.arch-art { background: var(--deep); }
/* 처음 열릴 때 한 번 — 문 안쪽에서 빛이 걷히며 인물이 드러난다 */
.portal.opening .arch-art img.on { animation: gate-open 1.5s var(--ease) both; }
@keyframes gate-open { from { opacity: 0; transform: scale(1.14); filter: brightness(2.4) blur(8px); } }
.arrow { top: 42%; }
.arrow:hover::before { border-color: var(--gold); }

/* 문의 이름표 — 그림 아래, 흐려지는 자리에 놓는다 */
.plate { position: relative; z-index: 2; margin-top: -18px; padding: 0 4px; }
.plate h2 { font-size: clamp(1.75rem, 8vw, 2.25rem); }
.plate .hook { max-width: 22em; margin-inline: auto; font-weight: 500; font-size: var(--t-s); line-height: 1.7; color: color-mix(in srgb, var(--ivory) 92%, transparent); }
.hero .dots { margin-top: 6px; }

/* ── 세계관 — 같은 규격의 카드. 대표 색 --w 는 윗선과 고른 테두리에만 ── */
.worlds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 12px; margin-top: 28px; text-align: left; }
.world { display: flex; flex-direction: column; min-width: 0; }
.world-art { position: relative; display: block; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; border-radius: var(--r-m); background: var(--velvet); box-shadow: 0 0 0 1px var(--hair); transition: box-shadow .3s ease, transform .35s var(--ease); }
.world-art::before { content: ""; position: absolute; inset: 0 0 auto; z-index: 3; height: 3px; background: var(--w); }
.world-art::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, color-mix(in srgb, var(--night) 96%, transparent) 6%, color-mix(in srgb, var(--night) 62%, transparent) 30%, transparent 56%), linear-gradient(color-mix(in srgb, var(--night) 62%, transparent), transparent 24%); pointer-events: none; }
.world-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transition: transform .8s var(--ease); }
.world-art:hover, .world.is-on .world-art { box-shadow: 0 0 0 1px var(--w), 0 0 40px -14px var(--w); }
.world-art:hover { transform: translateY(-3px); }
.world-art:hover img { transform: scale(1.04); }
.world-top { position: absolute; top: 14px; left: 12px; right: 12px; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .6875rem; line-height: 1.4; color: var(--ivory); }
.world-top i { flex: none; font-style: normal; font-weight: 700; color: var(--rose); }
.world-id { position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 3; display: grid; gap: 3px; }
.world-id small { font-size: .6875rem; font-weight: 600; line-height: 1.4; color: color-mix(in srgb, var(--w) 70%, var(--ivory)); }
.world-id b { font-family: var(--serif); font-weight: 900; font-size: clamp(1.0625rem, 4.7vw, 1.4375rem); line-height: 1.25; letter-spacing: -.025em; }
.world-hook { margin-top: 14px; font-family: var(--serif); font-weight: 500; font-size: var(--t-s); line-height: 1.65; color: var(--ivory); }
.world-ask { flex: 1; margin-top: 8px; font-size: var(--t-xs); line-height: 1.5; color: var(--mist); }
.world-act { display: grid; margin-top: 14px; }
.world-act .btn { min-height: 48px; padding: 0 10px; font-size: var(--t-xs); }
#gates .aside-note { margin-top: 20px; }

/* ── 문 너머의 이야기 — 그림 한 면, 글 한 면 ── */
.dossier { display: grid; margin-top: 20px; padding: 0; overflow: hidden; border-radius: var(--r-m); border: 1px solid var(--hair); background: linear-gradient(165deg, color-mix(in srgb, var(--burgundy) 62%, var(--velvet)), var(--velvet) 58%); text-align: left; }
.dossier-art { position: relative; margin: 0; aspect-ratio: 16 / 10; overflow: hidden; background: var(--deep); }
.dossier-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 14%; }
.dossier-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, color-mix(in srgb, var(--velvet) 96%, transparent), transparent 42%); }
.dossier-txt { min-width: 0; padding: 22px 20px 26px; }
.dossier h3 { font-size: 1.5rem; }
.tale { max-width: 34em; margin-top: 16px; line-height: 1.9; }
.path { margin-top: 26px; text-align: center; }
.dossier-act { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; margin-top: 26px; }
.dossier-act .btn { width: auto; min-height: 50px; padding: 0 22px; font-size: var(--t-s); }
.dossier-act .wait { font-size: var(--t-xs); color: var(--mist); }
.dossier-act .more { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--t-xs); color: var(--mist); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--hair); }
.dossier-act .more:hover { color: var(--ivory); }

/* ── 영혼 카드 미리보기 — 한 보드 위의 석 장 ── */
.board { display: grid; gap: 26px; margin-top: 28px; }
.board-table {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(8px, 2.6vw, 22px);
  padding: 42px 12px 22px;
  border-radius: var(--r-m);
  border: 1px solid var(--hair);
  background: radial-gradient(78% 72% at 50% 42%, color-mix(in srgb, var(--world) 9%, var(--burgundy)), var(--velvet) 78%);
  box-shadow: inset 0 0 0 4px var(--night), inset 0 0 0 5px var(--hair);
}
.bcard { flex: 0 1 176px; min-width: 0; display: grid; gap: 5px; align-content: start; text-align: center; transition: transform .4s var(--ease); }
.bcard-art { position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--ivory) 20%, transparent); background: var(--deep); box-shadow: 0 18px 28px -16px var(--deep); transition: border-color .25s ease, box-shadow .25s ease; }
.bcard-art img { width: 100%; height: 100%; object-fit: contain; }
.bcard.is-lock .bcard-art img { filter: blur(8px) brightness(.72) saturate(.85); transform: scale(1.12); }
.bcard-back { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(90% 62% at 50% 36%, color-mix(in srgb, var(--world) 20%, var(--burgundy)), var(--velvet) 76%); box-shadow: inset 0 0 0 5px var(--velvet), inset 0 0 0 6px var(--line); }
.bcard-back svg { width: 42%; color: var(--gold); }
.bcard-state { margin-top: 8px; font-size: .6875rem; font-weight: 700; letter-spacing: .04em; color: var(--mist); }
.bcard.is-got .bcard-state, .bcard.is-yours .bcard-state { color: var(--gold); }
.bcard.is-new .bcard-state { color: var(--world-soft); }
.bcard.is-new .bcard-state::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: var(--world); vertical-align: middle; }
.bcard-nm { min-height: 2.7em; font-family: var(--serif); font-weight: 700; font-size: var(--t-xs); line-height: 1.35; color: var(--ivory); text-wrap: balance; }
.bcard.is-lock .bcard-nm, .bcard.is-yours .bcard-nm { color: var(--mist); }
.bcard.is-yours { flex-basis: 200px; transform: translateY(-16px); }
.bcard.is-yours .bcard-art { border-color: var(--gold); }
.bcard.is-got .bcard-art { border-color: var(--line); }
.bcard.is-new .bcard-art { border-color: var(--world); }
.bcard:hover .bcard-art { border-color: var(--world); box-shadow: 0 0 30px -10px var(--world), 0 18px 28px -16px var(--deep); }
.bcard[aria-pressed="true"] { transform: translateY(-8px); }
.bcard.is-yours[aria-pressed="true"] { transform: translateY(-24px); }
.bcard[aria-pressed="true"] .bcard-art { border-color: var(--world); box-shadow: 0 0 0 1px var(--world), 0 0 38px -10px var(--world), 0 18px 28px -16px var(--deep); }
.bcard:focus-visible { outline-offset: 6px; }

/* 고른 카드의 설명 — 카드를 펼치는 판(.sheet)과 같은 글 모양을 쓴다 */
.board-info { width: 100%; max-width: var(--read); margin-inline: auto; text-align: center; }
.board-info .kind { font-size: var(--t-xs); font-weight: 600; color: var(--world-soft); }
.board-info h3 { margin-top: 4px; font-family: var(--serif); font-weight: 900; font-size: 1.625rem; line-height: 1.28; letter-spacing: -.025em; text-wrap: balance; }
.board-info .title { margin-top: 4px; font-family: var(--serif); font-weight: 700; font-size: var(--t-s); color: var(--mist); }
.board-info .line { margin-top: 14px; font-size: var(--t-s); line-height: 1.8; color: var(--ivory); text-wrap: pretty; }
.board-info .facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; align-items: baseline; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--hair); text-align: left; }
.board-info dt { font-size: .75rem; color: var(--mist); }
.board-info dd { margin: 0; font-size: var(--t-s); line-height: 1.6; }
.board-info .btn { margin-top: 20px; }
.demo-tag, .say .by em { margin-left: 8px; padding: 1px 6px; border-radius: 2px; border: 1px dashed var(--hair); font-style: normal; font-size: .6875rem; font-weight: 500; letter-spacing: 0; color: var(--mist); white-space: nowrap; }

/* ── 도감 — 새로 연 카드 ── */
.slot { border-radius: 6px; }
.slot:hover { box-shadow: 0 0 22px -10px var(--gold); }
.slot.is-new { border-color: var(--world); box-shadow: 0 0 0 1px var(--world), 0 0 26px -8px var(--world); }
.slot-new { position: absolute; top: 3px; right: 3px; z-index: 1; padding: 2px 5px; border-radius: 2px; background: var(--world); font-size: .5625rem; font-weight: 800; line-height: 1; letter-spacing: .08em; color: var(--on-gold); }
.dex-frame, .chamber, .cast-row, .sheet, .last { border-radius: var(--r-m); }
.dex-tabs button, .dex-tools > button, .dex-tools .pick select, .seg, .asks button, .host .card-btn, .say .hand, .soul-f input[type="date"], .soul-f select, .soul-pick span, .stone-uses li, .toast { border-radius: var(--r-s); }
.who button, .ledger-n, .stone-chip, .soul-line { border-radius: var(--r-s); }
.who button[aria-pressed="true"] { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.sheet { background: linear-gradient(170deg, color-mix(in srgb, var(--burgundy) 58%, var(--velvet)), var(--velvet) 46%); }

/* ── 대화 — 예시와 실제를 가르는 표시, 답이 드러나는 움직임 ── */
.host-sub { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 3px; font-size: .75rem; color: var(--mist); }
.host-sub > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode { flex: none; padding: 0 7px; border-radius: 2px; font-size: .6875rem; font-weight: 700; line-height: 20px; }
.mode.is-demo { border: 1px dashed color-mix(in srgb, var(--mist) 50%, transparent); color: var(--mist); }
.mode.is-live { border: 1px solid var(--line); color: var(--gold); }
.log > .say.them:last-child:not(.wait) p { animation: ink .7s ease both; }
@keyframes ink { from { opacity: 0; filter: blur(3px); } }
.say.none p { border-left-color: var(--hair); color: var(--mist); }
.say.none button { color: var(--ivory); }
.ask-form button { border-radius: var(--r-s); }
.cast-row { background: linear-gradient(100deg, color-mix(in srgb, var(--w) 7%, var(--velvet-2)), var(--velvet) 62%); }
.last { background: linear-gradient(165deg, color-mix(in srgb, var(--burgundy) 70%, var(--velvet)), var(--velvet) 64%); }
.last h2 { font-weight: 700; }

/* ── 명식을 적는 칸 — 마이페이지의 내 명식 (.soul-form 에 얹는다) ── */
.soul-f > span i, .soul-f > legend i { margin-left: 6px; font-style: normal; font-weight: 400; color: var(--mist); }
.soul-f small { font-size: .75rem; line-height: 1.55; color: var(--mist); }
.intake-form .soul-f > span, .intake-form .soul-f > legend { font-size: var(--t-xs); color: var(--ivory); }
.intake-form fieldset.soul-f small { margin-top: 6px; }
.soul-f.is-bad input[type="date"], .soul-f.is-bad .soul-pick span { border-color: var(--rose); }
.f-err { display: flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 600; color: var(--rose); }
.f-err::before { content: "!"; flex: none; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid currentColor; font-size: .6875rem; line-height: 1; }
.intake-form fieldset.soul-f .f-err { margin-top: 6px; }
.soul-err:focus-visible { outline-offset: 2px; }

/* ── 마이페이지 — 내 명식 · 꾸미기 · 기록 (2026-10-10) ──────────────
   .unfold · .sheet 를 함께 쓴다. 얼굴(.ava)은 대표 카드의 그림이고 테두리는 그 카드의 원소 색 */
.unfold.my { width: min(520px, calc(100vw - 24px)); }
.ava { flex: none; display: grid; place-items: center; width: 44px; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--r-s); border: 1px solid color-mix(in srgb, currentColor 62%, transparent); background: var(--velvet-2); }
.ava img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 14%; }
.ava.none { border-color: var(--hair); color: var(--gold); }
.ava.none svg { width: 56%; }
.ava.big { width: 104px; margin: 4px auto 0; box-shadow: 0 14px 28px -14px rgba(0, 0, 0, .9); }
.my-head .kind { margin-top: 12px; letter-spacing: .18em; }
.my-stat { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; overflow: hidden; border-radius: var(--r-m); border: 1px solid var(--hair); }
.my-stat button { display: grid; align-content: center; gap: 2px; min-height: 60px; padding: 8px 4px; font-size: .75rem; color: var(--mist); transition: background .15s; }
.my-stat button + button { border-left: 1px solid var(--hair); }
.my-stat button:hover { background: color-mix(in srgb, var(--gold) 7%, transparent); }
.my-stat b { font-family: var(--serif); font-weight: 900; font-size: 1.25rem; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--gold); }
.my-next { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: color-mix(in srgb, var(--gold) 8%, transparent); font-size: var(--t-s); line-height: 1.6; text-align: left; }
.sheet .knows-h small { margin-left: 6px; font-weight: 400; letter-spacing: 0; color: var(--mist); }
.my-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.my-cards button { display: grid; align-content: start; gap: 4px; padding: 6px 6px 8px; border-radius: var(--r-m); border: 1px solid var(--hair); transition: border-color .15s, background .15s; }
.my-cards img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--r-s); }
.my-cards span { font-family: var(--serif); font-weight: 700; font-size: .75rem; line-height: 1.35; text-wrap: balance; }
.my-cards small { font-size: .6875rem; color: var(--mist); }
.my-cards button:hover, .my-titles button:hover, .my-yours button:hover { border-color: var(--line); }
.my-cards button[aria-pressed="true"], .my-titles button[aria-pressed="true"] { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.my-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.sheet .my-row .seg { margin: 0; min-height: 44px; border-radius: var(--r-m); border: 1px solid var(--hair); }
.my-row .seg button { min-width: 56px; }
.my-off { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--t-xs); color: var(--mist); text-decoration: underline; text-underline-offset: 3px; }
.my-off:hover { color: var(--ivory); }
.my-titles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.my-titles button { min-height: 44px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--hair); font-family: var(--serif); font-weight: 700; font-size: var(--t-xs); transition: border-color .15s, background .15s; }
.my-titles button[aria-pressed="true"] { color: var(--gold); }
.my-yours { display: grid; gap: 6px; margin-top: 10px; }
.my-yours button { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; width: 100%; min-height: 56px; padding: 8px 12px; border-radius: var(--r-m); border: 1px solid var(--hair); text-align: left; transition: border-color .15s; }
.my-yours span { grid-column: 1; font-size: .6875rem; color: var(--mist); }
.my-yours b { grid-column: 1; font-family: var(--serif); font-weight: 700; font-size: var(--t-s); line-height: 1.4; }
.my-yours em { grid-column: 2; grid-row: 1 / span 2; padding: 0 8px; border-radius: var(--r-pill); border: 1px solid var(--hair); font-style: normal; font-size: .6875rem; font-weight: 700; line-height: 20px; color: var(--mist); }
.my-yours em.got { border-color: var(--line); color: var(--gold); }
.my-lib { margin-top: 16px; padding-bottom: 0; text-align: left; }
.me-who { display: flex; align-items: center; gap: 12px; }
.me-who > div { min-width: 0; }
.me-title { font-family: var(--serif); font-weight: 700; color: var(--gold); }

/* ── 마이페이지 — 게임의 프로필 화면처럼 (2026-10-11) ───────────────
   반은 영혼 카드(.pf-stage), 반은 기록(.pf-panel). 좁은 화면에서는 위아래로 쌓고 판 전체가 구른다.
   넓은 화면에서는 카드가 왼쪽 반에 서 있고 오른쪽 판만 구른다.
   --el 은 손님의 영혼의 원소 색(.pf[data-el]) — 무대의 빛과 테두리에만 쓴다 */
.unfold.my { width: min(1120px, calc(100vw - 16px)); }
.my .sheet { padding: 0; overflow-x: hidden; text-align: left; }
.my .sheet-x { z-index: 3; top: 8px; right: 8px; border-radius: 50%; background: color-mix(in srgb, var(--deep) 62%, transparent); color: var(--ivory); }
/* 낱말 바꾸기 — 닫기 단추 옆 구석 */
.pf-terms { position: absolute; top: 12px; right: 60px; z-index: 3; min-height: 36px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--hair); background: color-mix(in srgb, var(--deep) 62%, transparent); font-size: .75rem; font-weight: 600; color: var(--ivory); transition: border-color .15s, color .15s; }
.pf-terms:hover { border-color: var(--line); }
.pf-terms[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.pf { --el: var(--world); display: grid; }
.pf[data-el="wood"] { --el: #86cf9a; }
.pf[data-el="fire"] { --el: #ff8a73; }
.pf[data-el="earth"] { --el: #dcb070; }
.pf[data-el="metal"] { --el: #dfe3ea; }
.pf[data-el="water"] { --el: #7fb2ee; }

.pf-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  justify-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px 16px 18px;
  overflow: hidden;
  background: radial-gradient(92% 62% at 50% 40%, color-mix(in srgb, var(--el) 24%, var(--burgundy)), var(--deep) 88%);
}
/* 빗금과 아래의 그늘 — 카드 뒤로 지나가는 칼자국 */
.pf-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, var(--deep) 0%, transparent 42%),
    linear-gradient(118deg, transparent 0 31%, color-mix(in srgb, var(--el) 16%, transparent) 31% 31.5%, transparent 31.5% 58%, color-mix(in srgb, var(--crimson) 46%, transparent) 58% 72%, transparent 72%),
    repeating-linear-gradient(118deg, transparent 0 54px, color-mix(in srgb, var(--ivory) 4%, transparent) 54px 55px);
}
.pf-back { position: absolute; inset: -10%; z-index: -2; width: 120%; height: 120%; object-fit: cover; filter: blur(28px) saturate(1.25) brightness(.5); }
.pf-realm { justify-self: start; display: grid; gap: 1px; max-width: calc(100% - 176px); min-height: 40px; font-family: var(--serif); font-weight: 700; font-size: var(--t-xs); letter-spacing: .04em; color: var(--ivory); }
.pf-realm span { font-family: var(--ui); font-weight: 500; font-size: .6875rem; letter-spacing: .02em; color: color-mix(in srgb, var(--ivory) 66%, transparent); }
.pf-card {
  position: relative;
  grid-row: 2;
  align-self: center;
  width: min(60vw, calc(46dvh * 2 / 3));
  aspect-ratio: 2 / 3;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--el) 72%, transparent);
  background: var(--deep);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--deep) 66%, transparent), 0 0 80px -18px var(--el), 0 34px 50px -26px #000;
  transition: transform .5s var(--ease), box-shadow .3s ease;
}
.pf-card img { width: 100%; height: 100%; object-fit: cover; }
button.pf-card:hover { transform: translateY(-4px); box-shadow: 0 0 0 4px color-mix(in srgb, var(--deep) 66%, transparent), 0 0 96px -14px var(--el), 0 40px 54px -26px #000; }
.pf-card.is-sealed { border-color: var(--hair); }
.pf-card.is-sealed img { filter: blur(5px) brightness(.72) saturate(.9); transform: scale(1.12); }
.pf-card.is-none { display: grid; place-items: center; border-style: dashed; border-color: var(--line); background: radial-gradient(90% 62% at 50% 36%, color-mix(in srgb, var(--world) 18%, var(--burgundy)), var(--velvet) 76%); color: var(--gold); }
.pf-card.is-none svg { width: 38%; }
.unfold[open] .pf-card { animation: pf-rise .7s var(--ease) both; }
@keyframes pf-rise { from { opacity: 0; transform: translateY(22px) scale(.96); } }
/* 이름판 — 카드의 이름과 기세 */
.pf-plate { grid-row: 3; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; width: 100%; max-width: 440px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--el) 44%, transparent); }
.pf-plate > div { display: grid; gap: 2px; min-width: 0; }
.pf-plate small { font-size: .6875rem; font-weight: 600; letter-spacing: .08em; color: var(--el); }
.pf-plate div b { font-family: var(--serif); font-weight: 900; font-size: 1.25rem; line-height: 1.3; letter-spacing: -.02em; text-wrap: balance; }
.pf-plate div span { font-size: var(--t-xs); line-height: 1.5; color: color-mix(in srgb, var(--ivory) 70%, transparent); text-wrap: pretty; }
.pf-power { display: grid; justify-items: end; }
.pf-power b { font-family: var(--serif); font-weight: 900; font-size: 2.5rem; line-height: .95; letter-spacing: -.03em; font-variant-numeric: tabular-nums; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pf-power span { font-size: .6875rem; font-weight: 600; letter-spacing: .04em; white-space: nowrap; color: color-mix(in srgb, var(--ivory) 70%, transparent); }
/* 가진 카드의 줄 — 눌러서 큰 그림을 바꾼다 */
.pf-rail { grid-row: 4; display: flex; gap: 6px; width: 100%; max-width: 440px; padding: 2px; overflow-x: auto; scrollbar-width: none; }
.pf-rail button { flex: none; width: 44px; aspect-ratio: 2 / 3; padding: 0; overflow: hidden; border-radius: var(--r-s); border: 1px solid var(--hair); background: color-mix(in srgb, var(--deep) 60%, transparent); opacity: .72; transition: opacity .15s, border-color .15s, transform .15s; }
.pf-rail img { width: 100%; height: 100%; object-fit: cover; }
.pf-rail button:hover { opacity: 1; transform: translateY(-2px); }
.pf-rail button[aria-pressed="true"] { opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.pf-rail .pf-rail-more { display: grid; place-items: center; border-style: dashed; font-size: 1.125rem; color: var(--mist); }
.sheet .pf-wake { grid-row: 5; width: 100%; max-width: 440px; margin-top: 0; gap: 8px; }

.pf-panel { min-width: 0; padding: 20px 16px 24px; background: linear-gradient(170deg, color-mix(in srgb, var(--burgundy) 46%, var(--velvet)), var(--velvet) 40%); }
.pf-id { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; }
/* 등급 자리 — 영혼의 원소 문장 */
.pf-rank { display: grid; place-items: center; width: 56px; height: 56px; transform: rotate(45deg); border-radius: 6px; border: 1px solid color-mix(in srgb, currentColor 60%, transparent); background: color-mix(in srgb, currentColor 10%, var(--deep)); box-shadow: inset 0 0 0 3px var(--velvet), inset 0 0 0 4px color-mix(in srgb, currentColor 30%, transparent); color: var(--gold); margin: 8px; }
.pf-rank svg { width: 24px; height: 24px; transform: rotate(-45deg); }
.sheet .pf-name .kind { margin-top: 0; letter-spacing: .04em; }
.sheet .pf-name h3 { font-size: 1.875rem; overflow-wrap: anywhere; }
.sheet .pf-name .title { color: var(--gold); }
.pf-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pf-tags li { padding: 0 10px; border-radius: 2px; border: 1px solid var(--hair); background: color-mix(in srgb, var(--deep) 46%, transparent); font-size: .75rem; font-weight: 600; line-height: 26px; color: var(--ivory); }
.pf-tags li:first-child { border-color: color-mix(in srgb, var(--el) 60%, transparent); color: var(--el); }
/* 나이와 지금 지나는 계절 — 십 년 가운데 어디쯤인지 */
.pf-lv { display: grid; gap: 8px; margin-top: 14px; padding: 12px 14px; border-radius: var(--r-m); border: 1px solid var(--hair); background: color-mix(in srgb, var(--deep) 46%, transparent); }
.pf-lv p { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.pf-lv b { flex: none; font-family: var(--serif); font-weight: 900; font-size: 1.5rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ivory); }
.pf-lv b small { margin-left: 2px; font-family: var(--ui); font-size: .75rem; font-weight: 600; color: var(--mist); }
.pf-lv span { min-width: 0; font-size: var(--t-xs); color: var(--mist); }
.pf-lv i { display: block; height: 4px; border-radius: 2px; background: var(--hair); overflow: hidden; }
.pf-lv i::before { content: ""; display: block; width: var(--w); height: 100%; background: var(--foil); }
.pf-panel .my-stat { background: color-mix(in srgb, var(--deep) 46%, transparent); }
.pf-body .soul-saved { justify-content: flex-start; }
.pf-body .line { text-wrap: pretty; }

/* 세운 명식의 덧붙인 줄 — 숨은 기운 · 힘의 단계 · 표식 */
.mp th[scope="row"] { width: 34px; line-height: 1.25; }
.mp thead td { width: 34px; }
.mp .f { min-height: 0; padding: 2px 0; line-height: 1.3; text-wrap: balance; }
.mp tr.sub td { padding-top: 5px; vertical-align: middle; }
.mp tr.sub .f { color: var(--ivory); }
.mp tr.sub + tr.sub td, .mp tr.sub + tr.sub th { border-top: 1px solid var(--hair); }
.mp .hid { display: flex; justify-content: center; gap: 3px; min-height: 22px; }
.mp .hid i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; border: 1px solid color-mix(in srgb, currentColor 40%, transparent); background: color-mix(in srgb, currentColor 8%, transparent); font-family: var(--serif); font-style: normal; font-weight: 700; font-size: .75rem; }
.sradar { display: block; width: min(100%, 300px); margin: 6px auto 0; overflow: visible; }
.sradar .ring { fill: none; stroke: var(--hair); stroke-width: 1; }
.sradar .shape { fill: color-mix(in srgb, var(--gold) 20%, transparent); stroke: var(--gold); stroke-width: 1.5; stroke-linejoin: round; }
.sradar circle { fill: currentColor; }
.sradar text { fill: currentColor; font-size: 11px; font-weight: 700; text-anchor: middle; }
.sradar tspan { fill: var(--mist); font-size: 9.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ssides { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; align-items: center; gap: 10px; margin-top: 10px; font-size: .75rem; color: var(--mist); }
.ssides b { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ivory); }
.ssides i { display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--mist) 42%, transparent); overflow: hidden; }
.ssides i::before { content: ""; display: block; width: var(--w); height: 100%; background: var(--gold); }
/* 기세 — 여린 편에서 센 편까지의 눈금 위에 내 편의 힘 */
.sgauge { position: relative; height: 8px; margin: 34px 4px 0; border-radius: 4px; background: linear-gradient(90deg, #7fb2ee, color-mix(in srgb, var(--mist) 50%, transparent) 50%, #ff8a73); }
.sgauge i { position: absolute; left: var(--p); top: 50%; width: 14px; height: 14px; transform: translate(-50%, -50%) rotate(45deg); border-radius: 2px; border: 2px solid var(--velvet); background: var(--foil-1); }
.sgauge b { position: absolute; left: 50%; bottom: 14px; transform: rotate(-45deg) translate(-28%, -62%); font-family: var(--serif); font-style: normal; font-weight: 900; font-size: 1rem; font-variant-numeric: tabular-nums; color: var(--gold); }
.sgauge-k { display: flex; justify-content: space-between; margin-top: 8px; font-size: .6875rem; color: var(--mist); }
.smarks { display: grid; gap: 6px; margin-top: 10px; }
.smarks li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; padding: 10px 12px; border-radius: var(--r-m); border: 1px solid var(--hair); border-left: 2px solid var(--gold); background: color-mix(in srgb, var(--deep) 40%, transparent); }
.smarks b { font-family: var(--serif); font-weight: 900; font-size: var(--t-m); color: var(--gold); }
.smarks span { grid-column: 1 / -1; grid-row: 2; font-size: var(--t-xs); line-height: 1.6; color: var(--ivory); }
.smarks small { grid-column: 2; grid-row: 1; font-size: .6875rem; color: var(--mist); }
.smarks.is-stage li { border-left-color: var(--hair); }
.smarks.is-stage b { color: var(--ivory); }

@media (min-width: 900px) {
  .my .sheet { overflow: hidden; }
  .pf { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: min(860px, calc(100dvh - 34px)); }
  .pf-stage { gap: 18px; padding: 24px 32px 28px; }
  .pf-realm { max-width: none; min-height: 0; }
  .pf-terms { top: 14px; }
  .pf-card { width: auto; height: 100%; max-height: 640px; max-width: 100%; }
  .pf-plate div b { font-size: 1.5rem; }
  .pf-power b { font-size: 3.25rem; }
  .pf-panel { overflow-y: auto; padding: 32px 36px 36px; scrollbar-width: thin; scrollbar-color: var(--hair) transparent; }
  .sheet .pf-name h3 { font-size: 2.125rem; }
}
@media (prefers-reduced-motion: reduce) { .unfold[open] .pf-card { animation: none; } button.pf-card:hover { transform: none; } }

/* 문이 열리는 전환 — 첫 장으로 넘어가기 직전에 한 번 */
.veil { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; background: radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--world) 34%, var(--night)), var(--night) 62%); text-align: center; }
.veil.on { display: grid; animation: veil-in .5s ease both; }
.veil-in { display: grid; justify-items: center; gap: 10px; padding: 0 24px; animation: veil-rise 1s var(--ease) both; }
.veil-in svg { width: 56px; color: var(--gold); filter: drop-shadow(0 0 18px var(--world)); }
.veil-in b { font-family: var(--serif); font-weight: 900; font-size: 1.625rem; letter-spacing: -.02em; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.veil-in span { font-size: var(--t-s); color: var(--mist); }
@keyframes veil-in { from { opacity: 0; } }
@keyframes veil-rise { from { opacity: 0; transform: scale(.92); } }

/* ── 태블릿 ───────────────────────────── */
@media (min-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .hero .lede { font-size: var(--t-m); }
  .cta-row { grid-template-columns: 1fr 1fr; max-width: 520px; }
  .portal { width: min(100%, 360px); }
  .worlds { gap: 36px 20px; }
  .world-act .btn { font-size: var(--t-s); }
  .dossier-txt { padding: 32px; }
  .board-table { padding: 52px 24px 28px; }
  .bcard-nm { font-size: var(--t-s); }
}

/* ── 넓은 화면 ─────────────────────────
   폰의 한 줄을 늘리지 않는다. 머리줄에 내비를 올리고(아래 탭은 내린다), 첫 화면은 글과 차원문을 두 칸으로 가른다. */
@media (min-width: 1024px) {
  :root { --read: 640px; --gutter: 32px; }

  .top { height: 68px; }
  .nav { display: flex; align-items: center; gap: 4px; margin: 0 auto 0 48px; }
  .nav button { position: relative; height: 44px; padding: 0 16px; font-size: var(--t-s); font-weight: 500; color: var(--mist); transition: color .15s; }
  .nav button:hover { color: var(--ivory); }
  .nav button::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 6px; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
  .nav button[aria-current="page"] { color: var(--ivory); font-weight: 600; }
  .nav button[aria-current="page"]::after { transform: none; }
  .nav-cta { padding: 0 16px; border-radius: var(--r-s); border: 1px solid var(--line); transition: background .15s, border-color .15s; }
  .nav-cta:hover { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 9%, transparent); }
  .dock { display: none; }
  .page { padding-bottom: 80px; }
  .toast { bottom: 32px; }

  .hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); align-items: center; column-gap: 64px; min-height: calc(100dvh - 68px); padding-block: 32px 48px; text-align: left; }
  .hero .eyebrow { justify-content: flex-start; text-indent: 0; }
  .hero .eyebrow::before { display: none; }
  .hero .eyebrow::after { width: 56px; }
  .hero h1 { font-size: clamp(2.25rem, 3.15vw, 3rem); line-height: 1.3; text-wrap: normal; }
  .hero .lede { margin: 20px 0 0; font-size: 1.0625rem; line-height: 1.8; }
  .act { margin-top: 36px; }
  .cta-row { grid-template-columns: auto auto; justify-content: start; gap: 12px; max-width: none; margin-inline: 0; }
  .cta-row .btn { width: auto; min-height: 56px; padding: 0 30px; }
  .act .note { margin-top: 14px; }
  .hero .resume-box { margin-inline: 0; }
  .hero-stage { text-align: center; }
  .portal { width: min(100%, 380px); margin-top: 0; }
  .arch { max-height: calc(100dvh - 360px); min-height: 280px; }
  .plate h2 { font-size: 2.25rem; }

  .sec { padding-top: var(--s-9); }
  .page > .sec:first-child { padding-top: 48px; }
  .sec > h2, .lobby > h2, .dex-title h2 { font-size: 2.125rem; }
  .sec > .sub, .lobby > .sub { margin-top: 12px; font-size: var(--t-m); }
  .eyebrow { margin-bottom: 18px; }

  .worlds { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-top: 44px; }
  .world-id b { font-size: 1.375rem; }
  .world-top { top: 18px; left: 16px; right: 16px; }
  .world-id { left: 16px; right: 16px; bottom: 18px; }

  .dossier { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); margin-top: 28px; }
  .dossier-art { aspect-ratio: auto; min-height: 440px; }
  .dossier-art::after { background: linear-gradient(to left, color-mix(in srgb, var(--velvet) 92%, transparent), transparent 46%); }
  .dossier-txt { align-self: center; padding: 48px 56px 48px 40px; }
  .dossier h3 { font-size: 2rem; }
  .tale { margin-top: 20px; font-size: var(--t-m); }
  .path { max-width: 520px; margin-top: 32px; }
  .path li { font-size: var(--t-xs); }

  .board { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; gap: 56px; margin-top: 44px; }
  .board-table { padding: 64px 32px 36px; }
  .board-info { margin: 0; text-align: left; }
  .board-info h3 { font-size: 1.875rem; }
  .board-info .btn { width: auto; padding: 0 28px; }

  .steps.narrow { max-width: 860px; margin-top: 40px; }
  .steps i { width: 48px; height: 48px; margin-bottom: 14px; font-size: 1.0625rem; }
  .steps li + li::before { top: 24px; left: calc(-50% + 34px); right: calc(50% + 34px); }
  .steps b { font-size: 1.125rem; }
  .steps span { margin-top: 6px; font-size: var(--t-s); }

  .faq.narrow { max-width: 760px; margin-top: 28px; }
  .faq summary { min-height: 64px; font-size: 1.0625rem; }
  .faq p { font-size: var(--t-m); line-height: 1.8; }
  .last { margin-top: var(--s-9); padding: 48px 32px 32px; }
  .last h2 { font-size: 1.75rem; }
  .last .btn { width: auto; min-width: 280px; margin-inline: auto; }
  .foot { margin-top: 80px; }

  .dex-frame { margin-top: 24px; padding: 20px 20px 24px; }
  .dex-tabs { max-width: 480px; margin-inline: auto; }

  .cast.narrow { grid-template-columns: 1fr 1fr; gap: 14px; max-width: 960px; margin-top: 24px; }
  .cast-face { width: 104px; }
  .chamber.narrow { max-width: 800px; }
  .host { padding: 16px 20px 16px 8px; }
  .log { gap: 22px; padding: 28px 28px 12px; }
  .topics { padding-inline: 28px; }
  .asks { padding-inline: 28px; flex-wrap: wrap; overflow: visible; }
  .ask-form { padding-inline: 28px; }
  .quota { padding-inline: 28px; }
  .toll { margin-inline: 28px; }
}
@media (min-width: 1280px) {
  :root { --col: 1200px; }
  .hero { column-gap: 88px; }
  .portal { width: min(100%, 410px); }
  .dex { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .worlds { gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; }
  .portal.opening .arch-art img.on, .log > .say.them:last-child:not(.wait) p, .veil.on, .veil-in, .btn-gold:hover::after { animation: none; }
  .bcard, .bcard.is-yours, .bcard[aria-pressed="true"], .world-art:hover { transition: none; }
}

/* 창 안의 스크롤 막대는 가늘고 어둡게 */
.sheet, .drawer, .page { scrollbar-width: thin; scrollbar-color: var(--hair) transparent; }
.page { scrollbar-width: none; }

/* ── 그림 에셋 (2026-10-10) — 프롬프트와 규칙은 docs/홈배경_프롬프트.md ──────────
   그림은 색을 뺀 한 벌이고, 문마다 다른 색감은 --world 를 color 로 겹쳐서 입힌다.
   이전 판(선과 그라데이션만)은 _archive/gate/before_bg_assets_20261010/ */

/* 뒷배경 — 차원문이 서 있는 밤. 위에서부터: 안개 셋 · 아래를 덮는 어둠 · 그 세계의 색 · 그림 */
body::before {
  background:
    radial-gradient(64% 38% at 50% 0%, color-mix(in srgb, var(--world) 13%, transparent), transparent 70%),
    radial-gradient(56% 34% at 100% 36%, color-mix(in srgb, var(--haze-1) 11%, transparent), transparent 70%),
    radial-gradient(60% 36% at 0% 78%, color-mix(in srgb, var(--haze-2) 16%, transparent), transparent 70%),
    linear-gradient(color-mix(in srgb, var(--night) 46%, transparent), color-mix(in srgb, var(--night) 34%, transparent) 42%, var(--night) 94%),
    linear-gradient(color-mix(in srgb, var(--world) 34%, transparent), color-mix(in srgb, var(--haze-2) 40%, transparent)),
    url("assets/bg_night-portrait.webp") center top / cover no-repeat,
    var(--night);
  background-blend-mode: normal, normal, normal, normal, color, normal, normal;
}
@media (min-aspect-ratio: 1/1) {
  body::before {
    background:
      radial-gradient(64% 38% at 50% 0%, color-mix(in srgb, var(--world) 13%, transparent), transparent 70%),
      radial-gradient(56% 34% at 100% 36%, color-mix(in srgb, var(--haze-1) 11%, transparent), transparent 70%),
      radial-gradient(60% 36% at 0% 78%, color-mix(in srgb, var(--haze-2) 16%, transparent), transparent 70%),
      linear-gradient(color-mix(in srgb, var(--night) 46%, transparent), color-mix(in srgb, var(--night) 34%, transparent) 42%, var(--night) 94%),
      linear-gradient(color-mix(in srgb, var(--world) 34%, transparent), color-mix(in srgb, var(--haze-2) 40%, transparent)),
      url("assets/bg_night-landscape.webp") center top / cover no-repeat,
      var(--night);
    background-blend-mode: normal, normal, normal, normal, color, normal, normal;
  }
}

/* 차원문 문틀 — 금박 띠 대신 그림. 문 그림은 문틀 안쪽 모양으로 오려 낸다 */
.arch, .arch-gap, .arch-line, .arch-art { clip-path: none; }
.arch { padding: 0; background: none; }
.arch-gap { padding: 0; background: none; }
.arch-line { padding: 0; background: none; }
/* 그림 파일로 오려 내면 파일을 직접 열었을 때(file://) 문 그림이 통째로 사라진다 — 모양을 좌표로 적는다 */
.arch .arch-art { clip-path: polygon(50.0% 4.8%, 53.3% 5.9%, 57.2% 8.0%, 60.9% 10.0%, 64.3% 11.9%, 67.4% 13.9%, 70.5% 15.9%, 73.2% 18.0%, 75.8% 20.0%, 77.9% 21.9%, 80.1% 23.9%, 82.2% 25.9%, 84.2% 28.0%, 85.7% 30.0%, 87.3% 31.9%, 88.9% 33.9%, 90.0% 35.9%, 91.2% 38.0%, 92.2% 40.0%, 93.0% 41.9%, 93.6% 43.9%, 94.1% 45.9%, 94.5% 48.0%, 94.9% 50.0%, 94.9% 99.8%, 94.9% 100.0%, 5.1% 100.0%, 5.1% 99.8%, 5.1% 50.0%, 5.5% 48.0%, 5.9% 45.9%, 6.2% 43.9%, 7.0% 41.9%, 7.8% 40.0%, 8.8% 38.0%, 10.0% 35.9%, 11.3% 33.9%, 12.7% 31.9%, 14.1% 30.0%, 15.8% 28.0%, 17.8% 25.9%, 19.7% 23.9%, 22.1% 21.9%, 24.2% 20.0%, 26.8% 18.0%, 29.5% 15.9%, 32.4% 13.9%, 35.7% 11.9%, 39.1% 10.0%, 42.6% 8.0%, 46.7% 5.9%); }
.arch-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--world) 38%, transparent));
}
.keystone { display: none; }                  /* 문틀 꼭대기에 별이 새겨져 있다 */

/* 마지막 부름 — 틈이 벌어진 문. 빛줄기가 끝나는 자리에서 글이 시작한다 */
.last { position: relative; overflow: hidden; padding-top: clamp(118px, 33vw, 168px); background: var(--velvet); }
.last::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  aspect-ratio: 3 / 2;
  background:
    linear-gradient(color-mix(in srgb, var(--world) 40%, transparent), color-mix(in srgb, var(--world) 40%, transparent)),
    url("assets/last_door.webp") center top / cover no-repeat;
  background-blend-mode: color, normal;
  -webkit-mask-image: linear-gradient(#000 52%, transparent 96%);
  mask-image: linear-gradient(#000 52%, transparent 96%);
  pointer-events: none;
}
.last > * { position: relative; }

/* 마력석 — 충전 창의 큰 돌만 그림. 글줄 안의 작은 돌은 선 그림 그대로 */
.stone-mark { width: 76px; }
.stone-mark img { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 16px color-mix(in srgb, var(--gold) 32%, transparent)); }

/* 마력석 쿠폰 — 충전 창 아래의 한 줄. 번호 칸과 받기 단추 */
.stone-coupon { display: grid; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hair); text-align: left; }
.stone-coupon > label { font-size: .75rem; font-weight: 600; color: var(--mist); }
.stone-coupon-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.stone-coupon input {
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border-radius: var(--r-s);
  border: 1px solid color-mix(in srgb, var(--mist) 34%, transparent);
  background: color-mix(in srgb, var(--night) 55%, transparent);
  font: inherit;
  font-size: 1rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ivory);
}
.stone-coupon input::placeholder { letter-spacing: 0; color: color-mix(in srgb, var(--mist) 70%, transparent); }
.stone-coupon input:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.stone-coupon input[aria-invalid="true"] { border-color: var(--rose); }
.sheet .stone-coupon .btn { width: auto; min-height: 48px; margin-top: 0; padding: 0 16px; font-size: var(--t-s); white-space: nowrap; }
.stone-coupon .soul-err { margin-top: 0; }
.stone-coupon-ok { padding: 10px 12px; border-radius: var(--r-s); border: 1px solid var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); font-size: var(--t-xs); color: var(--ivory); }

/* ── 첫 화면 — 글 없이 차원문 하나 (2026-10-10) ──────────────
   차원문이 화면 가운데에 크게 서고, 그 아래에 문 이름 · 단추가 온다. 넓은 화면에서도 한 줄로 세운다 */
.hero { grid-template-columns: minmax(0, 1fr); gap: 22px; min-height: 0; padding-top: 18px; text-align: center; }
.hero-stage { order: 1; text-align: center; }
.hero-copy { order: 2; }
.hero h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.portal { width: min(100%, max(300px, min(580px, calc((100dvh - 230px) * .8)))); margin-top: 0; }
.arch { min-height: 0; max-height: none; }
.hero .act { margin-top: 0; }
.hero .cta-row { justify-content: center; margin-inline: auto; }
.hero .resume-box { margin-inline: auto; }
@media (min-width: 1024px) {
  .hero { padding-block: 24px 56px; }
  .plate h2 { font-size: 2.75rem; }
}

/* ── 구매 선물의 카드 스플래시 (2026-10-17) ── 그 문의 색(--world)으로 빛나고, 인물 그림이 부채꼴로 펼쳐진 위에 손님의 카드가 뒤집혀 나온다 */
.burst { width: min(460px, calc(100vw - 20px)); max-width: none; max-height: none; padding: 0; border: 0; background: none; color: var(--ivory); overflow: visible; }
.burst::backdrop { background: radial-gradient(70% 55% at 50% 42%, color-mix(in srgb, var(--world) 26%, var(--deep)), color-mix(in srgb, var(--deep) 94%, transparent) 72%); }
.burst-in { position: relative; max-height: calc(100dvh - 20px); overflow: hidden auto; padding: 26px 18px 18px; border-radius: 16px; border: 1px solid var(--line);
  background: radial-gradient(120% 60% at 50% 30%, color-mix(in srgb, var(--world) 18%, var(--velvet-2)), var(--velvet) 72%); text-align: center; }
.burst-glow { position: absolute; left: 50%; top: 46%; width: 160%; aspect-ratio: 1; translate: -50% -50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--world) 22%, transparent) 0 6deg, transparent 6deg 18deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 70%); mask-image: radial-gradient(closest-side, #000 20%, transparent 70%);
  animation: burst-spin 28s linear infinite; }
.burst-kicker { position: relative; margin: 0; font-size: var(--t-xs); font-weight: 600; letter-spacing: .08em; color: var(--world-soft); }
.burst h2 { position: relative; margin: 6px 0 0; font-family: var(--serif); font-size: clamp(1.5rem, 6vw, 1.875rem); font-weight: 700; line-height: 1.3; }
.burst-stage { position: relative; height: clamp(260px, 62vw, 320px); margin: 14px 0 4px; perspective: 1000px; }
.burst-fan { position: absolute; inset: 0; }
.bf { position: absolute; left: 50%; top: 50%; width: 26%; aspect-ratio: 2 / 3; margin: 0; border-radius: 8px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--world) 45%, transparent);
  box-shadow: 0 10px 22px -10px #000; transform: translate(calc(-50% + var(--x)), calc(-58% + var(--y))) rotate(var(--r));
  animation: burst-fan .7s calc(.15s + var(--i) * 45ms) var(--ease) both; }
.bf img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.82) saturate(.95); }
.burst-card { position: absolute; left: 50%; top: 50%; width: 44%; aspect-ratio: 2 / 3; translate: -50% -50%; transform-style: preserve-3d; animation: burst-flip 1s .55s var(--ease) both; }
.burst-back, .burst-front { position: absolute; inset: 0; border-radius: 12px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.burst-back { display: grid; place-items: center; transform: rotateY(180deg); border: 1px solid var(--line); color: var(--gold);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--world) 30%, var(--velvet-2)), var(--deep)); }
.burst-back svg { width: 38%; height: auto; }
.burst-front { border: 1px solid var(--world-soft); box-shadow: 0 0 0 1px color-mix(in srgb, var(--world) 40%, transparent), 0 0 46px -4px color-mix(in srgb, var(--world) 70%, transparent), 0 24px 40px -18px #000; }
.burst-front img { width: 100%; height: 100%; object-fit: cover; }
.burst-sheen { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, color-mix(in srgb, #fff 55%, transparent) 50%, transparent 65%); translate: -120% 0; animation: burst-sheen 1.1s 1.45s ease-out both; }
.burst-spark { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--world-soft); box-shadow: 0 0 10px var(--world);
  opacity: 0; animation: burst-spark 1.1s calc(1.1s + var(--d)) ease-out both; }
.burst-name { position: relative; margin: 10px 0 0; font-size: var(--t-xs); color: var(--mist); }
.burst-name b { display: block; margin-top: 4px; font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--ivory); }
.burst .pillar { position: relative; justify-content: center; margin-top: 4px; color: var(--gold); }
.burst-gains { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.burst-gains li { padding: 10px 4px 9px; border-radius: var(--r-m); border: 1px solid var(--hair); background: color-mix(in srgb, var(--deep) 45%, transparent); font-size: var(--t-xs); color: var(--mist); animation: burst-up .5s calc(1.5s + var(--n, 0) * 90ms) var(--ease) both; }
.burst-gains li:nth-child(2) { --n: 1; } .burst-gains li:nth-child(3) { --n: 2; }
.burst-gains b { display: block; font-family: var(--serif); font-size: 1.375rem; font-weight: 700; line-height: 1.2; color: var(--ivory); }
.burst-gains .gem { width: 15px; height: 15px; margin-right: 3px; color: var(--gold); vertical-align: -1px; }
.burst-gains .gem-li b { color: var(--foil-1); }
.burst-acts { position: relative; display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 16px; }
@keyframes burst-spin { to { rotate: 360deg; } }
@keyframes burst-fan { from { opacity: 0; transform: translate(-50%, -54%) rotate(0deg) scale(.7); } }
@keyframes burst-flip { 0% { opacity: 0; transform: rotateY(180deg) scale(.6); } 25% { opacity: 1; } 100% { transform: rotateY(0) scale(1); } }
@keyframes burst-sheen { to { translate: 120% 0; } }
@keyframes burst-spark { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--a)) translateY(0); } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(-150px) scale(.4); } }
@keyframes burst-up { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .burst-glow, .bf, .burst-card, .burst-sheen, .burst-gains li { animation: none; }
  .burst-spark { display: none; }
}

/* ── 열린 카드에 더 싣는 것 (assets/card_more.js) ─────────────────
   뒤집는 카드 · 인물의 한마디 · 모은 기록 · 오늘의 한 줄 · 카드의 힘 · 곁의 카드 · 다른 문의 같은 영혼 */
.sheet .big.flip { display: block; padding: 0; overflow: visible; border: 0; background: none; box-shadow: none; perspective: 1200px; cursor: pointer; }
.sheet .big.flip .face {
  position: absolute; inset: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--world);
  background: #000;
  box-shadow: 0 0 40px -14px var(--world), 0 18px 30px -14px rgba(0, 0, 0, .9);
  backface-visibility: hidden;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.sheet .big.flip .back { transform: rotateY(180deg); }
.sheet .big.flip.is-back .front { transform: rotateY(-180deg); }
.sheet .big.flip.is-back .back { transform: rotateY(0); }
@media (prefers-reduced-motion: reduce) { .sheet .big.flip .face { transition: none; } }
.sheet .big.flip .back {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 14px;
  background: radial-gradient(90% 60% at 50% 30%, color-mix(in srgb, var(--world) 22%, var(--velvet-2)), var(--velvet) 80%);
  text-align: center;
}
.back-mark svg { width: 30px; height: 30px; color: var(--gold); }
.back-kind { font-size: .6875rem; font-weight: 600; letter-spacing: .08em; color: var(--world-soft); }
.back-name { font-family: var(--serif); font-weight: 900; font-size: 1rem; line-height: 1.35; color: var(--ivory); text-wrap: balance; }
.back-word { margin-top: 4px; font-family: var(--voice); font-size: .8125rem; line-height: 1.7; color: var(--ivory); word-break: keep-all; text-wrap: balance; }
.back-by { font-family: var(--voice); font-size: .75rem; color: var(--world-soft); }
.back-sym { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; margin-top: 6px; font-size: .6875rem; color: var(--ivory); }
.back-sym small { margin-right: 4px; color: var(--mist); }
.sheet .flip-hint { margin-top: 8px; font-size: .6875rem; color: var(--mist); }

.sheet .word { margin: 16px 0 0; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--hair); background: color-mix(in srgb, var(--world) 6%, transparent); }
.sheet .word blockquote { margin: 0; font-family: var(--voice); font-size: 1rem; line-height: 1.85; color: var(--ivory); word-break: keep-all; text-wrap: balance; }
.sheet .word figcaption { margin-top: 6px; font-size: .75rem; font-weight: 600; color: var(--world-soft); }

.sheet .own { margin-top: 14px; }
.own-rec { font-size: var(--t-xs); color: var(--mist); }
.own-rec b { color: var(--gold); font-variant-numeric: tabular-nums; }
.own-act { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.own-act .btn { flex: 1 1 140px; min-height: 44px; font-size: var(--t-xs); }
.own-act [aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }

.sheet .cx { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hair); text-align: left; }
.sheet .cx h4 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-family: var(--serif); font-weight: 700; font-size: var(--t-s); color: var(--ivory); }
.sheet .cx h4 small { font-family: var(--ui); font-size: .75rem; font-weight: 500; color: var(--mist); }
.cx-note { margin-top: 10px; font-size: var(--t-xs); line-height: 1.65; color: var(--mist); }
.cx-note b { color: var(--ivory); }
.today-box p { margin-top: 6px; font-family: var(--voice); font-size: var(--t-s); line-height: 1.75; color: var(--ivory); word-break: keep-all; }

.bars { display: grid; gap: 8px; margin-top: 10px; }
.bars li { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; font-size: var(--t-xs); color: var(--mist); }
.bars i { position: relative; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--mist) 14%, transparent); overflow: hidden; }
.bars i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--v); border-radius: inherit; background: color-mix(in srgb, var(--world) 70%, var(--mist)); }
.bars .lead { color: var(--gold); font-weight: 700; }
.bars .lead i::after { background: var(--foil, var(--gold)); }

.kin { display: grid; gap: 8px; margin-top: 10px; }
.kin button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px; border-radius: 10px; border: 1px solid var(--hair); text-align: left; transition: border-color .15s; }
.kin button:hover { border-color: var(--world); }
.kin-art { position: relative; flex: none; width: 44px; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 6px; background: #000; }
.kin-art img { width: 100%; height: 100%; object-fit: cover; }
.kin-art.not img { filter: blur(2px) brightness(.75); transform: scale(1.1); }
.kin-art .slot-lock { position: absolute; inset: 0; display: grid; place-items: center; }
.kin-art .slot-lock svg { width: 16px; height: 16px; color: var(--ivory); }
.kin-txt { display: grid; gap: 2px; min-width: 0; }
.kin-txt small { font-size: .6875rem; color: var(--world-soft); }
.kin-txt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-weight: 700; font-size: var(--t-s); color: var(--ivory); }
.kin-txt em { font-style: normal; font-size: .6875rem; letter-spacing: .14em; color: var(--mist); }
.kin-clash small { color: var(--rose); }

/* 두 장(MOIRAI — 당신과 그 사람)일 때는 나란히, 조금씩 기울여 (2026-10-18) */
.burst-card.pair { width: 37%; }
.burst-card.pair.l { left: 31%; rotate: -6deg; }
.burst-card.pair.r { left: 69%; rotate: 6deg; animation-delay: .8s; }
.burst-card.pair.r .burst-sheen { animation-delay: 1.7s; }
.burst-pair { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.burst-pair span { display: block; }
.burst-pair small { display: block; font-size: var(--t-xs); color: var(--world-soft); }
.burst-pair b { display: block; margin-top: 2px; font-family: var(--serif); font-size: 1.0625rem; font-weight: 700; line-height: 1.35; color: var(--ivory); }
.burst-pair .pillar { margin-top: 4px; }

/* 메뉴 서랍의 그림 카드 단추 — 보관함 · 문 바로가기 (2026-10-18) */
.art-link { position: relative; display: flex; align-items: center; min-height: 78px; margin-bottom: 8px; padding: 12px 42px 12px 14px; border-radius: 10px; overflow: hidden; isolation: isolate;
  color: var(--ivory); text-decoration: none; border: 1px solid color-mix(in srgb, var(--c) 38%, transparent); background: var(--velvet); box-shadow: inset 3px 0 0 var(--c); transition: border-color .15s, transform .15s; }
.art-link:hover { border-color: var(--c); transform: translateY(-1px); }
.art-link:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.art-link-img { position: absolute; inset: 0 0 0 38%; z-index: -2; background-size: cover; background-repeat: no-repeat; transition: transform .4s; }
.art-link:hover .art-link-img { transform: scale(1.06); }
.art-link::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, var(--velvet) 34%, color-mix(in srgb, var(--velvet) 78%, transparent) 54%, color-mix(in srgb, var(--c) 10%, transparent) 100%); }
.art-link-tx { min-width: 0; max-width: 72%; }
.art-link small { display: block; margin-bottom: 2px; font-size: .6875rem; font-weight: 600; letter-spacing: .06em; color: var(--c); }
.art-link b { display: block; font-family: var(--serif); font-size: .9375rem; font-weight: 700; line-height: 1.35; color: var(--ivory); text-shadow: 0 1px 8px #000; }
.art-link-tx > span { display: block; margin-top: 3px; font-size: var(--t-xs); line-height: 1.45; color: color-mix(in srgb, var(--ivory) 80%, var(--mist)); text-shadow: 0 1px 6px #000; }
.art-link-go { position: absolute; right: 12px; top: 50%; translate: 0 -50%; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--deep) 70%, transparent); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); color: var(--c); font-size: 15px; line-height: 1; }

/* 대화 기록 — 날이 바뀌는 곳의 날짜 줄과 기록 지우기 */
.say-day { display: flex; align-items: center; gap: 10px; font-size: .6875rem; letter-spacing: .06em; color: var(--mist); font-variant-numeric: tabular-nums; }
.say-day::before, .say-day::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.talk-wipe { padding: 0 16px 14px; font-size: .75rem; color: var(--mist); }
.talk-wipe button { min-height: 44px; margin-left: 6px; padding: 0 4px; color: var(--ivory); text-decoration: underline; text-underline-offset: 3px; }
.talk-wipe button[data-wipe="go"] { color: var(--rose); }

/* ── 대화방을 기록에 내어 주기 (2026-10-21) ──────────────────
   추천 질문은 첫 질문 뒤에 접고(✦ 로 편다), 안내와 기록 지우기는 기록 맨 위로, 머리와 남은 횟수는 얇게 */
.picks[hidden] { display: none; }
.log-top { font-size: .6875rem; line-height: 1.6; color: color-mix(in srgb, var(--mist) 80%, transparent); }
.log-top button { min-height: 32px; margin-left: 4px; padding: 0 4px; color: var(--ivory); text-decoration: underline; text-underline-offset: 3px; }
.log-top button[data-wipe="go"] { color: var(--rose); }
.ask-form .pick-btn { flex: none; width: 44px; height: 48px; border-radius: 0; background: none; color: var(--mist); }
.ask-form .pick-btn[aria-expanded="true"] { color: var(--gold); }
.ask-form .pick-btn svg { width: 14px; height: 14px; }
.ask-form .pick-btn:hover { color: var(--gold); }
.quota { padding: 0 16px 10px; font-size: .6875rem; }
@media (max-width: 600px) {
  .host { gap: 8px; padding: 8px 10px 8px 0; }
  .host .back { width: 40px; height: 40px; }
  .host .por { width: 38px; }
  .host .rel { display: none; }
  .host .nm { font-size: 1.125rem; }
  .host .card-btn { min-height: 38px; padding: 0 10px; }
  .log { padding: 14px 14px 6px; gap: 14px; }
  .topics { padding-top: 0; }
  .asks { padding-top: 6px; }
  .ask-form { padding: 6px 14px 4px; }
}
