/*
 * 던전 수쿠마 소개·검색 페이지 — 게임 광고형 어두운 화면.
 * 제목·버튼·탭은 게임과 같은 픽셀 서체(Galmuri11), 본문은 Pretendard.
 * 색은 상점 키아트에서 왔다: 하수도 돌벽의 검갈색, 로고 주황, 횃불 노랑, 이끼 초록.
 */
:root {
  --bg: #0d0b0a;
  --bg-raise: #15110e;
  --panel: #1c1713;
  --panel-2: #241e18;
  --line: #3a2f26;
  --line-strong: #5b4837;
  --ink: #f5ecdd;
  --muted: #b9a891;
  --dim: #8c7c68;
  --accent: #ff9b26;
  --accent-hi: #ffc463;
  --accent-deep: #a8520b;
  --accent-ink: #1c0f04;
  --moss: #86c24a;
  --ember: #e0502f;
  --pixel: "Galmuri11", "Galmuri9", ui-monospace, monospace;
  --body: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --gutter: 24px;
  --max: 1180px;
  --top-h: 64px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* hidden 속성은 어떤 display 규칙보다 이긴다 (트레일러 표지가 남아 영상을 가리던 결함) */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top-h) + 12px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: break-word;
  overflow-x: clip;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.35;
}

h2 {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: 0;
  margin-bottom: 28px;
  text-shadow: 3px 3px 0 #000;
}

h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
}

p {
  margin: 0 0 14px;
}

.i {
  width: 20px;
  height: 20px;
  flex: none;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 14px;
  z-index: 60;
}

.skip:focus {
  left: 8px;
}

:focus-visible {
  outline: 3px solid var(--accent-hi);
  outline-offset: 3px;
}

/* 픽셀 모서리: 네 귀를 한 칸씩 깎는다 */
.px,
.btn,
.card,
.answer,
.band,
.cta-band,
.example,
.compare tr,
.shot img {
  --notch: 4px;
  clip-path: polygon(
    0 var(--notch), var(--notch) var(--notch), var(--notch) 0,
    calc(100% - var(--notch)) 0, calc(100% - var(--notch)) var(--notch), 100% var(--notch),
    100% calc(100% - var(--notch)), calc(100% - var(--notch)) calc(100% - var(--notch)), calc(100% - var(--notch)) 100%,
    var(--notch) 100%, var(--notch) calc(100% - var(--notch)), 0 calc(100% - var(--notch))
  );
}

/* ---------- header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--top-h);
  background: rgba(13, 11, 10, 0.82);
  border-bottom: 2px solid #000;
  box-shadow: 0 2px 0 var(--line);
  backdrop-filter: blur(10px);
}

.top-inner {
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 22px;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  text-shadow: 2px 2px 0 #000;
}

.nav {
  display: flex;
  gap: 2px;
  margin-right: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav a {
  font-family: var(--pixel);
  padding: 6px 12px;
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
}

.nav a:hover,
.nav a[aria-current="page"],
.nav a[aria-current="true"] {
  color: var(--ink);
}

.nav a[aria-current="page"],
.nav a[aria-current="true"] {
  box-shadow: inset 0 -3px 0 var(--accent);
}

/* ---------- buttons ---------- */
.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 32px 0 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 26px 15px;
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  border: 0;
  transition: transform 0.12s, filter 0.12s;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: inset 0 -4px 0 var(--accent-deep), inset 0 3px 0 var(--accent-hi);
}

.btn-secondary {
  background: var(--panel-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line-strong), inset 0 -4px 0 #000;
}

.btn-small {
  min-height: 40px;
  padding: 6px 16px 9px;
  font-size: 15px;
}

.btn-small .i {
  width: 18px;
  height: 18px;
}

.fineprint {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.fineprint .i {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--accent);
}

/* ---------- layout ---------- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.narrow {
  max-width: 780px;
}

.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 24px 0 0;
  padding: 0;
  font-size: 14px;
  color: var(--dim);
}

.crumbs li + li::before {
  content: "/";
  margin: 0 8px;
  color: var(--line-strong);
}

.crumbs a {
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--ink);
}

.kicker {
  font-family: var(--pixel);
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.lede {
  font-size: 18px;
  color: var(--muted);
}

/* ---------- images ---------- */
.shot {
  margin: 0;
  position: relative;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06);
}

/* ==========================================================
 * 안내 글 (로그라이크 입문, 돌죽 취향 안내) — 같은 시각 체계
 * ========================================================== */
.page-article main > section,
.page-article main > header,
.related,
.sources {
  margin-block: 72px;
}

.page-article main > :first-child {
  margin-top: 28px;
}

.article-head h1 {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.3;
  margin-bottom: 22px;
  max-width: 900px;
  text-shadow: 3px 3px 0 #000;
}

.article-head .lede {
  max-width: 780px;
}

.article-head .shot {
  margin-top: 36px;
  max-width: 920px;
}

.band {
  background: var(--panel);
  padding: 34px clamp(20px, 4vw, 40px);
  box-shadow: inset 0 0 0 2px var(--line);
}

.band h2 {
  font-size: clamp(22px, 2.8vw, 30px);
}

.facts {
  display: grid;
  gap: 12px;
  margin: 0;
}

.facts div {
  background: var(--panel-2);
  padding: 14px 18px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.facts dt {
  font-size: 14px;
  color: var(--dim);
}

.facts dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.facts.single div {
  display: grid;
  grid-template-columns: 7em 1fr;
  gap: 12px;
  padding: 10px 16px;
}

.facts.single dd {
  margin: 0;
  font-weight: 600;
}

.source-note {
  font-size: 14px;
  color: var(--dim);
  margin: 16px 0 0;
}

.callout {
  display: flex;
  gap: 10px;
  background: rgba(255, 155, 38, 0.08);
  box-shadow: inset 3px 0 0 var(--accent);
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 36px;
}

.callout .i {
  color: var(--accent);
  margin-top: 2px;
}

.ticks {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.ticks li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.ticks .i {
  width: 18px;
  height: 18px;
  margin-top: 5px;
  color: var(--moss);
}

.ticks.compact {
  gap: 6px;
}

.steps,
.rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 26px;
}

.steps li,
.rules li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  align-items: start;
}

.step-no {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 20px;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent-deep), 3px 3px 0 #000;
}

.steps p,
.rules p {
  margin-bottom: 6px;
  color: var(--muted);
}

.example {
  font-size: 15px;
  color: var(--muted);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 10px 14px;
  margin-top: 8px;
}

.split {
  display: grid;
  gap: 32px;
  align-items: start;
}

.cards {
  display: grid;
  gap: 16px;
}

.card {
  display: block;
  background: var(--panel);
  padding: 26px;
  text-decoration: none;
  box-shadow: inset 0 0 0 2px var(--line);
  transition: box-shadow 0.15s, transform 0.15s;
}

.card:hover {
  box-shadow: inset 0 0 0 2px var(--accent);
  transform: translateY(-2px);
}

.card h3 {
  font-family: var(--pixel);
  font-size: 19px;
  line-height: 1.45;
}

.card p {
  color: var(--muted);
  font-size: 16px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--pixel);
  color: var(--accent);
}

.card-link .i {
  width: 18px;
  height: 18px;
}

.spec-grid {
  display: grid;
  gap: 32px;
}

.glossary {
  margin: 0;
  border-top: 2px solid var(--line);
}

.glossary div {
  display: grid;
  gap: 4px 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.glossary dt {
  font-weight: 700;
  color: var(--accent-hi);
}

.glossary dd {
  margin: 0;
  color: var(--muted);
}

.answer {
  background: var(--panel);
  box-shadow: inset 0 0 0 2px var(--accent-deep);
  padding: 28px clamp(20px, 4vw, 36px);
}

.answer h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  margin-bottom: 12px;
}

.answer h2 .i {
  color: var(--accent);
  width: 24px;
  height: 24px;
}

.answer p {
  font-size: 18px;
  margin: 0;
}

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.65;
}

.compare caption {
  caption-side: bottom;
  text-align: left;
  font-size: 14px;
  color: var(--dim);
  padding-top: 12px;
}

.compare th,
.compare td {
  text-align: left;
  vertical-align: top;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.compare td {
  color: var(--muted);
}

.compare thead th {
  font-family: var(--pixel);
  font-size: 14px;
  color: var(--accent);
  border-bottom: 2px solid var(--line-strong);
}

.compare tbody th {
  font-weight: 700;
  white-space: nowrap;
}

.compare tr {
  clip-path: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--accent);
}

.text-link .i {
  width: 16px;
  height: 16px;
}

.related h2,
.sources h2 {
  font-size: 22px;
  margin-bottom: 16px;
}

.sources ul {
  margin: 0;
  padding-left: 20px;
  font-size: 15px;
  color: var(--dim);
}

