/* Roboto Condensed, selbst gehostet (latin) - die Schrift der Mutterseite
   bvbb-online.de. Ein iFrame erbt keine Schriften, und ein Abruf bei
   Google zur Laufzeit kommt nicht in Frage (DSGVO). */
@font-face {
    font-family: 'Roboto Condensed';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/roboto-condensed-400-latin.woff2') format('woff2');
}

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

body {
    color: #444444;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    background-color: transparent; /* better for iframe integration */
    margin: 0;
    padding: 15px;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    font-size: 14px;
    empty-cells: show;
}

table.ranking-table {
    margin: 15px 0;
}

#bc-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

#bc-options div {
    display: flex;
    align-items: center;
}

#bc-options a {
    margin-left: 8px; /* Add some space between the label and the icon */
}

.ical-icon {
    width: 1.3em;
    height: 1.3em;
    vertical-align: middle;
    fill: currentColor;
}

label {
    margin-left: 5px;
    margin-right: 5px;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
}

/* Herren/Damen als Segment-Pille im Stil der Kalender-Filter */
.gender-toggle {
    display: inline-flex;
    border: 1px solid #cfcfcf;
    border-radius: 5px;
    overflow: hidden;
    vertical-align: middle;
    background: #fff;
}

.saison-leiste {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.saison-titel {
    font-weight: 600;
}

.saison-schalter {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.gender-btn {
    background: none;
    border: none;
    padding: 4px 12px;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    color: #626262;
}

.gender-btn:hover:not(.active) {
    color: #B51218;
}

.gender-btn.active {
    background-color: #B51218;
    color: #fff;
}

.gender-btn.active:hover {
    background-color: #8E0E13;
}

th {
    background-color: #f8f9fa;
    color: #495057;
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    border-top: 1px solid #dee2e6;
    font-weight: bold;
    text-align: left;
    position: sticky;
    top: 0;
    box-shadow: inset 0 -2px 0 #dee2e6, inset 0 1px 0 #dee2e6;
    z-index: 10;
}

thead tr:last-child th {
    top: 35px; /* Adjust if header height changes */
}

tr {
    height: auto;
}

td, th {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

td {
    border-bottom: 1px solid #dee2e6;
}

tr.even td {
    background-color: rgba(0, 0, 0, 0.05); /* Bootstrap table-striped equivalent */
}

tr.odd td {
    background-color: #ffffff;
}

table tr:hover.even td, table tr:hover.odd td {
    background-color: rgba(0, 0, 0, 0.075); /* Hover effect */
}

tr.bc-month td {
    font-weight: bold;
    text-align: left;
    background-color: #e9ecef !important;
    color: #495057;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-top: 2px solid #dee2e6;
}

td.border-left, th.border-left {
    border-left: 1px solid #dee2e6;
}

/* /ranking scrollt als ganze Seite; wird die Tabelle zu breit, scrollt die
   Seite auch quer. Ein eigener Scrollkasten um die Tabelle wuerde das Haften
   der Kopfzeilen brechen — sticky wirkt nur gegen den naechsten Scroller,
   und das muss die Seite sein. Die Mannschafts-Leiste klebt ganz oben, die
   beiden Kopfzeilen darunter; ihre Versaetze setzt bvbb-calendar.js nach
   gemessener Leistenhoehe, die Werte hier sind nur der Rueckfall ohne JS. */
.ranking-table--main {
    width: max-content;
}

.ranking-table--main thead th {
    top: var(--kopf-versatz, 38px);
}

.ranking-table--main thead tr:last-child th {
    top: calc(var(--kopf-versatz, 38px) + var(--kopfzeile-hoehe, 35px));
}

.ranking-table--main th:nth-child(1),
.ranking-table--main td:nth-child(1) {
    position: sticky;
    left: 0;
    min-width: 90px;
    max-width: 90px;
    z-index: 1;
}

.ranking-table--main th:nth-child(2),
.ranking-table--main td:nth-child(2) {
    position: sticky;
    left: 90px;
    min-width: 160px;
    z-index: 1;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.08);
}

.ranking-table--main thead th:nth-child(1),
.ranking-table--main thead th:nth-child(2) {
    background-color: #f8f9fa;
    z-index: 12;
}

.ranking-table--main tbody tr.odd td:nth-child(1),
.ranking-table--main tbody tr.odd td:nth-child(2) {
    background-color: #ffffff;
}

.ranking-table--main tbody tr.even td:nth-child(1),
.ranking-table--main tbody tr.even td:nth-child(2) {
    background-color: #f2f2f2;
}

.ranking-table--main tbody tr:hover td:nth-child(1),
.ranking-table--main tbody tr:hover td:nth-child(2) {
    background-color: rgba(0, 0, 0, 0.075);
}

.sprung {
    margin-left: 0.25rem;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
}

.sprung-hoch {
    color: #1a7f37;
}

.sprung-runter {
    color: #b42318;
}

.legende {
    max-width: 60rem;
    color: #555;
    font-size: 0.9em;
    line-height: 1.5;
}

td.fremdverein {
    color: #777;
    font-style: italic;
    text-align: center;
}

.beschraenkungen {
    max-width: 60rem;
    line-height: 1.5;
}

a, a:active, a:visited {
    color: #dc3545; /* BVBB Red equivalent */
    text-decoration: none;
    background-color: transparent;
}

a:hover {
    color: #a71d2a;
    text-decoration: underline;
}

a#bc-print {
    display: inline-block;
    float: right;
    padding: 0.375rem 0.75rem;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #fff;
    background-color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 0.25rem;
    text-align: center;
    cursor: pointer;
}

a#bc-print:hover {
    color: #fff;
    background-color: #c82333;
    border-color: #bd2130;
    text-decoration: none;
}

