/* ==========================================================================
   THB-Website
   Alle Farben kommen aus den CSS-Variablen der Palette (theme.css, aus dem
   Vereinslogo abgeleitet). Hier stehen nur neutrale Basiswerte als Fallback,
   falls theme.css nicht geladen ist. Mannschaften überschreiben die Variablen
   lokal (--tm-*) für ihren Hero-Bereich.
   ========================================================================== */

:root {
  --primary: #b71c1c;
  --primary-bright: #d32f2f;
  --accent: #1c1c1c;
  --on-primary: #ffffff;
  --tint: #fbe9e9;
  --surface: #ffffff;
  --surface-alt: #faf7f7;
  --border: #e8dede;
  --ink: #161616;
  --ink-muted: #5e5e5e;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .06);
  --wrap: 1180px;
  --gap: 20px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* theme.css (per Link im head) überschreibt :root mit den Logo-Farben. */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface-alt);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.small { font-size: .85rem; }
.muted { color: var(--ink-muted); }
.strong { font-weight: 700; }
.center { text-align: center; }
.error { color: #b00020; font-weight: 600; }

/* --- Header --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 10px; object-fit: contain;
  background: var(--surface); border: 1px solid var(--border); padding: 2px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.02rem; }
.brand-sub { font-size: .78rem; color: var(--ink-muted); }
.nav { display: flex; gap: 18px; font-weight: 600; font-size: .92rem; }
.nav-muted { color: var(--ink-muted); font-weight: 500; }
.nav a:hover { color: var(--primary); }

/* --- Hero (Startseite) ---------------------------------------------------- */
.hero {
  background:
    radial-gradient(1200px 320px at 15% -40%, color-mix(in srgb, var(--primary) 92%, black) 0%, transparent 60%),
    linear-gradient(120deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 80%, black) 100%);
  color: var(--on-primary);
  padding: 44px 0 40px;
}
.hero-inner { display: flex; align-items: center; gap: 28px; }
.hero-logo {
  width: 110px; height: 110px; border-radius: 20px; object-fit: contain;
  background: var(--surface); padding: 8px; box-shadow: var(--shadow);
  flex: 0 0 auto;
}
.hero h1 { margin: 0 0 6px; font-size: clamp(1.7rem, 3.2vw, 2.6rem); letter-spacing: -.02em; }
.hero-sub { margin: 0 0 8px; opacity: .92; font-weight: 600; }
.hero-note { margin: 0; opacity: .82; max-width: 62ch; }

