/* ==========================================================================
   GhostSiege – Guide-Wiki (/guide)
   --------------------------------------------------------------------------
   Eigenes Stylesheet statt style.css: die Spielseite setzt html/body auf
   overflow:hidden und user-select:none – beides ist auf einer Leseseite falsch.
   Die Marken-Token (Farben, Schrift, Radien, Schatten) sind bewusst dieselben,
   damit Wiki und Spiel als eine Seite lesen.

   Jede Karte traegt --tint (Leitfarbe des Eintrags) und --accent als eigene
   Variablen; sie kommen aus js/guide-data.js. Neue Eintraege brauchen deshalb
   KEIN neues CSS.
   ========================================================================== */

:root {
  --bg: #0b0e18;
  --bg-2: #10142260;
  --panel: rgba(18, 22, 38, 0.92);
  --panel-2: rgba(24, 28, 50, 0.78);
  --line: rgba(120, 170, 255, 0.22);
  --line-strong: rgba(120, 170, 255, 0.4);
  --accent: #4aa8ff;
  --accent2: #9b7bff;
  --gold: #ffd35b;
  --text: #e8ecff;
  --muted: #8b93b8;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  --radius: 18px;
  --top-h: 118px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 18px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body.guide-page {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* KEIN overflow-x: hidden am body - das macht ihn zum eigenen Scroll-Container
     und die sticky Kopfzeile klebt dann am Body statt am Sichtfenster. Der
     Ueberlauf der Lichtflecken wird stattdessen in .g-aura selbst abgeschnitten. */
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* Eine eigene display-Regel schlaegt sonst das [hidden] des Browsers - genau das
   passiert hier bei jedem Flex-Element, das per JS aus- und eingeblendet wird. */
[hidden] { display: none !important; }

/* Nur fuer Screenreader */
.g-sr {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.g-skip {
  position: absolute; left: 12px; top: -60px; z-index: 60;
  background: var(--accent); color: #05070e; font-weight: 700;
  padding: 10px 16px; border-radius: 10px; text-decoration: none;
  transition: top 0.15s ease;
}
.g-skip:focus { top: 12px; }

/* ---------------------------------------------------------- Hintergrund */
/* Drei sehr weiche Lichtflecken. Sie liegen fix hinter allem und bewegen sich
   nicht – auf einer Leseseite waere Bewegung im Hintergrund nur Unruhe. */
.g-aura { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.g-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.g-orb-a { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: radial-gradient(circle, rgba(74, 168, 255, 0.5), transparent 68%); }
.g-orb-b { width: 40vw; height: 40vw; right: -10vw; top: 18vh; background: radial-gradient(circle, rgba(155, 123, 255, 0.45), transparent 68%); }
.g-orb-c { width: 52vw; height: 52vw; left: 22vw; bottom: -26vw; background: radial-gradient(circle, rgba(74, 168, 255, 0.22), transparent 70%); }

/* ------------------------------------------------------------- Kopfzeile */
.g-top {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(180deg, rgba(11, 14, 24, 0.97), rgba(11, 14, 24, 0.9));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.g-top-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px;
}

.g-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex: 0 0 auto;
}
.g-brand img { width: 32px; height: 32px; border-radius: 9px; }
.g-brand-word { font-size: 19px; font-weight: 700; letter-spacing: 0.2px; }
.g-brand-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: #cbb7ff; background: rgba(155, 123, 255, 0.18);
  border: 1px solid rgba(155, 123, 255, 0.4);
  padding: 2px 8px; border-radius: 999px;
}

/* Suche */
.g-search-wrap {
  position: relative; flex: 1 1 auto; max-width: 520px;
  display: flex; align-items: center;
}
.g-search-ico {
  position: absolute; left: 14px; font-size: 18px; color: var(--muted); pointer-events: none;
}
.g-search {
  width: 100%;
  background: rgba(10, 13, 24, 0.9);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font: inherit; font-size: 15px;
  padding: 11px 74px 11px 40px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.g-search::-webkit-search-cancel-button { display: none; }
.g-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 168, 255, 0.18); }
.g-search::placeholder { color: #6e769b; }
.g-kbd {
  position: absolute; right: 12px;
  font-family: inherit; font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 7px; pointer-events: none;
}
.g-search-clear {
  position: absolute; right: 38px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); border: 0; color: var(--text);
  font-size: 17px; line-height: 1; cursor: pointer;
}
.g-search-clear:hover { background: rgba(255, 255, 255, 0.18); }

.g-top-right { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }

.g-lang { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.g-lang a { text-decoration: none; color: var(--muted); padding: 2px 4px; border-radius: 6px; }
.g-lang a:hover { color: var(--text); }
.g-lang a[aria-current="true"] { color: var(--text); background: rgba(120, 170, 255, 0.16); }

/* Knoepfe */
.g-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 15px;
  padding: 10px 20px; text-decoration: none;
  transition: transform 0.12s ease, filter 0.15s ease;
}
.g-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.g-btn:active { transform: translateY(0); }
.g-btn-primary {
  color: #06111f;
  background: linear-gradient(135deg, #79d0ff, #9b7bff);
  box-shadow: 0 8px 22px rgba(74, 168, 255, 0.28);
}
.g-btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

/* Reiterleiste */
.g-tabs {
  max-width: 1240px; margin: 0 auto;
  display: flex; gap: 8px; padding: 0 22px 10px;
  overflow-x: auto; scrollbar-width: none;
}
.g-tabs::-webkit-scrollbar { display: none; }
.g-tab {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 700;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.g-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.g-tab.is-active {
  color: var(--text);
  background: rgba(74, 168, 255, 0.14);
  border-color: rgba(74, 168, 255, 0.4);
}
.g-tab.is-dim { opacity: 0.32; }
.g-tab-ico { font-size: 15px; }
.g-tab-n {
  font-size: 11px; color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px; padding: 1px 7px;
}

/* ------------------------------------------------------------ Hauptteil */
.g-main { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 0 22px 90px; }

.g-hero { padding: 54px 0 34px; max-width: 780px; }
.g-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: #9fb4ff; margin-bottom: 12px;
}
.g-hero h1 {
  font-size: clamp(32px, 5vw, 50px); line-height: 1.1; font-weight: 700;
  background: linear-gradient(120deg, #ffffff 20%, #a9c8ff 60%, #c9b0ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 16px;
}
.g-lede { color: #b9c1e0; font-size: 17px; }

.g-totals { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.g-total {
  display: inline-flex; align-items: baseline; gap: 7px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--muted);
}
.g-total strong { font-size: 16px; color: var(--text); }

.g-result {
  display: flex; align-items: baseline; gap: 7px;
  color: var(--muted); font-size: 14px; padding: 8px 0 4px;
}
.g-result strong { color: var(--gold); font-size: 17px; }

/* ------------------------------------------------------------ Abschnitte */
.g-section { padding: 40px 0 8px; scroll-margin-top: calc(var(--top-h) + 18px); }
.g-section[hidden] { display: none; }

.g-sec-head { margin-bottom: 20px; }
.g-sec-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 25px; font-weight: 700; margin-bottom: 8px;
}
.g-sec-ico { font-size: 22px; opacity: 0.9; }
.g-sec-count {
  font-size: 12px; font-weight: 700; color: var(--muted);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 9px;
}
.g-sec-blurb { color: var(--muted); max-width: 760px; font-size: 15px; }

.g-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.g-filter {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  color: var(--muted); background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.g-filter:hover { color: var(--text); background: rgba(255, 255, 255, 0.09); }
.g-filter.is-on {
  color: #06111f; background: linear-gradient(135deg, #79d0ff, #9b7bff);
  border-color: transparent;
}

/* ------------------------------------------------------------- Kartenraster */
.g-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(304px, 1fr));
}

.g-card {
  position: relative; display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: var(--text);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--tint) 18%, transparent), transparent 62%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  overflow: hidden;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.g-card[hidden] { display: none; }
.g-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.g-card:hover, .g-card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tint) 55%, var(--line));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 0 1px color-mix(in srgb, var(--tint) 22%, transparent);
  outline: none;
}