a#bc-clear {
    color: #6c757d;
    font-size: 12px;
}

@media print {
    body {
        padding: 0;
    }
    #bc-options, #bc-print, #bc-clear {
        display: none !important;
    }

    table {
        border-collapse: collapse !important;
        font-size: 11px;
    }
    td, th {
        background-color: #fff !important;
        border: 1px solid #dee2e6 !important;
        padding: 4px;
    }
    tr {
        height: auto;
    }
    tr.bc-month td {
        background-color: #f8f9fa !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}

.bearbeiten-table tr.beschlossen td.rang {
    font-weight: 700;
    color: #1a4fa0;
}

.bearbeiten-table tr.grundlage-geaendert td.gemeldet {
    background: #fff4d6;
}

.bearbeiten-table .griff {
    white-space: nowrap;
    cursor: grab;
}

/* Alle Listboxen der Ranglisten-Seiten als Tom Select in der Filterleiste;
   ohne feste Mindestbreite spraenge die Vereinssuche beim Tippen. */
.ts-wrapper {
    display: inline-flex;
    min-width: 130px;
    vertical-align: middle;
}

select#clubs + .ts-wrapper {
    min-width: 300px;
}

/* Das aufgeklappte Dropdown muss ueber der haftenden Mannschafts-Leiste
   (z-index 30) und den Tabellenkoepfen liegen. */
.ts-dropdown {
    z-index: 40;
}

/* Kein Scrollkasten in der aufgeklappten Liste: sie zeigt alle Eintraege,
   gescrollt wird — wie ueberall — die Seite selbst. */
.ts-dropdown-content {
    max-height: none;
}

/* Sobald das Suchfeld aktiv ist, verschwindet der bisherige Eintrag —
   niemand muss den alten Text erst loeschen, um zu suchen. */
.ts-wrapper.single.input-active .item {
    display: none;
}

.kommentar {
    display: inline-block;
    margin-right: 0.5rem;
    color: #444;
}

