/* ==========================================================================
   Rabbit-Mountain Darters — Design System
   Grundlage: Vereinswappen (Hexagon, Bergkontur, Zielscheibe, roter Punkt)
   Bei Aenderungen an dieser Datei: ?v=... in allen HTML-Dateien hochzaehlen (Cache-Busting)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Farben — vom Trikot/Wappen abgeleitet */
  --ink: #0b0d0e;          /* Trikot-Körper, Basis-Hintergrund */
  --ink-2: #16191b;        /* Panel-/Card-Hintergrund */
  --ink-3: #1f2325;        /* erhöhte Fläche, Hover */
  --slope: #33393c;        /* dunkler Bergschatten, Rahmen */
  --fog: #8b9598;          /* Ärmel-/Bergsilhouette, gedämpfter Text */
  --mist: #cbd3d4;         /* Wappen-Rand, helle Sekundärfarbe */
  --chalk: #f3f5f4;        /* Haupttext auf dunklem Grund */
  --bullseye: #e3352a;     /* EIN Rot — Zielscheibenpunkt, nur für Bedeutung */
  --bullseye-dim: #4a1613; /* gedämpftes Rot für Flächen/Hover */
  --win-green: #3fae62;    /* Gewonnen-Balken in der Statistik */

  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  --container: 1180px;
  --radius: 2px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Typografie ---------- */

h1, h2, h3, .display {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.05;
  font-weight: 400;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.3rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fog);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--fog);
  display: inline-block;
}

.lede {
  color: var(--mist);
  font-size: 1.05rem;
  max-width: 60ch;
}

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

/* ---------- Zielscheiben-Marker (Signature-Element) ----------
   Erscheint genau dort, wo etwas *gerade wichtig* ist: aktiver Menüpunkt,
   naechstes Spiel, eigene Zeile in der Tabelle. Nie dekorativ. */

.target-marker {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--fog);
  position: relative;
  flex-shrink: 0;
}
.target-marker::after {
  content: '';
  position: absolute;
  inset: 3.5px;
  border-radius: 50%;
  background: var(--bullseye);
}

/* ---------- Header / Navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  border-bottom: 1px solid var(--slope);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img { height: 44px; width: auto; }
.brand-text {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  font-size: 1.05rem;
  line-height: 1.1;
}
.brand-text small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--fog);
  text-transform: uppercase;
  font-weight: 400;
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
}

nav.main-nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  position: relative;
}
nav.main-nav a .target-marker { opacity: 0; transform: scale(0.6); transition: all 0.15s ease; }
nav.main-nav a:hover { color: var(--chalk); }
nav.main-nav a.active { color: var(--chalk); }
nav.main-nav a.active .target-marker { opacity: 1; transform: scale(1); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--slope);
  color: var(--chalk);
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  nav.main-nav {
    position: fixed;
    inset: 76px 0 0 0;
    background: var(--ink-2);
    border-top: 1px solid var(--slope);
    display: none;
    padding: 30px 24px;
  }
  nav.main-nav.open { display: block; }
  nav.main-nav ul { flex-direction: column; gap: 4px; }
  nav.main-nav a { font-size: 1rem; padding: 16px 0; border-bottom: 1px solid var(--ink-3); }
  .nav-toggle { display: block; }
}

/* ---------- Hero (Startseite) ---------- */

.hero {
  position: relative;
  padding: 90px 0 70px;
  overflow: hidden;
  border-bottom: 1px solid var(--slope);
}

.hero-topo {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
  mask-image: linear-gradient(to bottom, black 20%, transparent 92%);
  background-image: url('assets/img/topo.svg');
  background-size: cover;
  background-position: bottom;
}

.hero .wrap { position: relative; z-index: 1; }

.hero-crest {
  width: 160px;
  margin-bottom: 28px;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.5));
}

.hero h1 { max-width: 14ch; }
.hero h1 .accent-slash { color: var(--fog); }

