/* GeekRO wiki */
:root {
  --bg: #f5f8fc; --surface: #ffffff; --surface2: #eef3f9; --fg: #1a2432; --muted: #5a6a7f; --border: #dbe3ee;
  --accent: #2a67c9; --accent-soft: #e3edfb; --gold: #a87a12; --gold-soft: #fbf3df; --warn: #a3471b; --warn-soft: #fcece3;
  --ok: #217a4b; --ok-soft: #e2f4ea; --shadow: 0 1px 2px rgba(20,40,70,.06), 0 4px 16px rgba(20,40,70,.06);
  --side: 270px; --head: 60px; --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d131b; --surface: #141c27; --surface2: #1a2432; --fg: #dde7f3; --muted: #93a3b7; --border: #263244;
    --accent: #7fb3ff; --accent-soft: #1b2b44; --gold: #e2b84f; --gold-soft: #2c2512; --warn: #ff9f73; --warn-soft: #34201a;
    --ok: #6fd39c; --ok-soft: #15291f; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d131b; --surface: #141c27; --surface2: #1a2432; --fg: #dde7f3; --muted: #93a3b7; --border: #263244;
  --accent: #7fb3ff; --accent-soft: #1b2b44; --gold: #e2b84f; --gold-soft: #2c2512; --warn: #ff9f73; --warn-soft: #34201a;
  --ok: #6fd39c; --ok-soft: #15291f; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head) + 12px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
a { color: var(--accent); text-underline-offset: 2px; }
img { max-width: 100%; height: auto; }

/* header */
.top { position: sticky; top: 0; z-index: 30; height: var(--head); display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border); }
.top .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-weight: 650; white-space: nowrap; }
.top .brand img { height: 34px; width: auto; }
.top .brand span { font-size: 15px; color: var(--muted); font-weight: 500; }
.top .grow { flex: 1; }
.iconbtn { height: 36px; min-width: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface);
  color: var(--fg); font: inherit; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.iconbtn:hover { border-color: var(--accent); }
.lang { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.lang a { padding: 6px 10px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--muted); background: var(--surface); }
.lang a.on { background: var(--accent); color: #fff; }
.menubtn { display: none; }

/* search */
.search { position: relative; width: min(340px, 40vw); }
.search input { width: 100%; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface2); color: var(--fg);
  padding: 0 12px 0 34px; font: inherit; font-size: 14px; }
