/* =========================================================================
   styles.css
   -------------------------------------------------------------------------
   Gesamtes Styling für die 2. Bundesliga Web-App.
   Dunkles, energiegeladenes Sport-Layout mit klaren Karten/Grids.
   Mobile-first, responsive bis Desktop.
   ========================================================================= */

/* ---------- Grundlagen / Design-Tokens ---------- */
:root {
  --color-bg: #050f09;
  --color-bg-elevated: #0a1810;
  --color-card: #0d1f15;
  --color-card-hover: #12291c;
  --color-border: #1c3527;
  --color-text: #f3f5f9;
  --color-text-muted: #96a0b3;
  --color-text-faint: #676f80;

  --color-accent: #e2001a;       /* Signalfarbe der 2. Bundesliga */
  --color-accent-hover: #ff2438;
  --color-accent-soft: rgba(226, 0, 26, 0.14);

  --color-live: #22c55e;
  --color-win: #22c55e;
  --color-draw: #f5b942;
  --color-loss: #ef4444;

  --zone-aufstieg: #22c55e;
  --zone-relegation-auf: #38bdf8;
  --zone-relegation-ab: #f59e0b;
  --zone-abstieg: #ef4444;

  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.35);

  --max-width: 1240px;
  --font-sans: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ---------- Stadion-Hintergrund (sehr stark geblurt) ----------
   Reines CSS-Gradient-„Foto": oben Tribüne mit Sitzreihen/-blöcken und
   Flutlicht-Glanzpunkten, unten Rasen mit Mäh-Streifen. Scharfe Formen
   werden erst durch einen starken blur()-Filter zum verschwommenen
   Stadion-Eindruck – die Kacheln der Seite bleiben davor gut lesbar.
   Fixed + hinter allem Content (z-index -2), transform:scale kaschiert
   die weichgezeichneten Kanten des Filters am Viewport-Rand. */
body::before {
  content: '';
  position: fixed;
  inset: -5vh -5vw;
  z-index: -2;
  background:
    /* Flutlicht-Glanzpunkte */
    radial-gradient(420px 320px at 8% 4%, rgba(255, 244, 214, 0.75), transparent 70%),
    radial-gradient(420px 320px at 92% 2%, rgba(255, 244, 214, 0.7), transparent 70%),
    radial-gradient(520px 360px at 50% 0%, rgba(255, 244, 214, 0.55), transparent 70%),
    /* Sitzblöcke der Tribüne (Farbflächen) */
    repeating-linear-gradient(
      100deg,
      rgba(226, 0, 26, 0.55) 0%,
      rgba(226, 0, 26, 0.55) 6%,
      rgba(40, 55, 78, 0.75) 6%,
      rgba(40, 55, 78, 0.75) 16%,
      rgba(66, 84, 110, 0.75) 16%,
      rgba(66, 84, 110, 0.75) 24%
    ),
    /* Sitzreihen (horizontale Streifen) */
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.45) 0,
      rgba(0, 0, 0, 0.45) 8px,
      transparent 8px,
      transparent 26px
    ),
    /* Übergang Tribüne -> Rasen */
    linear-gradient(
      180deg,
      #202c40 0%,
      #263a52 34%,
      #1f6b3c 46%,
      #1a5732 68%,
      #12452a 100%
    ),
    /* Mäh-Streifen auf dem Rasen */
    repeating-linear-gradient(
      100deg,
      rgba(255, 255, 255, 0.14) 0,
      rgba(255, 255, 255, 0.14) 90px,
      transparent 90px,
      transparent 180px
    );
  background-repeat: no-repeat;
  background-size: 100% 100%;
  filter: blur(42px) saturate(1.3);
  transform: scale(1.15);
}

/* Dunkles Vignette-Overlay über dem geblurten Stadion – sorgt für genug
   Kontrast zum Text, lässt Rasen/Tribüne aber deutlich durchscheinen.
   Karten selbst bleiben regulär deckend. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(5, 15, 9, 0.3) 0%,
    rgba(5, 15, 9, 0.45) 45%,
    rgba(5, 15, 9, 0.6) 100%
  );
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3 {
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------- Kopfbereich / Branding ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* leicht transparent, damit das geblurte Stadion im Hintergrund auch
     hinter dem Header dezent durchscheint */
  background: linear-gradient(180deg, rgba(10, 24, 16, 0.82) 0%, rgba(18, 21, 29, 0.88) 100%);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.site-header-top {
  /* 3 Spalten: linker Platzhalter, mittig das Logo, rechts die
     Podcast-Icons – die zwei 1fr-Spalten bleiben immer gleich breit,
     dadurch sitzt das Logo unabhängig von der Breite der Podcast-Icons
     exakt mittig. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem 0.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  /* explizit Spalte 2: sonst würde Grid-Auto-Placement das Logo auf
     Seiten ohne Podcast-Icons (z. B. admin.html) in die erste statt
     mittlere Spalte setzen */
  grid-column: 2;
  justify-self: center;
}

