/* Startelf24 — Design-Tokens: "Flutlicht" (bewusst dunkel, kein Theme-Wechsel -
   das Nachtspiel-Flutlicht ist die Markenidentität, nicht ein Farbschema). */
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-raised: #1c222b;
  --text: #eef1f4;
  --text-muted: #8b93a1;
  --border: #262c36;
  --accent: #e63946;
  --accent-soft: rgba(230, 57, 70, 0.14);
  --accent-ink: #ffffff;

  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Work Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Courier New", monospace;

  /* Rasen bleibt Rasen, unabhängig vom Seiten-Theme */
  --pitch-a: #1f6f45;
  --pitch-b: #1b6640;
  --pitch-line: rgba(255, 255, 255, 0.5);

  /* Semantik: gut/schlecht fürs eigene Team - bewusst getrennt von der Marken-Akzentfarbe */
  --tone-positiv: #46d18b;
  --tone-positiv-soft: rgba(70, 209, 139, 0.14);
  --tone-negativ: #ff6f61;
  --tone-negativ-soft: rgba(255, 111, 97, 0.14);
  --tone-neutral: #7aa7ff;
  --tone-neutral-soft: rgba(122, 167, 255, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header - eine schmale, sticky Zeile: Logo, Navigation und Suche nebeneinander */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.site-header__row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
@media (min-width: 900px) {
  .site-header__row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
  }
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.brand__mark {
  display: inline-flex;
  flex-shrink: 0;
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.brand__name-accent {
  color: var(--accent);
}
.tagline {
  display: inline-block;
  margin: 0 0 10px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 480px) {
  .tagline { font-size: 10.5px; padding: 5px 11px; letter-spacing: 0.02em; }
}

/* Suche */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 5px 5px 16px;
  flex-shrink: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
@media (max-width: 899px) {
  .search-bar { max-width: 480px; }
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.search-bar__icon {
  color: var(--text-muted);
  flex-shrink: 0;
}
.search-bar__input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 7px 0;
}
.search-bar__input::placeholder {
  color: var(--text-muted);
}
.search-bar__submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
.search-bar__submit:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(230, 57, 70, 0.35);
}
.search-bar__submit:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Navigation - lebt jetzt in der Header-Zeile statt in einem eigenen Balken */
.tabbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 22px;
}
@media (min-width: 900px) {
  .tabbar { justify-content: flex-start; }
}
.tab {
  display: inline-block;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
  border-bottom: 2.5px solid transparent;
}
.tab:hover { color: var(--text); }
.tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Handy/Tablet: Kopf auf zwei schmale Zeilen (Logo + Suche, darunter die
   Navigation in einer Zeile) und nicht mitlaufend - so bleibt der Platz fuer
   die Meldungen. */
@media (max-width: 899px) {
  .site-header { position: static; padding: 10px 0 8px; }
  .site-header__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 12px;
  }
  .brand { grid-column: 1; grid-row: 1; gap: 8px; }
  .brand__mark svg { width: 34px; height: 29px; }
  .brand__name { font-size: 21px; }
  .search-bar { grid-column: 2; grid-row: 1; max-width: none; justify-self: end; width: 100%; }
  .tabbar {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabbar::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; font-size: 10px; letter-spacing: 0; padding: 5px 0 4px; }
  .tabbar { gap: 0 10px; }
}
@media (max-width: 560px) {
  .search-bar__submit-label { display: none; }
  .search-bar__submit { padding: 9px 11px; }
  .page { padding-top: 22px; }
  .page-title { font-size: 30px; }
  .page-subtitle { margin-bottom: 20px; }
}

/* Page chrome */
.page { padding: 32px 20px 64px; }
.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: balance;
  margin: 0 0 6px;
}
.page-subtitle {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 15px;
}

.empty-state {
  color: var(--text-muted);
  font-size: 14.5px;
  padding: 16px 0;
}