/* --- Team-Hero ------------------------------------------------------------ */
.team-hero {
  background:
    radial-gradient(900px 300px at 0% -30%, color-mix(in srgb, var(--tm-primary) 95%, black) 0%, transparent 65%),
    linear-gradient(140deg, var(--tm-primary) 0%, color-mix(in srgb, var(--tm-primary) 70%, black) 100%);
  color: var(--tm-on);
  padding: 34px 0 40px;
}
.team-hero-inner {
  display: grid; grid-template-columns: 1fr minmax(280px, 44%);
  gap: 28px; align-items: end;
}
.back { display: inline-block; font-size: .88rem; margin-bottom: 14px; opacity: .85; }
.back:hover { opacity: 1; text-decoration: underline; }
.team-hero h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 2.8vw, 2.4rem); letter-spacing: -.02em; }
.team-hero-sub { margin: 0 0 14px; opacity: .92; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
}
.chip.is-active { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.chip.solid { background: var(--tm-accent, var(--accent)); color: #fff; border-color: transparent; }
.chip.ghost {
  background: color-mix(in srgb, #fff 14%, transparent);
  border-color: color-mix(in srgb, #fff 40%, transparent);
  color: inherit; backdrop-filter: blur(4px);
}
.chip:hover { transform: translateY(-1px); }

.team-photo { margin: 0; }
.team-photo img,
.team-photo .photo-placeholder {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: var(--radius); box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
  background: #f1f1f1;
}
.team-photo figcaption { font-size: .78rem; opacity: .75; margin-top: 8px; }

/* Platzhalter, wenn kein Foto vorhanden */
.photo-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: #8a8a8a; background:
    repeating-linear-gradient(45deg, #f3f3f3 0 12px, #ececec 12px 24px);
  border: 1px dashed #c9c9c9; border-radius: var(--radius-sm);
  text-align: center; padding: 16px; font-size: .82rem; font-weight: 600;
}
.photo-placeholder svg { width: 44px; height: 44px; fill: currentColor; opacity: .8; }
.photo-placeholder.large svg { width: 64px; height: 64px; }

/* --- Main / Panels -------------------------------------------------------- */
.main { padding: 28px 0 56px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.panel-title {
  margin: 0 0 18px; font-size: 1.25rem; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 10px;
}
.panel-title::before {
  content: ""; width: 6px; height: 22px; border-radius: 3px;
  background: linear-gradient(var(--primary), var(--accent));
}
.count {
  font-size: .8rem; font-weight: 700; color: var(--ink-muted);
  background: var(--tint); padding: 2px 10px; border-radius: 999px;
}
.subhead { margin: 22px 0 12px; font-size: 1.02rem; }

.section-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 18px auto 22px;
  position: sticky; top: 64px; z-index: 10; padding: 6px 0;
  background: var(--surface-alt);
}
.section-tabs a {
  padding: 6px 14px; border-radius: 999px; font-size: .86rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface);
}
.section-tabs a:hover { border-color: var(--primary); color: var(--primary); }

/* --- Startseite: Filter + Karten ----------------------------------------- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.team-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.team-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.team-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow);
  border-color: var(--card-primary, var(--primary));
}
.team-card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #f1f1f1; }
.team-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.team-card:hover .team-card-media img { transform: scale(1.04); }
.team-card-media .photo-placeholder { height: 100%; border: 0; border-radius: 0; }
.team-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--card-accent, var(--accent)); color: #fff;
  font-size: .74rem; font-weight: 800; letter-spacing: .02em;
  padding: 4px 10px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.team-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.team-card-body h2 { margin: 0; font-size: 1.02rem; letter-spacing: -.01em; }
.team-league { margin: 0; font-size: .84rem; color: var(--primary); font-weight: 600; }
.team-meta {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 6px; font-size: .78rem; color: var(--ink-muted);
}

/* --- Kader ---------------------------------------------------------------- */
.player-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.player-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-alt); color: inherit; font: inherit; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.player-card:hover,
.player-card:focus-visible {
  border-color: var(--primary); background: var(--tint);
  transform: translateY(-1px); outline: none;
}
.player-card:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.player-photo {
  position: relative; width: 54px; height: 54px; flex: 0 0 auto;
  border-radius: 50%; overflow: hidden; background: var(--tint);
  display: flex; align-items: center; justify-content: center;
}
.player-photo img { width: 100%; height: 100%; object-fit: cover; }
.initials { font-weight: 800; color: var(--primary); font-size: 1.05rem; }
.shirt {
  position: absolute; right: -2px; bottom: -2px;
  min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 11px; background: var(--primary); color: var(--on-primary);
  font-size: .72rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}
.player-info { display: flex; flex-direction: column; min-width: 0; }
.player-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Trainer/Betreuer als Kacheln (wie Spieler, aber ohne Dialog-Klick). */
.player-card.is-staff { cursor: default; }
.player-card.is-staff:hover { transform: none; }
.player-card.is-staff .player-info { gap: 1px; }
.player-card.is-staff .player-info .small { font-size: .76rem; color: var(--ink-muted); }
.player-card.is-staff .staff-office { font-weight: 600; color: var(--primary); }

.staff-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.staff-list li { display: flex; gap: 8px; justify-content: space-between; padding: 8px 12px; background: var(--surface-alt); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.staff-list .muted { font-size: .82rem; }

/* --- Tabellen ------------------------------------------------------------- */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th, .data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table tr.is-own { background: var(--tint); font-weight: 600; }
.data-table tr.is-own:hover { background: color-mix(in srgb, var(--tint) 80%, var(--primary) 8%); }
.tag {
  display: inline-block; font-size: .68rem; font-weight: 800; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; background: var(--primary); color: var(--on-primary);
}
tr.is-own .tag, .cup-round li .tag { background: var(--accent); color: #fff; }

/* --- Spielplan ------------------------------------------------------------ */
.match-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.match {
  display: grid;
  grid-template-columns: 52px 130px 34px 1fr auto auto;
  align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface-alt); border: 1px solid var(--border);
  font-size: .9rem; color: inherit; text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
a.match:hover { border-color: var(--primary); background: var(--tint); }
.match.is-finished { border-left: 4px solid var(--primary); }
.match.is-live { border-color: #d32f2f; box-shadow: 0 0 0 1px #d32f2f inset; }
.match-round { font-weight: 700; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.match-date { color: var(--ink-muted); }
.match-venue { font-weight: 800; text-align: center; border-radius: 6px; padding: 2px 0; font-size: .78rem; }
.match-venue.home { background: var(--primary); color: var(--on-primary); }
.match-venue.away { background: var(--border); color: var(--ink); }
.match-opp { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-score { font-weight: 800; font-variant-numeric: tabular-nums; }

/* --- Statistik ------------------------------------------------------------ */
.kpi-grid {
  display: grid; gap: 12px; margin-bottom: 24px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.kpi {
  display: flex; flex-direction: column; gap: 2px; padding: 16px;
  border-radius: var(--radius-sm); background: var(--surface-alt);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
}
.kpi-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); }
.kpi-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.kpi-sub { font-size: .78rem; color: var(--ink-muted); }

.two-col { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }

.quarter-bars { display: flex; flex-direction: column; gap: 10px; }
.qb-row { display: grid; grid-template-columns: 84px 1fr 34px 1fr 34px; align-items: center; gap: 8px; }
.qb-label { font-size: .82rem; color: var(--ink-muted); }
.qb-bar { height: 12px; border-radius: 6px; min-width: 2px; }
.qb-bar.own { background: var(--primary); justify-self: end; }
.qb-bar.opp { background: var(--border); }
.qb-val { font-size: .8rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.legend { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot.own { background: var(--primary); }
.dot.opp { background: var(--border); margin-left: 10px; }

.scorer-list { list-style: none; counter-reset: s; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.scorer-list li { counter-increment: s; display: grid; grid-template-columns: 30px 34px 1fr auto; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-alt); }
.scorer-list li::before { content: counter(s) "."; font-weight: 800; color: var(--primary); }
.scorer-list img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
/* Ohne Foto (Teilzeit-Profis, Gegner): keine leere Foto-Spalte. */
.scorer-list.no-photo li { grid-template-columns: 30px 1fr auto; }

/* Höchster Sieg / höchste Niederlage. */
.outcome-grid { margin-bottom: 24px; }
.outcome-card {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px;
  border-radius: var(--radius-sm); background: var(--surface-alt);
  border: 1px solid var(--border); border-left: 4px solid var(--ink-muted);
}
.outcome-card.win { border-left-color: var(--primary); }
.outcome-card.loss { border-left-color: #b23a3a; }
.outcome-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.outcome-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); }
.outcome-score { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.outcome-diff { font-size: .95rem; font-weight: 700; color: var(--ink-muted); }
.outcome-card.win .outcome-diff { color: var(--primary); }
.outcome-meta { font-size: .88rem; }
.outcome-attendance { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .82rem; color: var(--ink-muted); }

/* Teilzeit-Profis und Gegner-Statistik als eigene, abgesetzte Blöcke. */
.stat-part-timers { margin-top: 26px; padding-top: 6px; border-top: 1px solid var(--border); }
.opponent-stats { margin-top: 34px; padding-top: 22px; border-top: 2px solid var(--border); }
.opponent-stats .subhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.opponent-stats .scorer-list li { background: var(--surface); border: 1px solid var(--border); }
.opponent-stats .kpi { border-top-color: var(--ink-muted); }

/* --- Startseite: Kacheln -------------------------------------------------- */
.tile-grid {
  display: grid; gap: var(--gap); margin-bottom: 24px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.stat-tile {
  display: flex; flex-direction: column; gap: 2px; padding: 20px;
  border-radius: var(--radius); text-decoration: none; color: var(--on-primary);
  background: linear-gradient(140deg, var(--primary) 0%,
              color-mix(in srgb, var(--primary) 75%, black) 100%);
  box-shadow: var(--shadow); transition: transform .15s ease, filter .15s ease;
}
.stat-tile:hover { transform: translateY(-3px); filter: brightness(1.06); }
.stat-tile-icon { font-size: 1.5rem; opacity: .85; line-height: 1; }
.stat-tile-count { font-size: 2.3rem; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; }
.stat-tile-label { font-weight: 700; }
.stat-tile-hint { margin-top: 8px; font-size: .78rem; opacity: .8; }
.stat-tile.horizontal { flex-direction: row; align-items: center; gap: 14px; }
.stat-tile.horizontal > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; }
.stat-tile.horizontal .stat-tile-count { font-size: 1.8rem; }
.stat-tile.horizontal .stat-tile-hint { margin: 0; }

.home-cols { display: grid; gap: var(--gap); grid-template-columns: 2fr 1fr; align-items: start; }
.home-side { display: grid; gap: var(--gap); }

/* Vereinsfoto auf der Startseite */
.club-photo {
  margin: 0 0 24px; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); background: var(--surface-alt);
}
.club-photo img { width: 100%; max-height: 460px; object-fit: cover; }

.more { margin: 12px 0 0; }
.more a { color: var(--primary); font-weight: 700; }

.venue-mini { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.venue-mini li { display: flex; flex-direction: column; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-alt); border: 1px solid var(--border); }

.venue-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.venue-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.venue-card.is-inactive { opacity: .6; }
.venue-map {
  display: flex; align-items: center; justify-content: center;
  padding: 18px; background: linear-gradient(135deg, var(--tint), var(--surface-alt));
}
.venue-map svg { width: 40px; height: 40px; fill: var(--primary); }
.venue-body { padding: 14px 16px 16px; }
.venue-body h2 { margin: 0 0 4px; font-size: 1.05rem; }
.venue-body p { margin: 0 0 10px; font-size: .9rem; color: var(--ink-muted); }
.venue-links { display: flex; flex-wrap: wrap; gap: 6px; }

/* --- Untertabs (Spielpläne) ---------------------------------------------- */
.sub-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.sub-tabs a {
  padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: .9rem;
  background: var(--surface); border: 1px solid var(--border);
}
.sub-tabs a:hover { border-color: var(--primary); color: var(--primary); }
.sub-tabs a.is-active { background: var(--primary); color: var(--on-primary); border-color: transparent; }

/* Vereinsspielplan: Zeile mit Mannschaft, Datum, Paarung (ganze Zeile Link) */
.match-list.compact { gap: 4px; }
.club-match {
  display: grid; grid-template-columns: 64px 128px 1fr auto auto;
  align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: var(--radius-sm); background: var(--surface-alt);
  border: 1px solid var(--border); font-size: .88rem;
}
.club-match.is-live { border-color: var(--primary); background: var(--tint); }
.club-match-team {
  font-weight: 800; font-size: .78rem; text-align: center; padding: 2px 6px;
  border-radius: 6px; background: var(--tint); color: var(--primary);
}
a.club-match-team:hover { background: var(--primary); color: var(--on-primary); }
.club-match-pair { color: inherit; text-decoration: none; }
.club-match-pair:hover { color: var(--primary); text-decoration: underline; }

/* Ergebnismarke: Win grün, Loss rot, Draw grau */
.outcome {
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: 1px 8px; border-radius: 999px;
  font-size: .7rem; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: #fff;
}
.outcome.is-win { background: #2e7d32; }
.outcome.is-loss { background: #c62828; }
.outcome.is-draw { background: #6b7280; }

/* Der Ergebnismarke den passenden Rand geben (dezent, nicht grell) */
.match.has-outcome-win { border-left-color: #2e7d32; }
.match.has-outcome-loss { border-left-color: #c62828; }
.match.has-outcome-draw { border-left-color: #6b7280; }

/* Live-Abzeichen: pulsierender Punkt + Text */
.live-badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em;
  background: #d32f2f; color: #fff;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #fff;
  animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.75); }
}

/* --- News ----------------------------------------------------------------- */
.news-list { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.news-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; color: inherit; text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
a.news-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.news-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-alt); }
.news-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
a.news-card:hover .news-media img { transform: scale(1.04); }
.news-media.is-empty { display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--tint), var(--surface-alt)); }
.news-media-empty { font-size: 2.4rem; opacity: .5; }
.news-date { margin: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--primary); }
.news-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.news-body h2 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.news-teaser {
  margin: 0; font-size: .9rem; color: var(--ink-muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-more { margin-top: auto; padding-top: 6px; font-size: .84rem; font-weight: 700; color: var(--primary); }
.news-text { white-space: pre-line; font-size: .95rem; line-height: 1.6; }

/* --- Besondere Termine (Startseite) --------------------------------------- */
.events-panel {
  border: 2px solid var(--primary);
  background: linear-gradient(180deg, var(--tint) 0, var(--surface) 120px);
}
.event-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.event-list a {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--border); color: inherit; text-decoration: none;
}
.event-list a:hover { border-color: var(--primary); }
.event-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 54px; padding: 4px 6px; border-radius: var(--radius-sm);
  background: var(--primary); color: var(--on-primary); line-height: 1.1;
}
.event-day { font-size: 1.35rem; font-weight: 800; }
.event-month { font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.event-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.event-tags { font-size: .74rem; color: var(--ink-muted); }

/* Team-News-Kacheln auf der Mannschaftsseite */
.team-news { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.team-news .news-card { box-shadow: none; }
.team-news .news-body h2 { font-size: .95rem; }

/* --- Beitragsseite mit Slideshow ------------------------------------------ */
.news-article { max-width: 900px; }
.news-teaser-lead {
  font-size: 1.08rem; font-weight: 600; line-height: 1.5; margin: 4px 0 18px;
  padding-left: 14px; border-left: 4px solid var(--primary);
}
.slideshow {
  position: relative; margin: 0 0 22px; border-radius: var(--radius);
  overflow: hidden; background: #111;
}
.slide-stage { position: relative; aspect-ratio: 16 / 10; }
.slide {
  position: absolute; inset: 0; margin: 0; display: flex;
  align-items: center; justify-content: center; opacity: 0;
  transition: opacity .25s ease; pointer-events: none;
}
.slide.is-active { opacity: 1; pointer-events: auto; }
.slide img, .slide video { max-width: 100%; max-height: 100%; object-fit: contain; }
.slide video { width: 100%; height: 100%; }
.slide-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 1.7rem; line-height: 1;
  cursor: pointer; opacity: .85;
}
.slide-nav:hover { opacity: 1; background: var(--primary); }
.slide-nav.prev { left: 12px; }
.slide-nav.next { right: 12px; }
.slide-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.slide-dot {
  width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0;
  background: rgba(255, 255, 255, .45); cursor: pointer;
}
.slide-dot.is-active { background: #fff; }
.slide-counter {
  position: absolute; top: 10px; right: 12px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: .75rem; font-weight: 700;
}

/* Fallback ohne JavaScript: alle Medien untereinander zeigen */
.slideshow:not(.is-ready) .slide-stage { aspect-ratio: auto; }
.slideshow:not(.is-ready) .slide {
  position: relative; opacity: 1; pointer-events: auto; margin-bottom: 8px;
}
.slideshow:not(.is-ready) .slide-nav,
.slideshow:not(.is-ready) .slide-dots,
.slideshow:not(.is-ready) .slide-counter { display: none; }

/* --- Tags im Formular ----------------------------------------------------- */
.tags-field { border: 0; padding: 0; margin-bottom: 18px; }
.tags-field legend { font-weight: 700; font-size: .9rem; margin-bottom: 8px; }
.tag-group { margin-bottom: 10px; }
.tag-group-label { display: block; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); margin-bottom: 4px; }
.tag-options { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-option {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: .85rem; cursor: pointer;
}
.tag-option:has(input:checked) { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.tag-option input { accent-color: var(--primary); }

/* --- Formular (News-Upload) ---------------------------------------------- */
.news-form .panel { max-width: 820px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field > span { font-weight: 700; font-size: .9rem; }
.field input[type="text"], .field textarea, .field select {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
}
.field textarea { resize: vertical; }
.field input[type="text"]:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
.field input[type="file"] { font: inherit; }
.form-actions { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; }
.form-actions .button { border: 0; cursor: pointer; font: inherit; }
.form-error {
  max-width: 820px; margin-bottom: 18px; padding: 12px 16px;
  border-radius: var(--radius-sm); background: #fdecea; color: #8a1c1c;
  border: 1px solid #f3c1bc; font-weight: 600;
}
.form-ok {
  max-width: 820px; margin-bottom: 18px; padding: 12px 16px;
  border-radius: var(--radius-sm); background: #e9f7ee; color: #17663a;
  border: 1px solid #bfe6cd; font-weight: 600;
}

/* Vereinsfoto: Ändern-Bereich (nur eingeloggt). */
.club-photo-wrap { margin-bottom: 24px; }
.club-photo-wrap .club-photo { margin-bottom: 8px; }
.club-photo-edit summary {
  cursor: pointer; display: inline-block; font-size: .85rem; font-weight: 600;
  color: var(--primary);
}
.club-photo-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 8px; padding: 12px; border-radius: var(--radius-sm);
  background: var(--surface-alt); border: 1px solid var(--border);
}
.button.small { padding: 6px 12px; font-size: .85rem; }

/* --- Kontaktformular ------------------------------------------------------ */
.contact-who {
  display: grid; gap: 0 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* --- Login / Konto / Admin ------------------------------------------------ */
.account { display: flex; align-items: center; gap: 12px; font-size: .88rem; }
.account-link { font-weight: 700; white-space: nowrap; }
.account-link:hover { color: var(--primary); }
.account-button {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: var(--ink-muted); font-weight: 600;
}
.account-button:hover { color: var(--primary); }
.inline-form { display: inline; margin: 0; }

.auth-form { max-width: 440px; }
.settings-grid {
  display: grid; gap: var(--gap); align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-bottom: var(--gap);
}
.readonly { background: var(--surface-alt) !important; color: var(--ink-muted); }
.form-notice {
  max-width: 820px; margin-bottom: 18px; padding: 12px 16px;
  border-radius: var(--radius-sm); background: #e8f5e9; color: #1b5e20;
  border: 1px solid #b7dfba; font-weight: 600;
}

.inline-form-wrap { max-width: 620px; }
.row-form { margin: 0; display: inline; }
.row-form select { font: inherit; padding: 4px 6px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface); }
.action-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-danger { background: #fdecea; border-color: #f3c1bc; color: #8a1c1c; }
.chip-danger:hover { background: #8a1c1c; color: #fff; }
.small-option { font-size: .74rem; padding: 3px 8px; }
.admin-table td { vertical-align: top; }

.cred-list {
  display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 0;
}
.cred-list dt { font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-muted); }
.cred-list dd { margin: 2px 0 0; font-weight: 700; }
.cred-list code { background: var(--tint); padding: 3px 8px; border-radius: 4px; font-size: 1rem; }
.generated-credentials { border: 2px solid var(--primary); }

/* Trainer-Kontakte auf der Mannschaftsseite */
.staff-list li.has-contact { flex-wrap: wrap; }
.staff-contact { display: flex; flex-wrap: wrap; gap: 6px; width: 100%;
  font-size: .78rem; color: var(--ink-muted); padding-top: 4px; }
.staff-office { font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; color: var(--primary); }
.edit-preview { max-width: 420px; width: 100%; border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-bottom: 12px; }

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
}

/* --- Vereinsladen --------------------------------------------------------- */
.shop-intro {
  max-width: 68ch; margin: -4px 0 22px; color: var(--ink-muted);
  font-size: .95rem; line-height: 1.6;
}
.kit-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.kit-item {
  margin: 0; display: flex; flex-direction: column;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
}
.kit-item:hover { border-color: var(--primary); transform: translateY(-2px); }
.kit-image {
  aspect-ratio: 4 / 5; display: flex; align-items: center; justify-content: center;
  padding: 14px; background:
    radial-gradient(circle at 50% 40%, #ffffff 0%, #f4f4f4 70%);
}
.kit-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.kit-placeholder { font-size: .8rem; color: var(--ink-muted); }
.kit-item figcaption {
  padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 1px;
  border-top: 1px solid var(--border); background: var(--surface);
}
.kit-item figcaption strong { font-size: .95rem; }
.kit-variant { font-size: .82rem; color: var(--ink-muted); }

.shop-split {
  display: grid; gap: 24px; grid-template-columns: 1.2fr 1fr; align-items: start;
}
.shop-text p { margin: 0 0 14px; line-height: 1.6; }
.shop-where {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--tint); border-left: 4px solid var(--primary);
}
.shop-note { font-size: .88rem; color: var(--ink-muted); margin: 0; }

/* Shop-Aufruf: ganze Fläche klickbar, deutlich als Aktion erkennbar */
.shop-links { display: grid; gap: 10px; }
.shop-cta {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: 16px 52px 16px 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary) 0%,
              color-mix(in srgb, var(--primary) 78%, black) 100%);
  color: var(--on-primary); text-decoration: none;
  box-shadow: var(--shadow); transition: transform .15s ease, filter .15s ease;
}
.shop-cta:hover { transform: translateY(-2px); filter: brightness(1.07); }
.shop-cta-label { font-weight: 800; font-size: 1.02rem; }
.shop-cta-note { font-size: .84rem; opacity: .85; }
.shop-cta-arrow {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 700;
}
.shop-images {
  display: grid; gap: 10px; grid-template-columns: 1fr 1fr;
}
.shop-images img {
  width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-alt);
}
.shop-contact .locked { align-items: center; }

@media (max-width: 780px) {
  .shop-split { grid-template-columns: 1fr; }
}

/* --- Schiedsrichter ------------------------------------------------------- */
.referee-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.referee-card {
  display: flex; align-items: center; gap: 16px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.referee-photos { display: flex; flex: 0 0 auto; }
.referee-photos a + a { margin-left: -14px; }
.referee-photos img,
.referee-placeholder {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--surface); background: var(--tint);
  display: flex; align-items: center; justify-content: center;
  /* Gespanne: das zweite Foto kreist farbig ab, aber bleibt erkennbar */
  box-shadow: 0 0 0 1px var(--border);
}
.referee-photos a:first-child img,
.referee-photos a:first-child .referee-placeholder { position: relative; z-index: 1; }
.referee-placeholder { font-weight: 800; color: var(--primary); font-size: 1rem; }
.referee-info { min-width: 0; }
.referee-info h2 { margin: 0; font-size: 1.02rem; line-height: 1.3; }
.referee-info h2 a:hover { color: var(--primary); }
.referee-info p { margin: 4px 0 0; }

/* --- Spielerdialog -------------------------------------------------------- */
.player-dialog {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0; background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
}
.player-dialog::backdrop { background: rgba(10, 10, 10, .55); backdrop-filter: blur(2px); }
.pd-head {
  display: flex; align-items: center; gap: 14px; padding: 20px 20px 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-bright));
  color: var(--on-primary);
}
.pd-head h2 { margin: 0; font-size: 1.25rem; }
.pd-head .muted { color: inherit; opacity: .85; margin: 2px 0 0; }
.pd-head > div:nth-child(2) { flex: 1; min-width: 0; }
.pd-photo {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  background: var(--tint); display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255, 255, 255, .6); flex: 0 0 auto;
}
.pd-photo img { width: 100%; height: 100%; object-fit: cover; }
.pd-photo .initials { color: var(--primary); font-size: 1.3rem; }
.pd-close {
  align-self: flex-start; background: transparent; border: 0; color: inherit;
  font-size: 1.6rem; line-height: 1; cursor: pointer; opacity: .8; padding: 0 4px;
}
.pd-close:hover { opacity: 1; }
.pd-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px;
  margin: 0; padding: 18px 20px;
}
.pd-grid dt { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); }
.pd-grid dd { margin: 2px 0 0; font-weight: 600; }
.pd-grid .pd-wide { grid-column: 1 / -1; }
.pd-grid code { font-size: .85rem; background: var(--tint); padding: 2px 6px; border-radius: 4px; }
.pd-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px; padding: 0 20px 8px;
}
.pd-stats > div {
  display: flex; flex-direction: column; align-items: center; padding: 10px 6px;
  border-radius: var(--radius-sm); background: var(--surface-alt); border: 1px solid var(--border);
}
.pd-num { font-size: 1.25rem; font-weight: 800; }
.pd-label { font-size: .74rem; color: var(--ink-muted); }
.pd-foot { margin: 0; padding: 10px 20px 18px; font-size: .9rem; }
.pd-foot a { color: var(--primary); font-weight: 700; }
.player-dialog .subhead { padding: 0 20px; margin: 6px 0 8px; }