.hero-actions { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 22px;
  border: 1px solid var(--fog);
  transition: all 0.15s ease;
}
.btn:hover { border-color: var(--chalk); background: var(--ink-3); }
.btn-primary { background: var(--chalk); color: var(--ink); border-color: var(--chalk); }
.btn-primary:hover { background: var(--mist); border-color: var(--mist); }

/* ---------- Naechstes-Spiel-Karte ---------- */

.next-match {
  margin-top: 46px;
  background: var(--ink-2);
  border: 1px solid var(--slope);
  padding: 26px 28px;
  max-width: 560px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.next-match .label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mist);
}
.next-match .teams { font-family: var(--font-display); font-size: 1.3rem; margin-top: 8px; }
.next-match .when { font-family: var(--font-mono); color: var(--fog); font-size: 0.85rem; margin-top: 6px; }

/* ---------- Sections ---------- */

section { padding: 76px 0; }
section.tight { padding: 50px 0; }
section + section { border-top: 1px solid var(--slope); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 42px;
}

.link-more {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--fog);
  padding-bottom: 2px;
}
.link-more:hover { border-color: var(--chalk); }

/* ---------- Cards: News / Team / Galerie ---------- */

.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--ink-2);
  border: 1px solid var(--slope);
  padding: 24px;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--fog); }
a.card { display: block; }

.card .date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fog);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.card h3 { margin: 10px 0 10px; }
.card p { color: var(--mist); font-size: 0.94rem; }

/* Spieler-Karte */
.player-card { text-align: left; }
.player-avatar {
  width: 100%;
  aspect-ratio: 1;
  background: var(--ink-3);
  border: 1px solid var(--slope);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
}
.player-avatar svg { width: 46%; opacity: 0.35; }
.player-card h3 { display: flex; align-items: center; gap: 10px; }
.player-role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fog);
}
.player-stats {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.player-stats span { display: block; color: var(--fog); font-size: 0.65rem; letter-spacing: 0.08em; }
.player-stats b { color: var(--chalk); font-size: 1rem; }

/* Galerie */
.gallery-item { overflow: hidden; border: 1px solid var(--slope); position: relative; aspect-ratio: 4/5; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 14px;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.05em;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  color: var(--mist);
}

/* ---------- Tabellen (Spielplan / Liga-Tabelle) ---------- */

.table-scroll { overflow-x: auto; border: 1px solid var(--slope); }

table { width: 100%; border-collapse: collapse; min-width: 640px; }

thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fog);
  padding: 14px 16px;
  border-bottom: 1px solid var(--slope);
  background: var(--ink-2);
  white-space: nowrap;
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--ink-3);
  font-size: 0.92rem;
  white-space: nowrap;
}

tbody tr:hover { background: var(--ink-2); }

td.num, th.num { font-family: var(--font-mono); text-align: center; }

tr.is-us { background: var(--bullseye-dim); }
tr.is-us:hover { background: var(--bullseye-dim); }

/* Karten-Ansicht auf schmalen Screens statt horizontal scrollbarer Tabelle -
   nur fuer .table-scroll.mobile-cards (Spielplan, Spielberichte, Statistik).
   Die Liga-Tabelle (tabelle.html) bleibt bewusst die klassische scrollbare
   Tabelle, daher opt-in statt global auf allen Tabellen. */
@media (max-width: 640px) {
  .table-scroll.mobile-cards { overflow-x: visible; border: none; }
  .mobile-cards table { min-width: 0; }
  .mobile-cards thead { display: none; }
  .mobile-cards tbody, .mobile-cards tr, .mobile-cards td { display: block; width: 100%; }
  .mobile-cards tr {
    border: 1px solid var(--slope);
    background: var(--ink-2);
    margin-bottom: 6px;
  }
  .mobile-cards tr.is-us { border-color: var(--bullseye); }
  .mobile-cards tbody tr:hover, .mobile-cards tr.is-us:hover { background: var(--ink-2); }
  .mobile-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 4px 14px;
    border-bottom: 1px solid var(--ink-3);
    white-space: normal;
    text-align: right;
    line-height: 1.3;
  }
  .mobile-cards td:last-child { border-bottom: none; }
  .mobile-cards td::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fog);
    text-align: left;
    flex-shrink: 0;
  }
}

