/* ============================================================================
   DOGTAGS – Feldhandbuch-Look für WARDOGS-Stats
   Dunkel zuerst (Anthrazit mit Olivstich), Khaki-Schrift, Signal-Amber als
   Akzent, Cash in Scheingrün. Heller Modus = Papier eines Feldhandbuchs.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #14150f;
  --bg-2: #191b13;
  --panel: #1f221a;
  --panel-2: #272b20;
  --panel-3: #30352a;
  --line: #363b2b;
  --line-2: #4a5139;
  --ink: #e8e1c8;
  --ink-2: #b3ae94;
  --muted: #7f7c68;
  --accent: #f0a83a;
  --accent-2: #c47f1c;
  --accent-ink: #1a1408;
  --cash: #9ccf5a;
  --danger: #e0614a;
  --good: #7cc26b;
  --olive: #5f6d3f;
  --steel: #4585cc;
  --series-1: #c47f1c;
  --series-2: #4585cc;
  --grid: #2c3124;
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.7);
  --font-display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --font-body: 'Archivo', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  --radius: 4px;
  --gutter: clamp(16px, 4vw, 40px);

  /* Bild-Assets „Tactical Telemetry“ (web/img). Nur im dunklen Theme; hell = Feldhandbuch-Papier ohne Bilder. */
  --bg-rgb: 20 21 15;      /* --bg als RGB-Tripel für Verläufe */
  --wash: 31 34 26;        /* --panel als RGB-Tripel für Overlays auf Bildern */
  --img-section: url('/img/section.webp');
  --img-section-h: 56.3vw; /* 1920×1081 */
  --img-hero: url('/img/hero.webp');
  --img-hero-tags: url('/img/hero-dogtags.webp');
  --img-live: url('/img/live-panel.webp');
  --img-board: url('/img/leaderboard.webp');
  --img-timeline: url('/img/timeline.webp');
  --img-mark: url('/img/dogtag-mark.png');
  --img-lonestar: url('/img/faction-lonestar.webp');
  --img-valkyra: url('/img/faction-valkyra.webp');
  --img-manticore: url('/img/faction-manticore.webp');
  --timeline-display: block;
}
@media (max-width: 640px) {
  :root {
    --img-section: url('/img/section-mobile.webp');
    --img-section-h: 133.4vw; /* 1080×1440 */
    --img-hero: url('/img/hero-mobile.webp');
  }
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg-rgb: 230 224 203;
    --wash: 241 236 219;
    --img-section: none; --img-hero: none; --img-hero-tags: none; --img-live: none; --img-board: none;
    --img-timeline: none; --img-mark: none; --img-lonestar: none; --img-valkyra: none; --img-manticore: none;
    --timeline-display: none;
    --bg: #e6e0cb;
    --bg-2: #ddd6bf;
    --panel: #f1ecdb;
    --panel-2: #e6dfc8;
    --panel-3: #d9d1b6;
    --line: #c8c0a3;
    --line-2: #aea684;
    --ink: #1f2118;
    --ink-2: #4d5040;
    --muted: #75735f;
    --accent: #b86f12;
    --accent-2: #a8600c;
    --accent-ink: #fff7e8;
    --cash: #3e7a1c;
    --danger: #b23a2b;
    --good: #3f7d2e;
    --olive: #6f7a4c;
    --steel: #2a6fc0;
    --series-1: #a8600c;
    --series-2: #2a6fc0;
    --grid: #d7cfb3;
    --shadow: 0 18px 40px -24px rgba(40, 30, 0, 0.45);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg-rgb: 230 224 203;
  --wash: 241 236 219;
  --img-section: none; --img-hero: none; --img-hero-tags: none; --img-live: none; --img-board: none;
  --img-timeline: none; --img-mark: none; --img-lonestar: none; --img-valkyra: none; --img-manticore: none;
  --timeline-display: none;
  --bg: #e6e0cb;
  --bg-2: #ddd6bf;
  --panel: #f1ecdb;
  --panel-2: #e6dfc8;
  --panel-3: #d9d1b6;
  --line: #c8c0a3;
  --line-2: #aea684;
  --ink: #1f2118;
  --ink-2: #4d5040;
  --muted: #75735f;
  --accent: #b86f12;
  --accent-2: #a8600c;
  --accent-ink: #fff7e8;
  --cash: #3e7a1c;
  --danger: #b23a2b;
  --good: #3f7d2e;
  --olive: #6f7a4c;
  --steel: #2a6fc0;
  --series-1: #a8600c;
  --series-2: #2a6fc0;
  --grid: #d7cfb3;
  --shadow: 0 18px 40px -24px rgba(40, 30, 0, 0.45);
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  /* Section-Hintergrund oben, läuft nach unten in die Grundfarbe aus; im hellen Theme ist --img-section none */
  background:
    linear-gradient(to bottom, rgb(var(--bg-rgb) / 0) 55%, rgb(var(--bg-rgb) / 1) 100%) center top / 100% var(--img-section-h) no-repeat,
    var(--img-section) center top / 100% var(--img-section-h) no-repeat,
    radial-gradient(1200px 600px at 80% -10%, color-mix(in oklab, var(--olive) 22%, transparent), transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body::before {
  /* feines Korn */
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.4 0 0 0 0.10 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  z-index: 0;
}
main, header, footer { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 0.9em; background: var(--panel-2); padding: 0 4px; border-radius: 3px; }
h2, h3 { margin: 0; font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; text-wrap: balance; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
button, .btn {
  font: 600 13px/1 var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover, button:hover { text-decoration: none; filter: brightness(1.08); }
.btn-ghost, button.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button[disabled] { opacity: 0.55; cursor: default; }

/* ---------------------------------------------------------------- Topbar */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 10px var(--gutter);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; line-height: 1; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 30px;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.brand-sub { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 10px;
  border-radius: var(--radius);
}
.nav a:hover { color: var(--ink); background: var(--panel-2); text-decoration: none; }
.sources { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink-2);
  max-width: 100%;
}
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.chip-ok::before { background: var(--good); box-shadow: 0 0 0 3px color-mix(in oklab, var(--good) 25%, transparent); }
.chip-warn::before { background: var(--accent); }
.chip-bad::before { background: var(--danger); }
.chip-wait::before { background: var(--muted); }
.chip a { color: var(--accent); }
/* Chip als Link (Server-Status springt zum Live-Bereich) */
a.chip { color: var(--ink-2); }
a.chip:hover, a.chip:focus-visible { color: var(--ink); border-color: var(--accent); text-decoration: none; }
.chip .chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Discord-Link: Chip-Optik wie die Statusanzeigen, Discord-Blau erst beim Hover */
.discord {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 6px 12px 6px 10px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.discord svg { flex: none; }
.discord:hover, .discord:focus-visible { color: #fff; background: #5865f2; border-color: #5865f2; text-decoration: none; }
.foot .discord { margin-top: 2px; }
/* QR-Code: immer auf hellem Grund mit Ruhezone, damit Scanner ihn in beiden Themes lesen */
.qr {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 4px 0 10px;
  padding: 8px 8px 6px;
  background: #ffffff;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: #3a3a30;
  text-decoration: none;
}
.qr:hover { text-decoration: none; border-color: #5865f2; }
.qr img { display: block; width: 112px; height: 112px; image-rendering: pixelated; }
.qr-cap { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; }

/* Sprachumschalter DE | EN (überschreibt die globalen CTA-Button-Regeln) */
.lang { display: inline-flex; flex: none; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel); overflow: hidden; }
.lang button {
  font: 700 11px/1 var(--font-body);
  letter-spacing: 0.12em;
  padding: 7px 11px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}
.lang button:hover { filter: none; color: var(--ink); background: var(--panel-2); }
.lang button.on { color: var(--accent-ink); background: var(--accent); cursor: default; }
.lang button:focus-visible { outline-offset: -2px; }

/* Hell/Dunkel-Schalter: runder Icon-Button, Icon zeigt das Ziel (Sonne im Dunkeln, Mond im Hellen).
   data-scheme setzt theme.js auf das tatsächlich sichtbare Schema – auch ohne explizite Wahl. */
.theme {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink-2);
}
.theme:hover { filter: none; color: var(--accent); border-color: var(--accent); }
.theme svg { flex: none; }
.theme .ico-moon { display: none; }
:root[data-scheme="light"] .theme .ico-sun { display: none; }
:root[data-scheme="light"] .theme .ico-moon { display: block; }

/* ---------------------------------------------------------------- Layout */
.page { padding-block: 24px 48px; padding-inline: var(--gutter); max-width: 1320px; margin: 0 auto; display: grid; gap: 40px; }
.banner { padding: 12px 16px; border: 1px solid var(--danger); border-left-width: 4px; background: color-mix(in oklab, var(--danger) 12%, var(--panel)); border-radius: var(--radius); }
.banner-ok { border-color: var(--good); background: color-mix(in oklab, var(--good) 12%, var(--panel)); }
.banner-demo { border-color: var(--accent); background: repeating-linear-gradient(-45deg, color-mix(in oklab, var(--accent) 18%, var(--panel)) 0 14px, color-mix(in oklab, var(--accent) 8%, var(--panel)) 14px 28px); }
.stamp-demo { color: var(--danger); }
.is-demo .stat .k .src:not(.src-account) { color: var(--danger); }
.is-demo .stat .k .src:not(.src-account)::after { content: ' · DEMO'; }
.sec { scroll-margin-top: 80px; }
/* Rangliste und Rekorde als Band auf gebürstetem Metall; Tabelle/Karten leicht durchscheinend */
#ranking, #records {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgb(var(--wash) / 0.78), rgb(var(--wash) / 0.78)),
    var(--img-board) center / cover no-repeat,
    var(--bg-2);
}
#ranking .table-wrap, #records .card, #ranking .card { background: color-mix(in oklab, var(--panel) 90%, transparent); }
/* Match-Historie: Messskala als Kopfleiste über der Tabelle */
#matches .sec-body::before {
  content: '';
  display: var(--timeline-display);
  height: 30px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--img-timeline) center / cover no-repeat, var(--panel);
}
/* Karriere: Dogtag-Wasserzeichen in den Karten */
#career .card { position: relative; overflow: hidden; }
#career .card::after {
  content: '';
  position: absolute;
  right: -14px;
  bottom: -30px;
  width: 96px;
  height: 236px;
  background: var(--img-mark) center / contain no-repeat;
  opacity: 0.06;
  pointer-events: none;
}
.sec-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.sec-head h2 { font-size: 28px; font-weight: 800; }
.sec-note { color: var(--muted); font-size: 12px; margin-left: auto; font-family: var(--font-mono); }
.stamp {
  display: inline-block;
  font: 700 10px/1 var(--font-body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1.5px solid currentColor;
  border-radius: 3px;
  padding: 4px 6px 3px;
  transform: rotate(-2deg);
  opacity: 0.9;
  vertical-align: middle;
}
.stamp-account { color: var(--steel); }

/* Leerzustände */
.empty {
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 22px 24px;
  background: color-mix(in oklab, var(--panel) 60%, transparent);
  display: grid;
  gap: 8px;
  max-width: 72ch;
}
.empty h3 { font-size: 20px; }
.empty p { margin: 0; color: var(--ink-2); }
.empty code { white-space: nowrap; }
.empty .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* ---------------------------------------------------------------- Dogtag */
.hero { display: grid; }
.dogtag {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgb(var(--wash) / 0.55) 0%, rgb(var(--wash) / 0.8) 45%, rgb(var(--wash) / 0.9) 100%),
    var(--img-hero) center / cover no-repeat,
    linear-gradient(135deg, color-mix(in oklab, var(--panel-3) 70%, transparent), transparent 45%),
    var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 26px 28px 24px 28px;
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(220px, 1fr) minmax(280px, 1.4fr);
  gap: 28px;
  align-items: center;
  mask: radial-gradient(circle at 26px 26px, transparent 8px, #000 9px);
}
.dogtag > * { position: relative; z-index: 1; }
.dogtag::before {
  /* Die Dogtags aus dem Banner, per Screen-Blend ohne harte Kanten hinter dem Rating */
  content: '';
  position: absolute;
  inset: 0;
  background: var(--img-hero-tags) 50% center / auto 96% no-repeat;
  mix-blend-mode: screen;
  opacity: 0.28;
  /* weiche Maske: der Ausschnitt aus dem Banner darf keine Kante zeigen */
  mask-image: radial-gradient(ellipse 34% 62% at 50% 50%, #000 45%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 34% 62% at 50% 50%, #000 45%, transparent 100%);
  pointer-events: none;
}
.dogtag::after {
  /* Kettenloch-Rand */
  content: '';
  position: absolute;
  left: 15px;
  top: 15px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  pointer-events: none;
}
.dogtag-loading { grid-column: 1 / -1; color: var(--muted); }
.dt-id { display: flex; gap: 16px; align-items: center; min-width: 0; }
.dt-avatar {
  width: 84px;
  height: 84px;
  border-radius: 8px;
  flex: none;
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  color: var(--ink-2);
  overflow: hidden;
}
.dt-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dt-name { font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 4vw, 40px); line-height: 1; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.dt-name .disc { color: var(--muted); font-weight: 600; }
.dt-meta { color: var(--muted); font-size: 12px; margin-top: 6px; display: grid; gap: 2px; }
.dt-meta .mono { color: var(--ink-2); }
.dt-rank { text-align: center; border-inline: 1px solid var(--line); padding-inline: 12px; }
.dt-rank .label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.dt-rank .rating { font-family: var(--font-display); font-weight: 900; font-size: clamp(56px, 7vw, 84px); line-height: 0.95; color: var(--accent); margin: 4px 0; }
.dt-rank .tier { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 20px; }
.dt-rank .pos { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.dt-rank .pos strong { color: var(--ink); font-size: 16px; }
.dt-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; }
.stat { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.stat .k { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.stat .k .src { font-size: 9px; letter-spacing: 0.16em; color: var(--accent); border: 1px solid currentColor; padding: 1px 4px 0; border-radius: 2px; opacity: 0.8; white-space: nowrap; flex: none; }
.stat .k { flex-wrap: wrap; }
.stat .k .src-account { color: var(--steel); }
.stat .v { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; }
.stat .v.cash { color: var(--cash); }
.stat .v.na { color: var(--muted); font-size: 18px; font-family: var(--font-body); font-weight: 500; }
.stat .s { font-size: 12px; color: var(--muted); }
.dt-live { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; color: var(--ink-2); }
.dt-live .pulse { color: var(--good); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.dt-live .pulse::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--good) 45%, transparent); } 60% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: reduce) { .dt-live .pulse::before { animation: none; } }

/* ---------------------------------------------------------------- Karten / Grids */
.grid { display: grid; gap: 14px; }
.grid-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.tile .k { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.tile .v { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1.05; }
.tile .v.cash { color: var(--cash); }
.tile .v.na { color: var(--muted); font-size: 16px; font-family: var(--font-body); font-weight: 500; }
.tile .s { font-size: 12px; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.card h3 { font-size: 16px; letter-spacing: 0.06em; color: var(--ink-2); margin-bottom: 8px; display: flex; align-items: baseline; gap: 10px; }
.card h3 .sub { font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; color: var(--muted); }
.stack { display: grid; gap: 14px; }

/* Live-Match */
.live-grid { display: grid; grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1fr); gap: 14px; }
.live-grid > .card:first-child {
  background:
    linear-gradient(90deg, rgb(var(--wash) / 0.93) 0%, rgb(var(--wash) / 0.72) 55%, rgb(var(--wash) / 0.45) 100%),
    var(--img-live) right center / cover no-repeat,
    var(--panel);
}
.live-server { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.live-server .name { font-weight: 700; font-size: 14px; letter-spacing: 0.02em; color: var(--ink); overflow-wrap: anywhere; }
.live-server .mono { font-size: 12px; }
.live-map { font-family: var(--font-display); font-weight: 900; font-size: clamp(36px, 5vw, 56px); line-height: 0.95; letter-spacing: 0.01em; }
.live-line { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); font-size: 13px; margin-top: 6px; }
.live-line .mono { color: var(--ink); }
/* Fraktionen als Kacheln mit ihrem Highlight-Motiv (nur für bekannte Namen, sonst neutral) */
.faction-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }
.faction {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgb(var(--wash) / 0.5), rgb(var(--wash) / 0.85)),
    var(--img-faction, none) center / cover no-repeat,
    var(--panel-2);
}
.faction[data-faction="lonestar"] { --img-faction: var(--img-lonestar); }
.faction[data-faction="valkyra"] { --img-faction: var(--img-valkyra); }
.faction[data-faction="manticore"] { --img-faction: var(--img-manticore); }
.faction .sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.25); flex: none; }
.faction .n { flex: 1; font-weight: 600; }
.faction .c { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.online-list { display: grid; gap: 4px; max-height: 360px; overflow: auto; }
.online-row { display: grid; grid-template-columns: 1.5fr 1fr 0.55fr 0.6fr minmax(84px, 1fr) 0.5fr; gap: 8px; font-size: 13px; padding: 5px 8px; border-radius: 3px; align-items: center; }
.online-row.head { color: var(--muted); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; position: sticky; top: 0; background: var(--panel); }
.online-row.me { background: color-mix(in oklab, var(--accent) 14%, transparent); outline: 1px solid color-mix(in oklab, var(--accent) 40%, transparent); }
.online-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-row .fac { display: inline-flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-row .fac .sw { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.online-row .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* Rollen */
.role { display: grid; gap: 6px; }
.role .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.role .name { font-family: var(--font-display); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: 0.04em; }
.role .lvl { font-family: var(--font-display); font-weight: 900; font-size: 30px; color: var(--accent); line-height: 1; }
.role .lvl small { font-family: var(--font-body); font-weight: 600; font-size: 10px; letter-spacing: 0.14em; color: var(--muted); margin-right: 6px; vertical-align: middle; }
.role .xp { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); display: flex; justify-content: space-between; }
.role svg { width: 100%; height: 34px; display: block; }

/* ---------------------------------------------------------------- Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--panel-2); position: sticky; top: 0; }
th.num, td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th.sorted { color: var(--accent); }
tbody tr:hover { background: var(--panel-2); }
tbody tr.me { background: color-mix(in oklab, var(--accent) 14%, transparent); }
tbody tr.me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tbody tr.dim { color: var(--muted); }
td .pl { display: inline-flex; align-items: center; gap: 8px; }
td .pl img, td .pl .ini { width: 22px; height: 22px; border-radius: 3px; background: var(--panel-3); display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--ink-2); }
td .pl a { color: var(--ink); }
.cash { color: var(--cash); }
.neg { color: var(--danger); }
.pos-v { color: var(--good); }
.rank-cell { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--ink-2); }
.rank-cell.top { color: var(--accent); }
.tier-pill { display: inline-block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; padding: 3px 7px 2px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--ink-2); }
.result-win { color: var(--good); font-weight: 600; }
.result-loss { color: var(--danger); font-weight: 600; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; color: var(--ink-2); }
.toolbar select, .toolbar input {
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 7px 10px;
}
.toolbar input { font-family: var(--font-mono); min-width: 220px; }

/* Ranking-Erklärung */
.formula { display: grid; gap: 10px; }
.formula .f { font-family: var(--font-mono); font-size: 13px; background: var(--panel-2); padding: 10px 12px; border-radius: 3px; overflow-x: auto; }
.tiers { display: flex; flex-wrap: wrap; gap: 6px; }
.tiers .t { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid var(--line-2); padding: 4px 8px; border-radius: 3px; color: var(--ink-2); }
.tiers .t b { color: var(--ink); font-family: var(--font-mono); margin-left: 6px; font-weight: 600; }

/* Rekorde */
.record { display: grid; gap: 8px; }
.record .label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.record .val { font-family: var(--font-display); font-weight: 900; font-size: 40px; line-height: 1; color: var(--accent); }
.record .val.cash { color: var(--cash); }
.record .holder { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.record .holder img, .record .holder .ini { width: 24px; height: 24px; border-radius: 3px; background: var(--panel-3); display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; }
.record .holder a { color: var(--ink); font-weight: 600; }
.record .ctx { font-size: 12px; color: var(--muted); }
.record .mine { font-size: 12px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 8px; display: flex; justify-content: space-between; gap: 8px; }
.record .mine b { font-family: var(--font-mono); font-weight: 600; color: var(--ink); }
.record.is-mine { border-color: var(--accent); }

/* ---------------------------------------------------------------- Charts */
.chart { width: 100%; height: auto; display: block; font-family: var(--font-body); }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series-1); opacity: 0.1; }
.chart .dot { fill: var(--series-1); stroke: var(--panel); stroke-width: 2; }
.chart .bar-1 { fill: var(--series-1); }
.chart .bar-2 { fill: var(--series-2); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover + .dot, .chart .hit:hover ~ .hl { opacity: 1; }
.chart .lbl { fill: var(--ink-2); font-size: 11px; }
.chart .lbl-strong { fill: var(--ink); font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.legend i.s1 { background: var(--series-1); }
.legend i.s2 { background: var(--series-2); }
.spark { width: 100%; height: 34px; }
.spark .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; }
.spark .area { fill: var(--series-1); opacity: 0.12; }
.spark .end { fill: var(--series-1); stroke: var(--panel); stroke-width: 2; }
.tooltip {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  line-height: 1.35;
  padding: 6px 9px;
  border-radius: 3px;
  max-width: 260px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  white-space: pre-line;
}
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.hbar .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 14px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.hbar .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.stackbar { display: flex; height: 18px; border-radius: 3px; overflow: hidden; gap: 2px; background: var(--panel-2); }
.stackbar div { height: 100%; min-width: 2px; }

/* ---------------------------------------------------------------- Footer */
.foot { border-top: 1px solid var(--line); padding: 28px var(--gutter) 40px; background: var(--bg-2); }
.foot-grid { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; font-size: 13px; color: var(--ink-2); }
.foot h3 { font-size: 15px; letter-spacing: 0.08em; color: var(--ink); margin-bottom: 8px; }
.foot p { margin: 0 0 8px; max-width: 60ch; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 960px) {
  .dogtag { grid-template-columns: 1fr 1fr; }
  .dt-rank { grid-column: 1 / -1; border-inline: 0; border-block: 1px solid var(--line); padding-block: 10px; }
  .dt-stats { grid-column: 1 / -1; }
  .live-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dogtag { grid-template-columns: 1fr; padding: 22px 18px 18px; }
  .dt-stats { grid-template-columns: 1fr 1fr; }
  .sec-head h2 { font-size: 24px; }
  .sec-note { margin-left: 0; }
  .online-row { grid-template-columns: 1.4fr 0.9fr 0.5fr 0.5fr 0.8fr 0.5fr; font-size: 12px; }
  .brand-mark { font-size: 26px; }
  .sources { margin-left: 0; }
}
