/* GTAa Docs theme (hand-written; the pages are generated by scripts/build-docs.mjs).
   Tokens follow the game's index.html :root: site navy, amber orange, sky blue. */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/manrope-400.woff2) format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/manrope-500.woff2) format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/manrope-600.woff2) format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/manrope-700.woff2) format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 800; font-display: swap; src: url(/assets/fonts/manrope-800.woff2) format('woff2'); }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/assets/fonts/oswald-600.woff2) format('woff2'); }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/oswald-700.woff2) format('woff2'); }

:root {
  --bg: #101827;
  --bg-2: #151f32;
  --bg-3: #1a263c;
  --line: rgba(101, 170, 224, .16);
  --line-strong: rgba(130, 185, 235, .3);
  --accent: #ffb12b;
  --accent-2: #ffd06a;
  --accent-soft: rgba(255, 177, 43, .1);
  --on-accent: #152033;
  --sky: #57bfff;
  --green: #4fd59a;
  --danger: #ff6b6b;
  --text: #e9edf3;
  --heading: #fff8ed;
  --muted: #a9b6c8;
  --faint: #7d8ba0;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --accent-grad: linear-gradient(135deg, #ffc54d 0%, #ff9d35 52%, #ff6a3d 100%);
  --font-display: 'Oswald', 'Arial Narrow', 'Roboto Condensed', 'Helvetica Neue', Impact, sans-serif;
  --font-body: 'Manrope', 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --top: 60px;
  --side: 280px;
  --toc: 232px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.7 var(--font-body); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 6px; font-weight: 700; }
.skip:focus { top: 10px; text-decoration: none; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: rgba(16, 24, 39, .88); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(12px); backdrop-filter: saturate(140%) blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--heading); flex: none; width: calc(var(--side) - 36px); }
.brand:hover { text-decoration: none; color: var(--heading); }
.brand img { width: 36px; height: 36px; display: block; }
.brand-name { font: 700 23px/1 var(--font-display); letter-spacing: .03em; }
.brand-docs {
  font: 700 11px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  border: 1px solid rgba(255, 177, 43, .4); border-radius: 999px; padding: 4px 8px 3px;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--heading); }
.menu-btn, .search-open, .search-close, .sidebar-close { display: none; }

.search { position: relative; flex: 1 1 auto; max-width: 520px; }
.search-box {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px;
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 10px; color: var(--faint);
  transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: rgba(255, 177, 43, .6); box-shadow: 0 0 0 3px rgba(255, 177, 43, .14); }
