/* ===== KO-Bracket: responsive Pyramide (Flex-Reihen pro Runde) ===== */
/* Kein JS-Node-Moving → Formular-State in /eingabe bleibt erhalten.   */
/* Startzustand (auf/zu) kommt serverseitig als Klasse → kein FOUC.    */

/* --- Akkordeon-Hülle (gleicher Stil wie .gruppen-akk) --- */
.ko-akk {
    margin-bottom: .5rem;
}

.ko-akk-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .35rem .6rem;
    border: 1px solid var(--tp-akk-border);
    border-radius: .375rem;
    background-color: var(--tp-akk-bg);
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    color: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.ko-akk-header:hover {
    background-color: var(--tp-akk-hover);
}

.ko-akk-titel {
    flex: 1 1 auto;
}

.ko-akk-chevron {
    flex: 0 0 auto;
    display: inline-block;
    transition: transform .15s ease;
}

.ko-akk-header.zu .ko-akk-chevron {
    transform: rotate(-90deg);
}

.ko-akk-body {
    padding: .5rem 0 0;
}

.ko-akk-body.collapsed {
    display: none;
}

/* --- Bracket-Innenleben --- */
.ko-baum {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .5rem;
    padding: .25rem 0 .5rem;
}

/* Eine Runde = zentrierte, umbrechende Reihe */
.ko-runde {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: .5rem;
}

/* Optionaler Runden-Titel (z. B. "Sechzehntelfinals") */
.ko-runde-label {
    flex: 1 0 100%;
    text-align: center;
    font-size: .78rem;
    color: #6c757d;
    margin-bottom: .1rem;
}

/* Eine Karte: Desktop 4-spaltig (flex-basis 22%, 4×22% + 3×gap passt) */
.ko-card {
    flex: 0 1 22%;
    min-width: 0;
    max-width: 22%;
}

/* Tablet 768–1199 px: 2-spaltig (4er-Runde bricht zu 2×2) */
@media (max-width: 1199.98px) {
    .ko-card {
        flex-basis: 46%;
        max-width: 46%;
    }
}

/* Handy < 768 px: 1-spaltig */
@media (max-width: 767.98px) {
    .ko-card {
        flex-basis: 100%;
        max-width: 100%;
    }
}

/* Kleines Final: eigene zentrierte Reihe direkt nach den Halbfinals.
   Gleiche responsive Breite wie normale Karte. */
.ko-runde--kleines-final .ko-card {
    flex-basis: 22%;
    max-width: 22%;
}

@media (max-width: 1199.98px) {
    .ko-runde--kleines-final .ko-card {
        flex-basis: 46%;
        max-width: 46%;
    }
}

@media (max-width: 767.98px) {
    .ko-runde--kleines-final .ko-card {
        flex-basis: 100%;
        max-width: 100%;
    }
}