.podcast-links {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.podcast-label {
  color: var(--color-text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.podcast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(22px, 2.6vw, 32px);
  height: clamp(22px, 2.6vw, 32px);
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: color 0.15s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.podcast-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.podcast-icon:hover,
.podcast-icon:focus-visible {
  color: var(--color-text);
  transform: translateY(-2px) scale(1.08);
}

/* Auf schmalen Screens verschwindet nur das Textlabel, die 3 Icons
   bleiben sichtbar (analog zu den Team-Namen in der Nav-Leiste). */
@media (max-width: 480px) {
  .podcast-label {
    display: none;
  }

  .podcast-icon {
    width: 22px;
    height: 22px;
  }
}

.brand-badge {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1.05rem;
}

.brand-text small {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

/* ---------- Team-Navigationsleiste ----------
   Immer alle 18 Teams gleichzeitig sichtbar, in einer Zeile über die
   gesamte Bildschirmbreite (kein horizontales Scrollen/„Taskbar"-Verhalten
   mehr). Jede Kachel bekommt per Grid einen gleich breiten Slot; Logo und
   Name schrumpfen mit clamp() auf schmalen Screens, statt zu umbrechen. */
.team-nav-wrapper {
  width: 100%;
  padding: 0 0.4rem 0.6rem;
}

.team-nav {
  display: grid;
  grid-template-columns: repeat(18, minmax(0, 1fr));
  gap: 0.05rem;
  padding: 0.25rem 0.15rem;
  width: 100%;
}

.nav-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.3rem 0.05rem;
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-team:hover,
.nav-team:focus-visible {
  background: var(--color-card-hover);
  transform: translateY(-3px) scale(1.06);
}

.nav-team img {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-team:hover img {
  transform: rotate(-6deg) scale(1.1);
}

.nav-team.is-active {
  background: var(--color-accent-soft);
  outline: 1px solid var(--color-accent);
}

.nav-team img {
  width: clamp(22px, 3.4vw, 46px);
  height: clamp(22px, 3.4vw, 46px);
  object-fit: contain;
}

.nav-team-name {
  font-size: clamp(0.48rem, 0.85vw, 0.62rem);
  color: var(--color-text-muted);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-team.is-active .nav-team-name {
  color: var(--color-text);
  font-weight: 600;
}

/* Auf sehr schmalen Screens werden die Namen ausgeblendet, damit alle 18
   Logos garantiert in einer Zeile bleiben. */
@media (max-width: 640px) {
  .nav-team-name {
    display: none;
  }

  .nav-team img {
    width: clamp(18px, 6.5vw, 32px);
    height: clamp(18px, 6.5vw, 32px);
  }
}

/* ---------- Layout / Sections ---------- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.section {
  margin-bottom: 2.5rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 1.3rem;
  border-left: 4px solid var(--color-accent);
  padding-left: 0.6rem;
}

/* ---------- Zustandsanzeigen: Laden / Fehler / Platzhalter ---------- */
.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 2.2rem 1rem;
  text-align: center;
  color: var(--color-text-muted);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.state-error {
  color: #ffb4b4;
}

.state-error-icon {
  font-size: 1.4rem;
}

.btn-retry {
  margin-top: 0.4rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--color-accent);
  background: transparent;
  color: var(--color-text);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color 0.15s ease;
}

.btn-retry:hover {
  background: var(--color-accent-soft);
}

.state-placeholder {
  color: var(--color-text-muted);
  border-style: dashed;
}

.placeholder-badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: rgba(245, 185, 66, 0.15);
  color: #f5b942;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Live-Ticker-Banner (verlinkt auf kicker, da OpenLigaDB für
   diese Liga keine Zwischenstände liefert) ---------- */
.live-ticker-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.8rem;
  background: var(--color-accent-soft);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  transition: background-color 0.15s ease;
}

.live-ticker-banner:hover {
  background: rgba(226, 0, 26, 0.22);
}

.live-ticker-banner-text {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--color-text);
}

.live-ticker-banner-text strong {
  color: var(--color-live);
}

.live-ticker-banner-arrow {
  flex-shrink: 0;
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* ---------- Spieltag / Match-Karten ---------- */
.match-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.match-card {
  --tilt: 0deg;
  display: grid;
  /* minmax(0, 1fr) statt 1fr: sonst setzt die implizite Mindestbreite
     (min-content) der Spalte die größeren Logos+Namen nicht unter Druck,
     und die Karte läuft auf schmalen Screens über den Viewport hinaus. */
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transform: perspective(700px) rotate(0deg) translateY(0);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease, border-color 0.3s ease, background-color 0.2s ease;
  will-change: transform;
}

.match-card:hover {
  background: var(--color-card-hover);
  border-color: var(--color-accent);
  transform: perspective(700px) rotate(-0.6deg) translateY(-6px) scale(1.015);
  box-shadow: 0 18px 34px -10px rgba(226, 0, 26, 0.35);
  z-index: 1;
}

.match-team {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.match-team--right {
  justify-content: flex-end;
  text-align: right;
}

.match-team img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Die beiden Team-Logos "fliegen" beim Hover leicht auseinander */
.match-card:hover .match-team:first-child img {
  transform: translate(-6px, -3px) rotate(-10deg) scale(1.18);
}

.match-card:hover .match-team--right img {
  transform: translate(6px, -3px) rotate(10deg) scale(1.18);
}

.match-team span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.92rem;
}

.match-center {
  text-align: center;
  min-width: 92px;
  transition: transform 0.35s ease;
}

.match-card:hover .match-center {
  transform: scale(1.06);
}

.match-score {
  font-size: 1.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.match-kickoff {
  font-size: 1.05rem;
  font-weight: 700;
}

.match-status {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 0.1rem;
}

.match-status--live {
  color: var(--color-live);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-live);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Tabelle ---------- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.league-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-card);
  min-width: 560px;
}

.league-table th,
.league-table td {
  padding: 0.65rem 0.7rem;
  text-align: center;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--color-border);
}

.league-table thead th {
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--color-bg-elevated);
}