.search input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.search svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: var(--muted); }
.results { position: absolute; top: 42px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); max-height: 60vh; overflow: auto; display: none; }
.results.open { display: block; }
.results a { display: block; padding: 9px 12px; text-decoration: none; color: var(--fg); border-bottom: 1px solid var(--border); }
.results a:last-child { border-bottom: 0; }
.results a:hover, .results a.sel { background: var(--accent-soft); }
.results b { display: block; font-size: 14px; }
.results small { color: var(--muted); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .none { padding: 10px 12px; color: var(--muted); font-size: 14px; }

/* layout */
.wrap { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }
.side { position: sticky; top: var(--head); height: calc(100vh - var(--head)); overflow: auto; padding: 18px 14px 40px; border-right: 1px solid var(--border);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.side .navplay { display: none; }
.side h4 { margin: 18px 10px 6px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.side h4:first-child { margin-top: 0; }
.side a, .side .soon { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 8px; font-size: 14.5px;
  text-decoration: none; color: var(--fg); }
.side a:hover { background: var(--surface2); }
.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side .soon { color: var(--muted); opacity: .7; }
.side .soon em { font-style: normal; font-size: 11px; border: 1px solid var(--border); border-radius: 99px; padding: 0 7px; }
main { min-width: 0; padding: 32px 40px 80px; }
article { max-width: 820px; }

/* typography */
article h1 { font-size: 34px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.01em; }
article .lead { font-size: 18px; color: var(--muted); margin: 0 0 26px; }
article h2 { font-size: 23px; margin: 40px 0 10px; padding-top: 8px; border-top: 1px solid var(--border); }
article h3 { font-size: 18px; margin: 26px 0 6px; }
article p, article li { max-width: 72ch; }
article ul, article ol { padding-left: 22px; }
article li { margin: 4px 0; }
.anchor { margin-left: 6px; opacity: 0; text-decoration: none; color: var(--muted); font-weight: 400; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
kbd { font: 600 13px ui-monospace, monospace; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--surface); }
.menu-path { font-weight: 600; }
.coin { color: var(--gold); font-weight: 650; }

/* callouts */
.callout { border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 12px 16px; margin: 18px 0; }
.callout p { margin: 4px 0; }
.callout.tip { border-left-color: var(--ok); background: var(--ok-soft); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.coin { border-left-color: var(--gold); background: var(--gold-soft); color: var(--fg); font-weight: 400; }
.callout b:first-child { display: block; margin-bottom: 2px; }

/* commands */
.cmd { display: flex; align-items: center; gap: 8px; margin: 10px 0; background: var(--surface2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 8px 8px 14px; }
.cmd code { flex: 1; font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; white-space: nowrap; }
.cmd button { flex: none; height: 30px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--fg); font: 600 12.5px system-ui, sans-serif; cursor: pointer; }
code { font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface2); border-radius: 5px; padding: 1px 5px; }

/* tables */
.table { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; background: var(--surface); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface2); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }

/* screenshots */
figure.shot { margin: 18px 0; }
figure.shot img { display: block; border-radius: 10px; border: 1px solid var(--border); box-shadow: var(--shadow); cursor: zoom-in; background: var(--surface2); }
figure.shot figcaption { font-size: 14px; color: var(--muted); margin-top: 7px; }
.shots2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.shots2 figure.shot { margin: 0; }

/* NPC card */
.npc { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 18px; align-items: start; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 18px 0; box-shadow: var(--shadow); }
.npc img { border-radius: 9px; display: block; cursor: zoom-in; }
.npc h3 { margin: 2px 0 8px; }
.npc dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 15px; }
.npc dt { color: var(--muted); }
.npc dd { margin: 0; }
.loc { font-weight: 650; }
td.loc { white-space: nowrap; }

/* steps */
ol.steps { list-style: none; counter-reset: s; padding: 0; }
ol.steps > li { counter-increment: s; position: relative; padding-left: 44px; margin: 14px 0; max-width: none; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent);
  color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }

/* home cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 18px 0; }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--fg); box-shadow: var(--shadow); }
.card:hover { border-color: var(--accent); }
.card b { display: block; margin-bottom: 3px; color: var(--accent); }
.card span { font-size: 14px; color: var(--muted); }
.card.soon { opacity: .6; pointer-events: none; }
.hero { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; }
.hero img { width: 220px; height: auto; }

/* prev / next */
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; max-width: 820px; }
.pager a { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; text-decoration: none; background: var(--surface); }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; color: var(--muted); font-size: 12.5px; }
.pager .next { text-align: right; }
footer { color: var(--muted); font-size: 13px; margin-top: 40px; max-width: 820px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(5,10,18,.86); display: none; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* phone */
@media (max-width: 900px) {
  :root { --head: 56px; }
  .wrap { display: block; }
  .menubtn { display: inline-flex; }
  .side { position: fixed; z-index: 40; top: var(--head); left: 0; width: min(300px, 86vw); background: var(--surface); transform: translateX(-102%);
    transition: transform .2s; box-shadow: var(--shadow); }
  body.nav .side { transform: none; }
  main { padding: 22px 16px 60px; }
  article h1 { font-size: 28px; }
  .top .brand span { display: none; }
  .top .brand img { height: 28px; }
  .search { width: auto; flex: 1; }
  .top .grow { display: none; }
  .npc { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero img { width: 180px; }
}
@media (max-width: 600px) {
  .playbtn { display: none; }
  .side .navplay { display: flex; margin-bottom: 10px; background: var(--accent); color: #fff; font-weight: 600; justify-content: center; }
}