.sources a {
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 픽셀 그림은 키워도 흐려지지 않게 */
.pixel {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

video {
  image-rendering: pixelated;
}

/* ==========================================================
 * 소개 페이지 (광고형)
 * ========================================================== */
.page-intro .top {
  position: fixed;
  left: 0;
  right: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
  border-bottom-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transition: background-color 0.2s;
}

.page-intro .top.is-scrolled {
  background: rgba(13, 11, 10, 0.94);
  border-bottom-color: #000;
  box-shadow: 0 2px 0 var(--line);
}

.top-cta {
  white-space: nowrap;
  align-self: stretch;
  min-height: 0;
  margin-right: calc(-1 * var(--gutter));
  padding: 0 28px;
  font-size: 17px;
  --notch: 0px;
}

.nav-page {
  color: var(--dim) !important;
}

.nav-page:first-of-type {
  margin-left: 14px;
  position: relative;
}

.nav-page:first-of-type::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 30%;
  bottom: 30%;
  width: 2px;
  background: var(--line-strong);
}

/* ---------- 첫 화면 ---------- */
/* 로고는 위, 버튼은 아래에 두고 가운데는 장면(수쿠마와 그곳의 주인)이 보이게 비운다. */
.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: calc(var(--top-h) + 20px) var(--gutter) 64px;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}

.stage-bg,
.cta-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #000;
}

.stage-bg img,
.stage-bg video,
.cta-bg img,
.cta-bg video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 60%;
}

.stage-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(13, 11, 10, 0.88) 0%,
    rgba(13, 11, 10, 0.45) 24%,
    rgba(13, 11, 10, 0) 42%,
    rgba(13, 11, 10, 0) 58%,
    rgba(13, 11, 10, 0.6) 74%,
    var(--bg) 100%
  );
}

.cta-bg::after {
  content: "";
  position: absolute;
  inset: 0;
}

.stage-top,
.stage-bottom {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stage-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
}

.stage-actions .ctas {
  margin: 0;
}

.stage .kicker {
  color: var(--accent-hi);
  font-size: 16px;
  text-shadow: 2px 2px 0 #000;
}

.logo {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: clamp(52px, 8vw, 108px);
  line-height: 1.05;
  color: var(--accent);
  letter-spacing: 0.01em;
  /* 로고처럼 검은 테두리 + 아래로 떨어지는 픽셀 그림자 */
  text-shadow:
    -4px 0 0 #2b1402, 4px 0 0 #2b1402, 0 -4px 0 #2b1402, 0 4px 0 #2b1402,
    -4px -4px 0 #2b1402, 4px -4px 0 #2b1402, -4px 4px 0 #2b1402, 4px 4px 0 #2b1402,
    0 10px 0 #000, 4px 10px 0 #000, -4px 10px 0 #000;
  margin-bottom: 18px;
}

.tagline {
  font-family: var(--pixel);
  font-size: clamp(17px, 2.1vw, 24px);
  color: var(--ink);
  text-shadow: 3px 3px 0 #000;
  margin: 0;
}

.tagline span {
  display: inline-block;
}

.badge {
  font-family: var(--pixel);
  font-size: clamp(15px, 1.8vw, 19px);
  color: #2a1a0a;
  background: linear-gradient(#f6e6c4, #e2c896);
  padding: 8px 22px 10px;
  box-shadow: inset 0 0 0 2px #7a5a2c, 0 0 0 3px #1c1208, 4px 5px 0 3px #000;
  margin: 0 0 24px;
}

.badge span {
  color: var(--accent-deep);
}

.play {
  display: grid;
  place-items: center;
  flex: none;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  color: var(--accent);
  background: radial-gradient(circle at 50% 40%, #3a220e, #1a0e05);
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 7px rgba(0, 0, 0, 0.7), 0 0 36px 6px rgba(255, 155, 38, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}

.play:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px var(--accent-hi), 0 0 0 7px rgba(0, 0, 0, 0.7), 0 0 48px 10px rgba(255, 155, 38, 0.6);
}

.play-i {
  width: 38px;
  height: 38px;
  margin-left: 6px;
}

.stage .fineprint {
  justify-content: center;
  max-width: 560px;
  margin: 18px 0 0;
  text-shadow: 1px 1px 0 #000;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 12px;
  translate: -50% 0;
  color: var(--accent-hi);
  animation: bob 1.6s steps(4) infinite;
}

.scroll-cue .i {
  width: 34px;
  height: 34px;
}

.stage-caption {
  position: absolute;
  right: var(--gutter);
  bottom: 22px;
  margin: 0;
  font-family: var(--pixel);
  font-size: 13px;
  color: var(--muted);
  text-shadow: 1px 1px 0 #000;
}

@keyframes bob {
  50% {
    transform: translateY(8px);
  }
}

/* ---------- 머리말 + 정보 ---------- */
.prologue {
  position: relative;
  padding: 24px 0 88px;
}

.prologue-inner {
  display: grid;
  gap: 32px;
  align-items: center;
}

.prologue-copy p {
  font-size: clamp(18px, 1.9vw, 21px);
  line-height: 1.85;
  color: var(--ink);
}

.facts-card {
  background: var(--panel);
  padding: 26px clamp(18px, 3vw, 30px);
  box-shadow: inset 0 0 0 2px var(--line);
}

.facts-card h2 {
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--accent);
}

.facts-card .facts {
  grid-template-columns: 1fr 1fr;
}

.facts-card .facts div {
  padding: 10px 14px;
}

/* ---------- 구간 공통 ---------- */
.sec {
  position: relative;
  padding: 104px 0;
}

.sec + .sec,
.prologue + .sec {
  border-top: 2px solid #000;
  box-shadow: inset 0 2px 0 var(--line);
}

.sec:nth-of-type(even) {
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255, 155, 38, 0.07), transparent 70%),
    var(--bg-raise);
}

.sec-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 48px;
}

.sec-head .kicker {
  margin-bottom: 10px;
}

.ornate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 18px;
}

.ornate::before,
.ornate::after {
  content: "";
  flex: 0 1 120px;
  height: 10px;
  background:
    linear-gradient(var(--accent), var(--accent)) center / 100% 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 50% / 10px 10px no-repeat;
}

.ornate::after {
  transform: scaleX(-1);
}

.sec-lede {
  color: var(--muted);
  font-size: 18px;
  margin: 0;
}

.sec-note {
  text-align: center;
  color: var(--dim);
  font-size: 14px;
  margin-top: 18px;
}

/* ---------- 트레일러 화면 ---------- */
.screen {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 0 0 3px #e2c896, 0 0 0 7px #1c1208, 0 0 0 9px #6b4a20, 0 24px 60px rgba(0, 0, 0, 0.6);
}

.corner {
  position: absolute;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: 3px solid #e2c896;
  pointer-events: none;
}

.corner.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.corner.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.corner.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

.screen.is-playing .corner {
  display: none;
}

.screen-video,
.screen-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.screen-video {
  image-rendering: auto;
}

.screen-cover {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: #000;
  color: inherit;
  cursor: pointer;
}

.screen-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.62);
  transition: filter 0.2s;
}

.screen-cover:hover img {
  filter: brightness(0.8);
}

.screen-cover .play {
  position: relative;
}

.screen-label {
  position: absolute;
  left: 50%;
  bottom: 26px;
  translate: -50% 0;
  font-family: var(--pixel);
  font-size: 15px;
  color: var(--ink);
  text-shadow: 2px 2px 0 #000;
  white-space: nowrap;
}

.screen.is-loading .play {
  animation: pulse 0.8s steps(2) infinite;
}

.screen-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.screen.is-failed + .sec-note + .screen-fallback {
  display: flex;
}

@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}

/* ---------- 이야기 (세 칸) ---------- */
.tablets {
  list-style: none;
  margin: 0 0 48px;
  padding: 0;
  display: grid;
  gap: 18px;
}

.tablet {
  position: relative;
  background: linear-gradient(var(--panel-2), var(--panel));
  padding: 30px 26px 26px;
  box-shadow: inset 0 0 0 2px var(--line-strong), inset 0 -5px 0 rgba(0, 0, 0, 0.45);
}

.tablet-no {
  display: block;
  font-family: var(--pixel);
  font-size: 44px;
  line-height: 1;
  color: var(--accent);
  text-shadow: 3px 3px 0 #000;
  margin-bottom: 14px;
}

.tablet h3 {
  font-family: var(--pixel);
  font-size: 24px;
}

.tablet p {
  color: var(--muted);
  margin: 0;
}

.sec-story .shot {
  max-width: 1000px;
  margin: 0 auto;
}

/* ---------- 꿈 던전 장면 넘기기 ---------- */
.sec-dreams .callout {
  max-width: 820px;
  margin: 0 auto 40px;
}

.reel-track {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 18px max(var(--gutter), calc((100vw - 820px) / 2));
  outline: none;
}

.reel-track::-webkit-scrollbar {
  display: none;
}

.reel-slide {
  flex: 0 0 min(820px, 86vw);
  margin: 0;
  scroll-snap-align: center;
  cursor: pointer;
  opacity: 0.45;
  transform: scale(0.9);
  transition: opacity 0.3s, transform 0.3s;
}

.reel-slide.is-active,
html:not(.js) .reel-slide {
  opacity: 1;
  transform: none;
  cursor: default;
}