.league-table tbody tr:hover {
  background: var(--color-card-hover);
}

.league-table tbody tr:last-child td {
  border-bottom: none;
}

.col-rank {
  font-weight: 700;
  color: var(--color-text-muted);
}

.col-team {
  text-align: left;
}

.col-points {
  color: var(--color-text);
}

.table-team-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.table-team-link img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Live-Symbol in der Tabelle: markiert Teams, die gerade spielen. */
.table-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  color: var(--color-live);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.league-table tr.zone-aufstieg td.col-rank { box-shadow: inset 3px 0 0 var(--zone-aufstieg); }
.league-table tr.zone-relegation-auf td.col-rank { box-shadow: inset 3px 0 0 var(--zone-relegation-auf); }
.league-table tr.zone-relegation-ab td.col-rank { box-shadow: inset 3px 0 0 var(--zone-relegation-ab); }
.league-table tr.zone-abstieg td.col-rank { box-shadow: inset 3px 0 0 var(--zone-abstieg); }

.table-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.9rem 0 0;
  padding: 0;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.table-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.legend-dot.zone-aufstieg { background: var(--zone-aufstieg); }
.legend-dot.zone-relegation-auf { background: var(--zone-relegation-auf); }
.legend-dot.zone-relegation-ab { background: var(--zone-relegation-ab); }
.legend-dot.zone-abstieg { background: var(--zone-abstieg); }

/* ---------- News-Grid (Startseite + Team-Seite) ---------- */
.news-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* Startseite: News-Karten sind <a>-Links (kicker-Artikel) innerhalb eines
   schlichten <li>-Wrappers; das <li> wird für das Grid "transparent",
   damit grid-column auf .news-card--hero greift (der eigentliche Grid-Item
   ist dann die <a>). Betrifft nicht die Team-Seite, deren <li> selbst
   bereits die .news-card-Klasse trägt. */
.news-grid > li:not(.news-card) {
  display: contents;
}

.news-card {
  position: relative;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease,
    border-color 0.3s ease;
  will-change: transform;
}

.news-card:hover {
  transform: translateY(-6px) rotate(-0.3deg);
  border-color: var(--color-accent);
  box-shadow: 0 18px 34px -12px rgba(226, 0, 26, 0.35);
}

/* Demo-/Beispiel-Ribbon für Karten mit demo:true in teams-content.json */
.news-card.is-demo::after {
  content: 'Beispiel';
  position: absolute;
  top: 0;
  right: 0;
  background: var(--color-draw);
  color: #1a1300;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.22rem 0.65rem;
  border-radius: 0 var(--radius-lg) 0 var(--radius-md);
}

/* Hervorgehobene erste News-Karte auf der Startseite */
.news-card--hero {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(226, 0, 26, 0.16), var(--color-card) 65%);
  padding: 1.5rem;
}

.news-card--hero h3 {
  font-size: 1.3rem;
}

.news-card--hero p {
  font-size: 0.95rem;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.news-card h3 {
  font-size: 1rem;
  margin: 0;
}

.news-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

/* ---------- Team-Kopfzeile ---------- */
.team-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0 1rem;
}

.team-header-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.team-header h1 {
  font-size: 1.6rem;
}