/* In der max-content-Tabelle der Uebersicht duerfen lange Kommentare die
   Spalte nicht endlos aufziehen — sie brechen stattdessen um. */
.ranking-table--main .kommentar {
    max-width: 22rem;
}

.gemeldet-alt {
    margin-left: 0.25rem;
    color: #888;
    text-decoration: line-through;
    font-size: 0.85em;
}

tr.grundlage-geaendert td {
    background: #fff4d6;
}

/* Kompakte, beim Scrollen haftende Mannschafts-Leiste auf /ranking. */
.team-leiste {
    position: sticky;
    top: 0;
    z-index: 30; /* ueber den klebenden Koepfen der Ranglistentabelle */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    padding: 6px 0;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 10px;
}

.team-etikett {
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    margin-right: 4px;
}

.team-marke {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    background: #f8f9fa;
    font-size: 12.5px;
    color: #333;
    white-space: nowrap;
    text-decoration: none;
}

/* Marken springen zur Mannschaft im Spielausschuss-Werkzeug */
a.team-marke:hover {
    border-color: #B51218;
    color: #B51218;
}

/* Abweichend beschlossene Klasse: auch ohne Tooltip erkennbar */
.team-marke--beschlossen {
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

/* ===== Rahmenterminplan (/bvbb): Angleichung an bvbb-online.de ==========
   Alles unter .bc-seite gekapselt. Die globalen Regeln weiter oben gelten
   fuer die Ranglisten-Seiten und bleiben unveraendert. */

.bc-seite {
    font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
    color: #333;
}

.bc-seite table {
    color: #333;
}

.bc-seite a {
    color: #B51218;
}

.bc-seite a:hover {
    color: #8E0E13;
}

/* --- Filterzeile: gruppierte Segment-Pillen --- */

.bc-seite #bc-options {
    background: none;
    border: none;
    padding: 0;
    gap: 8px 28px;
    margin-bottom: 16px;
    align-items: center;
}

.bc-seite .bc-filtergruppe {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Gruppenname im Stil der Gruppenzeile der Tabelle */
.bc-seite .bc-filtergruppe-name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #B51218;
    margin-right: 2px;
}

/* Die Checkbox bleibt fuer refresh() und Screenreader vorhanden und wird
   nur optisch versteckt - kein display:none, sonst verschwaende der Fokus. */
.bc-seite .cb-option {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

/* Pille mit zwei Segmenten: links der Schalter, rechts der iCal-Download */
.bc-seite .bc-pille {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #cfcfcf;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
}

.bc-seite #bc-options label {
    margin: 0;
    padding: 4px 10px;
    border: none;
    border-radius: 0;
    background: none;
    cursor: pointer;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.4;
    color: #626262;
}

.bc-seite #bc-options label:hover {
    color: #B51218;
}

.bc-seite #bc-options .cb-option:checked + label {
    background: #B51218;
    color: #fff;
}

.bc-seite #bc-options .cb-option:checked + label:hover {
    background: #8E0E13;
    color: #fff;
}

.bc-seite #bc-options .cb-option:focus-visible + label {
    outline: 2px solid #8E0E13;
    outline-offset: -2px;
}

.bc-seite #bc-options a {
    margin: 0;
    padding: 4px 8px;
    border-left: 1px solid #e0e0e0;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    color: #9a9a9a;
}

/* Das FontAwesome-Kalenderglyph fuellt seine Zeichenflaeche randlos -
   in Originalgroesse wirkt es im Segment eingequetscht und angeschnitten. */
.bc-seite #bc-options .ical-icon {
    width: 12px;
    height: 12px;
    display: block;
}

.bc-seite #bc-options a:hover {
    color: #B51218;
    background: #f6e7e8;
    text-decoration: none;
}

/* --- Drucken als Outline-Knopf --- */

.bc-seite a#bc-print {
    background: #fff;
    color: #B51218;
    border: 1px solid #B51218;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    padding: 5px 14px;
    margin-bottom: 0;
}