.reel-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 0 0 3px #e2c896, 0 0 0 7px #1c1208, 0 18px 40px rgba(0, 0, 0, 0.55);
}

.reel-media img,
.reel-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-media video {
  opacity: 0;
  transition: opacity 0.6s;
}

.reel-slide.has-video.is-active .reel-title,
.reel-slide.is-playing-clip .reel-play.is-on {
  opacity: 1;
}

.reel-slide.is-playing-clip .reel-title {
  opacity: 0;
}

/* 실제 플레이 녹화는 픽셀 확대가 아니라 원래 화면이다 */
.reel-play,
.clip {
  image-rendering: auto;
}

.reel-badge {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  font-family: var(--pixel);
  font-size: 13px;
  padding: 3px 10px 5px;
  color: var(--accent-ink);
  background: var(--moss);
  box-shadow: 2px 2px 0 #000;
}

.reel-badge.is-full {
  color: var(--ink);
  background: #6b4a9a;
}

.reel-lock {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 20px;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(30, 14, 44, 0.86), rgba(8, 4, 12, 0.92));
  opacity: 0;
  transition: opacity 0.3s;
}

.reel-lock p {
  margin: 0;
  color: var(--muted);
  text-shadow: 1px 1px 0 #000;
}

.reel-lock .lock-title {
  font-family: var(--pixel);
  font-size: clamp(22px, 3vw, 32px);
  color: #d9b8ff;
  text-shadow: 3px 3px 0 #000, 0 0 18px rgba(170, 110, 255, 0.6);
}

.lock-i {
  width: 34px;
  height: 34px;
  color: #d9b8ff;
}

.reel-slide.is-full.is-active:hover .reel-lock,
.reel-slide.is-full.is-active:focus-visible .reel-lock,
.reel-slide.is-full.is-peek .reel-lock {
  opacity: 1;
}

.reel-slide figcaption {
  text-align: center;
  padding-top: 22px;
}

.reel-slide h3 {
  font-family: var(--pixel);
  font-size: 26px;
  color: var(--accent);
  text-shadow: 2px 2px 0 #000;
}

.reel-slide figcaption p {
  color: var(--muted);
  margin: 0;
}

.reel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 26px;
}

html:not(.js) .reel-controls {
  display: none;
}

.round {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  color: var(--accent);
  background: #1a0e05;
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.round:hover {
  color: var(--accent-hi);
  box-shadow: 0 0 0 2px var(--accent-hi), 0 0 0 5px rgba(0, 0, 0, 0.6), 0 0 22px rgba(255, 155, 38, 0.45);
}

.round .i {
  width: 26px;
  height: 26px;
}

.reel-dots {
  display: flex;
  gap: 10px;
}

.reel-dots button {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  background: var(--line-strong);
  transform: rotate(45deg);
  cursor: pointer;
}

.reel-dots button[aria-current="true"] {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255, 155, 38, 0.7);
}

/* ---------- 종족 고르기 ---------- */
.select-screen {
  display: grid;
  gap: 28px;
  align-items: start;
}

.select-stage {
  text-align: center;
  padding: 28px 24px 30px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 38%, rgba(255, 155, 38, 0.18), transparent 70%),
    var(--panel);
  box-shadow: inset 0 0 0 2px var(--line-strong);
}

html:not(.js) .select-stage {
  display: none;
}

.select-portrait {
  width: min(240px, 60vw);
  aspect-ratio: 1;
  margin: 0 auto 12px;
}

.select-portrait {
  position: relative;
}

.select-portrait img {
  width: 100%;
  height: 100%;
  transition: opacity 0.35s, transform 0.35s;
}

.select-sprite {
  position: absolute;
  left: 50%;
  bottom: 0;
  translate: -50% 0;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.35s, transform 0.35s;
}

.select-stage.show-sprite .select-portrait img {
  opacity: 0;
  transform: scale(1.12);
}

.select-stage.show-sprite .select-sprite {
  opacity: 1;
  transform: none;
}

.select-stage.is-swapping .select-portrait {
  animation: hop 0.32s steps(3);
}

@keyframes hop {
  40% {
    transform: translateY(-12px);
  }
}

.select-name {
  font-family: var(--pixel);
  font-size: 30px;
  color: var(--accent);
  text-shadow: 3px 3px 0 #000;
  margin-bottom: 8px;
}

.select-body {
  color: var(--ink);
  margin: 0;
  min-height: 3.5em;
}

.lineage-grid {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.lineage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  border: 0;
  color: var(--muted);
  background: var(--panel);
  box-shadow: inset 0 0 0 2px var(--line);
  font: inherit;
  cursor: pointer;
  transition: box-shadow 0.12s, transform 0.12s;
}

.lineage img {
  width: 80px;
  height: 80px;
}

.lineage:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 2px var(--line-strong);
}

.lineage[aria-pressed="true"] {
  color: var(--ink);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 18px rgba(255, 155, 38, 0.3);
}

.lineage-name {
  font-family: var(--pixel);
  font-size: 14px;
}

.lineage-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--dim);
}