.search-box input {
  flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0; color: var(--text);
  font: 500 14px var(--font-body);
}
.search-box input::placeholder { color: var(--faint); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-hint { font-size: 11px !important; padding: 1px 7px !important; }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: min(70vh, 560px); overflow: auto;
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 6px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.sr-item { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); }
.sr-item:hover, .sr-item[aria-selected="true"] { background: var(--accent-soft); text-decoration: none; color: var(--text); }
.sr-item[aria-selected="true"] { box-shadow: inset 2px 0 0 var(--accent); }
.sr-path { display: block; font-size: 12px; color: var(--faint); font-weight: 600; letter-spacing: .02em; }
.sr-title { display: block; font-weight: 700; color: var(--heading); font-size: 14.5px; }
.sr-snip { display: block; font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.search-results mark { background: rgba(255, 177, 43, .22); color: var(--accent-2); border-radius: 2px; padding: 0 1px; }
.sr-empty { padding: 14px 12px; color: var(--muted); font-size: 14px; }

.top-links { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.top-home { color: var(--muted); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 8px; }
.top-home:hover { color: var(--heading); background: var(--surface-2); text-decoration: none; }
.btn-play {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 9px;
  background: var(--accent-grad); color: var(--on-accent); font: 800 13px var(--font-body); letter-spacing: .12em; text-transform: uppercase;
  box-shadow: 0 8px 22px rgba(255, 126, 48, .18), inset 0 1px rgba(255, 255, 255, .4);
}
.btn-play svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.btn-play:hover { color: var(--on-accent); text-decoration: none; filter: brightness(1.07); }

/* ---------- layout ---------- */
.layout {
  display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--toc);
  max-width: 1480px; margin: 0 auto; min-height: calc(100vh - var(--top));
}
.sidebar {
  position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; overscroll-behavior: contain;
  padding: 22px 14px 24px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: rgba(130, 185, 235, .2) transparent;
}
.sidebar-head { display: none; }
.nav { flex: 1; }
.nav-group { margin-bottom: 14px; }
.nav-group-title {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 8px; border: 0; background: none; cursor: pointer;
  font: 800 11.5px/1.2 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); border-radius: 6px; text-align: left;
}
.nav-group-title:hover { color: var(--heading); }
.nav-group-title .chev { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .15s; }
.nav-group.collapsed .chev { transform: rotate(0deg); }
.nav-group.collapsed ul { display: none; }
.nav-group.has-current .nav-group-title { color: var(--muted); }
.nav ul { list-style: none; margin: 2px 0 0; padding: 0 0 0 10px; border-left: 1px solid var(--line); margin-left: 15px; }
.nav li a {
  display: block; position: relative; padding: 6px 10px; margin: 1px 0; border-radius: 7px;
  color: var(--muted); font-size: 14.5px; font-weight: 500; line-height: 1.4;
}
.nav li a:hover { color: var(--heading); background: var(--surface-2); text-decoration: none; }
.nav li a.active { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.nav li a.active::before { content: ''; position: absolute; left: -11px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--accent); }
.sidebar-foot { margin-top: 16px; padding: 14px 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.sidebar-foot a { color: var(--faint); }
.sidebar-foot a:hover { color: var(--accent); }
.scrim { display: none; }

/* ---------- content ---------- */
.content { min-width: 0; padding: 40px 56px 40px; outline: none; }
.doc { max-width: 760px; margin: 0 auto; }
.crumb { margin: 0 0 6px; font: 800 12px/1.2 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.doc h1 {
  margin: 0 0 12px; font: 700 44px/1.1 var(--font-display); letter-spacing: .01em; color: var(--heading);
}
.lead { margin: 0 0 30px; font-size: 18.5px; line-height: 1.6; color: var(--muted); }
.doc h2, .doc h3, .doc h4 { position: relative; color: var(--heading); }
.doc h2 { margin: 48px 0 14px; padding-top: 28px; scroll-margin-top: -12px; border-top: 1px solid var(--line); font: 600 27px/1.2 var(--font-display); letter-spacing: .02em; }
.doc h1 + .lead + h2, .doc .lead + h2 { border-top: 0; padding-top: 0; margin-top: 36px; }
.doc h3 { margin: 32px 0 10px; font: 700 19px/1.35 var(--font-body); }
.doc h4 { margin: 24px 0 8px; font: 700 16px/1.4 var(--font-body); color: var(--text); }
.anchor {
  position: absolute; left: -26px; top: 0; bottom: 0; width: 22px; display: flex; align-items: center; justify-content: center;
  opacity: 0; color: var(--faint); transition: opacity .12s;
}
.doc h2 .anchor { top: 28px; }
.anchor::before { content: '#'; font: 600 18px var(--font-body); }
.doc h2:hover .anchor, .doc h3:hover .anchor, .doc h4:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--accent); text-decoration: none; }
.doc p { margin: 0 0 16px; }
.doc ul, .doc ol { margin: 0 0 18px; padding-left: 22px; }
.doc li { margin: 5px 0; }
.doc li > ul, .doc li > ol { margin: 4px 0 6px; }
.doc li::marker { color: var(--accent); }
.doc ol li::marker { font-weight: 700; color: var(--accent); }
.doc strong { color: var(--heading); font-weight: 700; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.doc code {
  font: 500 .86em/1.4 var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 5px; color: #ffd9a0; word-break: break-word;
}
.doc pre { background: #0c1320; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 0 0 18px; }
.doc pre code { background: none; border: 0; padding: 0; color: var(--text); font-size: 13.5px; word-break: normal; }
.doc blockquote { margin: 0 0 18px; padding: 2px 0 2px 16px; border-left: 3px solid var(--line-strong); color: var(--muted); }

kbd {
  display: inline-block; min-width: 1.7em; padding: 1px 6px; margin: 0 1px; text-align: center; vertical-align: 1px;
  font: 700 12.5px/1.5 var(--font-body); color: var(--heading); white-space: nowrap;
  background: linear-gradient(180deg, #24334f, #1a263c); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .35);
}

/* tables */
.table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 10px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.doc th, .doc td { padding: 9px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc th { background: var(--bg-3); color: var(--heading); font-weight: 700; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.doc tbody tr:last-child td { border-bottom: 0; }
.doc tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .018); }
.doc tbody tr:hover td { background: rgba(87, 191, 255, .04); }
.doc td:first-child { color: var(--heading); font-weight: 600; }
.doc table.kv td:first-child { width: 34%; color: var(--muted); }

/* callouts */
.callout { margin: 0 0 20px; padding: 14px 16px 2px; border: 1px solid; border-left-width: 4px; border-radius: 10px; }
.callout p { margin-bottom: 12px; }
.callout ul { margin-bottom: 12px; }
.callout-title { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.callout-title svg { width: 18px; height: 18px; }
.callout-info { background: rgba(87, 191, 255, .07); border-color: rgba(87, 191, 255, .28); border-left-color: var(--sky); }
.callout-info .callout-title { color: var(--sky); }
.callout-tip { background: rgba(79, 213, 154, .07); border-color: rgba(79, 213, 154, .26); border-left-color: var(--green); }
.callout-tip .callout-title { color: var(--green); }
.callout-warning { background: rgba(255, 177, 43, .08); border-color: rgba(255, 177, 43, .3); border-left-color: var(--accent); }
.callout-warning .callout-title { color: var(--accent); }
.callout-danger { background: rgba(255, 107, 107, .08); border-color: rgba(255, 107, 107, .3); border-left-color: var(--danger); }
.callout-danger .callout-title { color: var(--danger); }

/* card grid (welcome page) */
.doc .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; padding: 0; list-style: none; }
.doc .cards li { margin: 0; }
.doc .cards a {
  display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 14px; line-height: 1.5;
  transition: border-color .15s, background .15s;
}
.doc .cards a strong { display: block; color: var(--heading); font-size: 15.5px; margin-bottom: 2px; }
.doc .cards a:hover { border-color: rgba(255, 177, 43, .5); background: var(--accent-soft); text-decoration: none; }

/* changelog */
.update-date { margin: -8px 0 10px !important; color: var(--faint); font-size: 13.5px; font-weight: 600; letter-spacing: .03em; }

/* pager + footer */
.pager { max-width: 760px; margin: 56px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager a {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: 12px;
  color: var(--heading); font-weight: 700; font-size: 16px; line-height: 1.3; background: var(--surface); transition: border-color .15s, background .15s;
}
.pager a:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; color: var(--accent); }
.pager small { display: block; font-size: 12px; font-weight: 600; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 3px; }
.pager span { min-width: 0; }
.pager-next { justify-content: flex-end; text-align: right; grid-column: 2; }
.pager svg { color: var(--faint); }
.doc-foot {
  max-width: 760px; margin: 40px auto 0; padding: 20px 0 10px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--faint); font-size: 13px;
}

/* ---------- on this page ---------- */
.toc {
  position: sticky; top: var(--top); align-self: start; max-height: calc(100vh - var(--top)); overflow-y: auto;
  padding: 40px 20px 24px 8px; font-size: 13.5px; scrollbar-width: thin;
}
.toc-title { margin: 0 0 10px; font: 800 11.5px/1.2 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); line-height: 1.4; }
.toc .toc-l3 a { padding-left: 26px; font-size: 13px; color: var(--faint); }
.toc a:hover { color: var(--heading); text-decoration: none; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 700; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .layout { grid-template-columns: var(--side) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 920px) {
  .menu-btn { display: inline-flex; margin-left: -8px; }
  .brand { width: auto; }
  .layout { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; width: min(320px, 86vw); height: 100%;
    background: var(--bg-2); border-right: 1px solid var(--line-strong); padding-top: 0;
    transform: translateX(-102%); transition: transform .22s ease; visibility: hidden;
    box-shadow: 20px 0 50px rgba(0, 0, 0, .45);
  }
  body.nav-open .sidebar { transform: none; visibility: visible; }
  .sidebar-head {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1;
    height: var(--top); margin: 0 -14px 12px -20px; padding: 0 10px 0 22px; background: var(--bg-2); border-bottom: 1px solid var(--line);
    font: 800 12px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
  }
  .sidebar-close { display: inline-flex; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(4, 8, 16, .62); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .content { padding: 32px 28px 32px; }
}
@media (max-width: 640px) {
  :root { --top: 56px; }
  body { font-size: 15.5px; }
  .topbar { gap: 8px; padding: 0 12px; }
  .brand img { width: 32px; height: 32px; }
  .brand-name { font-size: 20px; }
  .top-home { display: none; }
  .btn-play { padding: 0 12px; height: 34px; font-size: 12px; }
  .search { position: static; flex: 0 0 auto; margin-left: auto; }
  .search-open { display: inline-flex; }
  .search-box { display: none; }
  .top-links { margin-left: 0; }
  body.search-on .search-box {
    display: flex; position: absolute; left: 10px; right: 10px; top: 9px; z-index: 5; height: 38px;
  }
  body.search-on .search-close { display: inline-flex; width: 30px; height: 30px; }
  body.search-on .search-hint { display: none; }
  .search-results { position: fixed; top: calc(var(--top) + 4px); left: 8px; right: 8px; max-height: calc(100vh - var(--top) - 16px); }
  .content { padding: 26px 16px 28px; }
  .doc h1 { font-size: 32px; }
  .lead { font-size: 17px; margin-bottom: 24px; }
  .doc h2 { font-size: 23px; margin-top: 40px; padding-top: 22px; }
  .doc h2 .anchor { top: 22px; }
  .anchor { display: none; }
  .doc .cards { grid-template-columns: 1fr; }
  .doc th, .doc td { padding: 8px 11px; }
  .doc table { font-size: 14px; }
  .pager { grid-template-columns: 1fr; margin-top: 40px; }
  .pager-next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