.g-card-art {
  flex: 0 0 92px; width: 92px; height: 104px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; overflow: hidden;
  background: radial-gradient(circle at 50% 62%, color-mix(in srgb, var(--tint) 34%, transparent), rgba(8, 10, 20, 0.6) 72%);
}
.g-card-art img { width: 100%; height: 100%; object-fit: contain; object-position: center; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5)); }
.g-card-art img.is-icon { width: 62%; height: 62%; }
.g-glyph { font-size: 34px; }

.g-card-body { flex: 1 1 auto; min-width: 0; }
.g-card-name { font-size: 18px; font-weight: 700; line-height: 1.25; }
.g-card-sub {
  font-size: 12.5px; color: color-mix(in srgb, var(--accent) 62%, #b9c1e0);
  margin: 3px 0 9px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.g-card-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.g-card-more { flex: 0 0 auto; color: var(--muted); font-size: 22px; line-height: 1; padding-right: 2px; }
.g-card:hover .g-card-more { color: var(--text); }

/* Chip: Icon · kleines Label · fetter Wert. Dieselbe Form auf Karte und Detail. */
.g-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(8, 11, 22, 0.6);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 12px; max-width: 100%;
}
.g-chip-ico { opacity: 0.75; font-size: 12px; }
.g-chip-lbl { color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; font-size: 10.5px; font-weight: 700; }
.g-chip-val { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.g-chip { font-family: inherit; cursor: pointer; color: var(--text); }
button.g-chip.is-link:hover { border-color: var(--accent); background: rgba(74, 168, 255, 0.12); }
button.g-chip.is-link .g-chip-val { color: #a9d4ff; text-decoration: underline dotted; text-underline-offset: 3px; }

.g-empty { color: var(--muted); font-size: 14px; padding: 10px 2px; }

.g-nohits { text-align: center; padding: 70px 0 40px; }
.g-nohits-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.g-nohits-hint { color: var(--muted); }

/* ---------------------------------------------------------- Detailansicht */
/* Aufbau wie die Skin-Karte im Spiel: Kunst links, Text rechts, Chips
   darueber, unten der Handlungsknopf. */
.g-dialog {
  width: min(1000px, calc(100vw - 32px));
  max-height: min(88vh, 940px);
  padding: 0; border: 0; background: transparent;
  color: var(--text); overflow: visible;
  /* Der Reset ganz oben (* { margin: 0 }) nimmt dem Dialog das margin:auto, mit
     dem der Browser modale Dialoge zentriert - hier wieder herstellen. */
  inset: 0; margin: auto;
}
.g-dialog::backdrop { background: rgba(4, 6, 14, 0.78); backdrop-filter: blur(6px); }
.g-dialog:not([open]) { display: none; }

.g-dialog-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(18, 22, 38, 0.96); border: 1px solid var(--line-strong);
  color: var(--text); font-size: 22px; line-height: 1; cursor: pointer;
  box-shadow: var(--shadow);
}
.g-dialog-close:hover { background: rgba(40, 46, 74, 0.98); }

.g-dialog-body { max-height: min(88vh, 940px); overflow-y: auto; overflow-x: hidden; border-radius: 24px; }

.g-detail {
  display: grid; grid-template-columns: 340px 1fr; gap: 8px;
  background:
    radial-gradient(90% 100% at 0% 0%, color-mix(in srgb, var(--tint) 24%, transparent), transparent 60%),
    linear-gradient(150deg, rgba(30, 22, 54, 0.98), rgba(15, 17, 34, 0.98));
  border: 1px solid color-mix(in srgb, var(--tint) 38%, var(--line));
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.g-detail-art {
  display: flex; align-items: center; justify-content: center;
  border-radius: 18px; min-height: 320px; padding: 10px;
  background: radial-gradient(circle at 50% 58%, color-mix(in srgb, var(--tint) 26%, transparent), transparent 68%);
}
.g-detail-art img { width: 100%; height: auto; max-height: 420px; object-fit: contain; filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.55)); }
.g-detail-art img.is-icon { width: 56%; }
.g-detail-art .g-glyph { font-size: 96px; }

/* rechts Platz fuer den Schliessen-Knopf, der ueber der Karte sitzt */
.g-detail-info { padding: 6px 46px 0 8px; min-width: 0; }
.g-detail-eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 70%, #ffffff);
  margin-bottom: 4px;
}
.g-detail-name { font-size: clamp(28px, 4vw, 42px); line-height: 1.1; font-weight: 700; margin-bottom: 16px; }