/* News feed */
.news-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.news-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.news-card__crest {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.news-card {
  --tone: var(--tone-neutral);
  --tone-soft: var(--tone-neutral-soft);
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--tone);
  border-radius: 4px 10px 10px 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Trikot des betroffenen Spielers: steht neben Name und Zeitrahmen und liegt
   nie ueber dem Text (frueher ein Wasserzeichen, das auf dem Handy den Fliesstext
   ueberdeckt hat). */
.news-card__lead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.news-card__lead-text { min-width: 0; }
.news-card__lead .news-card__player { margin-top: 0; }
.news-card__jersey {
  flex-shrink: 0;
  width: 58px;
  opacity: 0.95;
  pointer-events: none;
}
.news-card__jersey svg { width: 100%; height: auto; display: block; }
.news-card__content {
  position: relative;
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
}
.news-card--positiv { --tone: var(--tone-positiv); --tone-soft: var(--tone-positiv-soft); }
.news-card--negativ { --tone: var(--tone-negativ); --tone-soft: var(--tone-negativ-soft); }
.news-card--neutral { --tone: var(--tone-neutral); --tone-soft: var(--tone-neutral-soft); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.tag--impact {
  background: var(--tone-soft);
  color: var(--tone);
}
.tag--action {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.news-card__player {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin: 12px 0 0;
}
/* Zeitfenster: "wann ist er zurueck" ist beim Ueberfliegen die zweite
   Information nach dem Namen - deshalb direkt darunter, monospace, ruhig. */
.news-card__timeline {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--tone);
}

.news-card__hint {
  margin: 10px 0 14px;
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--tone-soft);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
}
/* Der Vertreter ist immer eine Chance - deshalb bewusst gruen, auch auf
   einer roten Ausfall-Karte: schlechte Nachricht fuer den Besitzer,
   Kaufsignal fuer alle anderen. */
.news-card__replacement {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: -6px 0 14px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px dashed var(--tone-positiv);
  background: var(--tone-positiv-soft);
}
.news-card__replacement-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tone-positiv);
}
.news-card__replacement-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.news-card__replacement-caveat {
  flex-basis: 100%;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  font-style: italic;
}
.news-card__replacement-caveat--checked {
  color: var(--accent);
  font-style: normal;
}

.news-card__headline {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  margin: 0 0 6px;
  color: var(--text);
  text-wrap: balance;
}
.news-card__summary {
  margin: 0 0 14px;
  max-width: 65ch;
  font-size: 14.5px;
  color: var(--text-muted);
}
.news-card__meta { margin-top: auto; }
.news-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 13.5px;
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
}
.badge--club { background: var(--border); color: var(--text); }

.source-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}
.source-link:hover { color: var(--accent); text-decoration-color: var(--accent); }
.source-link--also { font-size: 12.5px; }