.team-header-sub {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.tab-button {
  flex: 0 0 auto;
  padding: 0.7rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab-button:hover {
  color: var(--color-text);
}

.tab-button.is-active {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.panel-subheading {
  font-size: 1rem;
  margin: 1.4rem 0 0.7rem;
  color: var(--color-text-muted);
}

.panel-subheading:first-child {
  margin-top: 0;
}

.panel-empty-hint {
  color: var(--color-text-faint);
  font-size: 0.85rem;
}

/* ---------- Spielplan / Ergebnisse (Team-Seite) ---------- */
.fixture-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.fixture-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease,
    border-color 0.3s ease, background-color 0.2s ease;
  will-change: transform;
}

.fixture-row:hover {
  background: var(--color-card-hover);
  border-color: var(--color-accent);
  transform: translateX(4px) translateY(-3px) scale(1.01);
  box-shadow: 0 14px 28px -12px rgba(226, 0, 26, 0.35);
  z-index: 1;
}

.fixture-row:hover .fixture-opponent img {
  transform: rotate(-8deg) scale(1.2);
}

.fixture-row:hover .fixture-score {
  transform: scale(1.12);
  display: inline-block;
}

.fixture-matchday {
  color: var(--color-text-faint);
  font-size: 0.72rem;
  white-space: nowrap;
}

.fixture-home-away {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.fixture-opponent {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.fixture-opponent img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fixture-opponent span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.fixture-kickoff {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.fixture-score {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: transform 0.3s ease;
}

.fixture-score--sieg { color: var(--color-win); }
.fixture-score--niederlage { color: var(--color-loss); }
.fixture-score--unentschieden { color: var(--color-draw); }

/* ---------- Tabellenposition (Team-Seite) ---------- */
.position-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  margin-bottom: 0.8rem;
}

.position-rank {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.position-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1rem;
  margin: 0;
}

.position-stats dt {
  font-size: 0.7rem;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.position-stats dd {
  margin: 0.15rem 0 0;
  font-size: 1.1rem;
  font-weight: 700;
}

/* ---------- Kader: Formations-Ansicht (zweispaltig, volle Bildschirmbreite) ----------
   Durchbricht bewusst die zentrierte max-width von <main> (wie schon die
   Team-Nav-Leiste): Spielfeld füllt die komplette linke Bildschirmhälfte,
   die Kaderliste die rechte. Nur aktiv, wenn eine Formation gesetzt ist -
   der Fallback (Zeilen-Ansicht ohne Formation) bleibt einspaltig/zentriert. */
.panel-kader-formation {
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  display: grid;
  /* Spielfeld-Spalte nie schmaler als .pitch--formation min-width im
     Extremfall (5 Spalten * 138px = 690px, siehe unten), sonst würden
     Rand-Spieler breiter Linien über den Feldrand hinausragen.
     Kaderliste bekommt den Rest, mind. 280px. */
  grid-template-columns: minmax(690px, 1fr) minmax(280px, 1fr);
  align-items: start;
  gap: 0 2rem;
  padding: 0 2rem;
}

.panel-kader-formation .pitch-wrap {
  margin-bottom: 0;
}

.panel-kader-formation .squad-list-col {
  /* pitch-hint steht jetzt UNTER dem Feld statt davor (siehe js/team.js) -
     das Feld startet direkt am oberen Rand von .pitch-wrap, kein
     Ausgleichs-Abstand mehr nötig. */
  padding-top: 0;
}

/* Zweispaltig erst ab genug Breite für beide Mindestmaße (690px + 280px +
   Gap/Padding) - darunter lieber einspaltig (volle Breite fürs Spielfeld)
   statt eine gequetschte Kaderliste oder Seiten-Scrollbalken zu riskieren. */
@media (max-width: 1080px) {
  .panel-kader-formation {
    width: auto;
    position: static;
    left: auto;
    margin-left: 0;
    padding: 0;
    display: block;
  }

  .panel-kader-formation .squad-list-col {
    padding-top: 0;
    margin-top: 1.5rem;
  }
}

/* ---------- Kader: interaktives Spielfeld ---------- */
.pitch-wrap {
  margin-bottom: 1rem;
  /* Bei den großen Sammelkarten kann das Spielfeld (siehe .pitch--formation
     min-width) breiter sein als die verfügbare Spalte - dann lieber
     horizontal scrollen statt Karten am Rand abzuschneiden. */
  overflow-x: auto;
}

/* Steht jetzt UNTER dem Feld (siehe js/team.js) statt davor, damit das
   Feld selbst weiter nach oben rutscht und mehr vom sichtbaren Bereich
   nutzt - der volle Attributionstext (CC-BY-SA-Pflicht) steht als
   title-Tooltip weiter zur Verfügung, sichtbar ist nur eine Kurzform. */
.pitch-hint {
  color: var(--color-text-faint);
  font-size: 0.72rem;
  margin: 0.6rem 0 0;
  cursor: help;
}

/* ---------- Mögliche Wechsel (Alternativspieler je Position) ----------
   Steht unter dem Feld (siehe js/team.js renderKader()): pro Position mit
   im Admin-Editor hinterlegtem Alternativ-Spieler ein Karten-Paar
   Starter ⇄ Alternative, in derselben Kartengröße wie auf dem Feld
   (.player-card wird 1:1 wiederverwendet). */
.alt-section {
  margin-top: 1.4rem;
}

.alt-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.alt-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.7rem;
}

.alt-swap-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 1.15rem;
  font-weight: 700;
}

/* Realistischerer Rasen: breite, quer verlaufende Mäh-Streifen (wie beim
   echten Rasenmähen im Stadion), feine diagonale Grashalm-Textur darüber,
   plus dezentes Flutlicht-Glanzband von oben - alles reines CSS
   (Gradient-Layer), kein Bild-Asset nötig. */
.pitch {
  --line: rgba(255, 255, 255, 0.38);
  position: relative;
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 1rem;
  padding: 2rem 1rem;
  background:
    /* feine Grashalm-Textur, zwei Diagonalen für einen "gewebten" Look */
    repeating-linear-gradient(
      115deg,
      rgba(255, 255, 255, 0.05) 0,
      rgba(255, 255, 255, 0.05) 1px,
      transparent 1px,
      transparent 3px
    ),
    repeating-linear-gradient(
      65deg,
      rgba(0, 0, 0, 0.05) 0,
      rgba(0, 0, 0, 0.05) 1px,
      transparent 1px,
      transparent 3px
    ),
    /* kräftige, ECHT zweifarbige Mäh-Streifen quer übers Feld (abwechselnd
       auf-/abgehellt statt nur eine helle Linie auf einheitlichem Grund -
       wirkt wie frisch gemähter Rasen im Stadion/auf dem Sportplatz) */
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.1) 0,
      rgba(255, 255, 255, 0.1) 38px,
      rgba(0, 0, 0, 0.07) 38px,
      rgba(0, 0, 0, 0.07) 76px
    ),
    /* angedeutete Abnutzung/Erdflecken vor den Toren und im Mittelkreis,
       wie auf einem echten bespielten Platz */
    radial-gradient(60px 34px at 50% 6%, rgba(120, 96, 62, 0.16), transparent 75%),
    radial-gradient(60px 34px at 50% 94%, rgba(120, 96, 62, 0.16), transparent 75%),
    radial-gradient(90px 90px at 50% 50%, rgba(120, 96, 62, 0.08), transparent 70%),
    /* Flutlicht-Aufhellung von oben */
    radial-gradient(140% 55% at 50% 0%, rgba(255, 255, 255, 0.14), transparent 65%),
    /* Stadion-Vignette: Tribünenschatten an den Rändern */
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.28) 100%),
    linear-gradient(180deg, #226f3c 0%, #1c6134 30%, #144d29 62%, #0c3a1e 100%);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.55);
}

