/*
 * PagerSpass-Wiki — eigenständiges Stylesheet, keine Laufzeit-Abhängigkeit vom
 * Spiel-Build. Farbwerte bewusst von web/src/styles/base.css übernommen, damit
 * sich die Doku-Seite optisch als dasselbe Spiel zu erkennen gibt.
 */

:root {
  --bg: #080b10;
  --bg-tief: #05070a;
  --flaeche: #10161f;
  --flaeche-hoch: #161e29;
  --flaeche-aktiv: #1c2635;
  --rand: #232f3f;
  --rand-hell: #33455c;

  --text: #dbe4ef;
  --text-leise: #8b9bb0;
  --text-sehr-leise: #5d6d81;

  --amber: #ffb020;
  --amber-tief: #a86c00;
  --signal: #e5352b;
  --gruen: #2f9e44;

  --radius: 10px;
  --radius-klein: 6px;

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --kopfhoehe: 56px;
  --seitenleiste-breite: 248px;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--kopfhoehe) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--mono);
}

.leise {
  color: var(--text-leise);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 200;
  padding: 8px 12px;
  background: var(--amber);
  color: #1a1200;
  border-radius: var(--radius-klein);
  font-weight: 700;
}

.skip-link:focus {
  top: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------------------------------------------------------------- Kopfzeile */

.kopf {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--kopfhoehe);
  background: rgb(8 11 16 / 92%);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rand);
}

.kopf__zeile {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}

.marke {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.marke__punkt {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

.nav-schalter {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--rand);
  border-radius: var(--radius-klein);
  background: var(--flaeche);
  cursor: pointer;
}

.nav-schalter span {
  display: block;
  height: 2px;
  margin: 0 6px;
  background: var(--text-leise);
  border-radius: 2px;
}

.knopf-spiel {
  margin-left: auto;
  padding: 7px 12px;
  border: 1px solid var(--rand-hell);
  border-radius: var(--radius-klein);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.knopf-spiel:hover {
  background: var(--flaeche-aktiv);
  border-color: var(--amber-tief);
}

/* -------------------------------------------------------------------- Suche */

.suche {
  position: relative;
  flex: 1;
  max-width: 360px;
}

#suche-feld {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: var(--bg-tief);
  border: 1px solid var(--rand);
  border-radius: var(--radius-klein);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}

#suche-feld:focus {
  border-color: var(--amber-tief);
}

.suche__ergebnisse {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--flaeche-hoch);
  border: 1px solid var(--rand-hell);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgb(0 0 0 / 50%);
  padding: 6px;
}

.suche__gruppe-titel {
  padding: 6px 8px 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-sehr-leise);
}

.suche__treffer {
  display: block;
  padding: 8px 8px;
  border-radius: var(--radius-klein);
  color: var(--text);
  text-decoration: none;
  font-size: 13.5px;
}

.suche__treffer:hover,
.suche__treffer--aktiv {
  background: var(--flaeche-aktiv);
}

.suche__treffer .leise {
  display: block;
  font-size: 12px;
}

.suche__leer {
  padding: 10px 8px;
  font-size: 13px;
  color: var(--text-leise);
}

/* ------------------------------------------------------------------ Rahmen */

.rahmen {
  display: flex;
  max-width: 1160px;
  margin: 0 auto;
  align-items: flex-start;
}

.seitenleiste {
  position: sticky;
  top: var(--kopfhoehe);
  flex: none;
  width: var(--seitenleiste-breite);
  height: calc(100vh - var(--kopfhoehe));
  overflow-y: auto;
  padding: 20px 12px 20px 16px;
  border-right: 1px solid var(--rand);
}

