@font-face {
  font-family: 'Barlow Condensed';
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Barlow Condensed';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2');
}

/* TuS Roisdorf Alte Herren – Spielerverwaltung */

:root {
  /* Vereinsfarben aus dem Wappen: Schwarz, Gelb, Weiß */
  --club: #141414; /* Kopfleiste */
  --club-dark: #232323; /* Navigation */
  --on-club: #ffffff;
  --accent: #ffd500; /* Wappen-Gelb: Schaltflächen, Markierungen */
  --accent-dark: #e6c000;
  --on-accent: #141414;
  --club-soft: #fdf4c4; /* helles Gelb für Flächen */
  --link: #6f5a00; /* dunkles Gold: auf Weiß gut lesbar */
  --bar: #fdeeb0; /* Balken in Ranglisten */
  --chart: #b08600; /* Säulen in Diagrammen */

  --bg: #f5f5f4;
  --surface: #ffffff;
  --surface-2: #f0f0ee;
  --text: #171717;
  --muted: #62625e;
  --border: #dededa;

  --win: #1f7a43;
  --win-soft: #dff2e5;
  --draw: #6b7280;
  --draw-soft: #e9ebee;
  --loss: #b3261e;
  --loss-soft: #fbe4e2;
  --info: #1d4f91;
  --info-soft: #e3edf9;
  --warn: #8a5a00;
  --warn-soft: #fdf0d2;

  --yellow: #f2c200;
  --red: #d32f2f;

  --radius: 12px;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 2px 8px rgb(0 0 0 / 4%);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --club: #000000;
    --club-dark: #1a1a1a;
    --club-soft: #3a3206;
    --link: #ffd500;
    --bar: #3d3400;
    --chart: #e6c000;
    --bg: #121212;
    --surface: #1c1c1c;
    --surface-2: #262626;
    --text: #ededed;
    --muted: #a3a3a3;
    --border: #343434;
    --win: #5fce88;
    --win-soft: #16351f;
    --draw: #aab1b9;
    --draw-soft: #2a2f35;
    --loss: #ff8a80;
    --loss-soft: #3d1a18;
    --info: #8ab8f5;
    --info-soft: #16263b;
    --warn: #f0c060;
    --warn-soft: #3a2c0c;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

a {
  color: var(--link);
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 0.75rem;
}

small,
.small {
  font-size: 0.85rem;
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Kopf & Navigation ---------- */

.site-header {
  background: var(--club);
  color: var(--on-club);
}

.header-inner,
.nav-inner,
.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  flex: none;
  width: auto;
  height: 44px;
}

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

.brand-text strong {
  white-space: nowrap;
}

.brand-text span {
  font-size: 0.8rem;
  opacity: 0.85;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-name {
  color: inherit;
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 44vw;
}

@media (max-width: 520px) {
  .user-name {
    max-width: 26vw;
  }

  .user-name .badge {
    display: none;
  }
}

.site-header .btn-ghost {
  color: var(--on-club);
  border-color: rgb(255 255 255 / 45%);
}

.nav {
  background: var(--club-dark);
}

.nav-inner {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-inner::-webkit-scrollbar {
  display: none;
}

.nav a {
  flex: none;
  padding: 10px 12px;
  color: rgb(255 255 255 / 80%);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
}

.nav a:hover,
.nav a.active {
  color: #fff;
  border-bottom-color: var(--accent);
}

.container {
  flex: 1;
  padding-top: 20px;
  padding-bottom: 40px;
}

.site-footer {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ---------- Bausteine ---------- */

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

.page-head p {
  margin: 4px 0 0;
}

.breadcrumb {
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.breadcrumb a {
  text-decoration: none;
}

.section-title {
  margin: 24px 0 10px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.card > h2 {
  margin-bottom: 12px;
}

.card.narrow {
  max-width: 480px;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.card-head a {
  font-size: 0.9rem;
}

.grid-2 {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.grid-2 > .card {
  margin-bottom: 0;
}

@media (min-width: 760px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.empty {
  color: var(--muted);
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  background: var(--surface-2);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-dark) 80%, var(--text));
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-danger {
  color: var(--loss);
  border-color: color-mix(in srgb, var(--loss) 45%, var(--border));
}

.btn-danger:hover {
  background: var(--loss-soft);
}

.btn-ghost {
  background: transparent;
}

.btn-small {
  min-height: 34px;
  padding: 4px 12px;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
}

.badge-role {
  background: rgb(255 255 255 / 22%);
  color: inherit;
}

.card .badge-role {
  background: var(--club-soft);
  color: var(--link);
}

.badge-win {
  background: var(--win-soft);
  color: var(--win);
}

.badge-planned {
  background: var(--info-soft);
  color: var(--info);
}

.badge-pending,
.badge-verletzt {
  background: var(--warn-soft);
  color: var(--warn);
}

.alert {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert ul {
  margin: 0;
  padding-left: 1.2rem;
}

.alert-success {
  background: var(--win-soft);
  color: var(--win);
  border-color: color-mix(in srgb, var(--win) 30%, transparent);
}

.alert-error {
  background: var(--loss-soft);
  color: var(--loss);
  border-color: color-mix(in srgb, var(--loss) 30%, transparent);
}

.alert-info {
  background: var(--info-soft);
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 30%, transparent);
}

.alert-info a {
  color: inherit;
}

.alert-link {
  text-decoration: none;
  font-weight: 600;
}

/* ---------- Kennzahlen ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 760px) {
  .tiles {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tile-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.tile-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.record-line {
  margin-top: -4px;
}

/* ---------- Formulare ---------- */

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.field > span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.field small {
  color: var(--muted);
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
input[type='number'],
input[type='date'],
input[type='time'],
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
}

input[type='checkbox'] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 560px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.form-inline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}

@media (min-width: 760px) {
  .form-inline {
    grid-template-columns: 1.2fr 1fr 1fr auto;
  }
}

.below-form {
  margin-top: 10px;
}

.card + .below-form {
  margin-top: -6px;
  margin-bottom: 16px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}

.filters .field {
  flex: 1 1 140px;
  max-width: 260px;
}

fieldset {
  min-width: 0;
  margin: 0;
}

.result-fields {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.result-fields legend {
  padding: 0 6px;
  font-weight: 700;
}

.result-fields small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.result-fields.is-off {
  opacity: 0.55;
}

.auth-card {
  max-width: 420px;
  margin: 24px auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-logo {
  align-self: center;
  width: auto;
  height: 110px;
}

.auth-card p {
  margin: 0;
}

.auth-switch {
  text-align: center;
}

.error-code {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--muted);
  line-height: 1;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px 20px;
  margin: 0;
}

.facts dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.facts dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---------- Avatare ---------- */

.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  object-fit: cover;
  background: var(--club-soft);
  color: var(--link);
  font-weight: 800;
  overflow: hidden;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

.avatar-md {
  width: 52px;
  height: 52px;
  font-size: 1rem;
}

.avatar-lg {
  width: 84px;
  height: 84px;
  font-size: 1.5rem;
}

.avatar-xl {
  width: 128px;
  height: 128px;
  font-size: 2.4rem;
}

.avatar-picker {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-picker input[type='file'] {
  max-width: 100%;
  font: inherit;
  margin-bottom: 4px;
}

.avatar-picker small {
  display: block;
  color: var(--muted);
}

/* ---------- Spieler ---------- */

.player-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .player-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 980px) {
  .player-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}

.player-card:hover {
  border-color: var(--accent-dark);
}

.player-card.is-inactive {
  opacity: 0.7;
}

.player-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.player-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.player-card-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.player-card-stats strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.profile {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.profile-body {
  flex: 1 1 260px;
  min-width: 0;
}

.profile-body h1 {
  margin-bottom: 4px;
}

.profile-nickname {
  color: var(--muted);
  font-style: italic;
}

.profile-body .facts {
  margin-top: 12px;
}

.profile-notes {
  margin: 12px 0 0;
  color: var(--muted);
  white-space: pre-line;
}

.profile-actions {
  flex-basis: 100%;
}

.player-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.player-inline small {
  display: block;
  font-weight: 400;
}

/* ---------- Spiele ---------- */

.match-list {
  display: flex;
  flex-direction: column;
}

.match-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    'date result'
    'main result';
  gap: 2px 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

.match-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.match-row:last-child {
  padding-bottom: 0;
}

.match-row:hover .match-opponent {
  color: var(--link);
}

.match-date {
  grid-area: date;
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.match-date strong {
  font-weight: 600;
}

.match-main {
  grid-area: main;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.match-opponent {
  font-weight: 700;
}

.match-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.match-result {
  grid-area: result;
}

.score {
  display: inline-block;
  min-width: 3.2em;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--draw-soft);
  color: var(--draw);
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.score-win {
  background: var(--win-soft);
  color: var(--win);
}

.score-loss {
  background: var(--loss-soft);
  color: var(--loss);
}

.scoreboard {
  text-align: center;
}

.scoreboard-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.scoreboard-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

.scoreboard-team {
  font-weight: 700;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.scoreboard-team:first-child {
  text-align: right;
}

.scoreboard-team:last-child {
  text-align: left;
}

.scoreboard-score {
  padding: 6px 14px;
  border-radius: 12px;
  background: var(--draw-soft);
  color: var(--draw);
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.scoreboard-score.score-win {
  background: var(--win-soft);
  color: var(--win);
}

.scoreboard-score.score-loss {
  background: var(--loss-soft);
  color: var(--loss);
}

.scoreboard-actions {
  justify-content: center;
  margin-top: 16px;
}

/* ---------- Aufstellung ---------- */

.lineup-summary {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--club-soft);
  color: var(--link);
  font-weight: 600;
}

.lineup-summary.is-mismatch {
  background: var(--warn-soft);
  color: var(--warn);
}

.lineup-player {
  padding: 0;
  margin-bottom: 8px;
}

.lineup-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
}

.lineup-name {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.lineup-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 14px 14px;
}

.lineup-player:not(:has([data-lineup-on]:checked)) .lineup-stats {
  display: none;
}

.lineup-player:has([data-lineup-on]:checked) {
  border-color: var(--accent-dark);
}

.lineup-cards {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  cursor: pointer;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  padding: 12px 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.cardicon {
  display: inline-block;
  width: 11px;
  height: 15px;
  border-radius: 2px;
  vertical-align: -2px;
  background: var(--yellow);
}

.cardicon-red {
  background: var(--red);
}

.cardicon-yellow-red {
  background: linear-gradient(135deg, var(--yellow) 50%, var(--red) 50%);
}

/* ---------- Tabellen & Ranglisten ---------- */

.table-wrap {
  padding: 0;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

.table th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table a {
  text-decoration: none;
  font-weight: 600;
}

.ranking {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ranking li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  margin-bottom: 3px;
  border-radius: 8px;
  /* Balken: Länge entspricht dem Wert im Verhältnis zum Spitzenreiter */
  background: linear-gradient(to right, var(--bar) var(--share, 0%), transparent var(--share, 0%));
}

.ranking li:last-child {
  margin-bottom: 0;
}

.ranking li:nth-child(-n + 3) .ranking-pos {
  display: grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  font-size: 0.85rem;
}

.ranking-pos {
  width: 1.6em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ranking-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.ranking-name:hover {
  color: var(--link);
}

.ranking-extra {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.ranking-value {
  min-width: 1.8em;
  text-align: right;
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ranking-cards {
  display: flex;
  gap: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Benutzerverwaltung ---------- */

.user-card.is-pending {
  border-color: color-mix(in srgb, var(--warn) 50%, var(--border));
}

.user-card-head p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.user-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
}

.inline-form {
  display: flex;
  gap: 8px;
}

.inline-form select,
.inline-form input {
  width: auto;
  min-width: 0;
  flex: 1 1 140px;
}

.user-card-more {
  flex-basis: 100%;
}

.user-card-more summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 6px 0;
}

.user-card-more form {
  margin-top: 8px;
}

/* ---------- Excel-Import ---------- */

.import-errors {
  margin-top: 8px;
  max-height: 320px;
  overflow-y: auto;
}

/* ---------- Formkurve ---------- */

.form-dots {
  display: inline-flex;
  gap: 4px;
  vertical-align: middle;
}

.form-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--draw-soft);
  color: var(--draw);
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
}

.form-win {
  background: var(--win-soft);
  color: var(--win);
}

.form-loss {
  background: var(--loss-soft);
  color: var(--loss);
}

.form-dot:hover {
  outline: 2px solid currentColor;
}

.form-line {
  margin: 12px 0 0;
}

/* ---------- Diagramme im Spielerprofil ---------- */

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (min-width: 560px) {
  .chart-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.chart {
  margin: 0;
}

.chart figcaption {
  font-weight: 700;
  margin-bottom: 10px;
}

.chart-plot {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 150px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 22px;
  position: relative;
}

.chart-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}

.chart-value {
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.chart-bar {
  /* Höhe im Verhältnis zum größten Wert; oben bleibt Platz für die Zahl */
  height: calc((100% - 24px) * var(--h, 0));
  width: min(44px, 70%);
  border-radius: 4px 4px 0 0;
  background: var(--chart);
}

.chart-col:hover .chart-bar {
  filter: brightness(1.12);
}

.chart-label {
  position: absolute;
  bottom: -20px;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ---------- Überschriften-Schrift ---------- */

:root {
  --font-display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
}

h1,
h2,
.brand-text strong,
.tile-value,
.scoreboard-score,
.scoreboard-team,
.score,
.ranking-value,
.chart figcaption,
.auth-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 2.1rem;
}

h2 {
  font-size: 1.45rem;
}

.brand-text strong {
  font-size: 1.3rem;
  line-height: 1;
}

.tile-value {
  font-size: 2rem;
}

.score {
  font-size: 1.15rem;
}

.scoreboard-team {
  font-size: 1.4rem;
}

.scoreboard-score {
  font-size: 2.6rem;
}

.ranking-value {
  font-size: 1.4rem;
}

.chart figcaption {
  font-size: 1.2rem;
}

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

.nav-icon {
  display: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Am Handy sitzt die Navigation als feste Leiste am unteren Rand */
@media (max-width: 640px) {
  .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: var(--club);
    border-top: 1px solid rgb(255 255 255 / 12%);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .nav-inner {
    gap: 0;
    padding: 0;
    overflow: visible;
  }

  .nav a {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 2px 6px;
    font-size: 0.66rem;
    font-weight: 600;
    border-bottom: 0;
    border-top: 3px solid transparent;
  }

  .nav a span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav a:hover,
  .nav a.active {
    color: var(--accent);
    border-top-color: var(--accent);
  }

  .nav-icon {
    display: block;
  }

  body:has(.nav) .site-footer {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  body:has(.nav) .sticky-actions {
    bottom: calc(62px + env(safe-area-inset-bottom));
  }
}

/* ---------- Sanfte Bewegungen ---------- */

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 160ms;
  }

  .btn,
  .player-card,
  .tile,
  .match-row .match-opponent,
  .form-dot,
  .nav a,
  input,
  select,
  textarea {
    transition:
      transform 140ms ease,
      box-shadow 140ms ease,
      background-color 140ms ease,
      border-color 140ms ease,
      color 140ms ease;
  }

  .player-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgb(0 0 0 / 12%);
  }

  .btn:active,
  .player-card:active {
    transform: scale(0.98);
  }

  .alert {
    animation: slide-in 220ms ease;
  }

  .chart-bar {
    animation: grow 420ms ease-out;
    transform-origin: bottom;
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes grow {
  from {
    transform: scaleY(0);
  }
}

/* ---------- Anmeldeseiten (zweigeteilt) ---------- */

.auth-page .site-header {
  display: none;
}

.auth-page .container {
  display: grid;
  place-items: center;
  padding-top: 24px;
}

.auth-split {
  width: 100%;
  max-width: 860px;
  display: grid;
  grid-template-columns: 1fr;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgb(0 0 0 / 12%);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 28px 24px;
  background:
    linear-gradient(135deg, transparent 0 62%, rgb(255 213 0 / 14%) 62% 74%, transparent 74%),
    #141414;
  color: #fff;
  text-align: center;
}

.auth-brand img {
  width: auto;
  height: 120px;
  margin-bottom: 10px;
}

.auth-brand p {
  margin: 0;
}

.auth-brand-name {
  font-size: 2.2rem;
  line-height: 1;
}

.auth-brand-sub {
  color: #ffd500;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.auth-brand .auth-brand-claim {
  margin-top: 14px;
  color: rgb(255 255 255 / 70%);
  font-size: 0.9rem;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 28px 24px;
}

.auth-panel p {
  margin: 0;
}

@media (min-width: 760px) {
  .auth-split {
    grid-template-columns: 5fr 6fr;
    min-height: 520px;
  }

  .auth-brand img {
    height: 170px;
  }

  .auth-brand-name {
    font-size: 2.8rem;
  }

  .auth-panel {
    padding: 40px;
  }
}