.bc-seite a#bc-print:hover {
    background: #B51218;
    border-color: #B51218;
    color: #fff;
}

/* --- Tabelle --- */

.bc-seite td,
.bc-seite th {
    padding: 0.5rem 0.75rem;
}

.bc-seite th {
    background-color: #fff;
    border-top: none;
    box-shadow: none;
}

/* Gruppenzeile: gesperrte Versalien in BVBB-Rot, sticky ganz oben */
.bc-seite thead tr:first-child th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #B51218;
    border-bottom: none;
    padding-top: 0.4rem;
    padding-bottom: 0.2rem;
    height: 14px;
    line-height: 14px;
}

/* Spaltenkoepfe darunter; top muss zur Hoehe der Gruppenzeile passen.
   Die rote Linie als Inset-Schatten, nicht als border-bottom: bei
   border-collapse wandern Raender nicht mit klebenden Koepfen mit -
   dasselbe Muster wie in der globalen th-Regel. Der zweite (weisse)
   Inset deckt Subpixel-Reste am oberen Rand ab, wenn die Kopfzeilen
   beim Scrollen aufeinandertreffen. */
.bc-seite thead tr:last-child th {
    font-size: 13px;
    color: #626262;
    border-bottom: none;
    box-shadow: inset 0 -2px 0 #B51218, inset 0 2px 0 #fff;
    top: 24px;
}

/* Trennlinie vor jeder Spaltengruppe */
.bc-seite td.bc-gruppe {
    border-left: 2px solid #e0e0e0;
}

/* In den klebenden Kopfzeilen als Inset-Schatten statt border-left: bei
   border-collapse malt die Tabelle die Raender, und die verschwinden
   nicht hinter klebenden Zellen beim Scrollen. */
.bc-seite thead tr:first-child th.bc-gruppe {
    box-shadow: inset 2px 0 0 #e0e0e0;
}

.bc-seite thead tr:last-child th.bc-gruppe {
    box-shadow: inset 2px 0 0 #e0e0e0, inset 0 -2px 0 #B51218, inset 0 2px 0 #fff;
}

/* Monatsbaender: das Erkennungsmerkmal der Seite */
.bc-seite tr.bc-month td {
    background-color: #f7f7f7 !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 13px;
    color: #333;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    border-top: none;
}

/* Als Inset-Schatten statt border-left: bei border-collapse malt die
   Tabelle die Raender, und die verschwinden nicht hinter klebenden
   Koepfen beim Scrollen - der Schatten gehoert zum Zellhintergrund
   und scrollt sauber mit. */
.bc-seite tr.bc-month td:first-child {
    box-shadow: inset 4px 0 0 #B51218;
}

/* Zeilenstreifen etwas leiser als das globale Grau */
.bc-seite tr.even td {
    background-color: #fafafa;
}

.bc-seite table tr:hover.even td,
.bc-seite table tr:hover.odd td {
    background-color: #f1f1f1;
}

/* KW-Spalte als Nebentext */
.bc-seite tbody td:first-child {
    color: #9a9a9a;
}

/* Aktuelle Woche */
.bc-seite tr.bc-aktuell td {
    background-color: #fdf0f0 !important;
}

.bc-seite tr.bc-aktuell td:first-child {
    color: #B51218;
    font-weight: 700;
}

@media print {
    .bc-seite tr.bc-aktuell td {
        background-color: #fff !important;
    }

    .bc-seite tr.bc-aktuell td:first-child {
        color: #9a9a9a;
        font-weight: inherit;
    }

    .bc-seite tr.bc-month td:first-child {
        box-shadow: none;
    }

    .bc-seite td,
    .bc-seite th {
        padding: 4px;
        font-size: 11px;
    }

    .bc-seite tr.bc-month td {
        font-size: 11px;
        padding-top: 4px;
        padding-bottom: 4px;
    }
}