.js .lineage-body {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- 신들 ---------- */
.pantheon {
  list-style: none;
  margin: 0 0 56px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.god {
  flex: 0 0 148px;
  text-align: center;
  padding: 18px 10px 16px;
  background:
    radial-gradient(ellipse 70% 45% at 50% 34%, rgba(255, 196, 99, 0.12), transparent 70%),
    var(--panel);
  box-shadow: inset 0 0 0 2px var(--line);
  transition: transform 0.15s, box-shadow 0.15s;
}

.god:hover {
  transform: translateY(-4px);
  box-shadow: inset 0 0 0 2px var(--accent-deep), 0 10px 24px rgba(0, 0, 0, 0.5), 0 0 22px rgba(255, 155, 38, 0.18);
}

.god-portrait {
  width: 96px;
  margin: 0 auto 10px;
}

.god-portrait img {
  width: 96px;
  height: 127px;
}

.god-name {
  font-family: var(--pixel);
  font-size: 14px;
  color: var(--accent-hi);
  margin: 0 0 4px;
  line-height: 1.4;
}

.god-epithet {
  font-size: 13px;
  line-height: 1.45;
  color: var(--dim);
  margin: 0;
}

.altar {
  align-items: center;
}

/* ---------- 게임 특징 ---------- */
.features {
  display: grid;
  gap: 64px;
}

.feature {
  display: grid;
  gap: 26px;
  align-items: center;
}

.feature h3 {
  font-family: var(--pixel);
  font-size: clamp(22px, 2.6vw, 28px);
  color: var(--accent);
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 14px;
}

.feature p {
  color: var(--muted);
}

/* ---------- 안내 글 카드, 사양 ---------- */
.sec-guides .cards {
  max-width: 980px;
  margin: 0 auto;
}

.sec-specs h3 {
  font-family: var(--pixel);
  color: var(--accent);
}

/* ---------- 마지막 권유 ---------- */
.cta-band {
  position: relative;
  text-align: center;
  padding: 112px var(--gutter);
  overflow: hidden;
  isolation: isolate;
  background: var(--panel);
}

.page-article .cta-band {
  padding: 48px clamp(20px, 5vw, 56px);
  box-shadow: inset 0 0 0 2px var(--line-strong);
}

.cta-band.has-scene {
  clip-path: none;
  border-top: 2px solid #000;
}

.cta-bg::after {
  background: radial-gradient(ellipse 55% 60% at 50% 50%, rgba(13, 11, 10, 0.8), rgba(13, 11, 10, 0.94));
}

.cta-band h2 {
  font-size: clamp(30px, 4.4vw, 52px);
  color: var(--accent);
}

.cta-band p {
  color: var(--ink);
  max-width: 560px;
  margin: 0 auto;
  text-shadow: 1px 1px 0 #000;
}

.cta-band .ctas {
  justify-content: center;
  margin-bottom: 0;
}

.page-intro .crumbs ol {
  margin-top: 40px;
}

.page-intro .sources {
  margin-block: 24px 0;
}

/* ---------- 바닥 ---------- */
.foot {
  border-top: 2px solid #000;
  box-shadow: inset 0 2px 0 var(--line);
  margin-top: 56px;
  padding: 36px var(--gutter) 44px;
  font-size: 14px;
  color: var(--dim);
  text-align: center;
  background: #080706;
}

.foot p {
  margin: 0 auto 6px;
  max-width: 720px;
}

.foot-brand {
  font-family: var(--pixel);
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 12px !important;
}

/* 화면 아래 해시태그 줄: 검색어를 숨기지 않고 보이게 둔다 */
.foot-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  margin: 14px auto 16px !important;
  font-family: var(--pixel);
  font-size: 13px;
  color: var(--dim);
}

/* 자주 묻는 질문 */
.faq {
  display: grid;
  gap: 10px;
  max-width: 860px;
  margin: 0 auto;
}

.faq-item {
  background: rgba(21, 17, 14, 0.92);
  box-shadow: inset 0 0 0 2px var(--line);
}

.faq-item[open] {
  box-shadow: inset 0 0 0 2px var(--line-strong);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  font-family: var(--pixel);
  font-size: 17px;
  line-height: 1.45;
  color: var(--accent-hi);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

/* 펼침 표시: 픽셀 꺾쇠(펼치면 위로) */
.faq-item summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  transform: translateY(-3px) rotate(45deg);
}

.faq-item[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.faq-item summary:hover {
  color: var(--ink);
}

.faq-item p {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.faq-item a {
  color: var(--accent);
  white-space: nowrap;
}

.dock {
  display: none;
}

/* ---------- 미리보기 목차 (운영 대상 아님) ---------- */
.page-review main {
  padding: 40px 0;
}

.table-scroll {
  overflow-x: auto;
  box-shadow: inset 0 0 0 1px var(--line);
}

.review {
  border-collapse: collapse;
  min-width: 960px;
  font-size: 15px;
  line-height: 1.6;
}

.review th,
.review td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.review thead th {
  background: var(--panel);
  font-size: 14px;
}

.review a {
  color: var(--accent);
}

.count {
  display: inline-block;
  font-size: 12px;
  color: var(--dim);
  background: var(--panel);
  padding: 0 6px;
}

/* ==========================================================
 * 화면 너비
 * ========================================================== */
@media (min-width: 560px) {
  .facts:not(.single) {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 760px) {
  .page-article .facts:not(.single) {
    grid-template-columns: repeat(3, 1fr);
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .spec-grid {
    grid-template-columns: 1fr 1fr;
  }

  .glossary div {
    grid-template-columns: 8em 1fr;
  }

  .tablets {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }

  .prologue-inner {
    grid-template-columns: 1.15fr 1fr;
    gap: 56px;
  }

  .select-screen {
    grid-template-columns: 340px 1fr;
    gap: 36px;
  }

  .select-stage {
    position: sticky;
    top: calc(var(--top-h) + 24px);
  }

  .feature {
    grid-template-columns: 1.1fr 1fr;
    gap: 52px;
  }

  .feature:nth-child(even) .shot {
    order: 2;
  }
}


@media (max-width: 759px) {
  :root {
    --gutter: 16px;
    --top-h: 56px;
  }

  body {
    padding-bottom: 84px;
  }

  .top-inner {
    gap: 14px;
  }

  .brand {
    font-size: 19px;
  }

  .top-cta {
    margin-left: auto;
    padding: 0 16px;
    font-size: 15px;
  }

  .sec {
    padding: 72px 0;
  }

  .page-article main > section,
  .page-article main > header,
  .related,
  .sources {
    margin-block: 56px;
  }

  .stage {
    padding-bottom: 56px;
  }

  .stage-actions {
    gap: 12px;
  }

  .stage-actions .ctas {
    flex: 1 1 100%;
  }

  /* 좁은 화면: 장면은 위쪽 칸에만 깔고(수쿠마가 다 들어오게) 버튼은 장면 아래로 내린다 */
  .stage {
    --scene-h: min(76svh, 660px);
    min-height: 0;
    justify-content: flex-start;
    gap: 0;
    padding-bottom: 40px;
  }

  .stage-bg {
    bottom: auto;
    height: var(--scene-h);
  }

  .stage-bg img,
  .stage-bg video {
    object-position: 8% 60%;
  }

  .stage-top {
    min-height: calc(var(--scene-h) - var(--top-h) - 20px);
  }

  .scroll-cue {
    display: none;
  }

  .play {
    width: 76px;
    height: 76px;
  }

  .play-i {
    width: 30px;
    height: 30px;
  }

  .ctas .btn {
    flex: 1 1 100%;
  }

  .stage-caption {
    display: none;
  }

  .facts-card .facts {
    grid-template-columns: 1fr;
  }

  .reel-track {
    gap: 14px;
  }

  .reel-slide {
    flex-basis: 88vw;
  }

  .lineage-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .lineage img {
    width: 48px;
    height: 48px;
  }

  .lineage-name {
    font-size: 12px;
  }

  .pantheon {
    gap: 8px;
  }

  .god {
    flex-basis: calc((100% - 16px) / 3);
  }

  .god {
    padding: 12px 4px 10px;
  }

  .god-portrait,
  .god-portrait img {
    width: 72px;
  }

  .god-portrait img {
    height: 95px;
  }

  .god-name {
    font-size: 12px;
  }

  .god-epithet {
    font-size: 11px;
  }

  .ornate::before,
  .ornate::after {
    flex-basis: 36px;
  }

  /* 비교표: 좁은 화면에서는 행마다 카드로 쌓는다 */
  .compare thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .compare,
  .compare tbody,
  .compare tr,
  .compare th,
  .compare td {
    display: block;
  }

  .compare tr {
    background: var(--panel);
    box-shadow: inset 0 0 0 1px var(--line);
    margin-bottom: 12px;
  }

  .compare caption {
    display: block;
    padding: 0 0 12px;
  }

  .compare tbody th {
    background: var(--panel-2);
    white-space: normal;
  }

  .compare td::before {
    content: attr(data-label);
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--dim);
    margin-bottom: 2px;
  }

  .compare tr > :last-child {
    border-bottom: 0;
  }

  .dock {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    background: rgba(13, 11, 10, 0.96);
    border-top: 2px solid #000;
    box-shadow: 0 -2px 0 var(--line);
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  }

  .dock .btn {
    width: 100%;
  }
}


/* ==========================================================
 * 2차: 짙은 배경, 드러남 연출, 플레이 영상, 신 카드, 배경음악, 마스코트
 * ========================================================== */
.has-bg {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.sec-bg,
.page-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #000;
}

.page-bg {
  position: fixed;
  z-index: -2;
}

.sec-bg img,
.sec-bg video,
.page-bg img,
.page-bg video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sec-bg video,
.page-bg video,
.stage-video {
  opacity: 0;
  transition: opacity 0.8s;
}

.sec-bg video.is-on,
.page-bg video.is-on,
.stage-video.is-on {
  opacity: 1;
}

.sec-bg::after,
.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--bg), rgba(13, 11, 10, 0.55) 18%, rgba(13, 11, 10, 0.55) 82%, var(--bg)),
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(13, 11, 10, 0.35), rgba(13, 11, 10, 0.8));
}

.page-bg::after {
  background: linear-gradient(rgba(13, 11, 10, 0.72), rgba(13, 11, 10, 0.9));
}

.page-article main > section,
.page-article main > header {
  position: relative;
}

/* 어두웠다가 스크롤해 들어오면 가운데에서 장면이 터지듯 퍼진다 */
html.js [data-reveal] > .sec-bg {
  clip-path: circle(0% at 50% 45%);
  filter: brightness(2.2) saturate(0.4) blur(6px);
  transition: clip-path 1.25s cubic-bezier(0.2, 0.8, 0.2, 1), filter 1.6s ease-out;
}

html.js [data-reveal].is-revealed > .sec-bg {
  clip-path: circle(80% at 50% 45%);
  filter: none;
}

html.js [data-reveal] .sec-head,
html.js [data-reveal] .tablet,
html.js .feature[data-reveal],
html.js [data-reveal] .prologue-inner,
html.js [data-reveal] .cta-inner {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

html.js [data-reveal].is-revealed .sec-head,
html.js [data-reveal].is-revealed .tablet,
html.js .feature[data-reveal].is-revealed,
html.js [data-reveal].is-revealed .prologue-inner,
html.js [data-reveal].is-revealed .cta-inner {
  opacity: 1;
  transform: none;
}

html.js [data-reveal].is-revealed .tablet:nth-child(2) {
  transition-delay: 0.15s;
}

html.js [data-reveal].is-revealed .tablet:nth-child(3) {
  transition-delay: 0.3s;
}

.prologue.has-bg {
  padding-top: 72px;
}

.sec:nth-of-type(even).has-bg {
  background: transparent;
}

/* ---------- 이야기 카드의 플레이 영상 ---------- */
.tablet-media {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: -12px -8px 20px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 8px, transparent 8px 16px),
    #07060a;
  box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--line-strong);
}

.tablet-media video,
.shot.has-clip video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s;
}

.tablet-media video.is-on,
.shot.has-clip video.is-on {
  opacity: 1;
}

.sec-story .tablets {
  margin-bottom: 0;
}

/* ---------- 신 ---------- */
.sec-hint {
  text-align: center;
  color: var(--accent-hi);
  font-size: 15px;
  margin: -24px 0 32px;
}

.god {
  position: relative;
  cursor: pointer;
}

.god-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--pixel);
  font-size: 11px;
  padding: 1px 6px 3px;
  color: var(--accent-ink);
  background: var(--moss);
}

.god-badge.is-full {
  color: var(--ink);
  background: #6b4a9a;
}

.god-portrait {
  position: relative;
}

.god-tarot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84px;
  height: auto;
  translate: -50% -50%;
  opacity: 0;
  transform: rotateY(90deg);
  transition: opacity 0.25s, transform 0.35s;
}

