/*
 * mannschaften.css
 */

/* ===== TEAM CARD WRAPPER + VICTOR BADGE ===== */
.team-card-wrapper {
    position: relative;
}

.victor-card-badge {
    position: absolute;
    top: -2.2rem;
    left: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-blue);
    border: none;
    border-radius: 8px;
    padding: 5px 12px;
    box-shadow: 0 2px 8px rgba(43, 75, 140, 0.25);
    z-index: 1;
}

.victor-card-badge-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    font-family: 'Work Sans', sans-serif;
}

.victor-card-badge-logo {
    height: 16px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1) !important;
}

.page-header {
    margin-top: 100px;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--deep-blue));
    color: var(--white);
    text-align: center;
}

.page-header h1 {
    font-size: 4.5rem;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.3rem;
    opacity: 0.9;
}

.teams-section {
    padding: 6rem 2rem;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    overflow: visible;
    padding-top: 2.5rem;
}

.team-card {
    background: var(--surface);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(43, 75, 140, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-light);
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(43, 75, 140, 0.2);
}

/* ===================================================
   TEAM HEADER - Standard (nur Gradient)
   =================================================== */
.team-header {
    position: relative;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    color: var(--white);
    padding: 2rem;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.team-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(43, 75, 140, 0.85), rgba(74, 127, 204, 0.85));
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.team-header>* {
    position: relative;
    z-index: 2;
    transition: opacity 0.3s ease;
}

/* ===================================================
   INDIVIDUELLE BILDER FÜR JEDE MANNSCHAFT
   nth-child zählt .team-card-wrapper als Kind 1,
   direkte .team-card Geschwister als Kind 2, 3, 4
   =================================================== */