.g-detail-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.g-detail-chips .g-chip { padding: 8px 13px; border-radius: 12px; }
.g-detail-chips .g-chip-val { font-size: 14.5px; white-space: normal; }

.g-block { margin-bottom: 18px; }
.g-block-title { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; margin-bottom: 5px; }
.g-block-ico { font-size: 15px; opacity: 0.85; }
.g-block-text { color: #c3cae7; font-size: 15px; }

.g-stats { margin: 22px 0 18px; }
.g-stats-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 9px;
}
.g-stat-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px;
}
/* Jedes Paar ist EIN Rasterfeld: Bezeichnung oben, Wert darunter. */
.g-stat {
  background: rgba(8, 11, 22, 0.55);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 11px 8px;
  min-width: 0;
}
.g-stat dt {
  font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.6px; line-height: 1.35;
}
.g-stat dd { font-size: 17px; font-weight: 700; line-height: 1.3; }

.g-flavor {
  color: var(--muted); font-size: 14px; font-style: italic;
  border-left: 2px solid color-mix(in srgb, var(--tint) 60%, transparent);
  padding-left: 12px; margin-bottom: 20px;
}

.g-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.g-detail-actions .g-btn { flex: 1 1 180px; }

/* ---------------------------------------------------------------- Fusszeile */
.g-foot { position: relative; z-index: 1; border-top: 1px solid var(--line); background: rgba(9, 11, 20, 0.7); }
.g-foot-inner { max-width: 1240px; margin: 0 auto; padding: 30px 22px 40px; display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; }
.g-foot-brand { display: flex; align-items: center; gap: 11px; }
.g-foot-brand img { width: 28px; height: 28px; border-radius: 8px; }
.g-foot-brand strong { display: block; font-size: 15px; }
.g-foot-brand span { color: var(--muted); font-size: 13px; }
.g-foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; flex: 1 1 340px; }
.g-foot-links a { color: var(--muted); font-size: 13.5px; text-decoration: none; }
.g-foot-links a:hover { color: var(--text); text-decoration: underline; }
.g-foot-links a[aria-current="true"] { color: var(--text); }
.g-foot-copy { color: #5f678c; font-size: 12.5px; }

/* ------------------------------------------------------------- Schmale Fenster */
@media (max-width: 900px) {
  :root { --top-h: 156px; }
  .g-top-inner { flex-wrap: wrap; gap: 12px; }
  .g-search-wrap { order: 3; max-width: none; flex-basis: 100%; }
  .g-top-right { margin-left: auto; }
  .g-detail { grid-template-columns: 1fr; padding: 20px; }
  .g-detail-art { min-height: 220px; }
  .g-detail-art img { max-height: 280px; }
  .g-detail-info { padding: 0 40px 0 0; }
}

@media (max-width: 560px) {
  body.guide-page { font-size: 15px; }
  .g-main { padding: 0 14px 70px; }
  .g-top-inner { padding: 10px 14px; }
  .g-tabs { padding: 0 14px 10px; }
  .g-hero { padding: 34px 0 24px; }
  .g-brand-tag { display: none; }
  .g-kbd { display: none; }
  .g-search { padding-right: 44px; }
  .g-search-clear { right: 10px; }
  .g-grid { grid-template-columns: 1fr; }
  .g-card-art { flex-basis: 74px; width: 74px; height: 86px; }
  .g-foot-inner { padding: 24px 14px 32px; }
}

/* Wer Bewegung reduziert haben moechte, bekommt keine Schwebe-Effekte. */
@media (prefers-reduced-motion: reduce) {
  .g-card, .g-btn { transition: none; }
  .g-card:hover, .g-card:focus-visible, .g-btn:hover { transform: none; }
}

/* Fallback fuer Browser ohne color-mix(): dort greifen die Grundfarben. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .g-card { background: var(--panel); }
  .g-card:hover { border-color: var(--line-strong); }
  .g-card-art, .g-detail-art { background: rgba(255, 255, 255, 0.04); }
  .g-card-sub, .g-detail-eyebrow { color: var(--accent); }
  .g-detail { border-color: var(--line-strong); }
  .g-flavor { border-left-color: var(--accent2); }
}
