/* Dongry Games 공통 스타일 (모든 페이지). 외부 글꼴·라이브러리·추적 없음.
   게임별 긴 소개 페이지 전용 스타일은 game.css 에 있습니다. */

:root {
  color-scheme: light dark;
  --bg: #fbfbfd;
  --bg-2: #f3f1f8;
  --card: #ffffff;
  --fg: #1d1d1f;
  --muted: #62626b;
  --line: rgba(29, 29, 31, 0.12);
  --link: #6a42e0;
  --a1: #a78bfa;
  --a2: #f9a8d4;
  --n1: #7c5cf0;
  --n2: #e0509a;
  --on-accent: #21103f;
  --grad: linear-gradient(120deg, var(--a1), var(--a2));
  --grad-text: linear-gradient(120deg, var(--n1), var(--n2));
  --shadow: 0 1px 2px rgba(40, 20, 90, 0.06), 0 14px 44px rgba(70, 40, 140, 0.12);
  --glass: rgba(251, 251, 253, 0.72);
  --glow: rgba(167, 139, 250, 0.28);
  --glow-2: rgba(249, 168, 212, 0.26);
  --focus: #6a42e0;
  --nav-h: 52px;
  --r-lg: 28px;
  --r-md: 20px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0912;
    --bg-2: #12101f;
    --card: #16132a;
    --fg: #f5f5f7;
    --muted: #a8a6b8;
    --line: rgba(255, 255, 255, 0.13);
    --link: #c4b5fd;
    --focus: #a78bfa;
    --n1: #b7a4ff;
    --n2: #f9a8d4;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 24px 70px rgba(0, 0, 0, 0.55);
    --glass: rgba(10, 9, 18, 0.66);
    --glow: rgba(167, 139, 250, 0.34);
    --glow-2: rgba(249, 168, 212, 0.2);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 어두운 모드: 은은한 별빛 */
@media (prefers-color-scheme: dark) {
  body {
    background-image:
      radial-gradient(1px 1px at 24px 36px, rgba(255, 255, 255, 0.55), transparent),
      radial-gradient(1.5px 1.5px at 96px 128px, rgba(196, 181, 253, 0.6), transparent),
      radial-gradient(1px 1px at 168px 64px, rgba(255, 255, 255, 0.4), transparent),
      radial-gradient(1px 1px at 216px 196px, rgba(249, 168, 212, 0.5), transparent),
      radial-gradient(1px 1px at 60px 210px, rgba(255, 255, 255, 0.35), transparent);
    background-size: 240px 240px;
  }
}

main { flex: 1 0 auto; width: 100%; }
.site-footer { flex: none; }
img { max-width: 100%; height: auto; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }

.skip {
  position: absolute; left: 12px; top: -120px; z-index: 100;
  background: var(--card); color: var(--fg); padding: 10px 16px; border-radius: 999px; box-shadow: none;
}
.skip:focus { top: 8px; box-shadow: var(--shadow); }

/* 상단 고정 내비 (반투명 유리) */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.site-header__in {
  max-width: 1080px; height: 100%; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  font-weight: 700; font-size: 17px; letter-spacing: -0.02em; color: var(--fg); text-decoration: none; white-space: nowrap;
}
.site-header nav { display: flex; align-items: center; gap: clamp(2px, 1.5vw, 14px); }
.site-header nav a {
  color: var(--muted); text-decoration: none; font-size: 14px; padding: 12px 10px; min-height: 44px; display: inline-flex; align-items: center;
  white-space: nowrap; transition: color 0.2s;
}
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--fg); }
/* 내비 오른쪽 '받기' 알약: 보이는 높이 34px, 눌리는 영역은 44px */
.site-header nav a.nav-get {
  position: relative; min-height: 34px; padding: 0 16px; margin-left: 4px; border-radius: 999px;
  background: var(--grad); color: var(--on-accent); font-weight: 700;
}
.site-header nav a.nav-get::after { content: ""; position: absolute; inset: -5px -4px; }
.site-header nav a.nav-get:hover { color: var(--on-accent); filter: brightness(1.05); }
@media (max-width: 560px) { .site-header nav a[data-nav="game"] { display: none; } }