/* --- Login-Platzhalter (Statistik) ---------------------------------------- */
.locked {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px; border-radius: var(--radius-sm);
  background: var(--surface-alt); border: 1px dashed var(--border);
}
.locked svg { width: 34px; height: 34px; fill: var(--primary); flex: 0 0 auto; }
.locked p { margin: 4px 0 0; }

/* --- Pokal ---------------------------------------------------------------- */
.cup-round { margin-bottom: 14px; }
.cup-round-label { font-size: .8rem; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .04em; }
.cup-round ul { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 4px; }
.cup-round li { display: flex; gap: 10px; align-items: center; padding: 7px 12px; border-radius: var(--radius-sm); background: var(--surface-alt); font-size: .88rem; }
.cup-round li.is-own { background: var(--tint); font-weight: 600; }

/* --- Footer / Log --------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 18px 0; font-size: .82rem; color: var(--ink-muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--primary); font-weight: 600; }
.log {
  text-align: left; font-size: .78rem; background: #111; color: #ddd;
  padding: 14px; border-radius: var(--radius-sm); max-height: 260px; overflow: auto;
  white-space: pre-wrap; margin: 18px 0;
}
.button {
  display: inline-block; padding: 10px 20px; border-radius: 999px;
  background: var(--primary); color: var(--on-primary); font-weight: 700;
}
.button:hover { filter: brightness(1.08); }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 860px) {
  .home-cols { grid-template-columns: 1fr; }
  .team-hero-inner { grid-template-columns: 1fr; align-items: start; }
  .two-col { grid-template-columns: 1fr; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-logo { width: 84px; height: 84px; }
}
@media (max-width: 620px) {
  .nav .nav-muted { display: none; }
  .match { grid-template-columns: 40px 1fr auto; grid-auto-rows: auto; }
  .match-date, .match-venue { grid-column: 2; }
  .club-match { grid-template-columns: 56px 1fr auto; grid-auto-rows: auto; }
  .club-match .match-date { grid-column: 3; grid-row: 1; text-align: right; }
  .club-match .club-match-team { grid-row: 1 / span 2; }
  .club-match .club-match-pair { grid-column: 2 / -1; }
  .match-round { grid-row: span 2; }
  .qb-row { grid-template-columns: 70px 1fr 26px 1fr 26px; }
  .panel { padding: 18px; }
}

/* --- Mannschaftsgruppen (Männer, Frauen, Jungen, Mädchen, Mixed) ---------- */
.team-section { margin-bottom: 30px; }
.team-section-title {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; font-size: 1.15rem; letter-spacing: -.01em;
}
.team-section-title::before {
  content: ""; width: 6px; height: 20px; border-radius: 3px;
  background: linear-gradient(var(--primary), var(--accent));
}

