:root {
    --blau-dunkel: #0d47a1;
    --blau: #1565c0;
    --blau-hell: #e8f1ff;
    --gruen: #167a42;
    --rot: #c62828;
    --text: #1f2937;
    --text-hell: #64748b;
    --rand: #dbe3ee;
    --hintergrund: #eef2f7;
    --weiss: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 24px;
    background: var(--hintergrund);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--blau-dunkel);
}

button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--blau);
    color: var(--weiss);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

button:hover,
.button-link:hover {
    background: var(--blau-dunkel);
    color: var(--weiss);
    transform: translateY(-1px);
}

button:focus-visible,
.button-link:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible {
    outline: 3px solid #f6c744;
    outline-offset: 3px;
}

button.secondary,
.button-link.secondary {
    background: #e2e8f0;
    color: var(--text);
}

button.secondary:hover,
.button-link.secondary:hover {
    background: #cbd5e1;
    color: var(--text);
}

button.delete {
    background: var(--rot);
}

button.delete:hover {
    background: #9f2020;
}

.button-small {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 0.82rem;
}

.container {
    width: min(1400px, 100%);
    margin: 0 auto;
}

.live-container {
    width: min(1200px, 100%);
}

.seitenkopf {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.seitenkopf h1 {
    margin: 0;
    color: var(--blau-dunkel);
}

.seitenkopf p {
    margin: 2px 0 0;
    color: var(--text-hell);
}

h2,
h3,
h4,
p {
    margin-top: 0;
}

h2 {
    margin-bottom: 14px;
    color: var(--blau-dunkel);
}

h3 {
    margin-bottom: 8px;
}

h4 {
    margin-bottom: 10px;
}

.eyebrow {
    margin: 0 0 2px;
    color: var(--blau);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.card {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid var(--rand);
    border-radius: 14px;
    background: var(--weiss);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.abschnitt {
    margin: 32px 0;
}

.abschnitt-kopf,
.endphase-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.abschnitt-kopf h2,
.endphase-kopf h3 {
    margin-bottom: 0;
}

.endphase-kopf p {
    margin-bottom: 0;
    color: var(--text-hell);
}

.grid,
.gruppen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 20px;
}

.spiel-grid {
    margin-bottom: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}

.info-element {
    display: grid;
    gap: 4px;
    padding: 14px;
    border-radius: 10px;
    background: var(--blau-hell);
}

.info-element span,
.spiel-meta,
.status-offen {
    color: var(--text-hell);
}

.gruppe-karte {
    padding: 16px;
    border: 1px solid var(--rand);
    border-radius: 10px;
    background: #f8fafc;
}

.team-liste,
.satzliste {
    margin: 0;
    padding-left: 20px;
}

.team-liste li,
.satzliste li {
    margin: 5px 0;
}

.team-liste span {
    color: var(--text-hell);
}

.spiel-liste {
    display: grid;
    gap: 12px;
}

.spiel {
    padding: 16px;
    border-left: 5px solid var(--blau);
    border-radius: 10px;
    background: #f8fafc;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.team-karte {
    border-left-color: #4f46e5;
}

.spiel-endphase {
    border-left-color: #d97706;
}

.spiel-meta {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.spiel-teams {
    color: var(--text);
    font-size: 1.05rem;
}

.spiel-teams span {
    color: var(--text-hell);
    font-size: 0.9rem;
    font-weight: 400;
}

.gewinner {
    margin: 10px 0 0;
    color: var(--gruen);
    font-weight: 700;
}

.ergebnis-zeile {
    margin: 7px 0 0;
}

.form-zeile {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.aktionen form {
    margin: 0;
}

form {
    margin-top: 12px;
}

input {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #b9c5d3;
    border-radius: 8px;
    background: var(--weiss);
    color: var(--text);
    font: inherit;
}

.form-zeile input {
    flex: 1 1 190px;
}

.ergebnis-form {
    padding: 12px;
    border-radius: 8px;
    background: var(--weiss);
}

.satz-eingabe {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
}

.satz-eingabe label {
    min-width: 58px;
    font-weight: 700;
}

.satz-eingabe input {
    width: 74px;
}

.inline-form {
    display: inline;
    margin: 0 0 0 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid var(--rand);
    text-align: center;
}

th {
    background: var(--blau);
    color: var(--weiss);
    font-size: 0.88rem;
}

td:nth-child(2),
th:nth-child(2) {
    text-align: left;
}

tbody tr:nth-child(even) {
    background: #f8fafc;
}

.platzierungs-tabelle tbody tr:first-child {
    background: #fff7df;
    font-weight: 700;
}

.table-container {
    overflow-x: auto;
    border: 1px solid var(--rand);
    border-radius: 10px;
}

.tabellen-titel {
    margin: 20px 0 8px;
    color: var(--blau-dunkel);
}

.endphase-bereich {
    border-top: 4px solid #d97706;
}

.ko-baum {
    border-top-color: #7c3aed;
}

.turnierbaum {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.baum-runde {
    display: grid;
    flex: 0 0 min(310px, 82vw);
    gap: 10px;
}

.baum-runde h4 {
    margin: 0;
    color: var(--blau-dunkel);
}

.baum-spiele {
    display: grid;
    align-content: space-around;
    gap: 14px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--blau-hell);
    color: var(--blau-dunkel);
    font-size: 0.85rem;
    font-weight: 700;
}

.status-endphase {
    background: #fff1d6;
    color: #9a5b04;
}

.status-offen {
    font-weight: 700;
}

.table-link {
    font-weight: 700;
}

.gruppenphase-details {
    margin: 32px 0;
    overflow: hidden;
    border: 1px solid var(--rand);
    border-radius: 14px;
    background: var(--weiss);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.gruppenphase-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    cursor: pointer;
    color: var(--blau-dunkel);
    font-size: 1.15rem;
    font-weight: 700;
}

.gruppenphase-details summary::marker {
    color: var(--blau);
}

.details-hinweis {
    color: var(--text-hell);
    font-size: 0.85rem;
    font-weight: 400;
}

.details-inhalt {
    padding: 0 20px 4px;
}

.wertung_align {
    display: flex;
    align-items: center;
    gap: 8px;
    
}

@media (max-width: 700px) {
    body {
        padding: 12px;
    }

    .seitenkopf {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .seitenkopf h1 {
        font-size: 1.75rem;
    }

    .card,
    .details-inhalt {
        padding: 14px;
    }

    .gruppenphase-details summary {
        padding: 14px;
    }

    .form-zeile {
        align-items: center;
    }

    .form-zeile input:not([type="number"]) {
        flex: 1 1 11rem;
        min-width: 0;
        width: auto;
    }

    .form-zeile input {
        height: 30px;
        min-height: 30px;
        padding: 3px 8px;
        line-height: 1.25;
    }

    .form-zeile input[type="number"] {
        flex: 0 1 7rem;
        width: auto;
    }

    .form-zeile button {
        flex: 0 0 auto;
        min-height: 30px;
        padding: 3px 10px;
        line-height: 1.25;
        width: auto;
    }

    input {
        min-height: 38px;
        padding: 6px 8px;
    }

    .satz-eingabe {
        flex-wrap: wrap;
        gap: 6px;
    }

    .satz-eingabe label {
        flex-basis: 100%;
        min-width: 0;
    }

    .satz-eingabe input {
        width: clamp(3.5rem, 18vw, 4.625rem);
    }

    .table-container table {
        min-width: 590px;
    }
}