.god.is-full:hover .god-tarot,
.god.is-full:focus-visible .god-tarot {
  opacity: 1;
  transform: rotateY(0) rotate(-4deg);
  filter: drop-shadow(0 0 10px rgba(190, 130, 255, 0.7));
}

.god.is-full:hover .god-portrait > img:first-child,
.god.is-full:focus-visible .god-portrait > img:first-child {
  opacity: 0.15;
}

.god.is-demo:hover,
.god.is-demo:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent), 0 10px 24px rgba(0, 0, 0, 0.5), 0 0 26px rgba(255, 155, 38, 0.35);
}

/* 섬기기 카드: 신 자리에서 날아와 뒤집히며 자리를 잡는다 */
.covenant-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  perspective: 1400px;
}

.covenant-layer[data-side="right"] {
  justify-content: flex-end;
  padding-right: max(24px, calc((100vw - var(--max)) / 2));
}

.covenant-layer[data-side="left"] {
  justify-content: flex-start;
  padding-left: max(24px, calc((100vw - var(--max)) / 2));
}

.covenant-layer[data-side="center"] {
  background: rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

.cv-card {
  position: relative;
  width: min(440px, 92vw);
  max-height: min(84vh, 760px);
  pointer-events: auto;
  transform-style: preserve-3d;
}

/* 마우스를 올려 연 카드는 보기만 한다(마우스가 지나가 밑의 신 칸에 닿는다). 눌러서 연 카드만 손에 잡힌다 */
.cv-card.is-preview {
  pointer-events: none;
}

.cv-card.is-flying {
  animation: cv-fly 0.9s cubic-bezier(0.18, 0.9, 0.25, 1.05) both;
}

@keyframes cv-fly {
  0% {
    transform: translate(var(--from-x), var(--from-y)) scale(0.2) rotateY(540deg) rotateZ(-30deg);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  70% {
    transform: translate(0, 0) scale(1.04) rotateY(-12deg) rotateZ(2deg);
  }
  100% {
    transform: none;
  }
}

.cv-face {
  backface-visibility: hidden;
}

.cv-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform: rotateY(180deg);
  background: #120a1c;
  box-shadow: 0 0 0 3px #e2c896, 0 0 0 6px #1c1208;
}

.cv-back img {
  width: 70%;
  height: auto;
}

.cv-front {
  position: relative;
  max-height: min(84vh, 760px);
  overflow: auto;
  padding: 26px 26px 22px;
  text-align: left;
  color: #ede8f7;
  font-family: var(--pixel);
  font-size: 14px;
  line-height: 1.6;
  background: linear-gradient(#1b1430, #120d22);
  box-shadow: 0 0 0 2px #ff9b26, 0 0 0 5px #120d22, 0 0 0 7px #a5580f, 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 60px color-mix(in srgb, var(--god) 35%, transparent);
}

.cv-backdrop {
  position: absolute;
  top: 0;
  left: 50%;
  width: 240px;
  height: auto;
  translate: -50% 0;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.cv-front > :not(.cv-backdrop) {
  position: relative;
  z-index: 1;
}

.cv-close {
  position: absolute !important;
  top: 6px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #aba3bf;
  font-size: 22px;
  cursor: pointer;
}

.cv-name {
  font-family: "Song Myung", serif;
  font-size: 30px;
  font-weight: 400;
  text-align: center;
  color: #ffb838;
  text-shadow: 0.6px 0 0 #ffb838, 2px 2px 0 #000;
  margin: 18px 0 2px;
}

.cv-sub {
  font-family: "Song Myung", serif;
  font-size: 17px;
  text-align: center;
  color: #c7bdd1;
  margin: 0 0 8px;
  white-space: pre;
}

.cv-rule {
  border: 0;
  height: 2px;
  background: var(--god);
  margin: 0 0 14px;
}

.cv-warn {
  color: #ff8073;
  font-weight: 700;
  margin: 0 0 12px;
}

.cv-quote {
  font-family: "Song Myung", serif;
  font-size: 18px;
  line-height: 1.7;
  text-align: center;
  text-shadow: 0.5px 0 0 currentColor;
  margin: 0 0 16px;
}

.cv-head {
  color: #ffb842;
  font-weight: 700;
  margin: 10px 0 2px;
  white-space: pre-wrap;
}

.cv-head.cv-offer {
  color: #ff9e24;
}

.cv-body {
  margin: 0;
}

.cv-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #a5580f;
}

.cv-buttons span {
  min-width: 130px;
  text-align: center;
  padding: 8px 12px 10px;
  color: #e0d6c7;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px #4a3d62;
}

.cv-buttons .is-selected {
  color: #ffd46b;
  background: rgba(165, 88, 15, 0.45);
  box-shadow: inset 0 0 0 1px #ffb842;
}

.cv-card.is-sealed .cv-front {
  text-align: center;
  padding-bottom: 40px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(150, 90, 230, 0.35), transparent 70%),
    linear-gradient(#1b1430, #0d0918);
  box-shadow: 0 0 0 2px #b98cff, 0 0 0 5px #120d22, 0 0 0 7px #6b4a9a, 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 70px rgba(170, 110, 255, 0.45);
}

.cv-card.is-sealed .cv-backdrop {
  position: relative;
  display: block;
  left: auto;
  translate: none;
  margin: 0 auto 4px;
  width: 160px;
  opacity: 0.9;
  filter: grayscale(0.6) brightness(0.6) drop-shadow(0 0 16px rgba(190, 130, 255, 0.8));
}

.cv-sealed-title {
  font-size: 26px;
  color: #d9b8ff;
  text-shadow: 3px 3px 0 #000, 0 0 18px rgba(170, 110, 255, 0.7);
  margin: 6px 0 6px;
}

.cv-sealed-body {
  color: #c7bdd1;
  margin: 0;
}

.cv-card.is-sealed::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28) 45%, transparent 60%) -200% 0 / 250% 100% no-repeat;
  animation: cv-shine 2.4s 0.9s ease-in-out infinite;
}

@keyframes cv-shine {
  to {
    background-position: 200% 0;
  }
}

/* ---------- 배경음악 ---------- */
.bgm {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 14px;
  padding: 6px 12px 8px;
  border: 0;
  font-family: var(--pixel);
  font-size: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  cursor: pointer;
}

.bgm .i {
  width: 16px;
  height: 16px;
}

.bgm[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--accent-hi);
  box-shadow: none;
}

.bgm[aria-pressed="true"] .i {
  animation: bob 0.8s steps(2) infinite;
}

/* ---------- 마스코트 ---------- */
.ss-walker {
  --ss-walker-z: 35;
  --ss-bubble-size: 13px;
  --ss-bubble-max: 240px;
}

@media (max-width: 759px) {
  .ss-walker[data-fixed] {
    bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  }

  .bgm span {
    display: none;
  }

  .bgm {
    margin-right: 6px;
    padding: 8px;
  }

  .covenant-layer {
    align-items: center;
  }

  .sec-hint {
    margin-top: -16px;
  }
}

/* 이야기 아래 큰 녹화: 깨어난 수호자 */
.story-clip {
  margin-top: 40px;
}

.story-clip img {
  display: block;
}

/* 쭈니 춤: 게임에 춤 동작이 없어서 대기 그림 위에 깡총 뛰기와 좌우 돌기를 픽셀 박자로 얹는다 */
.ss-walker[data-dancing] > canvas {
  transform-origin: 50% 100%;
  animation: jj-dance 0.64s steps(1) infinite;
}

.ss-walker[data-dancing]::after {
  content: "♪";
  position: absolute;
  left: 70%;
  top: -10px;
  font-family: var(--pixel);
  font-size: 16px;
  color: var(--accent-hi);
  text-shadow: 1px 1px 0 #000;
  animation: jj-note 0.64s steps(4) infinite;
}

@keyframes jj-dance {
  0% { transform: translateY(0) scaleX(1); }
  25% { transform: translateY(-6px) scaleX(1); }
  50% { transform: translateY(0) scaleX(-1); }
  75% { transform: translateY(-6px) scaleX(-1); }
}

@keyframes jj-note {
  0% { transform: translate(0, 0); opacity: 1; }
  100% { transform: translate(6px, -14px); opacity: 0; }
}

/* ==========================================================
 * 3차: 안내 글을 만화 칸으로
 * ========================================================== */
.art {
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 8px, transparent 8px 16px),
    #07060a;
}

.art-clip,
.art-scene,
.art-shot {
  aspect-ratio: 16 / 9;
}

.art video,
.art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art video {
  opacity: 0;
  transition: opacity 0.5s;
}

.art video.is-on {
  opacity: 1;
}

.art-clip video {
  image-rendering: auto;
}

.art-sprite {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background: radial-gradient(ellipse 60% 60% at 50% 55%, rgba(255, 155, 38, 0.18), transparent 70%), #120d0a;
}

.art-sprite img {
  position: static;
  width: auto;
  height: 82%;
  object-fit: contain;
}

/* 말풍선 */
.say {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 12px 0;
}

.say > img {
  flex: none;
  width: 56px;
  height: 56px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 2px var(--line-strong), 2px 2px 0 #000;
}