/* Formations-Ansicht: höher (füllt die linke Bildschirmhälfte eher hochkant
   wie eine echte Aufstellungsgrafik) und mit "Sammelkarten" statt simpler
   Kreise (siehe .player-card weiter unten). */
.pitch--formation {
  /* Höhe UND Breite richten sich exakt nach Zeilen-/Spaltenanzahl der
     aktuellen Formation (--rows/--cols, per JS gesetzt - siehe
     Formations.getRowCount()/getColCount() in formations.js/team.js/
     admin.js): jede Zeile bekommt eine feste Bahn von 172px
     (Kartenhöhe inkl. der größeren Trikot-Silhouette + Mini-Abstand),
     jede Spalte (der breitesten Linie) eine feste Bahn von 138px
     (Kartenbreite + Mini-Abstand) - dadurch bleibt der Kartenabstand
     überall knapp bemessen, egal ob wenige Zeilen/Spalten (z. B. 5-4-1)
     oder viele (z. B. die Raute 4-1-2-1-2). --rows/--cols fehlen (z. B.
     admin-Vorschau ohne gewählte Formation) -> Default je 5. */
  height: calc(var(--rows, 5) * 172px);
  min-width: calc(var(--cols, 5) * 138px);
}

@media (max-width: 900px) {
  .pitch--formation {
    height: calc(var(--rows, 5) * 130px);
    min-width: calc(var(--cols, 5) * 108px);
  }
}

/* "Sammelkarte" je Startelf-Spieler, angelehnt an EA-FC/FIFA-Ultimate-
   Team-Karten: Silhouette oben, Name-Banner unten, Position + Rücken-
   nummer + Nationalflagge groß in der Kopfzeile, goldener Metallic-
   Verlauf mit diagonalem Glanzstreifen. */
.player-card {
  position: relative;
  width: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.45rem 0.4rem 0.5rem;
  border-radius: 16px 16px 9px 9px;
  background: linear-gradient(160deg, #fdf3d2 0%, #e8c766 32%, #c79a3c 60%, #8a6420 100%);
  box-shadow: 0 14px 28px -8px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  overflow: hidden;
}

/* Kleines Wechsel-Symbol oben rechts auf der Karte, nur wenn für diese
   Position ein Alternativspieler hinterlegt ist (siehe buildPlayerCard-
   Markup() in js/team.js) - Hinweis, dass weiter unten im Abschnitt
   "Mögliche Wechsel" eine Alternative für genau diese Position steht.
   Innerhalb der Karte platziert (nicht über den Rand hinaus), da
   .player-card overflow:hidden für den Foil-Glanzstreifen braucht. */
.player-card-alt-badge {
  position: absolute;
  /* unten rechts auf der Karte statt oben (dort würde es mit Flagge/
     Position/Rückennummer kollidieren) */
  bottom: 3px;
  right: 3px;
  z-index: 1;
  width: 1.1rem;
  height: 1.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Diagonaler Glanzstreifen für den "Foil-Card"-Look. */
.player-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.45) 0%, transparent 35%);
  pointer-events: none;
}

/* Kopfzeile der Karte: Flagge links, Position mittig-zentriert, Rücken-
   nummer rechts (drei feste Spalten statt nur space-between zwischen zwei
   Elementen, damit die Position wirklich in der Mitte sitzt). Bewusst
   groß/kräftig (Flagge, Position, Rückennummer sind - anders als Foto und
   Name - auf jeder Karte gleichermaßen aussagekräftig, da kein Foto mehr
   existiert). */
.player-card-top {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  font-size: 1.22rem;
  font-weight: 800;
  color: #3c2a05;
  letter-spacing: 0.02em;
}

.player-card-pos {
  flex: 1 1 auto;
  text-align: center;
  font-size: 0.82em;
}

