/* 던전게이트 사이트. 색은 게임 UI(양피지 · 무쇠 · 나무 팻말)와 같다. 도트 그림은 정수배(3배, 좁은 화면 2배)로만 키운다. */
:root {
  --bg: #15110e;
  --bg-alt: #1c1713;
  --line: #2e261f;
  --cream: #f8e6c8;
  --soft: #cbb79a;
  --dim: #9a8a74;
  --gold: #f4bc2c;
  --ink: #2e1c12;
  --ink-soft: #4e3626;
  --paper: #d9a06c;
  --wood: #604028;
  --warn: #a4281e;
  --px: 3px;                 /* 도트 하나의 크기 */
  --pixel: "Galmuri11", "Galmuri9", "DungGeunMo", "Malgun Gothic", sans-serif;
  --body: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--soft);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  word-break: keep-all;
  -webkit-text-size-adjust: 100%;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--gold); }
code { font-family: var(--pixel); font-size: 1em; }
h1, h2, h3 { font-family: var(--pixel); color: var(--cream); line-height: 1.3; margin: 0; font-weight: 700; }
p { margin: 0; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--cream); color: var(--ink); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- 도트 테두리 ---------- */
.plank, .sheet, .shot { image-rendering: pixelated; }

.plank {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  border-style: solid;
  border-width: calc(3 * var(--px)) calc(8 * var(--px)) calc(4 * var(--px));
  border-image: url(img/plank.png) 3 8 4 fill / calc(3 * var(--px)) calc(8 * var(--px)) calc(4 * var(--px)) stretch;
  padding: 6px 10px 5px;
  color: var(--cream);
  font-family: var(--pixel);
  font-size: 18px;
  text-decoration: none;
  text-shadow: 2px 2px 0 #22140e;
  cursor: pointer;
  transition: filter .12s, transform .12s;
}
a.plank:hover, button.plank:hover { filter: brightness(1.14); }
a.plank:active { transform: translateY(2px); }
.plank.small { --px: 2px; font-size: 15px; padding: 3px 4px 2px; }
.plank.big { flex-direction: column; gap: 2px; padding: 16px 22px 14px; min-width: 260px; }
.plank.big strong { font-size: 22px; }
.plank.big span { font-family: var(--body); font-size: 14px; color: #e3cba6; text-shadow: none; }

.ghost {
  display: inline-flex; align-items: center; padding: 10px 6px;
  color: var(--cream); font-family: var(--pixel); font-size: 17px; text-underline-offset: 6px;
}
.ghost:hover { color: var(--gold); }

.sheet {
  border-style: solid;
  border-width: calc(3 * var(--px));
  border-image: url(img/sheet.png) 3 fill / calc(3 * var(--px)) stretch;
  padding: 28px 30px;
  color: var(--ink-soft);
}

.shot {
  border-style: solid;
  border-width: calc(3 * var(--px));
  border-image: url(img/frame.png) 3 / calc(3 * var(--px)) stretch;
  background: #0d0b09;
  overflow: hidden;
}
.shot img { width: 100%; image-rendering: auto; }

/* ---------- 위 띠 ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(21, 17, 14, .94);
  border-bottom: 3px solid #0b0907;
  box-shadow: 0 3px 0 var(--line);
}
.top-in { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-family: var(--pixel); font-size: 20px; }
.brand img { image-rendering: pixelated; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--soft); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--cream); }

/* ---------- 첫 화면 ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(21, 17, 14, .50) 0%, rgba(21, 17, 14, .58) 55%, var(--bg) 100%),
    url(img/hero.webp) center 40% / cover no-repeat;
}
.hero-in { padding: 96px 0 104px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.eyebrow { font-family: var(--pixel); color: var(--gold); font-size: 16px; text-shadow: 2px 2px 0 #1a120c; }
.hero h1 { font-size: clamp(52px, 10vw, 104px); letter-spacing: .02em; margin-top: 10px; text-shadow: 5px 5px 0 #1a120c; }
.lead { margin-top: 18px; color: var(--cream); font-size: clamp(17px, 2.2vw, 21px); text-shadow: 0 2px 6px rgba(0, 0, 0, .8); }

.address { margin-top: 36px; gap: 16px; padding: 10px 6px 9px; cursor: default; }
.address-label { font-size: 15px; color: #e3cba6; }
.address-value { font-size: clamp(26px, 5vw, 36px); color: #fff3d6; letter-spacing: .03em; user-select: all; }
.copy {
  font-family: var(--pixel); font-size: 15px; line-height: 1;
  color: var(--ink); background: var(--gold);
  border: 0; padding: 9px 12px 8px; cursor: pointer;
  box-shadow: 0 3px 0 #9a6a10, 0 0 0 3px #22140e;
  text-shadow: none;
}
.copy:hover { background: #ffd35a; }
.copy:active { transform: translateY(2px); box-shadow: 0 1px 0 #9a6a10, 0 0 0 3px #22140e; }
.copy.ink { margin-left: 8px; font-size: 14px; padding: 7px 10px 6px; vertical-align: 1px; }
.hero-note { margin-top: 16px; font-size: 15px; color: #eadcc4; text-shadow: 0 2px 6px rgba(0, 0, 0, .9); }
.hero-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 14px 22px; justify-content: center; align-items: center; }

/* ---------- 구역 ---------- */
.section { padding: 84px 0; }
.section.alt { background: var(--bg-alt); border-block: 3px solid #0b0907; }
.section h2 { font-size: clamp(28px, 4.6vw, 40px); display: flex; align-items: center; gap: 16px; }
.gem { width: 15px; height: 15px; background: var(--gold); transform: rotate(45deg); box-shadow: 0 0 0 3px #22140e, 3px 3px 0 3px #7a5310; flex: none; margin-left: 6px; }
.section-lead { margin-top: 14px; max-width: 46em; }

.cards { margin-top: 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 28px; }
.card h3 { font-size: 21px; margin-top: 16px; }
.card p { margin-top: 8px; font-size: 16px; }


.sheet { margin-top: 36px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px; }
.steps li { display: grid; grid-template-columns: 48px 1fr; gap: 18px; align-items: start; }
.num {
  width: 48px; height: 48px; display: grid; place-items: center;
  font-family: var(--pixel); font-size: 24px; color: var(--cream);
  background: #4a3228; box-shadow: 0 0 0 3px var(--ink), inset 0 3px 0 #6a4a3a, inset 0 -3px 0 #34221a;
  text-shadow: 2px 2px 0 #22140e;
}
.sheet h3 { color: var(--ink); font-size: 21px; }
.sheet p { margin-top: 6px; font-size: 16px; }
.sheet code { color: var(--ink); background: rgba(46, 28, 18, .12); padding: 1px 6px; }
.sheet b { color: var(--ink); }
.help { margin-top: 30px; padding-top: 24px; border-top: 3px dashed rgba(46, 28, 18, .35); }
.help h3 { color: var(--warn); font-size: 19px; }
.alt-address { margin-top: 12px !important; }
.alt-address code { font-size: 20px; padding: 3px 9px; }
.after { margin-top: 26px; text-align: center; }

.links { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 22px; }
.rules-title { margin-top: 56px; font-size: 20px; }
.rules { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 16px; }
.rules li { padding-left: 20px; position: relative; }
.rules li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 7px; height: 7px; background: var(--dim); }

.foot { padding: 40px 0 56px; font-size: 14px; color: var(--dim); border-top: 3px solid #0b0907; }
.foot-name { font-family: var(--pixel); color: var(--soft); font-size: 17px; margin-bottom: 6px; }
.foot-name span { color: var(--gold); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #22140e; color: var(--cream); font-family: var(--pixel); font-size: 16px;
  padding: 10px 18px; box-shadow: 0 0 0 3px var(--gold); z-index: 40;
}
.toast[hidden] { display: none; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 960px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
  .top-in .plank { margin-left: auto; }
}
@media (max-width: 720px) {
  :root { --px: 2px; }
  body { font-size: 16px; }
  .wrap { width: min(1120px, 100% - 32px); }
  .hero-in { padding: 64px 0 72px; }
  .section { padding: 60px 0; }
  .cards { grid-template-columns: 1fr; gap: 34px; }
  .address { flex-wrap: wrap; row-gap: 6px; }
  .address-label { width: 100%; text-align: center; }
  .sheet { padding: 22px 18px; }
  .steps li { grid-template-columns: 40px 1fr; gap: 14px; }
  .num { width: 40px; height: 40px; font-size: 20px; }
  .plank.big { min-width: 0; width: 100%; }
  .copy.ink { margin-left: 0; margin-top: 8px; display: inline-block; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .plank, .copy { transition: none; }
}

/* ---------- 딸린 페이지(처음 하는 법, 후원, 규칙) ---------- */
.nav a[aria-current="page"] { color: var(--gold); }
.page-head {
  position: relative; isolation: isolate; padding: 72px 0 60px; text-align: center;
  border-bottom: 3px solid #0b0907;
}
.page-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(21, 17, 14, .70) 0%, rgba(21, 17, 14, .86) 100%),
    url(img/hero.webp) center 55% / cover no-repeat;
}
.page-head h1 { font-size: clamp(38px, 7vw, 64px); margin-top: 8px; text-shadow: 4px 4px 0 #1a120c; }
.page-head .lead { margin-top: 14px; }
.section.tight { padding: 56px 0 84px; }
.wrap.narrow { width: min(820px, 100% - 40px); }
.section.tight .sheet { margin-top: 0; }
.sub { font-size: clamp(22px, 3.6vw, 28px) !important; margin: 56px 0 22px; }
.sub.first { margin-top: 0; }
.sub .gem { width: 12px; height: 12px; }

.cmds { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.cmds div { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--bg-alt); box-shadow: 0 0 0 3px #0b0907, inset 0 3px 0 #2a221c; }
.cmds dt { flex: none; min-width: 92px; }
.cmds dt code { color: var(--gold); font-size: 18px; }
.cmds dd { margin: 0; font-size: 16px; }

.tiers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tiers li { padding: 22px 12px 18px; text-align: center; background: var(--bg-alt); box-shadow: 0 0 0 3px #0b0907, inset 0 3px 0 #2a221c; }
.tiers p { margin-top: 12px; font-size: 16px; }
.tag { display: inline-block; font-family: var(--pixel); font-size: 19px; padding: 5px 12px 4px; text-shadow: 2px 2px 0 rgba(0, 0, 0, .55); box-shadow: 0 0 0 3px #0b0907; }
.tag::before { content: "["; margin-right: 4px; opacity: .7; }
.tag::after { content: "]"; margin-left: 4px; opacity: .7; }
.tag.t1 { color: #f6c8d8; background: #5a2c3c; }
.tag.t2 { color: #eef2f6; background: #55606e; }
.tag.t3 { color: #fff1c0; background: #7a5310; }
.note { margin-top: 18px; font-size: 16px; }
.note.first { margin-top: 0; }
.note code, .after code { color: var(--gold); }
.links.center { justify-content: center; margin-top: 36px; }
.more { margin-top: 16px; font-size: 16px; }
.foot-links { margin-bottom: 8px; }
.foot-links a { color: var(--soft); }

@media (max-width: 720px) {
  .page-head { padding: 52px 0 44px; }
  .section.tight { padding: 40px 0 60px; }
  .wrap.narrow { width: min(820px, 100% - 32px); }
  .cmds { grid-template-columns: 1fr; }
  .tiers { grid-template-columns: 1fr; }
  .page-head .lead br { display: none; }
}
