:root {
    --md-red: #C8322C;
    --md-blue: #1D2E8C;
    --md-black: #2C2C2A;
    --md-pitch: #6FA85A;
    --md-pitch-light: #7DB468;
    --md-ink: #1E2230;
    --md-muted: #667085;
    --md-line: #E1E3DD;
    --md-bg: #F4F5F2;
    --md-card: #FFFFFF;
    --md-hot: #FBE4E2;
    --md-hot-ink: #8E1F1A;
    --bs-primary: #1D2E8C;
    --bs-primary-rgb: 29, 46, 140;
    --bs-body-font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-bg: var(--md-bg);
    --bs-body-color: var(--md-ink);
}

[data-bs-theme="dark"] {
    --md-ink: #ECEEF2;
    --md-muted: #9AA1AE;
    --md-line: #2C303B;
    --md-bg: #12141A;
    --md-card: #1C1F28;
    --md-hot: #3A1F21;
    --md-hot-ink: #F2A7A2;
    --md-black: #5B5E66;
    --bs-body-bg: var(--md-bg);
    --bs-body-color: var(--md-ink);
}

body { background: var(--md-bg); }

h1, h2, h3, .display-font, .navbar-brand {
    font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: .01em;
    text-wrap: balance;
}

.navbar-club { background: var(--md-blue); }
.navbar-club .navbar-brand .dot { display: inline-block; width: 22px; height: 22px; border-radius: 50%; margin-right: .5rem; vertical-align: -4px;
    background: linear-gradient(135deg, var(--md-red) 50%, var(--md-blue) 50%); box-shadow: 0 0 0 2px #fff; }
.navbar-club .nav-link { color: rgba(255,255,255,.8); font-weight: 500; }
.navbar-club .nav-link.active, .navbar-club .nav-link:hover { color: #fff; }

.card { border-color: var(--md-line); background: var(--md-card); }
.eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--md-muted); font-weight: 600; }
.tabular { font-variant-numeric: tabular-nums; }

/* Spieler-Chip in Gruppenfarbe */
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 26px; padding: 0 7px;
    border-radius: 13px; color: #fff; font: 700 .95rem/1 "Barlow Condensed", sans-serif; font-variant-numeric: tabular-nums; }
.chip-rot { background: var(--md-red); }
.chip-blau { background: var(--md-blue); }
.chip-schwarz { background: var(--md-black); }
.pos-badge { display: inline-block; min-width: 30px; text-align: center; font: 700 .85rem "Barlow Condensed", sans-serif;
    border: 1px solid var(--md-line); border-radius: 6px; padding: 1px 5px; color: var(--md-muted); }
.pos-badge.main { border-color: var(--md-ink); color: var(--md-ink); }

/* Planer */
.round-tabs { display: grid; grid-template-columns: repeat(var(--rounds, 6), minmax(0, 1fr)); gap: 6px; }
.round-tab.after-ht { margin-left: 8px; } /* Halbzeitpause sichtbar machen */
@media (max-width: 575.98px) {
    .round-tabs { gap: 4px; }
    .round-tab { border-radius: 8px; padding: 5px 0 3px; font-size: 1.05rem; }
    .round-tab small { font-size: .58rem; }
    .round-tab.after-ht { margin-left: 5px; }
    .round-tab .res-dot { top: 4px; right: 4px; width: 7px; height: 7px; }
}
.round-tab { border: 1.5px solid var(--md-line); background: var(--md-card); border-radius: 10px; padding: 6px 0 4px; position: relative;
    font: 700 1.2rem "Barlow Condensed", sans-serif; color: var(--md-ink); }
