:root {
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    color: #172534;
    background: #f1f4f6;
    line-height: 1.5;
    font-size: 15px;
    --muted: #526372;
    --border: #d9e1e8;
    --accent: #09694c;
    --accent-dark: #07513c;
    --nav: #132431;
    --surface: #fff;
    --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
    outline: 3px solid #29977a;
    outline-offset: 3px;
}
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.65rem); letter-spacing: -.045em; line-height: 1.12; margin-bottom: .35rem; }
h2 { font-size: 1.22rem; letter-spacing: -.02em; margin-bottom: 1rem; }
h3 { font-size: 1.04rem; margin: 1.35rem 0 .6rem; }
.muted { color: var(--muted); }
.app-version { margin: 1rem auto 1.5rem; padding-inline: 1rem; text-align: center; font-size: .8rem; }
.help { margin: .65rem 0 0; font-size: .9rem; }
.skip { position: fixed; top: .5rem; left: .5rem; transform: translateY(-150%); background: white; z-index: 5; padding: .6rem; }
.skip:focus { transform: none; }

.top { background: var(--nav); color: #fff; }
.top-inner {
    width: min(1120px, calc(100% - 2.5rem));
    min-height: 70px;
    margin: auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}
.brand { display: inline-flex; align-items: center; gap: .65rem; color: white; font-weight: 800; font-size: 1.15rem; text-decoration: none; white-space: nowrap; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border-radius: 9px;
    background: #abefc3;
    color: var(--nav);
    font-size: 1.17rem;
    font-weight: 900;
}
.brand-muted { color: #bbcad4; font-weight: 500; }
.top nav { display: flex; align-items: center; gap: .35rem; }
.top nav a { color: #c4d2dc; text-decoration: none; padding: .5rem .75rem; border-radius: 7px; font-weight: 600; }
.top nav a:hover, .top nav .active { background: #284051; color: white; }
.logout { margin-left: auto; }

.wrap { width: min(1120px, calc(100% - 2.5rem)); margin: 0 auto; padding: 2.25rem 0 4rem; }
.guest-wrap { display: grid; justify-content: center; padding-top: clamp(2.5rem, 12vh, 8rem); }
.login-panel { width: min(100%, 420px); }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.45rem; }
.heading p { margin-bottom: 0; }
.panel {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1rem, 3vw, 1.65rem);
    box-shadow: 0 1px 2px #102d4310;
}
.form-panel { max-width: 760px; }
.back { display: inline-block; margin-bottom: 1rem; text-decoration: none; color: var(--muted); font-weight: 600; }
.back:hover, .text-link:hover { text-decoration: underline; }
.text-link { text-decoration: none; font-weight: 650; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 42px;
    padding: .55rem .9rem;
    border: 1px solid transparent;
    border-radius: 7px;
    text-decoration: none;
    font-weight: 650;
    white-space: nowrap;
}
.primary { color: white; background: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.secondary { color: #263d4c; background: #fff; border-color: #bfccd7; }
.secondary:hover { background: #edf3f6; }
.subtle { color: #d8e4ea; background: transparent; border-color: #465b6a; }
.subtle:hover { background: #284051; }
.danger { color: #942c27; background: #fff; border-color: #efccc9; }
.danger:hover { background: #fcefed; }
.stack { display: grid; gap: 1rem; }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; }
.full { grid-column: 1 / -1; }
label { display: grid; gap: .35rem; font-weight: 650; color: #293b4a; min-width: 0; }
input, select, textarea {
    width: 100%;
    min-width: 0;
    padding: .52rem .65rem;
    min-height: 42px;
    border-radius: 7px;
    border: 1px solid #bfccd7;
    background: white;
    color: #172534;
    font-weight: 450;
}
input[readonly] { background: #f1f4f6; }
textarea { resize: vertical; }
.short-field { max-width: 25rem; }
.filter, .actions, .pagination { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem 1rem; }
.filter label { flex: 0 1 13rem; }
.filter { margin-bottom: 1.25rem; }
.filter .text-link { align-self: center; }
.pagination { justify-content: center; align-items: center; margin-top: 1rem; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .72rem .7rem; border-bottom: 1px solid var(--border); }
th { background: #f3f6f8; color: #405363; font-size: .8rem; font-weight: 750; }
tr:last-child td { border-bottom: 0; }
.number, .numeric, .score, .rating-values { font-variant-numeric: tabular-nums; }
.numeric { text-align: right; }
.nowrap { white-space: nowrap; }

.empty { border: 1px dashed #b9cbd4; border-radius: 9px; padding: 1.4rem; background: #f8fafb; }
.empty p { margin: .35rem 0 .7rem; color: var(--muted); }
.empty p:last-child { margin-bottom: 0; }
.tag { display: inline-block; border-radius: 5px; padding: .12rem .45rem; background: #edf1f4; color: #465b6b; font-size: .77rem; font-weight: 650; }
.tag-green { background: #e2f4ea; color: #185b40; }
.section-form { margin-bottom: 1rem; }
details { border-bottom: 1px solid var(--border); }
details:last-child { border-bottom: 0; }
summary { padding: .75rem .15rem; font-weight: 650; }
summary .tag { margin-left: .3rem; }
details[open] > summary { color: var(--accent-dark); }
.details-form { display: grid; gap: .75rem; padding: .35rem .15rem 1rem; }
.message { padding: .7rem .9rem; border: 1px solid; border-radius: 8px; margin-bottom: 1rem; }
.message ul { margin: .25rem 0 0; padding-left: 1.3rem; }
.success { background: #e3f4eb; color: #13533b; border-color: #abd9c3; }
.error { background: #fff0ef; color: #862822; border-color: #edbeb9; }
.notice { background: #edf6fa; color: #244a62; border-color: #b7d6e5; }
.reference-grid { margin-bottom: 1rem; }
.weight-row { display: grid; grid-template-columns: 1fr minmax(5rem, 7.25rem); align-items: center; padding: .38rem 0; border-top: 1px solid var(--border); gap: .55rem; }
.weight-row input { min-height: 36px; padding: .35rem .5rem; }
.sign { display: inline-block; width: 1.45rem; color: #176848; font-size: 1.1rem; }
.sign.negative { color: #9a362e; }

.match {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: clamp(1.25rem, 4vw, 2.35rem);
    color: white;
    background: linear-gradient(115deg, #152b38, #1a433e);
    border-radius: var(--radius);
}
.match-meta { color: #c4d9df; margin: 0; }
.match h1 { margin: .35rem 0 .5rem; overflow-wrap: anywhere; }
.match h1 span, .score span { color: #8bd6a8; }
.score { flex-shrink: 0; color: #fff; font-size: clamp(1.9rem, 5vw, 3.4rem); letter-spacing: -.05em; }
.section-nav { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; padding: .85rem 0; }
.section-nav nav { display: flex; flex-wrap: wrap; gap: .45rem; }
.section-nav nav a { padding: .4rem .65rem; color: #254456; background: #e6edf1; text-decoration: none; border-radius: 6px; font-weight: 650; }
.section-nav nav a:hover { background: #d8e8e3; }
.section-nav nav span { color: var(--muted); margin-left: .25rem; }
.match-content section { scroll-margin-top: 1rem; }
.jersey { color: var(--muted); font-size: .82rem; margin-right: .2rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin-bottom: 1rem; }
.stats div { display: grid; align-content: start; background: #f2f7f6; border-radius: 9px; padding: .75rem; }
.stats strong { color: #155343; font-size: 1.5rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stats span { font-size: .9rem; font-weight: 650; }
.stats small, .totals { color: var(--muted); }
.rating summary { list-style: none; display: flex; gap: .65rem; justify-content: space-between; align-items: center; }
.rating summary::-webkit-details-marker { display: none; }
.rating summary::before { content: '›'; font-size: 1.25rem; line-height: 1; }
.rating[open] summary::before { transform: rotate(90deg); }
.rating-values { margin-left: auto; flex-shrink: 0; display: flex; gap: .65rem; align-items: center; font-size: .84rem; color: var(--muted); }
.rating-values b { color: var(--nav); font-size: 1rem; }
.index { background: #dff3e8; color: #185e43; padding: .2rem .45rem; border-radius: 5px; }
.index b { color: #104f37; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }

@media (max-width: 700px) {
    .top-inner { gap: .5rem 1rem; flex-wrap: wrap; padding: .55rem 0; }
    .top nav { order: 3; flex-basis: 100%; }
    .top nav a { padding: .4rem .65rem; }
    .wrap, .top-inner { width: calc(100% - 1.5rem); }
    .wrap { padding-top: 1.4rem; }
    .two-columns { grid-template-columns: 1fr; }
    .heading { flex-wrap: wrap; align-items: start; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .match { flex-wrap: wrap; gap: .5rem; }
}

@media (max-width: 430px) {
    .field-grid { grid-template-columns: 1fr; }
    .rating summary { flex-wrap: wrap; }
    .rating-values { margin-left: 1.1rem; }
}

.top nav { flex-wrap: wrap; }
.match-content { margin-top: 1rem; }
.match-content > .section-nav { padding-bottom: 0; }
.standout {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.25rem;
    padding: clamp(1rem, 3vw, 1.65rem);
    border: 1px solid #a8d2c0;
    border-radius: var(--radius);
    background: linear-gradient(115deg, #e0f3e9, #fff 75%);
}
.standout-portrait {
    width: 100%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 10px;
    overflow: hidden;
    background: #235448;
    color: #d0f6e2;
    font-size: 2.4rem;
    font-weight: 800;
}
.standout-portrait img { width: 100%; height: 100%; object-fit: cover; }
.standout-person h2 { color: #17634c; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 .3rem; }
.standout-name { font-size: clamp(1.55rem, 4vw, 2.55rem); font-weight: 800; line-height: 1.07; letter-spacing: -.035em; margin: 0 0 .35rem; overflow-wrap: anywhere; }
.standout-role { color: var(--muted); margin: 0; }
.standout-index { text-align: right; color: #07513c; display: grid; }
.standout-index span { font-weight: 750; letter-spacing: .07em; }
.standout-index strong { font-size: clamp(2.1rem, 7vw, 4.65rem); font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.055em; }
.standout-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; gap: .65rem; }
.standout-stats div { display: flex; flex-direction: column-reverse; background: #ffffffbd; border: 1px solid #d3e9df; border-radius: 8px; padding: .65rem .8rem; }
.standout-stats dt { color: var(--muted); font-size: .85rem; }
.standout-stats dd { margin: 0; font-size: 1.35rem; font-variant-numeric: tabular-nums; font-weight: 750; color: #114a3a; }
@media (max-width: 600px) {
    .standout { grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: .75rem; }
    .standout-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 390px) {
    .standout { grid-template-columns: 3.5rem minmax(0, 1fr); }
    .standout-index { grid-column: 1 / -1; text-align: left; }
}
.check-field { display: flex; align-items: center; gap: .5rem; }
.check-field input { width: auto; min-height: auto; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.team-card { display: flex; flex-direction: column; align-items: start; gap: .8rem; min-height: 10rem; padding: 1.25rem; text-align: left; color: var(--ink, #152a37); border: 1px solid #d9e2e8; border-radius: var(--radius); background: #fff; }
.team-card:hover, .team-card-active { border-color: #56a58b; background: #f3faf7; }
.team-card-logo, .team-logo-preview { width: 3.75rem; height: 3.75rem; border-radius: .55rem; background: #e4f3ea; object-fit: contain; }
.team-card-logo { display: grid; place-items: center; color: #07513c; font-weight: 800; }
.team-card-logo img { width: 100%; height: 100%; object-fit: contain; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover { text-decoration: underline; }
.sort-link span { color: #17634c; margin-inline-start: .2rem; }

.match-links { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin: .6rem 0; }
.match-links a { color: #e0f7e9; text-underline-offset: .2em; }
.verlauf-scroll { overflow-x: auto; padding: .5rem 0 .25rem; }
.verlauf { display: flex; min-width: calc(2.5rem + var(--spiele) * 6rem); min-height: 12rem; padding-bottom: 1.65rem; }
.verlauf-skala { flex: 0 0 2.5rem; display: flex; flex-direction: column; justify-content: space-between; padding-right: .55rem; color: var(--muted); text-align: right; font-size: .8rem; }
.verlauf-spiele { display: grid; grid-template-columns: repeat(var(--spiele), minmax(0, 1fr)); gap: .5rem; position: relative; flex: 1; list-style: none; margin: 0; padding: 0 .35rem; border-block: 1px solid #dbe6e1; }
.verlauf-spiele::after { content: ''; position: absolute; inset-inline: 0; bottom: var(--mittel); border-top: 2px dashed #52786b; pointer-events: none; }
.verlauf-spiele li { position: relative; }
.verlauf-spiele a { position: absolute; inset: 0; color: #064a38; text-decoration: none; }
.verlauf-spiele a::before { content: ''; position: absolute; bottom: 0; left: 25%; width: 50%; height: var(--wert); background: #a8ddc9; border-radius: .35rem .35rem 0 0; }
.verlauf-spiele a:hover::before, .verlauf-spiele a:focus-visible::before { background: #73bba2; }
.verlauf-wert { position: absolute; left: 0; right: 0; text-align: center; bottom: clamp(0%, var(--wert), calc(100% - 1.3rem)); z-index: 1; font-weight: 750; }
.verlauf-datum { position: absolute; top: calc(100% + .25rem); left: 0; right: 0; color: var(--muted); font-size: .75rem; text-align: center; }

.mannschaftswerte { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .75rem; margin: 0; }
.mannschaftswerte div { padding: .75rem 1rem; border-radius: .55rem; background: #eef5f2; }
.mannschaftswerte dt { color: var(--muted); font-weight: 650; }
.mannschaftswerte dd { margin: .15rem 0 0; font-size: 1.4rem; font-weight: 750; color: #07513c; }
.mannschaftswerte small, td small { font-size: .8rem; font-weight: 450; color: var(--muted); }
.tempo-felder { min-width: 0; border: 1px solid #d9e2e8; border-radius: .55rem; padding: .75rem 1rem 1rem; }
.tempo-felder legend { font-weight: 700; padding: 0 .3rem; }

[data-benutzer-rolle][hidden] { display: none; }