/* Statt eines echten Fotos (existiert längst nicht für jeden Spieler)
   immer eine Oberkörper-Silhouette im Trikot der Vereinsfarbe (siehe
   jerseySilhouette() in js/team.js) - ohne umgebenden Kreis/Rahmen, die
   Silhouette steht direkt auf der Karte. */
.player-card-photo {
  position: relative;
  width: 100%;
  height: 92px;
  margin: 0.15rem 0;
  display: grid;
  place-items: center;
}

.player-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-card-silhouette {
  height: 100%;
  width: auto;
}

/* Nationalflagge oben links in der Kopfzeile (nicht mehr am Foto), damit
   sie bei den kompakten Karten nicht mit Foto/Rand kollidiert und auf
   jeder Formation (auch enge 4er-/5er-Ketten) zuverlässig sichtbar bleibt.
   Echte Flaggen-Grafik (siehe Utils.flagImgHtml) statt Emoji - Emoji
   werden auf manchen Systemen nur als Buchstaben-Code dargestellt statt
   als Bild. Feste Mindestbreite, damit die Position auch ohne Flagge
   mittig bleibt. */
.player-card-flag {
  flex: 0 0 auto;
  min-width: 1.5em;
  width: 1.5em;
  height: 1.1em;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

/* Emoji-Fallback (kein Grafik-Mapping oder Bild lädt nicht) - eigenes
   Kästchen-Aussehen entfällt, Emoji bringt sein Bild ggf. selbst mit. */
.player-card-flag--emoji {
  width: auto;
  height: auto;
  box-shadow: none;
  border-radius: 0;
  font-size: 0.85em;
  line-height: 1.1em;
  text-align: left;
}

.player-card-number {
  flex: 0 0 auto;
  min-width: 1.3em;
  text-align: right;
}

.player-card-name {
  position: relative;
  font-size: 0.92rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: #2a1d04;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 5px;
  padding: 0.08rem 0.4rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pitch-player.is-demo .player-card {
  background: linear-gradient(160deg, #f3f3f3 0%, #cfd3d8 35%, #9aa1ab 65%, #6b7280 100%);
}

.pitch-player--card:hover .player-card,
.pitch-player--card:focus-visible .player-card {
  box-shadow: 0 26px 46px -8px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

@media (max-width: 900px) {
  .player-card {
    width: 100px;
    padding: 0.35rem 0.3rem 0.4rem;
    gap: 0.15rem;
  }

  .player-card-photo {
    height: 68px;
    margin: 0.1rem 0;
  }

  .player-card-top {
    font-size: 0.98rem;
  }

  .player-card-name {
    font-size: 0.72rem;
  }

  .player-card-alt-badge {
    bottom: 2px;
    right: 2px;
    width: 0.95rem;
    height: 0.95rem;
    font-size: 0.56rem;
  }
}

/* Mittellinie & Mittelkreis */
.pitch::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
  transform: translateY(-50%);
}

.pitch::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110px;
  height: 110px;
  border: 2px solid var(--line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.pitch-box {
  position: absolute;
  left: 50%;
  width: 42%;
  height: 68px;
  border: 2px solid var(--line);
  transform: translateX(-50%);
}

.pitch-box--top {
  top: -2px;
  border-top: none;
  border-radius: 0 0 10px 10px;
}

.pitch-box--bottom {
  bottom: -2px;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
}

.pitch-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.4rem 1.1rem;
}

.pitch-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
}

.pitch-player:hover,
.pitch-player:focus-visible {
  transform: translateY(-7px) scale(1.1);
}

/* Spieler-Portrait auf dem Feld (statt der früheren Rückennummer): echtes
   Foto, wo per Wikipedia-Skript vorhanden (siehe scripts/kader_von_
   wikipedia.py), sonst ein generisches Personen-Icon als Platzhalter. */
.pitch-player-photo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-accent);
  color: #fff;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

.pitch-player-photo--fallback svg {
  width: 60%;
  height: 60%;
  fill: currentColor;
}

.pitch-player-name {
  position: relative;
  font-size: 0.66rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pitch-player.is-demo .pitch-player-photo--fallback {
  background: var(--color-draw);
  color: #1a1300;
}

/* Freie Positionierung, wenn im Admin-Editor (admin.html) Spieler
   verschoben wurden ("x"/"y" in Prozent statt Zeilen-Gruppierung). */
.pitch-player--abs {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
}

/* Muss NACH der generischen .pitch-player:hover-Regel stehen, sonst würde
   die Zentrierung (translate(-50%,-50%)) beim Hover verlorengehen. */
.pitch-player--abs:hover,
.pitch-player--abs:focus-visible {
  transform: translate(-50%, -50%) translateY(-7px) scale(1.1);
  z-index: 3;
}

.pitch-empty-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
  background: rgba(8, 10, 14, 0.45);
  color: #f3f5f9;
  font-weight: 600;
}

.pitch-empty-overlay span {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  font-size: 0.85rem;
}

.pitch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.76rem;
  color: var(--color-text-muted);
}

/* ---------- Kompletter Kader (Liste unter dem Formations-Spielfeld,
   team.html + admin.html) ---------- */