/* Reiter der Mannschaftsgruppen */
.team-tabs { margin-bottom: 20px; }
.team-tabs .tab-count {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px;
  border-radius: 999px; font-size: .74rem; font-weight: 800;
  background: var(--tint); color: var(--primary);
}
.team-tabs a.is-active .tab-count { background: rgba(255, 255, 255, .28); color: inherit; }

/* --- Personen-Kacheln (Trainer/Weitere) ---------------------------------- */
.person-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.person-card {
  display: flex; flex-direction: column; gap: 8px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  border-top: 3px solid var(--primary);
}
.person-head { display: flex; flex-direction: column; gap: 2px; }
.person-head strong { font-size: 1.02rem; }
.person-teams { display: flex; flex-wrap: wrap; gap: 5px; }
.person-teams .chip { font-size: .74rem; padding: 2px 8px; }
.person-contact {
  margin: 0; padding-top: 8px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px; font-size: .86rem;
}
.person-contact div { display: flex; gap: 8px; }
.person-contact dt { font-weight: 700; color: var(--ink-muted); min-width: 56px; }
.person-contact dd { margin: 0; word-break: break-word; }

/* --- Ansprechpartner-Kasten ---------------------------------------------- */
.contact-box {
  display: flex; gap: 14px; align-items: flex-start;
  margin-bottom: 20px; padding: 14px 18px;
  border-radius: var(--radius); background: var(--tint);
  border-left: 4px solid var(--primary);
}
.contact-box-icon { font-size: 1.4rem; color: var(--primary); line-height: 1; }
.contact-box-title {
  display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--primary); margin-bottom: 2px;
}
.contact-box strong { display: block; }
.contact-box-data { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; color: var(--ink-muted); }

/* Foto in Personen-Kacheln (Trainer/Weitere) */
.person-photo {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm);
  background: var(--tint); border: 1px solid var(--border);
}
.person-photo-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 800; color: var(--primary);
}