.timestamp {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.timestamp--source { margin-left: 0; }

/* Pressekonferenzen */
.presser-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 16px;
}
.presser-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}
.presser-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.presser-card__video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 14px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.presser-card__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.presser-card__video-load {
  position: absolute;
  inset: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: #0d1117;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.presser-card__video-load small {
  padding: 0 16px;
  font-weight: 400;
  font-size: 12px;
  text-align: center;
  opacity: 0.7;
}
.presser-card__video-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 22px;
  transition: transform 0.15s;
}
.presser-card__video-load:hover .presser-card__video-play,
.presser-card__video-load:focus-visible .presser-card__video-play {
  transform: scale(1.08);
}
.presser-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 0.01em;
  margin: 0 0 8px;
}
.presser-card__summary {
  margin: 0;
  max-width: 65ch;
  color: var(--text-muted);
}
.presser-card__label {
  margin: 14px 0 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.presser-card__list {
  margin: 0;
  padding-left: 18px;
  max-width: 65ch;
}
.presser-card__source {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
}

/* Aufstellungen */

.crest-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}
.crest-btn {
  width: 46px;
  height: 46px;
  padding: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.crest-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.crest-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.crest-btn img { width: 100%; height: 100%; object-fit: contain; }
.crest-btn__fallback {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Empfehlungs-Filter unter der Wappenleiste */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -10px 0 26px;
}
.chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip--active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* "Mehr laden" unter der Meldungsliste */
.load-more-wrap { text-align: center; margin: 28px 0 0; }
.load-more {
  display: inline-block;
  padding: 11px 28px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.load-more:hover,
.load-more:focus-visible { background: var(--accent); color: var(--accent-ink); }
.load-more.is-loading { opacity: 0.6; pointer-events: none; }

.lineup-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.lineup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  scroll-margin-top: 74px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.lineup-card--active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.lineup-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.matchday {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.lineup-card__fixture {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.01em;
  margin: 0 0 14px;
  flex-wrap: wrap;
}
.fixture-name--muted { color: var(--text-muted); font-weight: 500; }
.crest-sm { width: 22px; height: 22px; object-fit: contain; }
.crest-sm--muted { opacity: 0.7; }
.vs { color: var(--text-muted); font-weight: 400; font-size: 14px; }

/* Platz-Grafik */
.pitch {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 8px;
  min-height: 260px;
  border-radius: 10px;
  border: 2px solid var(--pitch-line);
  background-image: repeating-linear-gradient(0deg, var(--pitch-a) 0 36px, var(--pitch-b) 36px 72px);
  margin-bottom: 12px;
}
.pitch::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 74px;
  height: 74px;
  border: 1.5px solid var(--pitch-line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.pitch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1.5px solid var(--pitch-line);
}
.pitch-row {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-evenly;
  gap: 6px;
  min-width: 0;
}
.pitch-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 74px;
}
.pitch-player__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid #fff;
  margin-bottom: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.pitch-player__label {
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.pitch--pending {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}
.pitch__pending-label {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 20px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
}

.lineup-card__formation {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.lineup-card__eleven {
  margin: 0 0 8px;
  font-size: 14.5px;
  line-height: 1.6;
}
.lineup-card__notes {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}

/* Meldungen (z.B. nach Formular-Absenden) */
.messages {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.message {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid transparent;
}
.message--success {
  color: var(--tone-positiv);
  background: var(--tone-positiv-soft);
  border-color: var(--tone-positiv);
}
.message--error {
  color: var(--tone-negativ);
  background: var(--tone-negativ-soft);
  border-color: var(--tone-negativ);
}

/* Community-Elf */
.crest-btn--active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.community-club { scroll-margin-top: 74px; }

/* Trikot-Icon je Spieler - solange keine Bildrechte an echten Spielerfotos
   bestehen, steht diese SVG-Rueckansicht (newsroom/jersey.py) stellvertretend
   fuer jeden Spieler. */
.token-avatar {
  display: flex;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.token-avatar svg { width: 100%; height: 100%; display: block; }

.community-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}
@media (max-width: 760px) {
  .community-grid { grid-template-columns: 1fr; }
}

.community-form__hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.community-form__submit {
  margin-top: 16px;
  width: 100%;
  justify-content: center;
}
.community-form__warning {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--tone-negativ);
}

/* Spielfeld-Baukasten */
.pitch-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.pitch-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.pitch-panel__hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
}
.formation-select {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  cursor: pointer;
}
.formation-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.pitch--builder { min-height: 480px; padding: 26px 8px 30px; gap: 22px; }

.pitch-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 64px;
  min-width: 0;
  flex-shrink: 1;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
}
@media (max-width: 480px) {
  .pitch-slot { width: 48px; }
  .pitch-slot__dot { width: 34px; height: 42px; }
  .pitch-slot__label { font-size: 10px; max-width: 48px; }
}
/* Trikot-"Karte" statt Kreis - wie eine kleine Sammelkarte: Seitenverhaeltnis
   4:5 passt zur Trikot-Silhouette (240x300), damit nichts gestaucht oder mit
   leeren Raendern angezeigt wird. Die Akzentfarbe (--accent, je Verein per
   player_accent gesetzt) faerbt den Glow im Hintergrund ein. */
.pitch-slot__dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 57px;
  border-radius: 10px;
  border: 2px dashed rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.pitch-slot__dot svg { width: 100%; height: 100%; display: block; }
.pitch-slot__remove {
  display: none;
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--tone-negativ);
  color: #fff;
  border: 1.5px solid var(--bg);
  font-size: 11px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
}
.pitch-slot--filled .pitch-slot__dot {
  border: 1.5px solid color-mix(in srgb, var(--accent, #fff) 55%, transparent);
  background: radial-gradient(120% 100% at 50% 18%,
    color-mix(in srgb, var(--accent, #666) 45%, var(--surface-raised)) 0%,
    var(--surface-raised) 72%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.pitch-slot--filled:hover .pitch-slot__dot {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
}
.pitch-slot--filled .pitch-slot__remove { display: flex; }
.pitch-slot--dragover .pitch-slot__dot { border-color: var(--accent); transform: scale(1.1); }
.pitch-slot--armed-target .pitch-slot__dot { border-color: var(--accent); }
.pitch-slot__label {
  font-size: 10.5px;
  line-height: 1.2;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  max-width: 66px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pitch-slot--empty .pitch-slot__label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
}

/* Kader-Liste */
.squad-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  max-height: 460px;
  overflow-y: auto;
}
.squad-group { margin-bottom: 16px; }
.squad-group__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  margin: 0 0 8px;
  color: var(--text-muted);
}
.squad-token {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: grab;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
}
.squad-token:hover { background: var(--surface-raised); }
.squad-token.is-armed { border-color: var(--accent); background: var(--accent-soft); }
.squad-token.is-used { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.squad-token .token-avatar { width: 32px; height: 32px; }
.squad-token__name { font-size: 13px; }
.squad-token__number { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

/* Veroeffentlichte Aufstellung: groessere, ruhigere Praesentation als der
   kompakte Baukasten - da steht ihr keine Kader-Liste im Weg, also darf sie
   den ganzen Kartenplatz nutzen. */
.pitch--static .pitch-slot { cursor: default; }
.pitch--static {
  min-height: 500px;
  padding: 34px 10px 40px;
  gap: 30px;
}
.pitch--static .pitch-slot { width: 78px; }
.pitch--static .pitch-slot__dot {
  width: 58px;
  height: 72px;
  border-radius: 12px;
}
.pitch--static .pitch-slot__label {
  font-size: 14px;
  max-width: 78px;
  margin-top: 2px;
}
@media (max-width: 560px) {
  .pitch--static { padding: 26px 4px 32px; gap: 20px; min-height: 420px; }
  .pitch--static .pitch-slot { width: 58px; }
  .pitch--static .pitch-slot__dot { width: 42px; height: 52px; }
  .pitch--static .pitch-slot__label { font-size: 11.5px; max-width: 58px; }
}

.draft-flag {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tone-neutral);
  background: var(--tone-neutral-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.edit-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}
.edit-link:hover { background: var(--accent-soft); }

/* Redaktions-Editor */
.editor-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
}
.editor-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.editor-field--wide { flex: 1; min-width: 260px; }
.editor-field__label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.editor-textarea {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  resize: vertical;
}
.editor-textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.formation-results {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.formation-results strong { color: var(--text); }

.community-results__count {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.result-group { margin-bottom: 18px; }
.result-group__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  margin: 0 0 8px;
}
.result-row {
  display: grid;
  grid-template-columns: 26px minmax(75px, 38%) 1fr 38px;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.result-row__avatar {
  display: flex;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.result-row__avatar svg { width: 100%; height: 100%; display: block; }
.result-row__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}
.result-row--elf .result-row__name { color: var(--text); font-weight: 600; }
.result-row__bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-raised);
  overflow: hidden;
}
.result-row__bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--tone-neutral);
}
.result-row--elf .result-row__bar span { background: var(--accent); }
.result-row__pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.empty-state--sm { font-size: 13px; margin: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 40px;
}
.site-footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.legal-links {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 13px;
}
.legal-links a { color: var(--text-muted); }
.legal-links a:hover { color: var(--text); }

/* KI-Kennzeichnung auf News-Karten (Art. 50 KI-Verordnung) */
.ai-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}

/* Impressum & Datenschutz */
.legal {
  max-width: 70ch;
}
.legal h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 36px 0 8px;
}
.legal h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 22px 0 6px;
}
.legal p, .legal li {
  color: var(--text-muted);
  font-size: 15px;
}
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; }
.legal li { margin-bottom: 4px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--text); }
.legal address { font-style: normal; color: var(--text); line-height: 1.6; margin-bottom: 12px; }
.legal-placeholder {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------------------
   Frei verschiebbares Spielfeld (nur Aufstellungen): Spieler sind absolut
   positionierte Trikot-Karten (left/top in % der Feldgroesse) statt eines
   festen Zeilenrasters - siehe pitch-layout.js. Die Community-Elf benutzt
   weiter das Slot-Raster oben (.pitch-slot).
   Die Breite folgt der verfuegbaren Hoehe (--pitch-chrome = alles Drumherum),
   damit Wappenleiste und Spielfeld zusammen auf einen Bildschirm passen; das
   Seitenverhaeltnis bleibt dabei fest.
   --------------------------------------------------------------------------- */
.pitch--free {
  display: block;
  padding: 0;
  gap: 0;
  width: min(100%, 760px, calc((100vh - var(--pitch-chrome, 330px)) * 5 / 6));
  min-width: 280px;
  aspect-ratio: 5 / 6;
  margin: 0 auto 10px;
  overflow: hidden;
}
@media (max-width: 560px) {
  /* Schmales Handy-Feld: hoeher, damit die fuenf Reihen Platz haben. */
  .pitch--free { width: 100%; min-width: 0; aspect-ratio: 4 / 5; }
}
.pitch--free:not(.pitch--readonly) { cursor: crosshair; }
.pitch--free.pitch--dragover { box-shadow: inset 0 0 0 3px var(--accent-soft); }

/* Karte = Trikot + Name darunter. Die Breite in % der Feldbreite, dadurch
   wachsen Trikots mit dem Feld. */
.pitch-card {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(46px, 14%, 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.pitch-card.is-settling { transition: left 0.18s ease, top 0.18s ease; }
.pitch-card--drag { cursor: grabbing; z-index: 6; }
.pitch-card__jersey {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid color-mix(in srgb, var(--accent, #fff) 55%, transparent);
  background: radial-gradient(120% 100% at 50% 18%,
    color-mix(in srgb, var(--accent, #666) 45%, var(--surface-raised)) 0%,
    var(--surface-raised) 72%);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pitch-card__jersey svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.pitch-card:hover .pitch-card__jersey {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
}
.pitch-card--drag .pitch-card__jersey {
  transform: scale(1.06);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.55);
}
/* Waehrend des Ziehens ueber einer anderen Karte: Warnrand, beim Loslassen
   rueckt die Karte zur naechsten freien Stelle. */
.pitch-card.is-blocked .pitch-card__jersey { outline: 2.5px solid var(--tone-negativ); outline-offset: 2px; }

/* Name als kleines Schild unter dem Trikot. */
.pitch-card__name {
  margin-top: 4px;
  padding: 1px 8px;
  max-width: 130%;
  border-radius: 999px;
  background: rgba(13, 17, 23, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.pitch-card__remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--tone-negativ);
  color: #fff;
  border: 1.5px solid var(--bg);
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
}

.pitch-reset {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
}
.pitch-reset:hover { color: var(--text); border-color: var(--text-muted); }

/* Hinweistext, solange noch niemand auf dem Platz steht - echtes Element,
   nicht ::before/::after (die sind schon von Mittelkreis/Mittellinie belegt). */
.pitch-empty-hint {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  max-width: 70%;
  margin: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.5);
}
.pitch--empty .pitch-empty-hint { display: block; }

/* Kompaktes Seitenlayout (Aufstellungen): Titel, Wappenleiste, Spielansetzung
   und Spielfeld sollen zusammen auf einen Bildschirm passen. --pitch-chrome
   ist die Hoehe alles Drumherums; das Feld bekommt den Rest (siehe .pitch--free). */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 16px;
  margin-bottom: 10px;
}
.page-head .page-title { font-size: 26px; margin: 0; }
.page-head .page-subtitle { margin: 0; font-size: 13.5px; }
.page--compact {
  --pitch-chrome: 262px;
  padding-top: 14px;
  padding-bottom: 24px;
}
.page--compact .crest-picker { gap: 6px; margin-bottom: 10px; }
.page--compact .crest-btn { width: 38px; height: 38px; padding: 5px; }
.page--compact .lineup-card__fixture { font-size: 17px; margin-bottom: 8px; }
.page--compact .pitch-panel { padding: 10px 12px; }
.page--compact .pitch-panel__head { margin-bottom: 6px; }
.page--compact .community-grid { margin-bottom: 12px; gap: 16px; }
.page--compact .squad-panel { max-height: calc(100vh - var(--pitch-chrome)); }
/* Im Editor sitzt ueber dem Feld noch die Zeile mit Hinweis und Formationswahl. */
.page--compact .community-grid .pitch--free { --pitch-chrome: 296px; }

/* Passwortseite der Freunde-Vorschau */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.gate__box {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  text-align: center;
}
.gate__box .brand__name { margin: 0; }
.gate__hint { color: var(--text-muted); margin: 6px 0 18px; }
.gate__input {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
}
.gate__input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.gate__submit { width: 100%; justify-content: center; }

/* Fehlerseiten (404, 500, abgelaufenes Formular) */
.error-page { text-align: center; padding: 40px 0 20px; }
.error-page__code {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.error-page .page-subtitle { max-width: 46ch; margin: 0 auto 26px; }

/* Handy: Wappen- und Empfehlungs-Filter als je eine wischbare Zeile (steht am
   Dateiende, damit es die Grundregeln oben sicher uebersteuert). */
@media (max-width: 560px) {
  /* Wappen und Empfehlungs-Filter: je eine wischbare Zeile statt mehrerer
     Zeilen, damit die erste Meldung ohne Scrollen sichtbar bleibt. Der
     Verlauf am rechten Rand zeigt, dass es weitergeht. */
  .crest-picker,
  .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-left: -20px;
    margin-right: -20px;
    padding: 3px 20px 6px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
    mask-image: linear-gradient(to right, #000 88%, transparent);
  }
  .crest-picker::-webkit-scrollbar,
  .chip-row::-webkit-scrollbar { display: none; }
  .crest-picker { margin-bottom: 14px; }
  .chip-row { margin-top: 0; margin-bottom: 20px; }
  .crest-btn { flex: 0 0 auto; width: 42px; height: 42px; padding: 5px; }
  .chip { flex: 0 0 auto; white-space: nowrap; }
}

/* Handy: kleinere Trikots auf dem Spielfeld, damit fuenf in einer Reihe
   nebeneinander passen und die oberste/unterste Reihe noch ganz aufs Feld
   passt - sonst schiebt die Entzerrung (pitch-layout.js) einzelne Spieler aus
   ihrer Reihe. Steht am Dateiende, damit es die Grundregeln uebersteuert. */
@media (max-width: 560px) {
  .pitch--free { aspect-ratio: 3 / 4; }
  .pitch-card { width: 11.5%; }
  .pitch-card__name { margin-top: 3px; padding: 0 4px; font-size: 9.5px; max-width: 150%; }
}