.squad-list {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.squad-list-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 3px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* Kann sowohl ein <span> (umschließt Foto oder Fallback-Icon) als auch
   direkt ein <img> sein, je nachdem welche Seite es rendert - deshalb hier
   auf beiden Formen dieselbe Kreis-Größe. */
.squad-list-avatar,
img.squad-list-avatar {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-bg-elevated);
  color: var(--color-text-faint);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.squad-list-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.squad-list-avatar svg {
  width: 60%;
  height: 60%;
  fill: currentColor;
}

/* Öffentliche Team-Seite: Nationalflagge statt Foto-Kreis (siehe
   buildSquadListItem() in js/team.js) - existiert für jeden Spieler mit
   hinterlegter Nationalität, anders als das Foto. */
.squad-list-flag-wrap {
  flex-shrink: 0;
  width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.squad-list-flag {
  width: 26px;
  height: 19px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.squad-list-flag--emoji {
  width: auto;
  height: auto;
  font-size: 1.15rem;
  line-height: 1;
  box-shadow: none;
  border-radius: 0;
}

.squad-list-number {
  flex-shrink: 0;
  width: 1.8rem;
  text-align: center;
  font-weight: 800;
  color: var(--color-text-muted);
}

.squad-list-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.squad-list-position {
  flex-shrink: 0;
  color: var(--color-text-faint);
  font-size: 0.78rem;
}

.squad-list-badge {
  flex-shrink: 0;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent-hover);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Alternativspieler-Variante: gleiches Rot-Schema wie "Startelf", aber
   mit Umrandung statt Füllung - auf den ersten Blick als "zweite
   Kategorie" erkennbar, nicht mit dem Startelf-Badge verwechselbar. */
.squad-list-badge--alt {
  background: transparent;
  color: var(--color-accent-hover);
  border: 1px solid var(--color-accent-hover);
}

/* Verfügbarkeits-Status je Spieler (Feld "status", gepflegt über
   admin.html/js/player-status.js). Jeder Status hat eine feste Farbe, die
   sowohl für das Badge als auch (bis auf "verfügbar", siehe unten) für die
   Einfärbung der ganzen Zeile genutzt wird. */
.squad-status-badge {
  flex-shrink: 0;
  margin-left: auto;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.squad-status-badge.status-verfuegbar { background: rgba(34, 197, 94, 0.16); color: var(--color-win); }
.squad-status-badge.status-angeschlagen { background: rgba(245, 185, 66, 0.18); color: var(--color-draw); }
.squad-status-badge.status-aufbautraining { background: rgba(251, 146, 60, 0.18); color: #fb923c; }
.squad-status-badge.status-verletzt { background: rgba(239, 68, 68, 0.18); color: var(--color-loss); }
.squad-status-badge.status-gelbsperre { background: rgba(234, 179, 8, 0.18); color: #eab308; }
.squad-status-badge.status-gesperrt { background: rgba(226, 0, 26, 0.2); color: var(--color-accent-hover); }
.squad-status-badge.status-nicht-im-kader { background: rgba(103, 111, 128, 0.2); color: var(--color-text-faint); }

/* Zeileneinfärbung: nur Abweichungen vom Normalfall ("verfügbar" bleibt
   neutral/unauffällig) bekommen einen farbigen linken Rand + dezenten
   Hintergrund-Tint, damit Auffälligkeiten (Verletzung, Sperre, ...) auf
   den ersten Blick aus der Liste herausstechen. */
.squad-list-item--angeschlagen { background: rgba(245, 185, 66, 0.08); border-left-color: var(--color-draw); }
.squad-list-item--aufbautraining { background: rgba(251, 146, 60, 0.08); border-left-color: #fb923c; }
.squad-list-item--verletzt { background: rgba(239, 68, 68, 0.1); border-left-color: var(--color-loss); }
.squad-list-item--gelbsperre { background: rgba(234, 179, 8, 0.1); border-left-color: #eab308; }
.squad-list-item--gesperrt { background: rgba(226, 0, 26, 0.12); border-left-color: var(--color-accent); }
.squad-list-item--nicht-im-kader { background: rgba(103, 111, 128, 0.08); border-left-color: var(--color-text-faint); }

/* ---------- Transfers ---------- */
.transfer-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.transfer-list li {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.9rem;
  font-size: 0.87rem;
}

.transfer-list li span {
  float: right;
  color: var(--color-text-faint);
  font-size: 0.78rem;
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  color: var(--color-text-faint);
  font-size: 0.78rem;
  text-align: center;
}

.site-footer a {
  color: var(--color-text-muted);
  text-decoration: underline;
}

/* ---------- Responsive Anpassungen ---------- */
@media (min-width: 640px) {
  .brand-text strong {
    font-size: 1.15rem;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .match-card {
    padding: 0.75rem 0.7rem;
  }

  .match-team span {
    font-size: 0.8rem;
  }

  .match-team img {
    width: 30px;
    height: 30px;
  }

  .fixture-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'opponent score'
      'meta meta';
  }

  .fixture-matchday,
  .fixture-home-away {
    display: none;
  }
}

/* Nutzer, die reduzierte Bewegung bevorzugen: alle "fliegenden" Hover-
   Effekte deaktivieren, aber Farb-/Rahmen-Feedback beibehalten. */
@media (prefers-reduced-motion: reduce) {
  .match-card,
  .match-team img,
  .match-center,
  .fixture-row,
  .fixture-opponent img,
  .fixture-score,
  .nav-team,
  .nav-team img,
  .news-card,
  .pitch-player {
    transition: none !important;
  }

  .match-card:hover,
  .fixture-row:hover,
  .nav-team:hover,
  .news-card:hover,
  .pitch-player:hover {
    transform: none !important;
  }

  .match-card:hover .match-team:first-child img,
  .match-card:hover .match-team--right img,
  .fixture-row:hover .fixture-opponent img,
  .nav-team:hover img {
    transform: none !important;
  }

  /* Frei positionierte Kader-Marker (admin.html) brauchen ihren
     Zentrier-Transform auch im Ruhezustand bei Hover weiterhin. */
  .pitch-player--abs,
  .pitch-player--abs:hover {
    transform: translate(-50%, -50%) !important;
  }
}

/* =========================================================================
   Admin-Kader-Editor (admin.html)
   ========================================================================= */
.admin-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.admin-intro h1 {
  font-size: 1.5rem;
}

.admin-intro p {
  color: var(--color-text-muted);
  max-width: 62ch;
}

.admin-intro code {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.85em;
}

.admin-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 1.2rem 0 0.8rem;
}

.btn-admin {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn-admin:hover:not(:disabled) {
  background: var(--color-card-hover);
  border-color: var(--color-accent);
}

.btn-admin:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-admin--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.btn-admin--primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

.admin-select {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
  font-size: 0.85rem;
}

.admin-select:disabled {
  opacity: 0.4;
}

.admin-status {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  min-height: 1.4em;
  margin-bottom: 1.2rem;
}

/* ---------- Formation-Editor (admin.html) ---------- */
.formation-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Team-Auswahl per Logos statt Dropdown: nutzt dieselben .team-nav/.nav-team-
   Klassen wie die Kopfzeile, hier aber als <button> statt <a> (deshalb der
   Button-Reset) und innerhalb der normalen max-width statt Full-Bleed. */
.admin-team-select {
  display: grid;
  grid-template-columns: repeat(18, minmax(0, 1fr));
  gap: 0.3rem;
  padding: 0.5rem 0;
  margin-bottom: 0.3rem;
}

.admin-team-select .nav-team {
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.admin-team-select-fallback-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.admin-last-saved {
  color: var(--color-text-faint);
  font-size: 0.78rem;
  margin: 0 0 1.4rem;
}

/* ---------- Alternativspieler je Startelf-Position (admin.html) ----------
   Eigener Bereich unter dem Formations-Editor: pro Position (Zeile) ein
   zweites Dropdown, um optional einen Wechsel-Kandidaten aus dem Kader
   zuzuweisen (siehe renderAlternatives() in js/admin.js). */
.admin-alternatives-section {
  margin-top: 2rem;
}

.admin-alternatives {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.admin-alternatives-empty {
  color: var(--color-text-faint);
  font-size: 0.85rem;
}

.admin-alt-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.9rem;
  flex-wrap: wrap;
}

.admin-alt-starter {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 220px;
  flex: 1 1 220px;
}

.admin-alt-starter-label {
  color: var(--color-text-faint);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.admin-alt-swap-icon {
  color: var(--color-accent);
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.admin-alt-select {
  flex: 1 1 220px;
  min-width: 180px;
}

.formation-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 150px;
}

.formation-slot-avatar-wrap {
  position: relative;
  display: inline-flex;
}

/* Vorschau-Portrait des aktuell zugewiesenen Spielers (oder Platzhalter-
   Icon bei leerer Position) über dem Positions-Dropdown - goldener Ring
   im selben "Sammelkarten"-Look wie .player-card auf der öffentlichen Seite. */
.formation-slot-avatar,
img.formation-slot-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a1300;
  color: #fff;
  display: grid;
  place-items: center;
  border: 3px solid;
  border-image: linear-gradient(160deg, #fdf3d2, #e8c766, #8a6420) 1;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

.formation-slot-avatar--empty {
  background: var(--color-bg-elevated);
  border-style: dashed;
  border-color: var(--color-border);
}

.formation-slot-avatar svg {
  width: 60%;
  height: 60%;
  fill: currentColor;
}

/* Echte Flaggen-Grafik statt Emoji (siehe Utils.flagImgHtml). */
.formation-slot-flag {
  position: absolute;
  top: 0;
  left: -6px;
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  background: var(--color-bg-elevated);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.formation-slot-flag--emoji {
  width: auto;
  height: auto;
  font-size: 1rem;
  line-height: 1;
  padding: 2px;
  border-radius: 50%;
}

.formation-slot-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.5);
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.formation-slot-select {
  width: 100%;
  padding: 0.3rem 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  font-size: 0.72rem;
  font-weight: 600;
}

.formation-slot-select:focus-visible {
  outline: 2px solid var(--color-accent);
}

.squad-list-item.is-hidden {
  opacity: 0.45;
}

.squad-status-select {
  flex-shrink: 0;
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
}