/* 1. Mannschaft – sitzt innerhalb .team-card-wrapper */
.team-card-wrapper .team-card .team-header {
    background-image: url('/ressources/teams/1.Mannschaft.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.team-card-wrapper .team-card .team-header::before {
    background: linear-gradient(135deg, rgba(43, 75, 140, 0.65), rgba(74, 127, 204, 0.65));
}

.team-card-wrapper .team-card:hover .team-header::before {
    opacity: 0;
}

.team-card-wrapper .team-card:hover .team-header>* {
    opacity: 0;
}

/* 2. Mannschaft – zweites Kind des Grids (direkte .team-card) */
.teams-grid>.team-card:nth-child(2) .team-header {
    background-image: url('/ressources/teams/2.Mannschaft.webp');
    background-position: center 20%;
    background-size: cover;
    background-repeat: no-repeat;
}

.teams-grid>.team-card:nth-child(2) .team-header::before {
    background: linear-gradient(135deg, rgba(43, 75, 140, 0.65), rgba(74, 127, 204, 0.65));
}

.teams-grid>.team-card:nth-child(2):hover .team-header::before {
    opacity: 0;
}

.teams-grid>.team-card:nth-child(2):hover .team-header>* {
    opacity: 0;
}

/* 3. Mannschaft */
.teams-grid>.team-card:nth-child(3) .team-header {
    background-image: url('/ressources/teams/3.Mannschaft.webp');
    background-size: cover;
    background-position: center 55%;
    background-repeat: no-repeat;
}

.teams-grid>.team-card:nth-child(3) .team-header::before {
    background: linear-gradient(135deg, rgba(43, 75, 140, 0.65), rgba(74, 127, 204, 0.65));
}

.teams-grid>.team-card:nth-child(3):hover .team-header::before {
    opacity: 0;
}

.teams-grid>.team-card:nth-child(3):hover .team-header>* {
    opacity: 0;
}


/* 4. Mannschaft */
.teams-grid>.team-card:nth-child(4) .team-header {
    background-image: url('/ressources/teams/4.Mannschaft.webp');
    background-size: cover;
    background-position: center 60%;
    background-repeat: no-repeat;
}

.teams-grid>.team-card:nth-child(4) .team-header::before {
    background: linear-gradient(135deg, rgba(43, 75, 140, 0.65), rgba(74, 127, 204, 0.65));
}

.teams-grid>.team-card:nth-child(4):hover .team-header::before {
    opacity: 0;
}

.teams-grid>.team-card:nth-child(4):hover .team-header>* {
    opacity: 0;
}


/* Jugend U15 – kein Overlay nötig */
.teams-grid>.team-card:nth-child(5) .team-header::before {
    display: none;
}

.team-number {
    font-family: 'Bebas Neue', cursive;
    font-size: 4rem;
    line-height: 1;
    opacity: 0.4;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.team-name {
    font-size: 2rem;
    margin: 0.5rem 0;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
}

.team-league {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 500;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

.team-body {
    padding: 2rem;
}

.team-body p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.team-details {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem;
    background: var(--ice-blue);
    border-radius: 8px;
}

.detail-label {
    font-weight: 600;
    color: var(--heading);
}

.detail-value {
    color: var(--text-gray);
}

.players-toggle {
    width: 100%;
    padding: 1rem;
    background: var(--light-blue);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.players-toggle:hover {
    background: var(--primary-blue);
}

.players-toggle .arrow {
    transition: transform 0.3s ease;
}

.players-toggle.active .arrow {
    transform: rotate(180deg);
}

.players-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    margin-top: 1rem;
}

.players-list.active {
    max-height: 2000px;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--off-white);
    border-radius: var(--radius-sm);
    margin-bottom: 0.8rem;
    transition: transform 0.2s ease;
}

.player-item:hover {
    transform: translateX(5px);
    background: var(--ice-blue);
}

.player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--light-blue), var(--sky-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

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

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 600;
    color: var(--heading);
    font-size: 1.05rem;
}

.player-position {
    font-size: 0.85rem;
    color: var(--text-gray);
}


@media (max-width: 1024px) {
    .page-header h1 {
        font-size: 3.5rem;
    }

    .teams-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2.4rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    .team-header {
        min-height: 160px;
    }

    .team-name {
        font-size: 1.7rem;
    }

    .team-body {
        padding: 1.5rem;
    }

    .players-toggle {
        font-size: 0.9rem;
        padding: 0.85rem;
    }

    .liga-link {
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
    }

    .terminplan-section {
        padding: 3rem 1.25rem;
    }

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

    .kalender-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .kalender-item {
        padding: 1rem 0.5rem;
    }

    .k-datum {
        font-size: 0.85rem;
    }

    .victor-card-badge {
        padding: 4px 9px;
    }

    .victor-card-badge-label {
        font-size: 0.65rem;
    }

    .victor-card-badge-logo {
        height: 14px;
        filter: brightness(0) invert(1) !important;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .team-header {
        min-height: 140px;
    }

    .team-name {
        font-size: 1.5rem;
    }

    .team-body {
        padding: 1.25rem;
    }

    .detail-row {
        font-size: 0.9rem;
        padding: 0.65rem;
    }

    .players-toggle {
        font-size: 0.85rem;
        padding: 0.75rem;
    }

    .player-name {
        font-size: 0.95rem;
    }

    .player-avatar {
        width: 42px;
        height: 42px;
    }

    .liga-link {
        font-size: 0.82rem;
        padding: 0.55rem 1rem;
    }

    .terminplan-section {
        padding: 2.5rem 1rem;
    }

    .terminplan-tab {
        font-size: 0.82rem;
        padding: 0.45rem 1rem;
    }

    .kalender-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
}


.liga-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.2rem;
    padding: 0.65rem 1.4rem;
    background: linear-gradient(135deg, var(--primary-blue, #1a3a6b) 0%, var(--deep-blue, #0d2044) 100%);
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.liga-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #2451a0 0%, #1a3a6b 100%);
}

/* ===== TERMINPLAN ===== */
.terminplan-section {
    background: var(--off-white);
    padding: 5rem 2rem;
    scroll-margin-top: 60px;   /* Sprung über "Tabelle & Spielplan ↓" nicht unter den Header */
}

.terminplan-section .section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.terminplan-section .section-header h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.8rem;
    color: var(--heading);
    margin-bottom: 0.5rem;
}

.terminplan-section .section-header p {
    color: var(--text-gray);
    font-size: 1rem;
}

.terminplan-tabs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.terminplan-tab {
    padding: 0.6rem 1.6rem;
    border: 2px solid var(--primary-blue);
    background: transparent;
    color: var(--heading);
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.terminplan-tab:hover,
.terminplan-tab.active {
    background: var(--primary-blue);
    color: white;
}

.terminplan-panel {
    display: none;
    max-width: 700px;
    margin: 0 auto;
}

.terminplan-panel.active {
    display: block;
}

.terminplan-liga-badge {
    text-align: center;
    margin-bottom: 2rem;
}

.terminplan-liga-badge span {
    display: inline-block;
    background: var(--ice-blue);
    color: var(--heading);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.35rem 1rem;
    border-radius: 50px;
}

.kalender-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.kalender-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.25rem 0.75rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.15s;
}

.kalender-item.vergangen {
    background: var(--surface);
    border: 2px solid var(--border-light);
    opacity: 0.6;
}

.kalender-item.kommend {
    background: var(--surface);
    border: 2px solid var(--border-light);
}

.kalender-item.naechstes {
    background: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    color: white;
    box-shadow: 0 4px 16px rgba(43, 75, 140, 0.25);
    transform: scale(1.03);
}

.k-datum {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.kalender-item.naechstes .k-datum {
    color: white;
}

.k-next {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.85);
}

/* ===== TABELLE & ERGEBNISSE (aus data/liga.json) ===== */
.liga-details {
    display: grid;
    grid-template-columns: minmax(0, 1fr);   /* Karten nicht breiter als das Panel werden lassen */
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.liga-card {
    background: var(--surface);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.liga-card h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--heading);
    margin-bottom: 1rem;
}

.liga-tabelle-wrap {
    overflow-x: auto;
}

.liga-tabelle {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.liga-tabelle th,
.liga-tabelle td {
    padding: 0.55rem 0.5rem;
    text-align: center;
    white-space: nowrap;
}

.liga-tabelle th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-gray);
    border-bottom: 2px solid var(--border-light);
}

.liga-tabelle tbody tr + tr td {
    border-top: 1px solid var(--border-light);
}

/* Teamname immer einzeilig: Spalte nimmt den Restplatz, zu lange Namen
   werden mit "…" gekürzt (voller Name im Tooltip) */
.liga-tabelle .lt-team {
    text-align: left;
    width: 100%;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.liga-tabelle .lt-rang {
    width: 2rem;
    color: var(--text-gray);
}

.liga-tabelle .lt-punkte {
    font-weight: 700;
}

.liga-tabelle tr.eigene td {
    background: var(--ice-blue);
    color: var(--heading);
    font-weight: 700;
}

.liga-tabelle tr.eigene td:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.liga-tabelle tr.eigene td:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.spiel-liste,
.spiel-liste ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.spieltag + .spieltag {
    margin-top: 1.25rem;
}

.spieltag-datum {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--heading);
    margin-bottom: 0.4rem;
}

.spieltag-ort {
    font-weight: 500;
    color: var(--text-gray);
}

.spieltag-ort::before {
    content: ' · ';
}

.spiel {
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.spiel-kopf {
    display: grid;
    grid-template-columns: 3rem 1fr auto 1rem;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    font: inherit;
    color: inherit;
    text-align: left;
}

button.spiel-kopf {
    cursor: pointer;
}

button.spiel-kopf:hover {
    background: var(--ice-blue);
}

button.spiel-kopf:focus-visible {
    outline: 2px solid var(--light-blue);
    outline-offset: 2px;
}

.sp-pfeil {
    color: var(--text-gray);
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.spiel-kopf[aria-expanded="true"] .sp-pfeil {
    transform: rotate(180deg);
}

/* Spielbericht als Anzeigetafel */
.bericht {
    padding: 0.25rem 0.75rem 0.9rem;
}

.bd {
    display: grid;
    grid-template-columns: 3rem 1fr auto;
    column-gap: 0.75rem;
    align-items: center;
    padding: 0.45rem 0;
}

.bd + .bd {
    border-top: 1px solid var(--border-light);
}

.bd-disz {
    grid-row: span 2;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-gray);
}

.bd-namen {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.bd-namen.gewinner {
    color: var(--text-dark);
    font-weight: 600;
}

.bd-sep {
    margin: 0 0.3rem;
    color: var(--border-light);
}

.bd-saetze {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
    font-variant-numeric: tabular-nums;
}

.bd-saetze span {
    width: 1.7rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.bd-saetze span.satz-gewonnen {
    color: var(--text-dark);
    font-weight: 700;
}

.spieler-link {
    padding: 0;
    background: none;
    border: 0;
    font: inherit;
    color: var(--heading);
    text-decoration: underline;
    text-decoration-color: var(--sky-blue);
    text-underline-offset: 2px;
    cursor: pointer;
}

.spieler-link:hover {
    text-decoration-color: currentColor;
}

/* Spielerliste der Team-Karten */
.player-item.hat-statistik {
    cursor: pointer;
}

.player-item.hat-statistik:focus-visible {
    outline: 2px solid var(--light-blue);
    outline-offset: 2px;
}

.player-bilanz {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-top: 0.15rem;
}

/* Spieler-Statistik-Dialog */
.spieler-dialog {
    width: min(640px, calc(100% - 2rem));
    max-height: 85vh;
    margin: auto;   /* globaler Reset setzt margin: 0 → Dialog sonst oben links */
    padding: 0;
    border: 0;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(15, 20, 25, 0.3);
    color: var(--text-dark);
}

.spieler-dialog::backdrop {
    background: rgba(15, 20, 25, 0.55);
}

.sd-box {
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.sd-kopf {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sd-kopf h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.9rem;
    font-weight: 400;
    color: var(--heading);
    line-height: 1.1;
}

.sd-kopf p {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.sd-avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
}

.sd-schliessen {
    margin-left: auto;
    align-self: flex-start;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: var(--off-white);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-gray);
    cursor: pointer;
}

.sd-schliessen:hover {
    background: var(--ice-blue);
    color: var(--heading);
}

.sd-kacheln {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.sd-kachel {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.8rem 0.5rem;
    background: var(--ice-blue);
    border-radius: var(--radius-sm);
}

.sd-kachel.leer {
    background: var(--off-white);
}

.sd-kachel-wert {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--heading);
    font-variant-numeric: tabular-nums;
}

.sd-kachel.leer .sd-kachel-wert {
    color: var(--text-gray);
}

.sd-kachel-titel {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-gray);
}

.sd-inhalt h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-gray);
    margin: 1.25rem 0 0.5rem;
}

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

.sd-spiele li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
        "meta meta chip"
        "paarung saetze chip";
    column-gap: 0.75rem;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.sd-spiele li:nth-child(odd) {
    background: var(--off-white);
}

.sd-meta {
    grid-area: meta;
    font-size: 0.75rem;
    color: var(--text-gray);
}

.sd-paarung {
    grid-area: paarung;
    display: flex;
    flex-direction: column;
}

.sd-partner {
    color: var(--text-gray);
}

.sd-saetze {
    grid-area: saetze;
    white-space: pre;
    font-variant-numeric: tabular-nums;
    color: var(--text-gray);
}

.sd-chip {
    grid-area: chip;
    width: 1.8rem;
    height: 1.8rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
}

.sd-spiele li.sieg .sd-chip {
    background: rgba(30, 158, 87, 0.12);
    color: var(--accent-green);
}

.sd-spiele li.niederlage .sd-chip {
    background: rgba(200, 50, 50, 0.1);
    color: #b03030;
}

.sd-leer {
    color: var(--text-gray);
    text-align: center;
    padding: 1rem 0;
}

.spiel:nth-child(odd) {
    background: var(--off-white);
}

.sp-zeit {
    color: var(--text-gray);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.sp-vs {
    color: var(--text-gray);
    margin: 0 0.15rem;
}

.sp-eigen {
    font-weight: 700;
    color: var(--heading);
}

.sp-ergebnis {
    min-width: 3.2rem;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-pill);
    color: var(--text-gray);
}

.sp-ergebnis a {
    color: inherit;
    text-decoration: none;
}

.sp-ergebnis a:hover {
    text-decoration: underline;
}

.spiel.sieg .sp-ergebnis {
    background: rgba(30, 158, 87, 0.12);
    color: var(--accent-green);
}

.spiel.niederlage .sp-ergebnis {
    background: rgba(200, 50, 50, 0.1);
    color: #b03030;
}

.spiel.remis .sp-ergebnis {
    background: var(--ice-blue);
    color: var(--heading);
}

/* Breite Bildschirme: links Spieltage + Tabelle, rechts Spiele & Ergebnisse */
@media (min-width: 1320px) {
    .terminplan-panel.mit-daten {
        max-width: 1240px;
    }

    .terminplan-panel.mit-daten.active {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        /* Restliche Höhe der langen Spielliste landet unter der Tabelle,
           nicht zwischen Spieltagen und Tabelle */
        grid-template-rows: auto auto auto 1fr auto;
        grid-template-areas:
            "badge    badge"
            "kalender spiele"
            "tabelle  spiele"
            ".        spiele"
            "stand    stand";
        gap: 1.5rem 2rem;
        align-items: start;
    }

    .mit-daten .terminplan-liga-badge {
        grid-area: badge;
        margin-bottom: 0.5rem;
    }

    .mit-daten .kalender-grid {
        grid-area: kalender;
        gap: 0.6rem;
    }

    /* schmalere Spalte → Kacheln kompakter, damit das Datum nicht umbricht */
    .mit-daten .kalender-item {
        padding: 0.85rem 0.3rem;
    }

    .mit-daten .k-datum {
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .mit-daten .liga-details {
        display: contents;
    }

    .mit-daten .liga-card-tabelle {
        grid-area: tabelle;
    }

    .mit-daten .liga-card-spiele {
        grid-area: spiele;
    }

    .mit-daten .liga-stand {
        grid-area: stand;
        margin-top: 0;
    }
}

.liga-stand {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-gray);
}

.liga-stand a {
    color: var(--heading);
}



/* Responsive */
@media (max-width: 1024px) {
    .page-header h1 {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {

    .page-header {
        margin-top: 60px;
    }

    .kalender-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .kalender-grid {
        grid-template-columns: 1fr 1fr;
    }

    .liga-card {
        padding: 1rem;
    }

    /* Handy: nur Rang, Team, Begegnungen, Punkte – damit Teamnamen ganz passen */
    .liga-tabelle .lt-opt,
    .liga-tabelle .lt-spiele {
        display: none;
    }

    .liga-tabelle {
        font-size: 0.85rem;
    }

    .liga-tabelle th,
    .liga-tabelle td {
        padding: 0.5rem 0.3rem;
    }

    .spiel {
        font-size: 0.85rem;
    }

    .spiel-kopf {
        grid-template-columns: 2.6rem 1fr auto 0.8rem;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .bericht {
        padding: 0.25rem 0.5rem 0.75rem;
    }

    .bd {
        grid-template-columns: 2.4rem 1fr auto;
        column-gap: 0.5rem;
    }

    .bd-saetze span {
        width: 1.45rem;
        font-size: 0.8rem;
    }

    .bd-namen {
        font-size: 0.8rem;
    }

    .sd-box {
        padding: 1.1rem;
    }

    .sd-spiele li {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "meta chip"
            "paarung chip"
            "saetze chip";
    }

    .sd-saetze {
        justify-self: start;
    }

    /* Heim und Gast untereinander statt mitten im Namen umzubrechen */
    .sp-paarung > span:not(.sp-vs) {
        display: block;
    }

    .sp-vs {
        display: none;
    }

    .page-header {
        margin-top: 60px;
    }
}
/* Tabelle & Spiele oben, Spieltagstermine darunter
   (Reihenfolge im DOM kommt aus scripts/mannschaften.js) */

.mit-daten .liga-details {
    margin-top: 0;
}

.mit-daten .kalender-grid {
    margin-top: 2rem;
}

@media (min-width: 1320px) {
    .terminplan-panel.mit-daten.active {
        grid-template-areas:
            "badge    badge"
            "tabelle  spiele"
            "kalender spiele"
            ".        spiele"
            "stand    stand";
    }

    .mit-daten .kalender-grid {
        margin-top: 0;
    }
}
