/* PvpBot Wiki - one stylesheet for every page. Colours are tokens; dark mode redefines them. */

:root {
  --bg: #fbfbfc;
  --bg-soft: #f2f3f6;
  --panel: #ffffff;
  --text: #1b1d24;
  --text-soft: #555a66;
  --text-faint: #858a96;
  --border: #e3e5ea;
  --accent: #c8283a;
  --accent-soft: #fbe9eb;
  --accent-text: #a51f2f;
  --link: #b02233;
  --code-bg: #f3f4f7;
  --code-text: #2a2d36;
  --pre-bg: #181a21;
  --pre-text: #e6e7eb;
  --note-bg: #eef4ff;
  --note-border: #3d6fd8;
  --tip-bg: #ecf8f0;
  --tip-border: #2f9a5b;
  --warn-bg: #fff6e6;
  --warn-border: #d98b12;
  --shadow: 0 1px 2px rgba(16, 18, 27, .05), 0 6px 18px rgba(16, 18, 27, .06);
  --radius: 10px;
  --sidebar-w: 268px;
  --toc-w: 220px;
  --topbar-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1116;
    --bg-soft: #161920;
    --panel: #151820;
    --text: #e7e8ec;
    --text-soft: #a9adb8;
    --text-faint: #767b87;
    --border: #262a33;
    --accent: #ef4b5c;
    --accent-soft: #2a1519;
    --accent-text: #ff8391;
    --link: #ff7282;
    --code-bg: #1d2029;
    --code-text: #e3e5ea;
    --pre-bg: #0a0b0f;
    --pre-text: #e3e5ea;
    --note-bg: #141c2d;
    --note-border: #5b8cf0;
    --tip-bg: #11211a;
    --tip-border: #43b875;
    --warn-bg: #251d0e;
    --warn-border: #e6a23c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1116;
  --bg-soft: #161920;
  --panel: #151820;
  --text: #e7e8ec;
  --text-soft: #a9adb8;
  --text-faint: #767b87;
  --border: #262a33;
  --accent: #ef4b5c;
  --accent-soft: #2a1519;
  --accent-text: #ff8391;
  --link: #ff7282;
  --code-bg: #1d2029;
  --code-text: #e3e5ea;
  --pre-bg: #0a0b0f;
  --pre-text: #e3e5ea;
  --note-bg: #141c2d;
  --note-border: #5b8cf0;
  --tip-bg: #11211a;
  --tip-border: #43b875;
  --warn-bg: #251d0e;
  --warn-border: #e6a23c;
  --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(--topbar-h) + 16px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd, pre { font-family: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace; }

/* ---- top bar ---------------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 16px;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 45%, transparent);
}
.brand small { color: var(--text-faint); font-weight: 500; }

.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input {
  width: 100%;
  height: 38px;
  padding: 0 38px 0 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.search input:focus { border-color: var(--accent); background: var(--panel); }
.search .icon { position: absolute; left: 11px; top: 9px; color: var(--text-faint); pointer-events: none; }
.search kbd {
  position: absolute; right: 9px; top: 8px;
  font-size: 12px; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--border); color: var(--text-faint); background: var(--panel);
}
.results {
  position: absolute; top: 44px; left: 0; right: 0;
  max-height: 70vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; display: none;
}
.results.open { display: block; }
.results a { display: block; padding: 8px 10px; border-radius: 7px; color: var(--text); }
.results a:hover, .results a.active { background: var(--accent-soft); text-decoration: none; }
.results .r-title { font-weight: 600; }
.results .r-page { color: var(--text-faint); font-size: 13px; }
.results .r-snip { color: var(--text-soft); font-size: 13px; display: block; margin-top: 2px; }
.results mark { background: none; color: var(--accent-text); font-weight: 700; }
.results .empty { padding: 10px; color: var(--text-faint); }

.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-soft);
  cursor: pointer; font-size: 17px;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-faint); }
.menu-btn { display: none; }

/* ---- layout ----------------------------------------------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  max-width: 1440px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 22px 14px 40px 18px;
  border-right: 1px solid var(--border);
}
.sidebar h4 {
  margin: 18px 0 6px 10px;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint);
}
.sidebar h4:first-child { margin-top: 0; }
.sidebar a {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px; border-radius: 7px;
  color: var(--text-soft); font-size: 15px;
}
.sidebar a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.sidebar a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.sidebar .ico { width: 18px; text-align: center; opacity: .9; }

.content { min-width: 0; padding: 34px 44px 60px; }
article { max-width: 820px; }

.toc {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto; padding: 34px 18px 40px 8px;
  font-size: 14px;
}
.toc h5 { margin: 0 0 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.toc a { display: block; padding: 3px 0 3px 10px; color: var(--text-faint); border-left: 2px solid var(--border); }
.toc a.sub { padding-left: 22px; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--accent-text); border-left-color: var(--accent); }

/* ---- typography ------------------------------------------------------------------------------- */

.crumb { color: var(--text-faint); font-size: 14px; margin-bottom: 6px; }
h1 { font-size: 34px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.01em; }
.lead { font-size: 18px; color: var(--text-soft); margin: 0 0 26px; }
h2 { font-size: 24px; margin: 42px 0 12px; padding-top: 6px; letter-spacing: -.005em; border-top: 1px solid var(--border); padding-top: 26px; }
h2:first-of-type { border-top: 0; padding-top: 0; }
h3 { font-size: 19px; margin: 28px 0 8px; }
h2 .anchor, h3 .anchor { opacity: 0; margin-left: 6px; font-weight: 400; color: var(--text-faint); }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
p, ul, ol { margin: 0 0 14px; }
li { margin: 4px 0; }
li > ul { margin: 4px 0; }
strong { font-weight: 650; }

:not(pre) > code {
  background: var(--code-bg); color: var(--code-text);
  padding: 1px 6px; border-radius: 5px; font-size: .88em;
  overflow-wrap: anywhere;
}

pre {
  position: relative;
  background: var(--pre-bg); color: var(--pre-text);
  padding: 14px 16px; border-radius: var(--radius);
  overflow-x: auto; font-size: 14px; line-height: 1.55;
  margin: 0 0 18px;
}
pre code { background: none; padding: 0; color: inherit; }
pre .c { color: #7f8595; }
.copy {
  position: absolute; top: 8px; right: 8px;
  font: 12px system-ui, sans-serif; padding: 3px 8px; border-radius: 6px;
  border: 1px solid #3a3e4a; background: #232631; color: #c9ccd4; cursor: pointer; opacity: 0;
}
pre:hover .copy, .copy:focus { opacity: 1; }

kbd {
  font-size: .85em; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--border); border-bottom-width: 2px; background: var(--panel);
}

.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-soft); font-weight: 650; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
td.def { white-space: nowrap; color: var(--text-soft); }
/* the description column never gets squeezed to a sliver; the wrapper scrolls instead */
td:last-child { min-width: 180px; }
/* command tables: long syntax wraps instead of squeezing the description */
table.cmds td:first-child { width: 44%; }
table.cmds td code { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  td code { white-space: normal; }
  td:last-child { min-width: 140px; }
  table.cmds thead { display: none; }
  table.cmds, table.cmds tbody, table.cmds tr, table.cmds td { display: block; width: auto; }
  table.cmds td:first-child { padding-bottom: 2px; border-bottom: 0; }
  table.cmds td:last-child { min-width: 0; }
  /* settings: name, default and range on one line, the description under them */
  table.settings thead { display: none; }
  table.settings, table.settings tbody { display: block; }
  table.settings tr { display: grid; grid-template-columns: auto auto 1fr; gap: 4px 10px; padding: 10px 12px;
    border-bottom: 1px solid var(--border); }
  table.settings tr:last-child { border-bottom: 0; }
  table.settings td { padding: 0; border: 0; min-width: 0; }
  table.settings td:last-child { grid-column: 1 / -1; }
}