.nav__liste {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__punkt {
  display: block;
  padding: 8px 10px;
  margin-bottom: 2px;
  border-radius: var(--radius-klein);
  color: var(--text-leise);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.nav__punkt:hover {
  background: var(--flaeche);
  color: var(--text);
}

.nav__punkt--aktiv {
  background: var(--flaeche-aktiv);
  color: var(--amber);
}

.seitenleiste__fuss {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--rand);
  font-size: 12px;
  line-height: 1.5;
}

.inhalt {
  flex: 1;
  min-width: 0;
  padding: 32px 28px 80px;
}

/* -------------------------------------------------------------------- Text */

.text h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.01em;
}

.text h2 {
  margin: 34px 0 12px;
  padding-top: 8px;
  font-size: 20px;
  color: var(--amber);
  border-top: 1px solid var(--rand);
}

.text h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.text h3 {
  margin: 26px 0 10px;
  font-size: 17px;
}

.text h4 {
  margin: 18px 0 8px;
  font-size: 14px;
  color: var(--text-leise);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.text p,
.text ul,
.text ol {
  margin: 0 0 14px;
}

.text ul,
.text ol {
  padding-left: 22px;
}

.text li {
  margin-bottom: 6px;
}

.text a {
  color: var(--amber);
}

.text blockquote {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-left: 3px solid var(--amber-tief);
  background: var(--flaeche);
  border-radius: 0 var(--radius-klein) var(--radius-klein) 0;
  color: var(--text-leise);
}

.text code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--flaeche-aktiv);
  font-family: var(--mono);
  font-size: 0.9em;
}

.text pre {
  padding: 12px 14px;
  background: var(--bg-tief);
  border: 1px solid var(--rand);
  border-radius: var(--radius-klein);
  overflow-x: auto;
}

.text pre code {
  padding: 0;
  background: none;
}

.text hr {
  margin: 28px 0;
  border: none;
  border-top: 1px solid var(--rand);
}

.tabelle-wrap {
  margin: 0 0 18px;
  overflow-x: auto;
}

.text table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.text th,
.text td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--rand);
  text-align: left;
  vertical-align: top;
}

.text th {
  color: var(--text-leise);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fahrzeug-uebersicht {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 20px;
  list-style: none;
}

.fahrzeug-uebersicht li {
  padding: 6px 12px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 99px;
  font-size: 13px;
  margin: 0;
}

/* -------------------------------------------------------- Inhaltsverzeichnis */

.toc {
  float: right;
  clear: right;
  width: 230px;
  margin: 0 0 20px 24px;
  padding: 14px 16px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  font-size: 13px;
}

.toc__titel {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-sehr-leise);
}

.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc__punkt a {
  display: block;
  padding: 3px 0;
  color: var(--text-leise);
  text-decoration: none;
}

.toc__punkt--3 a {
  padding-left: 12px;
  font-size: 12.5px;
}

.toc__punkt a:hover,
.toc__punkt--aktiv > a {
  color: var(--amber);
}

/* -------------------------------------------------------------------- Fuß */

.fuss {
  padding: 28px 16px 40px;
  text-align: center;
  border-top: 1px solid var(--rand);
  font-size: 13px;
}

.fuss p {
  margin: 4px 0;
}

/* --------------------------------------------------------------- Reaktiv */

@media (max-width: 860px) {
  .toc {
    float: none;
    width: 100%;
    margin: 0 0 24px;
  }
}

@media (max-width: 760px) {
  .nav-schalter {
    display: flex;
  }

  .suche {
    order: 3;
    max-width: none;
    flex-basis: 100%;
  }

  .kopf {
    height: auto;
  }

  .kopf__zeile {
    flex-wrap: wrap;
    padding: 10px 14px;
  }

  .rahmen {
    display: block;
  }

  .seitenleiste {
    position: fixed;
    inset: 0 20% 0 0;
    top: 0;
    z-index: 90;
    height: 100vh;
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    padding-top: calc(var(--kopfhoehe) + 16px);
  }

  body.nav-offen .seitenleiste {
    transform: translateX(0);
    box-shadow: 12px 0 32px rgb(0 0 0 / 50%);
  }

  .inhalt {
    padding: 22px 16px 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