.badge-upcoming, .badge-win, .badge-loss, .badge-draw {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid var(--slope);
  display: inline-block;
}
.badge-win { border-color: var(--fog); color: var(--chalk); }
.badge-loss { color: var(--fog); }
.badge-draw { border-color: var(--mist); color: var(--mist); }
.badge-upcoming { display: inline-flex; align-items: center; gap: 8px; border-color: var(--bullseye); color: var(--chalk); }

tr.row-clickable { cursor: pointer; }

/* ---------- Spielberichte ---------- */

.report-controls { margin-bottom: 44px; }
.report-controls label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fog);
  margin-bottom: 10px;
}
.report-select {
  width: 100%;
  max-width: 560px;
  background: var(--ink-2);
  border: 1px solid var(--slope);
  color: var(--chalk);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 12px 14px;
  border-radius: var(--radius);
}
.report-select:hover, .report-select:focus { border-color: var(--fog); outline: none; }

.report-block + .report-block { margin-top: 56px; }
.report-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.report-meta h3 { margin-top: 6px; }
.report-score { font-size: 1.05rem; color: var(--mist); }

/* ---------- Statistik: Balken ---------- */

.stat-legend {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fog);
}
.stat-legend span { display: inline-flex; align-items: center; gap: 8px; }
.stat-legend .dot { width: 10px; height: 10px; display: inline-block; }
.dot-won { background: var(--win-green); }
.dot-lost { background: var(--bullseye); }

.stat-bars { display: flex; flex-direction: column; }
.stat-bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr 70px;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-3);
}
.stat-bar-name { font-size: 0.86rem; }
.stat-bar-bars { display: flex; flex-direction: column; gap: 4px; }
.stat-bar-outer { background: var(--ink-2); border: 1px solid var(--slope); height: 12px; }
.stat-bar-fill { height: 100%; min-width: 2px; }
/* Breite kommt ueber die .wN Klassen (siehe Dateiende) - die CSP dieser
   Seite (style-src 'self') blockiert Inline-Styles. */
.stat-bar-won-fill { background: var(--win-green); }
.stat-bar-lost-fill { background: var(--bullseye); }
.stat-bar-value { font-size: 0.78rem; color: var(--fog); text-align: right; white-space: nowrap; }
@media (max-width: 560px) {
  .stat-bar-row { grid-template-columns: 1fr; gap: 6px; }
  .stat-bar-value { text-align: left; }
}

.stat-view .section-head { margin-top: 56px; }
.stat-view .section-head:first-child { margin-top: 0; }

/* ---------- Kontakt ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }

.info-line {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--slope);
}
.info-line .k {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fog);
  width: 140px;
  flex-shrink: 0;
  padding-top: 3px;
}


/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--slope);
  padding: 50px 0 34px;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { height: 40px; }
.footer-brand .brand-text { font-size: 0.95rem; }
.footer-brand .text-fog.mono { font-size: 0.72rem; margin-top: 4px; }
.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fog);
  text-align: right;
  line-height: 1.8;
}
@media (max-width: 600px) { .footer-meta { text-align: left; } }

/* ---------- Page header (Unterseiten) ---------- */

.page-header { padding: 56px 0 40px; border-bottom: 1px solid var(--slope); }
.page-header .eyebrow { margin-bottom: 14px; }
.page-header .lede { margin-top: 14px; }

.contact-grid .lede { margin-top: 16px; }