.callout {
  border-left: 4px solid var(--note-border); background: var(--note-bg);
  padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 18px;
}
.callout > :last-child { margin-bottom: 0; }
.callout .t { font-weight: 700; display: block; margin-bottom: 2px; }
.callout.tip { border-color: var(--tip-border); background: var(--tip-bg); }
.callout.warn { border-color: var(--warn-border); background: var(--warn-bg); }

.badge {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-text); vertical-align: middle;
}
.badge.gray { background: var(--bg-soft); color: var(--text-soft); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 18px 0 26px; }
.card {
  display: block; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); color: var(--text); box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.card .ci { font-size: 22px; }
.card b { display: block; margin: 6px 0 2px; }
.card span { color: var(--text-soft); font-size: 14px; }

.hero {
  padding: 28px 30px; border-radius: 14px; margin: 0 0 26px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--panel);
  border: 1px solid var(--border);
}
.hero h1 { font-size: 38px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 9px; font-weight: 600;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:hover { text-decoration: none; filter: brightness(1.05); }

.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 46px; max-width: 820px; }
.pager a {
  flex: 1; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .next { text-align: right; }
.pager small { display: block; color: var(--text-faint); font-size: 13px; }

.foot { margin-top: 40px; color: var(--text-faint); font-size: 13px; max-width: 820px; }

/* ---- small screens ---------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: grid; }
  .brand small { display: none; }
  .search kbd { display: none; }
  .sidebar {
    position: fixed; z-index: 25; left: 0; top: var(--topbar-h);
    width: min(86vw, 300px); background: var(--bg);
    transform: translateX(-100%); transition: transform .18s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  .content { padding: 24px 16px 50px; }
  h1 { font-size: 28px; }
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 30px; }
}