/* 버튼 */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--grad); color: var(--on-accent); text-decoration: none;
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
  min-height: 52px; padding: 0 30px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(167, 139, 250, 0.38);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s, filter 0.25s;
}
.pill:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 16px 40px rgba(167, 139, 250, 0.5); filter: brightness(1.04); }
.pill:active { transform: scale(0.98); }
.pill--ghost { background: var(--card); color: var(--fg); border: 1px solid var(--line); box-shadow: none; }
.pill--ghost:hover { box-shadow: var(--shadow); }
.textlink { color: var(--link); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; }
.textlink:hover { text-decoration: underline; }

/* 바닥글 */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font-size: 14px; }
.site-footer__in { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }
.site-footer p { margin: 0 0 10px; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0 18px; }
.site-footer a { color: var(--fg); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.site-footer a:hover { text-decoration: underline; }

/* 방침·확률·404 같은 글 페이지 */
.doc { max-width: 760px; margin: 0 auto; padding: calc(var(--nav-h) + 56px) 16px 96px; }
.doc h1 { font-size: clamp(36px, 6.4vw, 56px); line-height: 1.18; letter-spacing: -0.02em; margin: 0 0 24px; }
.doc h2 { font-size: clamp(22px, 3vw, 28px); line-height: 1.3; letter-spacing: -0.015em; margin: 56px 0 14px; }
.doc h3 { font-size: 19px; margin: 32px 0 8px; }
.doc p, .doc ul, .doc ol { margin: 0 0 14px; }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc li { margin-bottom: 6px; }
.doc .table-wrap {
  overflow-x: auto; margin: 0 0 20px; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: 16px; background: var(--card);
}
.doc table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 15px; line-height: 1.55; }
.doc th, .doc td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc tr:last-child td { border-bottom: 0; }
.doc th { background: var(--bg-2); }
.doc .back { margin-top: 40px; }

/* 스크롤하면 부드럽게 나타나는 효과 */
@keyframes rise { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
  html:not(.static) .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 38%; }
}
.js-reveal .reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js-reveal .reveal.in { opacity: 1; transform: none; }
html.static .reveal, html.static .reveal.in { animation: none !important; opacity: 1 !important; transform: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.in { animation: none !important; opacity: 1 !important; transform: none !important; transition: none !important; }
  .pill, .pill:hover { transition: none; transform: none; }
}

/* 글 페이지: 목차와 맨 위로 */
.doc h2[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }
.toc { margin: 0 0 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.toc summary { cursor: pointer; padding: 12px 16px; min-height: 44px; font-weight: 700; display: flex; align-items: center; }
.toc ol { list-style: none; margin: 0; padding: 0 8px 10px; }
.toc li { margin: 0; }
.toc a { display: flex; align-items: center; min-height: 44px; padding: 6px 8px; text-decoration: none; border-radius: 10px; }
.toc a:hover { background: var(--bg-2); }
.totop {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--card); color: var(--fg); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 700; text-decoration: none;
}
@keyframes totop-in { from { opacity: 0; visibility: hidden; } to { opacity: 1; visibility: visible; } }
@supports (animation-timeline: scroll()) {
  .totop { opacity: 0; visibility: hidden; animation: totop-in linear both; animation-timeline: scroll(root); animation-range: 240px 400px; }
}
.doc .back { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* 폭 600px 이하: 표를 카드로 (각 행이 카드, 칸 제목은 data-label) */
@media (max-width: 600px) {
  .doc .table-wrap { overflow: visible; border: 0; background: none; border-radius: 0; }
  .doc table, .doc tbody, .doc tr, .doc td { display: block; width: 100%; min-width: 0; }
  .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .doc tr {
    margin: 0 0 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); overflow: hidden;
  }
  .doc td {
    position: relative; padding: 9px 14px 9px calc(38% + 8px); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; min-height: 40px;
  }
  .doc tr:last-child td { border-bottom: 1px solid var(--line); }
  .doc tr td:last-child { border-bottom: 0; }
  .doc td::before { content: attr(data-label); position: absolute; left: 14px; top: 10px; width: calc(38% - 8px); font-size: 13px; line-height: 1.45; font-weight: 700; color: var(--muted); overflow-wrap: break-word; }
  .doc td:first-child { background: var(--bg-2); font-weight: 700; }
  .doc table.t-stack td { padding: 9px 14px; }
  .doc table.t-stack td::before { position: static; display: block; width: auto; margin-bottom: 2px; }
}