.say > p,
.say > div {
  position: relative;
  margin: 0;
  padding: 10px 14px 12px;
  font-family: var(--pixel);
  font-size: 15px;
  line-height: 1.6;
  color: #19161d;
  background: #f5f1e8;
  box-shadow: 3px 3px 0 #000;
}

.say > p::before,
.say > div::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 16px;
  border: 4px solid transparent;
  border-right-color: #f5f1e8;
  border-top-color: #f5f1e8;
}

.say b {
  display: block;
  font-size: 12px;
  color: var(--accent-deep);
  margin-bottom: 2px;
}

.say-jjooni > p,
.say-jjooni > div {
  background: #fff3c4;
}

.say-jjooni > p::before,
.say-jjooni > div::before {
  border-right-color: #fff3c4;
  border-top-color: #fff3c4;
}

.say-long > div {
  font-family: var(--body);
  font-size: 16px;
}

.say-long > div p {
  margin: 0 0 8px;
  color: #19161d;
}

.say-long > div p:last-child {
  margin: 0;
}

/* 만화 칸 */
.comic {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
}

.panel {
  background: var(--panel);
  padding: 14px;
  box-shadow: inset 0 0 0 2px var(--line-strong), 5px 5px 0 #000;
}

.panel-art {
  position: relative;
  box-shadow: 0 0 0 2px #000;
}

.panel-no {
  position: absolute;
  z-index: 2;
  left: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  font-family: var(--pixel);
  font-size: 22px;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent-deep), 3px 3px 0 #000;
}

.panel-copy {
  padding: 16px 6px 4px;
}

.panel-copy h3 {
  font-family: var(--pixel);
  font-size: clamp(22px, 2.6vw, 28px);
  color: var(--accent);
  text-shadow: 2px 2px 0 #000;
  margin: 0 0 6px;
}

.more {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
}

.more summary {
  cursor: pointer;
  font-family: var(--pixel);
  font-size: 13px;
  color: var(--dim);
}

.more summary:hover {
  color: var(--accent-hi);
}

.more p {
  margin: 8px 0 0;
}

