:root {
  --bg: #f6f1e7; --side: #f1eadc; --surface: #fffdf8; --surface-2: #f0e9db; --border: #e3d8c4;
  --text: #2b2219; --soft: #6e604f; --faint: #9a8b76; --link: #9a5b00;
  --accent: #ffc83d; --accent-ink: #2b2219; --accent-weak: #ffe9a8;
  --blue: #2f7de1; --green: #2f9e5a; --red: #d6332b;
  --shadow: 0 1px 2px rgba(60, 40, 10, .06), 0 4px 14px rgba(60, 40, 10, .06);
  --r: 14px; --top: 58px; --sidew: 264px;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --title: "Black Han Sans", var(--font);
  --hand: "Jua", var(--font);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #14161b; --side: #171a20; --surface: #1d2027; --surface-2: #262a33; --border: #2f3440;
  --text: #eeeae2; --soft: #aeb2bb; --faint: #7d828e; --link: #ffcf5a;
  --accent-weak: #3a3220; --blue: #6aa8ff; --green: #5cc98a; --red: #ff6b5f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 12px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.7 var(--font); word-break: keep-all; overflow-wrap: break-word; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 14px; }
code { font: 600 .92em/1 ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 3px 6px; border-radius: 6px; white-space: nowrap; }
kbd { display: inline-block; min-width: 1.9em; padding: 1px 7px; text-align: center; font: 700 13px/1.6 var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-bottom-width: 3px; border-radius: 7px; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.soft { color: var(--soft); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ===== 윗줄 ===== */
.top { position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 30; display: flex; align-items: center; gap: 6px; padding: 0 14px;
  background: var(--surface); border-bottom: 1px solid var(--border); }
.logo { display: flex; align-items: center; gap: 8px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-ic { width: 32px; height: 32px; }
.logo span { font: 22px/1 var(--title); letter-spacing: -.3px; }
.logo small { font: 700 11px/1 var(--font); background: var(--accent); color: var(--accent-ink); padding: 4px 7px; border-radius: 99px; }
.top-sp { flex: 1; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 10px;
  background: none; color: var(--soft); cursor: pointer; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.menu-btn, #searchBtn { display: none; }
:root[data-theme="dark"] .i-sun, :root:not([data-theme="dark"]) .i-moon { display: none; }

/* ===== 옆줄 ===== */
.side { position: fixed; top: var(--top); left: 0; bottom: 0; width: var(--sidew); z-index: 25; overflow-y: auto;
  background: var(--side); border-right: 1px solid var(--border); padding: 0 10px 40px; }
.side-search { position: sticky; top: 0; z-index: 2; background: var(--side); padding: 14px 2px 8px; }
.search-box { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px; border: 1px solid var(--border);
  border-radius: 11px; background: var(--surface); color: var(--faint); }
.search-box:focus-within { border-color: var(--accent); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 15px var(--font); }
.results { position: absolute; left: 2px; right: 2px; top: 60px; max-height: 64vh; overflow-y: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.results a { display: block; padding: 9px 10px; border-radius: 8px; color: var(--text); }
.results a:hover, .results a:focus { background: var(--surface-2); text-decoration: none; }
.results b { display: block; font-size: 14.5px; }
.results span { display: block; font-size: 12.5px; color: var(--soft); line-height: 1.5; }
.results mark { background: var(--accent-weak); color: inherit; border-radius: 3px; padding: 0 1px; }
.r-none { padding: 12px; color: var(--soft); font-size: 14px; }
.nav-head { margin: 18px 12px 6px; font-size: 12px; font-weight: 800; color: var(--faint); letter-spacing: .5px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 9px; color: var(--text); font-size: 15px; }
.nav-link .ic { width: 18px; height: 18px; color: var(--soft); }
.nav-link:hover { background: var(--surface-2); text-decoration: none; }
.nav-link.on { background: var(--accent-weak); font-weight: 700; }
.nav-link.on .ic { color: var(--text); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin: 0 4px; box-shadow: 0 0 0 2px rgba(0, 0, 0, .08); }
.scrim { display: none; }

/* ===== 본문 ===== */
.main { margin-left: var(--sidew); padding-top: var(--top); min-height: 100vh; }
.content { max-width: 1000px; margin: 0 auto; padding: 26px 32px 30px; }
h1, h2, h3 { line-height: 1.3; }
.sec { display: flex; align-items: center; gap: 10px; margin: 44px 0 14px; font-size: 23px; font-weight: 800; letter-spacing: -.3px; }
.sec .ic { width: 24px; height: 24px; color: var(--text); background: var(--accent); padding: 4px; border-radius: 8px; box-sizing: content-box; }
.lead { color: var(--soft); margin-top: -6px; }
.crumb { font-size: 13px; color: var(--faint); margin-bottom: 14px; }
.crumb a { color: var(--faint); }
.crumb span { color: var(--soft); }
.phead { display: flex; align-items: center; gap: 16px; margin: 4px 0 22px; }
.ph-ic { width: 30px; height: 30px; padding: 10px; box-sizing: content-box; background: var(--accent); color: var(--accent-ink); border-radius: 14px; }
.phead h1 { margin: 0; font: 34px/1.15 var(--title); letter-spacing: -.3px; }
.phead p { margin: 4px 0 0; color: var(--soft); }
.phead + .sec, .phead + p { margin-top: 0; }

/* 히어로 */
.hero { position: relative; border-radius: 18px; overflow: hidden; background: #1b1610; box-shadow: var(--shadow); }
.hero img { width: 100%; aspect-ratio: 16 / 9; max-height: 470px; object-fit: cover; }
.hero-text { position: absolute; left: 18px; bottom: 18px; max-width: 540px; padding: 22px 24px; border-radius: 14px;
  background: rgba(27, 22, 16, .84); color: #fff; }
.hero-text h1 { margin: 0 0 8px; font: 44px/1 var(--title); color: var(--accent); letter-spacing: -.5px; }
.hero-text p { margin: 0 0 16px; font-size: 15px; color: #efe7da; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 11px; background: var(--accent);
  color: var(--accent-ink); font-weight: 800; font-size: 15px; }
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .45); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.facts div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; }
.facts b { display: block; font: 30px/1.1 var(--title); }
.facts span { font-size: 13.5px; color: var(--soft); }

/* 게임 카드 */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 15px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: 600 14px var(--font); cursor: pointer; }
.chip:hover { border-color: var(--faint); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; }
.gcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; color: var(--text); box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.gcard:hover { transform: translateY(-3px); border-color: var(--gc); text-decoration: none; }
.gcard[hidden] { display: none; }
.gthumb { position: relative; border-bottom: 4px solid var(--gc); }
.gthumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gicon { position: absolute; right: 12px; bottom: -24px; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  border: 3px solid var(--surface); }
.gicon .hand { width: 34px; height: 34px; }
.gbody { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.gname { font: 20px/1.25 var(--title); margin-right: 52px; letter-spacing: -.2px; }
.gbody p { margin: 6px 0 10px; font-size: 13.5px; line-height: 1.55; color: var(--soft); flex: 1; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--soft); }
.badge.b-team { color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.crs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 12px 0 8px; }
.cr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; }
.cr > b { display: block; font-size: 15px; line-height: 1.35; }
.cr .by { font-size: 12.5px; color: var(--soft); }
.cr > .by { display: block; margin: 2px 0 8px; }
.cr ul { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.55; }
.cr li .by { margin-left: 4px; }
.gppl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: -2px 0 10px; }
.gppl span { padding: 5px 9px; border-radius: 9px; background: var(--surface-2); font-size: 11.5px; line-height: 1.3; color: var(--soft); white-space: nowrap; }
.gppl b { display: block; font-size: 14.5px; color: var(--text); }
.ppl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
.ppl > div { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r); padding: 12px 16px; }
.ppl .ic { grid-row: span 2; width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: color-mix(in srgb, var(--gc) 24%, transparent); }
.ppl span { font-size: 13px; color: var(--soft); }
.ppl b { font: 26px/1.15 var(--title); }
.ppl-note { margin: 8px 2px 0; font-size: 13.5px; color: var(--soft); }

/* 흐름 */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.flow li { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.flow b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.flow h3 { margin: 0; font-size: 16px; }
.flow p { margin: 0; font-size: 13.5px; color: var(--soft); line-height: 1.55; }
.guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gd { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); color: var(--text); }
.gd:hover { border-color: var(--accent); text-decoration: none; }
.gd .ic { width: 24px; height: 24px; margin-bottom: 6px; color: var(--link); }
.gd span { font-size: 13.5px; color: var(--soft); }
.cat-line { margin: 0 0 8px; }
.cat-line b { color: var(--text); margin-right: 8px; }

/* 게임 문서 */
.ghero { position: relative; }
.ghero > img { width: 100%; aspect-ratio: 16 / 9; max-height: 430px; object-fit: cover; border-radius: 18px; box-shadow: var(--shadow); }
.ghero-text { position: relative; margin: -56px 22px 0; padding: 18px 22px 18px; background: var(--surface); border: 1px solid var(--border);
  border-top: 6px solid var(--gc); border-radius: var(--r); box-shadow: var(--shadow); }
.gtag { display: inline-block; font: 700 12.5px/1 var(--font); padding: 5px 10px; border-radius: 99px; background: var(--gc); color: var(--gi); }
.ghero-text h1 { margin: 8px 0 4px; font: 38px/1.1 var(--title); letter-spacing: -.4px; }
.ghero-text p { margin: 0 0 10px; color: var(--soft); font-size: 16.5px; }
.scenes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.scene { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.sc-art { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; gap: 14px; }
.sc-art .hand { width: 88px; height: 88px; }
.stamp { position: absolute; right: 14px; bottom: 14px; transform: rotate(-9deg); padding: 0 10px; font: 22px/1.4 var(--title);
  color: #d6332b; border: 3px solid #d6332b; border-radius: 8px; background: rgba(255, 255, 255, .85); }
.sc-text { position: relative; padding: 14px 18px 16px 58px; }
.sc-num { position: absolute; left: 16px; top: 16px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--text); color: var(--bg); font-weight: 800; font-size: 14px; }
.sc-text h3 { margin: 0 0 4px; font: 21px/1.3 var(--hand); }
.sc-text p { margin: 0; color: var(--soft); font-size: 15px; }
.win { display: flex; align-items: center; gap: 16px; margin: 16px 0; padding: 16px 20px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--gc); }
.win .hand { width: 64px; height: 64px; flex: none; }
.win span { font-size: 13px; font-weight: 800; color: var(--faint); }
.win p { margin: 0; font: 22px/1.35 var(--hand); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; }
.pager a { flex: 1; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); color: var(--text); font-weight: 700; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .next { justify-content: flex-end; text-align: right; }
.pager small { display: block; font-size: 12px; color: var(--faint); font-weight: 600; }

/* 표·알림 */
.twrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); margin: 14px 0 18px; background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; background: var(--surface-2); font-size: 13px; color: var(--soft); padding: 9px 14px; white-space: nowrap; }
.tbl td { padding: 11px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.tbl.keys td:first-child, .tbl.karts td:first-child { white-space: nowrap; }
.tbl.karts td:last-child { white-space: nowrap; }
.bar { display: inline-block; width: 80px; height: 8px; border-radius: 99px; background: var(--surface-2); vertical-align: middle; overflow: hidden; }
.bar i { display: block; height: 100%; width: calc(var(--v) * 100%); background: var(--accent); border-radius: 99px; }
.num { margin-left: 8px; font-weight: 700; font-size: 13px; }
.callout { display: flex; gap: 12px; padding: 13px 16px; margin: 16px 0; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); border-left-width: 4px; font-size: 15px; }
.callout .ic { margin-top: 3px; }
.c-info { border-left-color: var(--blue); } .c-info .ic { color: var(--blue); }
.c-tip { border-left-color: var(--green); } .c-tip .ic { color: var(--green); }
.pts { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.pts div { text-align: center; padding: 10px 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.pts div:first-child { background: var(--accent-weak); }
.pts b { display: block; font-size: 13px; color: var(--soft); }
.pts span { font: 22px/1.2 var(--title); }

/* 카트 */
.karts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 14px 0; }
.kart { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.kart b { display: block; font: 20px/1.3 var(--title); }
.k-good { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px; font-weight: 700; font-size: 14.5px; }
.k-good .ic { width: 16px; height: 16px; color: var(--link); }
.kart p { margin: 0 0 10px; font-size: 13.5px; color: var(--soft); line-height: 1.5; }
.k-speed { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--faint); }
.k-speed .num { margin: 0; color: var(--text); }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.item img { width: 56px; height: 56px; flex: none; }
.item p { margin: 0; font-size: 14px; color: var(--soft); line-height: 1.5; }
.tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.track { position: relative; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.track img:first-child { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #bcd3f5; }
.track img + img { position: absolute; right: 10px; top: 10px; width: 52%; border: 3px solid #fff; border-radius: 9px; box-shadow: var(--shadow); background: #bcd3f5; }
.track figcaption { padding: 12px 14px 14px; }
.track b { display: block; font: 19px/1.3 var(--title); }
.track span { font-size: 14px; color: var(--soft); }

/* 바닥 */
.foot { max-width: 1000px; margin: 30px auto 0; padding: 20px 32px 34px; border-top: 1px solid var(--border); font-size: 13px; color: var(--faint); }
.foot p { margin: 0 0 4px; }
.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 20; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .2s; }
.to-top.show { opacity: 1; pointer-events: auto; }

/* ===== 폰 ===== */
@media (max-width: 960px) {
  .menu-btn, #searchBtn { display: grid; }
  .side { transform: translateX(-102%); transition: transform .2s; width: min(300px, 86vw); box-shadow: var(--shadow); }
  .nav-open .side { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: var(--top) 0 0 0; z-index: 24; background: rgba(0, 0, 0, .4); }
  .main { margin-left: 0; }
  .content { padding: 16px 14px 24px; }
  .foot { padding: 18px 14px 30px; }
  .flow { grid-template-columns: 1fr; }
  .flow li { flex-direction: row; align-items: flex-start; gap: 12px; }
  .flow b { flex: none; }
}
@media (max-width: 720px) {
  .hero img { aspect-ratio: 16 / 10; }
  .hero-text { position: static; max-width: none; border-radius: 0; padding: 18px 18px 20px; }
  .hero-text h1 { font-size: 36px; }
  .facts { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .facts b { font-size: 26px; }
  .ggrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gname { font-size: 17px; margin-right: 0; margin-top: 10px; }
  .gicon { width: 42px; height: 42px; bottom: -20px; right: 8px; }
  .gicon .hand { width: 28px; height: 28px; }
  .gbody { padding: 10px 11px 12px; }
  .gbody p { font-size: 12.5px; }
  .badge { font-size: 11px; padding: 2px 7px; }
  .scenes { grid-template-columns: 1fr; }
  .sc-art { height: 128px; }
  .sc-art .hand { width: 76px; height: 76px; }
  .ghero > img { border-radius: 14px; }
  .ghero-text { margin: -34px 10px 0; padding: 14px 16px; }
  .ghero-text h1 { font-size: 31px; }
  .sec { font-size: 21px; margin-top: 36px; }
  .phead h1 { font-size: 28px; }
  .win p { font-size: 19px; }
  .win .hand { width: 52px; height: 52px; }
  .pts { grid-template-columns: repeat(4, 1fr); }
  .pager { flex-direction: column; }
  .tbl { font-size: 14px; }
  .tbl td, .tbl th { padding: 9px 11px; }
}