/* Utility */
.mt-0 { margin-top: 0; }
.mb-20 { margin-bottom: 20px; }
.news-list-grid { grid-template-columns: 1fr; max-width: 760px; gap: 0; }
.text-fog { color: var(--fog); }

/* ---------- Statistik: Balken-Breiten/Farbverlauf-Klassen (0-100%) ---------- */
/* Erzeugt, weil die CSP dieser Seite (style-src 'self', kein 'unsafe-inline')
   Inline-Styles blockiert - Balkenbreite/Farbaufteilung muessen daher ueber
   vorab generierte Klassen statt style="..." gesetzt werden. */
.w0 { width: 0%; }
.w1 { width: 1%; }
.w2 { width: 2%; }
.w3 { width: 3%; }
.w4 { width: 4%; }
.w5 { width: 5%; }
.w6 { width: 6%; }
.w7 { width: 7%; }
.w8 { width: 8%; }
.w9 { width: 9%; }
.w10 { width: 10%; }
.w11 { width: 11%; }
.w12 { width: 12%; }
.w13 { width: 13%; }
.w14 { width: 14%; }
.w15 { width: 15%; }
.w16 { width: 16%; }
.w17 { width: 17%; }
.w18 { width: 18%; }
.w19 { width: 19%; }
.w20 { width: 20%; }
.w21 { width: 21%; }
.w22 { width: 22%; }
.w23 { width: 23%; }
.w24 { width: 24%; }
.w25 { width: 25%; }
.w26 { width: 26%; }
.w27 { width: 27%; }
.w28 { width: 28%; }
.w29 { width: 29%; }
.w30 { width: 30%; }
.w31 { width: 31%; }
.w32 { width: 32%; }
.w33 { width: 33%; }
.w34 { width: 34%; }
.w35 { width: 35%; }
.w36 { width: 36%; }
.w37 { width: 37%; }
.w38 { width: 38%; }
.w39 { width: 39%; }
.w40 { width: 40%; }
.w41 { width: 41%; }
.w42 { width: 42%; }
.w43 { width: 43%; }
.w44 { width: 44%; }
.w45 { width: 45%; }
.w46 { width: 46%; }
.w47 { width: 47%; }
.w48 { width: 48%; }
.w49 { width: 49%; }
.w50 { width: 50%; }
.w51 { width: 51%; }
.w52 { width: 52%; }
.w53 { width: 53%; }
.w54 { width: 54%; }
.w55 { width: 55%; }
.w56 { width: 56%; }
.w57 { width: 57%; }
.w58 { width: 58%; }
.w59 { width: 59%; }
.w60 { width: 60%; }
.w61 { width: 61%; }
.w62 { width: 62%; }
.w63 { width: 63%; }
.w64 { width: 64%; }
.w65 { width: 65%; }
.w66 { width: 66%; }
.w67 { width: 67%; }
.w68 { width: 68%; }
.w69 { width: 69%; }
.w70 { width: 70%; }
.w71 { width: 71%; }
.w72 { width: 72%; }
.w73 { width: 73%; }
.w74 { width: 74%; }
.w75 { width: 75%; }
.w76 { width: 76%; }
.w77 { width: 77%; }
.w78 { width: 78%; }
.w79 { width: 79%; }
.w80 { width: 80%; }
.w81 { width: 81%; }
.w82 { width: 82%; }
.w83 { width: 83%; }
.w84 { width: 84%; }
.w85 { width: 85%; }
.w86 { width: 86%; }
.w87 { width: 87%; }
.w88 { width: 88%; }
.w89 { width: 89%; }
.w90 { width: 90%; }
.w91 { width: 91%; }
.w92 { width: 92%; }
.w93 { width: 93%; }
.w94 { width: 94%; }
.w95 { width: 95%; }
.w96 { width: 96%; }
.w97 { width: 97%; }
.w98 { width: 98%; }
.w99 { width: 99%; }
.w100 { width: 100%; }
