:root {
  --navy: #0a1530;
  --cyan: #19b5d6;
  --orange: #f26a1b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--navy);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Das Bild enthält Name und Claim oben und wird auf Breite eingepasst, damit nichts abgeschnitten wird. Inhalte liegen unten auf einem Verlauf. */
.stage {
  position: relative;
  width: 100%;
  max-width: 40rem;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(to bottom, rgba(10, 21, 48, 0) 70%, rgba(10, 21, 48, 0.9) 95%, var(--navy) 100%),
    url("/static/hero.jpg") center top / 100% auto no-repeat;
}

.tiles {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.tile {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.5rem;
  background: rgba(10, 21, 48, 0.6);
  border: 1px solid rgba(25, 181, 214, 0.5);
  border-radius: 1rem;
  backdrop-filter: blur(3px);
  color: #fff;
  font-size: clamp(1rem, 4.6vw, 1.2rem);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.tile .icon { font-size: 3rem; line-height: 1; }

/* Mit der zusätzlichen V-Admin-Kachel (5 Kacheln): drei pro Reihe, damit nichts scrollen muss */
.tiles--many {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.tiles--many .tile {
  gap: 0.35rem;
  font-size: clamp(0.8rem, 3.6vw, 1rem);
}

.tiles--many .tile .icon { font-size: 2rem; }

footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

.whoami { color: #8e97ad; flex: none; text-decoration: none; }
a.whoami:hover, a.whoami:focus-visible { color: #fff; text-decoration: underline; }

.form-ok {
  margin: 0;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  color: #7fe3a1;
  background: rgba(127, 227, 161, 0.1);
  border-radius: 0.6rem;
}

.status {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--cyan);
}

footer form { flex: none; }

.form-error {
  margin: 0;
  font-size: 0.85rem;
  color: #ff8a7a;
}

.admin {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.admin-card {
  width: 100%;
  max-width: 26rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(25, 181, 214, 0.35);
  border-radius: 1rem;
}

.admin-card h1 { margin: 0 0 1.25rem; font-size: 1.5rem; }
.admin-card h1 span { color: var(--cyan); font-weight: 400; }
.admin-note { color: #d5dbe8; line-height: 1.5; }

.login-form,
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.login-form input,
.form-stack input,
.form-stack select {
  width: 100%;
  padding: 0.8rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: #fff;
  background: rgba(10, 21, 48, 0.6);
  border: 1px solid rgba(25, 181, 214, 0.5);
  border-radius: 0.75rem;
  backdrop-filter: blur(3px);
}

.form-stack select option { color: #000; }

.login-form input::placeholder,
.form-stack input::placeholder { color: #8e97ad; }

.login-form input:focus-visible,
.form-stack input:focus-visible,
.form-stack select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

.form-stack { gap: 1rem; }

.form-stack label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #d5dbe8;
}

.form-stack small { color: #8e97ad; }

/* Listen- und Formularseiten ohne Titelbild */
.page { min-height: 100vh; }

.column {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem;
}

.column h1 { margin: 0.5rem 0 1rem; font-size: 1.6rem; }
.column h1 span { display: block; margin-top: 0.15rem; font-size: 0.95rem; font-weight: 400; color: var(--cyan); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.back {
  padding: 0.5rem 0.25rem;
  color: #8e97ad;
  text-decoration: none;
  font-size: 0.9rem;
}

.back:hover, .back:focus-visible { color: #fff; }

.small-button {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  color: var(--cyan);
  text-decoration: none;
  border: 1px solid rgba(25, 181, 214, 0.5);
  border-radius: 999px;
}

.small-button:hover, .small-button:focus-visible { background: rgba(25, 181, 214, 0.12); }

.primary-button {
  padding: 0.85rem 1rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--orange);
  border: 0;
  border-radius: 0.75rem;
  cursor: pointer;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(25, 181, 214, 0.35);
  border-radius: 0.75rem;
}

.card span { font-size: 0.9rem; color: #8e97ad; }

.card-link {
  position: relative;
  color: inherit;
  text-decoration: none;
}

.card-link::after {
  content: "›";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--cyan);
}

.card-link:hover, .card-link:focus-visible { background: rgba(25, 181, 214, 0.1); }

.count { margin: 0 0 0.6rem; font-size: 0.9rem; color: #8e97ad; }

.hint { margin: 0; font-size: 0.85rem; line-height: 1.4; color: #8e97ad; }

.column h2 { margin: 1.2rem 0 0.6rem; font-size: 1rem; color: #d5dbe8; }
.column h2 small { margin-left: 0.3rem; font-size: 0.85rem; font-weight: 400; color: #8e97ad; }

.inline-link { color: var(--cyan); }

/* Auswahllisten mit Häkchen (Zuordnung Coach <-> Team) */
.check-list { display: grid; gap: 0.6rem; }

.check,
.form-stack .check {
  flex-direction: row;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(25, 181, 214, 0.35);
  border-radius: 0.75rem;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.check { display: flex; }

.check input { width: 1.35rem; height: 1.35rem; flex: none; accent-color: var(--orange); }
.check small { margin-left: 0.4rem; font-size: 0.85rem; color: #8e97ad; }

/* Spielerzeile: oben Name und TNA, unten Trikots und Statistik */
.player-card { gap: 0.55rem; }
.player-card::after { display: none; }

.player-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.card .player-top { font-size: 1rem; color: #fff; }
.card .player-bottom { font-size: 1rem; }
.card .player-name { font-size: 1rem; color: #fff; }
.card .liga { margin-left: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--cyan); }

.player-top strong { min-width: 0; overflow-wrap: anywhere; }
.tna { font-size: 0.9rem; font-variant-numeric: tabular-nums; color: #8e97ad; }

.player-bottom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.player-bottom .stat { font-size: 0.8rem; color: #8e97ad; white-space: nowrap; }
.player-bottom .stat:first-of-type { margin-left: 0.4rem; }

.jersey { width: 2.1rem; height: 2.3rem; flex: none; }
.jersey text { font: 700 15px system-ui, sans-serif; }
.jersey-light path { fill: #fff; stroke: #c9ced9; stroke-width: 1; }
.jersey-light text { fill: #0a1530; }
.jersey-dark path { fill: #111; stroke: #8e97ad; stroke-width: 1; }
.jersey-dark text { fill: #fff; }

.empty { color: #8e97ad; line-height: 1.5; }

.subtle-button {
  align-self: flex-end;
  padding: 0.5rem 0.25rem;
  font: inherit;
  font-size: 0.85rem;
  color: #8e97ad;
  background: none;
  border: 0;
  cursor: pointer;
}

.subtle-button:hover,
.subtle-button:focus-visible {
  color: #fff;
  text-decoration: underline;
}

/* Team-Bereiche: auf dem Handy nebeneinander, aktiver Bereich klar markiert. */
.team-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 1.2rem;
  border-bottom: 1px solid rgba(25, 181, 214, 0.35);
}

.team-tabs a {
  flex: 1;
  min-width: 0;
  padding: 0.8rem 0.4rem;
  border-bottom: 3px solid transparent;
  color: #8e97ad;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.team-tabs a[aria-current="page"] {
  border-bottom-color: var(--cyan);
  color: #fff;
  background: rgba(25, 181, 214, 0.1);
  border-radius: 0.5rem 0.5rem 0 0;
}

.team-tabs a:hover { color: #fff; background: rgba(25, 181, 214, 0.08); }
.team-tabs a:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }

.game-card { gap: 0.45rem; }
.game-teams { overflow-wrap: anywhere; }
.game-teams .hint { display: inline-block; min-width: 2.8rem; }
.card .game-note { color: #ffd09c; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.8rem; }
.section-heading h2 { margin: 0; }
.league-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.league-entry { display: flex; flex-direction: column; gap: 0.8rem; min-width: 0; margin: 0; padding: 1rem; border: 1px solid rgba(25, 181, 214, 0.35); border-radius: 0.75rem; }
.league-entry legend { padding: 0 0.35rem; color: var(--cyan); font-size: 0.9rem; }
.form-stack textarea { width: 100%; padding: 0.8rem 1rem; font: inherit; font-size: 1rem; color: #fff; background: rgba(10, 21, 48, 0.6); border: 1px solid rgba(25, 181, 214, 0.5); border-radius: 0.75rem; resize: vertical; }
.form-stack textarea:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
button.small-button { font: inherit; background: transparent; cursor: pointer; }

.league-standard { margin-bottom: 0.8rem; }
.league-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.5rem 1rem; margin: 0.8rem 0 0; font-size: 0.9rem; }
.league-facts dt { color: #8e97ad; }
.league-facts dd { margin: 0; overflow-wrap: anywhere; }
.form-stack input[readonly] { color: #8e97ad; }

.input-with-help { display: flex; align-items: center; gap: 0.5rem; }
.input-with-help input { flex: 1; min-width: 0; }
.input-with-help button { flex: none; min-height: 2.75rem; }
.dbb-help { padding: 1rem; border: 1px solid rgba(25, 181, 214, 0.35); border-radius: 0.75rem; background: rgba(25, 181, 214, 0.06); font-size: 0.9rem; line-height: 1.55; }
.dbb-help h3 { margin: 0 0 0.75rem; font-size: 1rem; }
.dbb-help ol { margin: 0; padding-left: 1.3rem; }
.dbb-help li + li { margin-top: 0.65rem; }
.dbb-help code { overflow-wrap: anywhere; color: var(--cyan); }

/* Spielkarten: klare Zeilen nach Joachims Vorlage. */
.game-cards { gap: 0.8rem; }
.card.game-card { display: block; padding: 0.85rem 1rem; border: 2px solid rgba(25, 181, 214, 0.4); border-radius: 0.8rem; background: linear-gradient(120deg, rgba(25, 181, 214, 0.035), rgba(255, 255, 255, 0.02)); }
.card.game-card--win { border-color: #52c982; background: linear-gradient(120deg, rgba(52, 168, 99, 0.16), rgba(52, 168, 99, 0.07)); }
.card.game-card--loss { border-color: #ff6b78; background: linear-gradient(120deg, rgba(206, 63, 83, 0.16), rgba(206, 63, 83, 0.07)); }
.game-icon { flex: none; width: 1.2rem; height: 1.2rem; vertical-align: middle; }
.game-card-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.55rem; padding-bottom: 0.75rem; border-bottom: 1px solid rgba(174, 184, 211, 0.22); }
.card .game-badge { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.6rem; border: 1px solid; border-radius: 999px; font-size: 0.78rem; font-weight: 650; line-height: 1.2; }
.card .game-badge--confirmed { color: #36ded0; border-color: #219f99; background: rgba(0, 181, 166, 0.12); }
.card .game-badge--pending { color: #ffbf3d; border-color: #c48a14; background: rgba(255, 175, 20, 0.12); }
.card .game-badge--local { color: #b8c3da; border-color: #65718d; background: rgba(160, 173, 201, 0.08); }
.game-date { margin-left: auto; font-size: 0.85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.game-matchup { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.8rem; padding: 0.95rem 0; }
.game-team-list { display: grid; gap: 0.5rem; min-width: 0; }
.game-team-row { display: grid; grid-template-columns: 2.8rem minmax(0, 1fr); gap: 0.7rem; align-items: center; }
.card .game-side { padding: 0.25rem 0.35rem; border-radius: 0.4rem; color: #b3bdd3; background: rgba(160, 173, 201, 0.18); font-size: 0.78rem; font-weight: 650; text-align: center; }
.card .game-side--own { color: #4de0f4; background: rgba(25, 181, 214, 0.22); }
.card .game-team-name { color: #f1f3fb; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.game-team-row--own .game-team-name { font-weight: 750; }
.game-score-panel { border-left: 1px solid rgba(174, 184, 211, 0.3); padding-left: 0.8rem; text-align: right; min-width: 4.8rem; }
.game-result { color: var(--cyan); font-size: clamp(2rem, 7vw, 3rem); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; width: max-content; min-width: 7ch; max-width: none; display: block; white-space: nowrap; overflow-wrap: normal; word-break: normal; letter-spacing: -0.04em; }
.card .game-no-result { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; color: #8896b4; text-align: center; }
.game-no-result .game-icon { width: 1.65rem; height: 1.65rem; }
.card .game-no-result span { font-size: 0.75rem; line-height: 1.3; }
.game-venue-row, .game-meta-row { display: flex; align-items: center; gap: 0.65rem; padding: 0.65rem 0; border-top: 1px solid rgba(174, 184, 211, 0.22); color: #b3bdd3; }
.game-info-text { display: flex; align-items: center; gap: 0.65rem; min-width: 0; flex: 1; }
.game-info-text span, .game-meta-row span { color: #b3bdd3; font-size: 0.85rem; overflow-wrap: anywhere; }
.card .game-location-icon { flex: none; color: var(--cyan); }
.game-location-icon .game-icon { width: 1.55rem; height: 1.55rem; }
.game-extra { display: grid; gap: 0.4rem; padding: 0.7rem 0; border-top: 1px solid rgba(174, 184, 211, 0.22); font-size: 0.85rem; }
.game-extra p { margin: 0; }
footer.game-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.65rem; flex-wrap: wrap; margin: 0; padding-top: 0.65rem; border-top: 1px solid rgba(174, 184, 211, 0.22); }
.game-edit-button { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.55rem 0.7rem; border: 2px solid var(--cyan); border-radius: 0.65rem; color: #34d9f2; font-size: 0.85rem; font-weight: 700; text-decoration: none; }
.game-dbb-link { color: #34d9f2; font-size: 0.8rem; text-underline-offset: 0.2rem; margin-left: auto; }
.game-edit-button:hover, .game-edit-button:focus-visible { background: rgba(25, 181, 214, 0.12); }
@media (max-width: 420px) {
  .card.game-card { padding: 0.75rem; }
  .game-date { font-size: 0.8rem; }
  .game-matchup { gap: 0.6rem; }
  .game-team-row { grid-template-columns: 2.35rem minmax(0, 1fr); gap: 0.5rem; }
  .card .game-team-name { font-size: 0.9rem; }
  .game-score-panel { min-width: 4.5rem; padding-left: 0.6rem; }
  .game-result { font-size: 2rem; }
  .game-edit-button { padding: 0.5rem; font-size: 0.78rem; }
  .game-dbb-link { font-size: 0.75rem; }
}

.game-delete-section { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid rgba(239, 119, 119, 0.3); }
.danger-button { display: inline-block; padding: 0.8rem 1rem; border: 1px solid #ef7777; border-radius: 0.7rem; color: #ffaaaa; background: rgba(206, 63, 63, 0.14); font: inherit; font-weight: 650; text-align: center; text-decoration: none; cursor: pointer; }
.danger-button:hover, .danger-button:focus-visible { background: rgba(206, 63, 63, 0.28); }

.form-stack .team-competition-check { display: flex; align-items: center; gap: .75rem; }
.form-stack .team-competition-check input { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; accent-color: #00c6e8; }

/* Sonstiges und Mitgliederverwaltung */
.other-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; padding: 0; list-style: none; }
.other-buttons .tile { font-size: 1rem; overflow-wrap: anywhere; }
.member-roles { min-width: 0; margin: 0; padding: 0; border: 0; }
.member-roles legend { margin-bottom: .6rem; font-size: .95rem; color: #d5dbe8; }
#member-list [hidden] { display: none; }

.member-card span { overflow-wrap: anywhere; }

.member-dashboard { margin-bottom: 1.25rem; }
.member-stats { display: grid; gap: .5rem; margin: 0 0 .5rem; }
.member-stats--players { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.member-stats--coaches { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.member-stat { min-width: 0; padding: .6rem .35rem; text-align: center; border: 1px solid rgba(25, 181, 214, .4); border-radius: .65rem; background: rgba(25, 181, 214, .06); }
.member-stat-label { display: block; font-size: .8rem; color: #d5dbe8; }
.member-stat-count { display: block; margin: .15rem 0 0; color: var(--cyan); font-size: 1.5rem; line-height: 1.2; font-weight: 750; font-variant-numeric: tabular-nums; }
@media (min-width: 600px) { .member-stats--players { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .member-stats--players .member-stat { padding-inline: .2rem; }
  .member-stats--players .member-stat-label { font-size: .75rem; }
}

.member-filter { width: 100%; font: inherit; cursor: pointer; }
.member-filter:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.member-filter[data-state="included"] { border-color: #65ce8e; background: rgba(41, 152, 83, .2); }
.member-filter[data-state="included"] .member-stat-count { color: #8ce7ac; }
.member-filter[data-state="excluded"] { border-color: #ef7777; background: rgba(185, 55, 55, .2); }
.member-filter[data-state="excluded"] .member-stat-count { color: #ffaaaa; }

.member-dashboard-reset { margin: .35rem 0 .6rem; background: transparent; font: inherit; font-size: .8rem; cursor: pointer; }