html.js .panel[data-reveal] {
  opacity: 0;
  transform: translateY(30px) rotate(-1deg);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

html.js .panel[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* 첫 판 요령 카드 */
.tip-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.tip {
  position: relative;
  padding: 22px 18px 16px 18px;
  background: var(--panel);
  box-shadow: inset 0 0 0 2px var(--line), 4px 4px 0 #000;
}

.tip p {
  margin: 0;
  font-size: 16px;
}

.tip-no {
  position: absolute;
  top: -12px;
  left: 14px;
  padding: 0 8px 2px;
  font-family: var(--pixel);
  font-size: 16px;
  color: var(--accent-ink);
  background: var(--accent-hi);
  box-shadow: 2px 2px 0 #000;
}

html.js .tip[data-reveal] {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.45s, transform 0.45s;
}

html.js .tip[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* 용어 풀이는 낱말 카드로 */
.page-article .glossary {
  border-top: 0;
  display: grid;
  gap: 12px;
}

.page-article .glossary div {
  display: block;
  padding: 14px 16px;
  border-bottom: 0;
  background: var(--panel);
  box-shadow: inset 0 0 0 2px var(--line);
}

.page-article .glossary dt {
  font-family: var(--pixel);
  font-size: 18px;
  margin-bottom: 4px;
}

/* 짧은 답: 수쿠마가 말한다 */
.answer.has-speaker {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.answer.has-speaker > img {
  flex: none;
  width: 80px;
  height: 80px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 2px var(--line-strong);
}

/* 비교표의 그림 */
.compare td.has-art .art {
  width: 160px;
  margin-bottom: 8px;
  box-shadow: 0 0 0 2px #000;
}

.compare td.has-art .art-sprite {
  width: 96px;
}

@media (min-width: 760px) {
  .comic {
    grid-template-columns: 1fr 1fr;
  }

  .comic .panel:first-child {
    grid-column: 1 / -1;
  }

  .tip-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .page-article .glossary {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 759px) {
  .page-article .glossary {
    grid-template-columns: 1fr 1fr;
  }

  .say > img {
    width: 44px;
    height: 44px;
  }

  .compare td.has-art .art {
    width: 100%;
  }
}

/* ==========================================================
 * 안내 글은 가운데 정렬. 페이지 스크롤은 자유롭게 둔다
 * (4차에 구간마다 걸리게 했다가, 내리는 감이 안 좋다는 20차 피드백으로 걸림을 모두 뺐다)
 * ========================================================== */
/* 메뉴로 구간에 갈 때 머리 메뉴에 가리지 않게만 */
html {
  scroll-padding-top: var(--top-h);
}

/* 안내 글: 가운데 정렬이 기본 */
.page-article .crumbs ol {
  justify-content: center;
}

.page-article main,
.page-article .related,
.page-article .sources {
  text-align: center;
}

.page-article main > section,
.page-article main > header,
.page-article .related,
.page-article .sources {
  margin-inline: auto;
}

.page-article .article-head h1,
.page-article .article-head .lede,
.page-article .article-head .shot,
.page-article .narrow {
  margin-inline: auto;
}

.page-article main h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.page-article main h2::before,
.page-article main h2::after {
  content: "";
  flex: 0 1 100px;
  height: 10px;
  background:
    linear-gradient(var(--accent), var(--accent)) center / 100% 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 50% / 10px 10px no-repeat;
}

.page-article main h2::after {
  transform: scaleX(-1);
}

.page-article .answer h2::before,
.page-article .answer h2::after {
  display: none;
}

.page-article .comic {
  max-width: 1040px;
  margin-inline: auto;
}

.page-article .panel-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-article .say {
  justify-content: center;
  text-align: left;
}

.page-article .say-long {
  max-width: 760px;
  margin-inline: auto;
}

.page-article .more p {
  text-align: left;
}

.page-article .tip-cards,
.page-article .glossary,
.page-article .ticks {
  max-width: 980px;
  margin-inline: auto;
}

.page-article .ticks {
  justify-items: center;
}

.page-article .tip {
  text-align: center;
}

.page-article .tip-no {
  left: 50%;
  translate: -50% 0;
}

.page-article .answer.has-speaker {
  justify-content: center;
  text-align: left;
  max-width: 880px;
  margin-inline: auto;
}

.page-article .compare caption {
  text-align: center;
}

.page-article .compare td.has-art .art {
  margin-inline: 0;
}

.page-article .sources ul {
  list-style: none;
  padding: 0;
}

.page-article .cards {
  max-width: 980px;
  margin-inline: auto;
}

/* ==========================================================
 * 5차: 글 뒤에 판을 깔아 읽기 쉽게, 빈 카드에 안내 인물, 한 턴씩
 * ========================================================== */
.page-article .article-head,
.page-article main > section:not(.comic-sec):not(.cta-band):not(.band):not(.answer),
.page-article .related,
.page-article .sources {
  background: rgba(16, 13, 11, 0.93);
  padding: 32px clamp(16px, 4vw, 44px);
  box-shadow: inset 0 0 0 2px var(--line), 5px 5px 0 rgba(0, 0, 0, 0.6);
}

.page-article .band {
  background: rgba(28, 23, 19, 0.96);
}

.page-article .comic-sec > h2 {
  display: flex;
  width: fit-content;
  margin-inline: auto;
  padding: 10px 24px 12px;
  background: rgba(16, 13, 11, 0.93);
  box-shadow: inset 0 0 0 2px var(--line);
}

/* 소개 페이지에서도 배경 위 글은 판 위에 */
.sec-lede,
.select-side .ticks,
.altar .ticks,
.feature-copy {
  background: rgba(16, 13, 11, 0.82);
  padding: 14px 18px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.sec-lede {
  display: inline-block;
}

/* 빈 카드 옆 안내 인물 */
.band.has-guide {
  display: grid;
  gap: 18px;
  align-items: end;
}

.guide-char {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.guide-say {
  position: relative;
  max-width: 260px;
  margin: 0;
  padding: 10px 14px 12px;
  font-family: var(--pixel);
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
  color: #19161d;
  background: #f5f1e8;
  box-shadow: 3px 3px 0 #000;
}

.guide-say::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  translate: -50% 0;
  border: 4px solid transparent;
  border-top-color: #f5f1e8;
  border-left-color: #f5f1e8;
}

.guide-say b {
  display: block;
  font-size: 12px;
  color: var(--accent-deep);
}

/* 16x24 전신, 대기 2프레임을 6배로 */
.guide-sprite {
  display: block;
  width: 96px;
  height: 144px;
  background-image: var(--sheet);
  background-size: 192px 288px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  animation: guide-idle 0.36s steps(2) infinite;
}

@keyframes guide-idle {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -192px 0;
  }
}

@media (min-width: 760px) {
  .band.has-guide {
    grid-template-columns: 1fr auto;
  }
}

/* 한 턴씩 */
.turn-badge {
  position: absolute;
  z-index: 2;
  right: 12px;
  top: 12px;
  padding: 4px 12px 6px;
  font-family: var(--pixel);
  font-size: 18px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.75);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.turn-badge b {
  color: var(--accent-hi);
}

[data-turns].is-tick .turn-badge {
  animation: turn-tick 0.25s steps(2);
}

@keyframes turn-tick {
  50% {
    transform: scale(1.18);
    background: var(--accent);
  }
}

/* 비교표 글은 판 위에서 또렷하게 */
.page-article .compare td {
  color: #d9ccb8;
}

/* 걸어 다니는 수쿠마·쭈니는 안내 글에서도 맨 앞에 보인다(클릭은 통과한다). 폰에서는 아래 고정 단추 위를 걷는다. */
.page-article .ss-walker {
  z-index: 35;
}

/* 6차: 혼자 남은 마지막 칸은 가로로 펼쳐 오른쪽을 채운다 */
@media (min-width: 760px) {
  .comic .panel:last-child:nth-child(even) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 24px;
    align-items: center;
  }

  .comic .panel:last-child:nth-child(even) .panel-copy {
    padding: 8px 12px;
  }
}

/* 숙련 다섯: 스크롤해 들어오면 게이지가 차오른다 */
.skill-gauges {
  list-style: none;
  width: min(420px, 100%);
  margin: 14px auto 4px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 2px var(--line);
}

.skill-gauges li {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  align-items: center;
  gap: 10px;
  font-family: var(--pixel);
  font-size: 14px;
  text-align: left;
}

.skill-gauges i {
  position: relative;
  height: 12px;
  background: #0b0908;
  box-shadow: inset 0 0 0 2px #3a2f26;
}

.skill-gauges i::after {
  content: "";
  position: absolute;
  inset: 2px auto 2px 2px;
  width: 0;
  background: repeating-linear-gradient(90deg, var(--accent) 0 6px, var(--accent-hi) 6px 8px);
  transition: width 1.2s steps(12);
}

.panel.is-revealed .skill-gauges i::after,
html:not(.js) .skill-gauges i::after {
  width: calc(var(--fill) - 4px);
}

.skill-gauges li:nth-child(2) i::after { transition-delay: 0.15s; }
.skill-gauges li:nth-child(3) i::after { transition-delay: 0.3s; }
.skill-gauges li:nth-child(4) i::after { transition-delay: 0.45s; }
.skill-gauges li:nth-child(5) i::after { transition-delay: 0.6s; }

/* 7차: 숙련 19, 갈래 셋 */
.skill-board {
  display: grid;
  gap: 12px;
  width: min(980px, 100%);
  margin: 14px auto 4px;
  text-align: left;
}

.skill-board .skill-gauges {
  width: 100%;
  margin: 0;
}

.skill-group {
  padding: 10px 12px 12px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 2px var(--line);
}

.skill-group .skill-gauges {
  padding: 0;
  background: none;
  box-shadow: none;
}

.skill-group-name {
  margin: 0 0 8px;
  font-family: var(--pixel);
  font-size: 15px;
  color: var(--accent-hi);
}

.skill-weapons .skill-gauges i::after {
  background: repeating-linear-gradient(90deg, #b8c4d6 0 6px, #e6edf7 6px 8px);
}

.skill-spells .skill-group-name {
  color: #b9a4ff;
}

.skill-spells .skill-gauges i::after {
  background: repeating-linear-gradient(90deg, #7a5cff 0 6px, #67d0ff 6px 8px);
}

@media (min-width: 760px) {
  .skill-board {
    grid-template-columns: 1fr 1fr 1.7fr;
    align-items: start;
  }

  .skill-spells .skill-gauges {
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
  }
}

/* ==========================================================
 * 8차: 언어 선택과 언어별 글꼴
 * ========================================================== */
.top-cta {
  margin-right: 0;
}

.lang-menu {
  position: relative;
  align-self: stretch;
  display: flex;
  margin-right: calc(-1 * var(--gutter));
}

.lang-menu summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
  font-family: var(--pixel);
  font-size: 15px;
  color: var(--ink);
  background: #1c1713;
  box-shadow: inset 2px 0 0 #000, inset 0 -3px 0 #000;
  white-space: nowrap;
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-menu summary .i {
  width: 18px;
  height: 18px;
  color: var(--accent-hi);
}

.lang-menu[open] summary {
  background: var(--panel-2);
}

.lang-menu ul {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 60;
  min-width: 160px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #120e0b;
  box-shadow: inset 0 0 0 2px var(--line-strong), 4px 4px 0 #000;
}

.lang-menu a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  font-size: 15px;
  color: var(--muted);
}

.lang-menu a:hover,
.lang-menu a[aria-current="true"] {
  color: var(--ink);
  background: rgba(255, 155, 38, 0.12);
}

.lang-menu a[aria-current="true"]::before {
  content: "◆ ";
  color: var(--accent);
}

@media (max-width: 759px) {
  .lang-menu summary {
    padding: 0 10px;
  }

  .lang-menu summary span {
    display: none;
  }
}

/* 일본어: Galmuri11 굵은 파일에는 가나·한자가 없다. 게임처럼 보통 굵기 파일 하나로 굵은 글도 쓴다. */
@font-face {
  font-family: "DS Galmuri JA";
  src: url("https://cdn.jsdelivr.net/npm/galmuri@2.40.3/dist/Galmuri11.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

html[lang="ja"] {
  --pixel: "DS Galmuri JA", "Galmuri11", ui-monospace, monospace;
  --body: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
}

html[lang="ja"] .cv-name,
html[lang="ja"] .cv-sub,
html[lang="ja"] .cv-quote {
  font-family: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
}

/* 중국어 간체: Galmuri 에 간체 한자가 없어 게임과 같은 Fusion Pixel 12px 간체를 쓴다. 굵은 파일이 없다. */
html[lang="zh-Hans"] {
  --pixel: "Fusion Pixel 12px Proportional Simplified Chinese", ui-monospace, monospace;
  --body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

html[lang="zh-Hans"] .cv-name,
html[lang="zh-Hans"] .cv-sub,
html[lang="zh-Hans"] .cv-quote {
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Noto Serif SC", serif;
}

html[lang="zh-Hans"] body,
html[lang="ja"] body {
  word-break: normal;
  line-break: strict;
}

/* 영어는 낱말이 길다: 큰 픽셀 제목의 자간과 줄 높이를 살짝 */
html[lang="en"] .logo {
  letter-spacing: 0;
}

/* ==========================================================
 * 9차: 신 타로 - 엎어 둔 카드를 뒤집으면 신이 말을 건다
 * ========================================================== */
.art-tarot {
  aspect-ratio: auto;
  min-height: 420px;
  padding: 28px 16px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  background:
    radial-gradient(ellipse 60% 55% at 50% 40%, rgba(150, 90, 230, 0.22), transparent 70%),
    #0d0918;
}

.tarot-row {
  --tarot-gap: clamp(8px, 2vw, 22px);
  list-style: none;
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: var(--tarot-gap);
  perspective: 1000px;
}

/* 카드 폭은 화면이 아니라 카드 줄의 폭에서 나눈다(좁은 만화 칸 안에서 줄이 칸 밖으로 밀어내지 않게) */
.tarot-row > li {
  flex: none;
  width: min(clamp(72px, 13vw, 150px), calc((100% - 3 * var(--tarot-gap)) / 4));
}

.tarot {
  position: relative;
  container-type: inline-size; /* 앞면 글자 크기가 카드 폭을 따른다 */
  width: 100%;
  aspect-ratio: 80 / 123;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: rotate(var(--tilt));
  transition: transform 0.25s;
}

@media (max-width: 759px) {
  .tarot-row > li {
    width: min(96px, calc((100% - 3 * var(--tarot-gap)) / 4)); /* 폰에서는 네 장이 줄을 다 쓰게 */
  }
}

.tarot:hover,
.tarot:focus-visible {
  transform: rotate(var(--tilt)) translateY(-10px);
}

.tarot-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1.1);
}

.tarot.is-open .tarot-inner {
  transform: rotateY(180deg);
}

.tarot.is-open {
  transform: rotate(0) translateY(-14px) scale(1.06);
}

.tarot-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #e2c896, 0 0 0 4px #1c1208, 0 10px 24px rgba(0, 0, 0, 0.6);
}

.tarot-back {
  background: #120a1c;
}

.tarot-face img {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tarot-front {
  transform: rotateY(180deg);
  padding: 8px 6px;
  gap: 4px;
  background: radial-gradient(ellipse 70% 50% at 50% 38%, rgba(255, 196, 99, 0.25), transparent 70%), #1b1430;
}

/* 그림은 이름·설명이 먼저 자리를 잡고 남는 높이만 쓴다(좁은 카드에서 글이 카드 밖으로 나가지 않게) */
.tarot-front img {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
}

.tarot-front b {
  font-family: "Song Myung", serif;
  font-weight: 400;
  font-size: clamp(11px, 12.5cqi, 17px);
  color: #ffb838;
  line-height: 1.15;
  text-wrap: balance;
}

.tarot-front small {
  font-size: clamp(8px, 8.5cqi, 12px);
  color: #c7bdd1;
  line-height: 1.25;
  text-wrap: balance;
}

.tarot.is-open .tarot-face {
  box-shadow: 0 0 0 2px #ffb838, 0 0 0 4px #1c1208, 0 0 30px rgba(255, 184, 56, 0.45);
}

.tarot-speech {
  width: min(640px, 100%);
  padding: 16px 20px 14px;
  text-align: center;
  background: linear-gradient(#1b1430, #120d22);
  box-shadow: 0 0 0 2px #ff9b26, 0 0 0 5px #120d22, 0 0 0 7px #a5580f;
}

.tarot-who {
  margin: 0 0 6px;
  font-family: "Song Myung", serif;
  font-size: 20px;
  color: #ffb838;
}

.tarot-line {
  min-height: 3.4em;
  margin: 0 0 10px;
  font-family: "Song Myung", serif;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.7;
  color: #f0e6ff;
  white-space: pre-line;
}

html[lang="ja"] .tarot-who,
html[lang="ja"] .tarot-line,
html[lang="ja"] .tarot-front b {
  font-family: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
}

html[lang="zh-Hans"] .tarot-who,
html[lang="zh-Hans"] .tarot-line,
html[lang="zh-Hans"] .tarot-front b {
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Noto Serif SC", serif;
}

.tarot-next {
  padding: 6px 14px 8px;
  border: 0;
  font-family: var(--pixel);
  font-size: 14px;
  color: #ffd46b;
  background: rgba(165, 88, 15, 0.45);
  box-shadow: inset 0 0 0 1px #ffb842;
  cursor: pointer;
}

.tarot-hint {
  margin: 0;
  font-family: var(--pixel);
  font-size: 14px;
  color: #b9a4ff;
}

/* 일본어·중국어 로고는 글자가 길어 한 줄로, 크기를 조금 줄인다 */
html[lang="ja"] .logo,
html[lang="zh-Hans"] .logo {
  white-space: nowrap;
  font-size: clamp(36px, 7vw, 96px);
}

@media (max-width: 759px) {
  /* 폰 머리: 로고 · BGM · 찜하기(하트) · 언어(지구본). 체험판 버튼은 아래 고정 단추에 있다 */
  .top-inner {
    gap: 8px;
  }

  .brand {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-cta {
    flex: none;
    padding: 0 14px;
  }

  .top-cta span {
    display: none;
  }

  .lang-menu,
  .bgm {
    flex: none;
  }
}

/* ==========================================================
 * 10차: 좁은 화면에서도 머리 메뉴가 잘리지 않게
 * 로고·BGM·찜하기·언어는 늘 보이고, 메뉴는 남는 폭만 쓴다. 안 들어가는 항목은 '더보기'로 옮긴다(site.js).
 * ========================================================== */
.brand,
.bgm,
.top-cta,
.lang-menu {
  flex: none;
}

/* 메뉴 칸은 다른 단추가 자리를 잡고 남은 폭만 쓴다(바탕 폭 0). 내용 폭을 바탕으로 두면 항목을 '더보기'로 옮길 때
   로고가 다시 넓어져 칸이 줄고, 남은 항목이 BGM 단추 위로 겹친다. */
.nav {
  flex: 1 1 0;
  min-width: 44px; /* 다 옮겨도 '더보기' 단추 자리는 남는다(로고가 대신 말줄임으로 줄어든다) */
  margin-right: 0;
  align-items: center;
}

.nav a {
  flex: none;
}

html.js .nav {
  overflow: visible;
}

.nav a.is-overflow {
  display: none;
}

.nav-more {
  position: relative;
  flex: none;
  margin-left: 2px;
}

.nav-more[hidden] {
  display: none !important;
}

.nav-more summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  cursor: pointer;
  list-style: none;
  font-family: var(--pixel);
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
}

.nav-more summary::-webkit-details-marker {
  display: none;
}

.nav-more summary .i {
  width: 18px;
  height: 18px;
}

.nav-more[open] summary,
.nav-more summary:hover {
  color: var(--ink);
}

.nav-more-list {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 60;
  min-width: 200px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #120e0b;
  box-shadow: inset 0 0 0 2px var(--line-strong), 4px 4px 0 #000;
}

.nav-more-list a {
  display: block;
  padding: 9px 12px;
  text-decoration: none;
  font-family: var(--pixel);
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
}

.nav-more-list a:hover,
.nav-more-list a[aria-current] {
  color: var(--ink);
  background: rgba(255, 155, 38, 0.12);
}

.nav-more-list li[hidden] {
  display: none;
}

/* 메뉴 칸이 다 차면 더보기 단추만 남고, 정말 좁으면 그것도 아이콘만 */
@media (max-width: 480px) {
  .nav-more summary span {
    display: none;
  }

  .nav-more summary {
    padding: 6px 8px;
  }
}

/* 더보기 목록은 오른쪽 끝에 붙어 있을 때 화면 밖으로 나가지 않게 */
.nav-more.is-right .nav-more-list {
  left: auto;
  right: 0;
}

@media (max-width: 759px) {
  .brand {
    flex: 0 1 auto;
    min-width: 0;
  }
}

/* 넓은 화면에서는 머리 메뉴가 화면 폭을 더 쓴다 */
.top-inner {
  max-width: min(1680px, 100%);
}

/* 중간 폭: 찜하기는 하트 아이콘만(크게 쓴 체험판·찜 단추는 첫 화면에 있다) */
@media (max-width: 1023px) {
  .top-cta {
    padding: 0 14px;
  }

  .top-cta span {
    display: none;
  }
}

/* ==========================================================
 * 개발일지·소식 (21차): Steam 글 목록과 글 한 편
 * ========================================================== */
.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 20px;
  max-width: 1080px;
  margin: 28px auto 8px;
}

.news-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  text-decoration: none;
  box-shadow: inset 0 0 0 2px var(--line);
  transition: box-shadow 0.15s, transform 0.15s;
}

.news-card:hover {
  box-shadow: inset 0 0 0 2px var(--accent);
  transform: translateY(-2px);
}

.news-card-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #080706;
}

.news-card-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
  text-align: left;
}

.news-card h2 {
  margin: 0;
  font-family: var(--pixel);
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink);
}

.news-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: inherit;
  gap: 8px 10px;
  margin: 0;
  font-size: 13px;
  color: var(--dim);
}

.news-post .news-meta {
  justify-content: center;
}

.news-kind {
  padding: 2px 8px;
  font-family: var(--pixel);
  font-size: 12px;
  color: var(--accent-ink);
  background: var(--moss);
}

.news-kind-devlog {
  background: var(--accent);
}

.news-lang {
  padding: 1px 6px;
  font-size: 12px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

/* 글 한 편: 제목은 가운데, 본문은 읽기 쉽게 왼쪽 정렬 */
.news-post {
  max-width: 760px;
  margin: 0 auto;
}

.news-cover {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0 28px;
  box-shadow: inset 0 0 0 2px var(--line), 0 10px 30px rgba(0, 0, 0, 0.45);
}

.news-body {
  text-align: left;
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
}

.news-body p {
  margin: 0 0 16px;
}

.news-body h2,
.news-body h3,
.news-body h4 {
  margin: 34px 0 12px;
  font-family: var(--pixel);
  line-height: 1.4;
  color: var(--accent-hi);
}

.news-body ul,
.news-body ol {
  margin: 0 0 18px;
  padding-left: 1.3em;
}

.news-body li {
  margin: 4px 0;
}

.news-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px auto;
}

.news-body a {
  color: var(--accent);
}

.news-video {
  position: relative;
  display: block;
  max-width: 560px;
  margin: 12px auto 18px;
  text-decoration: none;
  box-shadow: inset 0 0 0 2px var(--line);
}

.news-video img {
  width: 100%;
  margin: 0;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.news-video span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 18px;
  font-family: var(--pixel);
  font-size: 15px;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ink);
}

.news-source {
  margin: 26px 0 0;
  text-align: center;
}

.news-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  margin: 36px 0 8px;
  padding-top: 20px;
  border-top: 2px solid var(--line);
  font-size: 14px;
}

.news-pager a {
  color: var(--muted);
  text-decoration: none;
}

.news-pager a:hover {
  color: var(--accent-hi);
}

.news-pager span {
  display: block;
  font-family: var(--pixel);
  font-size: 12px;
  color: var(--dim);
}

.news-prev {
  text-align: left;
}

.news-next {
  text-align: right;
}

.news-all {
  font-family: var(--pixel);
}

/* 글 목록 카드 제목·본문 소제목에는 안내 글 구간 제목의 양옆 장식선을 쓰지 않는다 */
.page-article main .news-card h2,
.page-article main .news-body h2 {
  display: block;
  text-align: left;
}

.page-article main .news-card h2::before,
.page-article main .news-card h2::after,
.page-article main .news-body h2::before,
.page-article main .news-body h2::after {
  content: none;
  display: none;
}