.round-tab small { display: block; font: 500 .65rem "Barlow", sans-serif; color: var(--md-muted); }
.round-tab.hot small { color: var(--md-hot-ink); }
.round-tab.active { background: var(--md-ink); color: var(--md-bg); border-color: var(--md-ink); }
.round-tab.active small { color: var(--md-bg); opacity: .8; }
.round-tab .res-dot { position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border-radius: 4px; }
.field-card .field-head { color: #fff; padding: .6rem 1rem; font: 700 1.1rem "Barlow Condensed", sans-serif; display: flex; justify-content: space-between; align-items: center; }
.field-card.field-A .field-head { background: var(--md-red); }
.field-card.field-B .field-head { background: var(--md-blue); }
.slot-row { display: grid; grid-template-columns: 44px 1fr 34px; gap: .5rem; align-items: center; padding: .35rem 1rem; border-top: 1px solid var(--md-line); }
.slot-row .pos { font: 700 1rem "Barlow Condensed", sans-serif; color: var(--md-muted); }
.slot-row.warn select { border-color: #D98C1F; }
.slot-row .games { font-size: .8rem; font-weight: 600; color: var(--md-muted); text-align: right; }
.slot-row .streak { grid-column: 2 / 4; font-size: .72rem; margin-top: -.2rem; }
/* Spiele am Stück: 1 grün, 2 gelb, 3 orange, 4+ rot */
.swap-badge { display: inline-flex; align-items: center; gap: 3px; border-radius: 999px; padding: 1px 8px; font-weight: 700; margin-left: .35rem; }
.swap-out { background: var(--md-hot); color: var(--md-hot-ink); }
.swap-move { background: var(--md-line); color: var(--md-muted); }
.streak-badge { display: inline-block; border-radius: 999px; padding: 1px 8px; font-weight: 700; }
.streak-1 { background: #DDF2E3; color: #1C6B38; }
.streak-2 { background: #FFF1C2; color: #7A5A00; }
.streak-3 { background: #FFDDB8; color: #8A4300; }
.streak-4 { background: #FBD0CD; color: #8E1F1A; }
[data-bs-theme="dark"] .streak-1 { background: #1E3A28; color: #8FD6A6; }
[data-bs-theme="dark"] .streak-2 { background: #3D3415; color: #F2D46B; }
[data-bs-theme="dark"] .streak-3 { background: #45291A; color: #F5AE6E; }
[data-bs-theme="dark"] .streak-4 { background: #4A1F1E; color: #F2A7A2; }
.slot-row .hint { grid-column: 2 / 4; font-size: .75rem; color: #9A5B00; }
.score-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem 1rem; border-top: 1px solid var(--md-line); }
.score-row input { width: 52px; text-align: center; font: 700 1.3rem "Barlow Condensed", sans-serif; }
/* Eigene Tore in Teamfarbe, Gegner neutral: verhindert Verwechseln im Spielstress */
.score-box { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; }
.score-row .score-own { border: 3px solid; }
.score-row .score-own-A { border-color: var(--md-red); background: rgba(200, 50, 44, .08); }
.score-row .score-own-B { border-color: var(--md-blue); background: rgba(29, 46, 140, .10); }
.score-row .score-own:focus { box-shadow: 0 0 0 .2rem rgba(0, 0, 0, .12); }
.score-row .score-opp { border: 3px dashed var(--md-muted); }
.score-tag { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--md-muted); line-height: 1; }
.score-tag-A { color: var(--md-red); }
.score-tag-B { color: var(--md-blue); }
[data-bs-theme="dark"] .score-row .score-own-B { border-color: #5C74E6; }
[data-bs-theme="dark"] .score-tag-B { color: #8C9EF0; }
.outcome { font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; }
.outcome-w { background: #DDF2E3; color: #1C6B38; }
.outcome-d { background: var(--md-line); color: var(--md-muted); }
.outcome-l { background: var(--md-hot); color: var(--md-hot-ink); }
.bench-chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--md-bg); border-radius: 999px; padding: 2px 10px 2px 2px; font-size: .85rem; font-weight: 600; margin: 0 .3rem .3rem 0; }

/* Einsatzmatrix */
.matrix { font-size: .85rem; }
.matrix th, .matrix td { text-align: center; vertical-align: middle; white-space: nowrap; }
.matrix td.name { text-align: left; }
.matrix .cell-A { background: rgba(200, 50, 44, .14); font-weight: 700; }
.matrix .cell-B { background: rgba(29, 46, 140, .14); font-weight: 700; }
.matrix th.hot { background: var(--md-hot); color: var(--md-hot-ink); }
.minutes-low { color: var(--md-hot-ink); font-weight: 700; }

/* Taktik-Board */
.board-wrap { background: var(--md-card); border: 1px solid var(--md-line); border-radius: 12px; padding: .5rem; }
.board-svg { width: 100%; height: auto; touch-action: none; user-select: none; display: block; }
.board-toolbar .btn.active { background: var(--md-ink); color: var(--md-bg); }
.sketch-thumb svg { width: 100%; height: auto; display: block; border-radius: 8px; }

/* Sternebewertung */
.stars { display: inline-flex; gap: 1px; white-space: nowrap; }
.stars button { border: 0; background: none; padding: 0 1px; font-size: 1.15rem; line-height: 1; color: var(--md-line); cursor: pointer; transition: color .1s; }
.stars button.on { color: #E8A317; }
.stars button.hover { color: #F2C35B; }
.stars.saving { opacity: .5; }
.stars-lg button { font-size: 1.7rem; }
.stars-label { font-size: .8rem; color: var(--md-muted); }

/* Gesamtliste */
.chip-sm { min-width: 22px; height: 19px; padding: 0 5px; font-size: .75rem; border-radius: 10px; }
@media (min-width: 768px) { .border-md-end { border-right: 1px solid var(--md-line) !important; border-bottom: 0 !important; } }
.print-only { display: none; }
@media print {
    .navbar, .no-print, .round-tabs, .sticky-top, .alert, footer { display: none !important; }
    .print-only { display: block; }
    body { background: #fff; }
    .game-round { break-inside: avoid; }
    .card { border-color: #ccc; }
}
.season-table .sticky-col { position: sticky; left: 0; background: var(--md-card); z-index: 1; }

/* Fehlende Spieler (krank, verhindert) */
.absent-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; font-weight: 600; text-decoration: line-through; color: var(--md-hot-ink); background: var(--md-hot); border-radius: 999px; padding: 2px 10px 2px 3px; }
.absent-toggle { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--md-line); background: var(--md-card); color: var(--md-ink); border-radius: 999px; padding: 3px 12px 3px 4px; font-size: .9rem; font-weight: 600; }
.absent-toggle.on { border-color: var(--md-red); background: var(--md-hot); color: var(--md-hot-ink); text-decoration: line-through; }
.absent-toggle.on span.ms-1 { text-decoration: none; font-size: .75rem; }
.absent-badge { background: var(--md-hot); color: var(--md-hot-ink); }
.absent-chip .chip, .absent-toggle .chip { text-decoration: none; display: inline-flex; }
