/* ==========================================================================
   BetSystem – modernes Bootstrap-Design mit Light/Dark-Mode
   ========================================================================== */

:root,
[data-bs-theme="light"] {
    --app-primary: #15803d;
    --app-primary-rgb: 21, 128, 61;
    --app-accent: #0d9488;
    --app-bg: #f3f6f9;
    --app-surface: #ffffff;
    --app-surface-2: #f8fafc;
    --app-border: rgba(15, 23, 42, .08);
    --app-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
    --app-muted: #64748b;
    --bs-primary: var(--app-primary);
    --bs-primary-rgb: var(--app-primary-rgb);
    --bs-link-color: #15803d;
    --bs-link-color-rgb: 21, 128, 61;
    --bs-link-hover-color: #166534;
    --bs-body-bg: var(--app-bg);
}

[data-bs-theme="dark"] {
    --app-primary: #22c55e;
    --app-primary-rgb: 34, 197, 94;
    --app-accent: #2dd4bf;
    --app-bg: #0b1220;
    --app-surface: #111a2e;
    --app-surface-2: #16213a;
    --app-border: rgba(148, 163, 184, .14);
    --app-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --app-muted: #94a3b8;
    --bs-primary: var(--app-primary);
    --bs-primary-rgb: var(--app-primary-rgb);
    --bs-link-color: #4ade80;
    --bs-link-color-rgb: 74, 222, 128;
    --bs-link-hover-color: #86efac;
    --bs-body-bg: var(--app-bg);
    --bs-body-color: #e2e8f0;
    --bs-secondary-bg: #16213a;
    --bs-tertiary-bg: #131d33;
    --bs-border-color: rgba(148, 163, 184, .18);
}

html { scroll-padding-top: 80px; }

body {
    background: var(--app-bg);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-main { flex: 1 0 auto; }

/* ---------- Buttons / Farben ---------- */
.btn-primary {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: #166534;
    --bs-btn-hover-border-color: #166534;
    --bs-btn-active-bg: #14532d;
    --bs-btn-active-border-color: #14532d;
    --bs-btn-disabled-bg: var(--app-primary);
    --bs-btn-disabled-border-color: var(--app-primary);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #052e16; --bs-btn-hover-color: #052e16; --bs-btn-hover-bg: #4ade80; --bs-btn-hover-border-color: #4ade80; --bs-btn-active-color: #052e16; }

.btn-outline-primary {
    --bs-btn-color: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary);
    --bs-btn-hover-border-color: var(--app-primary);
    --bs-btn-active-bg: var(--app-primary);
    --bs-btn-active-border-color: var(--app-primary);
}
.text-primary { color: var(--app-primary) !important; }
.bg-primary { background-color: var(--app-primary) !important; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: rgba(var(--app-primary-rgb), .6);
    box-shadow: 0 0 0 .2rem rgba(var(--app-primary-rgb), .2);
}
.form-check-input:checked { background-color: var(--app-primary); border-color: var(--app-primary); }

/* ---------- Navigation ---------- */
.app-navbar {
    background: linear-gradient(120deg, #14532d 0%, #15803d 55%, #0f766e 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
    padding-top: max(.5rem, env(safe-area-inset-top));
}
.app-navbar .nav-link { border-radius: .6rem; padding: .45rem .8rem !important; color: rgba(255, 255, 255, .82); }
.app-navbar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.app-navbar .nav-link.active { color: #fff; background: rgba(255, 255, 255, .16); font-weight: 600; }
.btn-nav-icon { color: #fff; border: 0; border-radius: .6rem; padding: .4rem .6rem; }
.btn-nav-icon:hover, .btn-nav-icon:focus, .btn-nav-icon.show { color: #fff; background: rgba(255, 255, 255, .14); }
.btn-nav-icon .bi { font-size: 1.15rem; }
.notification-count { position: absolute; top: 0; right: 0; font-size: .65rem; transform: translate(25%, -10%); }

.notification-menu { width: min(380px, 92vw); }
.notification-list { max-height: 420px; overflow-y: auto; }
.notification-item { display: block; padding: .7rem 1rem; border-bottom: 1px solid var(--app-border); color: inherit; text-decoration: none; white-space: normal; }
.notification-item:hover { background: var(--app-surface-2); color: inherit; }
.notification-item.unread { background: rgba(var(--app-primary-rgb), .07); }
.notification-item .title { font-weight: 600; font-size: .92rem; }
.notification-item .body { font-size: .82rem; color: var(--app-muted); white-space: pre-line; }
.notification-item .time { font-size: .72rem; color: var(--app-muted); }

.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #0d9488); color: #fff; font-weight: 700;
    flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: .8rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.8rem; }

/* Bottom-Navigation (mobil / PWA) */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030;
    display: flex; justify-content: space-around;
    background: var(--app-surface); border-top: 1px solid var(--app-border);
    padding: .35rem 0 max(.35rem, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
}
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; color: var(--app-muted); text-decoration: none; padding: .2rem 0; }
.bottom-nav a .bi { font-size: 1.25rem; }
.bottom-nav a.active { color: var(--app-primary); font-weight: 600; }
@media (max-width: 991.98px) { body.signed-in { padding-bottom: 72px; } }

/* ---------- Karten / Flächen ---------- */
.card { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 1rem; box-shadow: var(--app-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--app-border); padding: 1rem 1.25rem; font-weight: 600; }
.card-header:first-child { border-radius: 1rem 1rem 0 0; }
.card-footer { background: transparent; border-top: 1px solid var(--app-border); }
.list-group-item { background: transparent; border-color: var(--app-border); }
.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { border-bottom-color: var(--app-border); }
.dropdown-menu { border-radius: .8rem; border-color: var(--app-border); }

.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.6rem; font-weight: 700; margin: 0; }
.page-header .subtitle { color: var(--app-muted); margin: 0; }

.hero {
    background: linear-gradient(120deg, #14532d 0%, #15803d 50%, #0f766e 100%);
    color: #fff; border-radius: 1.25rem; padding: 2rem; position: relative; overflow: hidden;
    box-shadow: var(--app-shadow);
}
.hero::after {
    content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px;
    border-radius: 50%; border: 36px solid rgba(255, 255, 255, .07);
}
.hero h1 { font-weight: 800; }
.hero .stat { background: rgba(255, 255, 255, .12); border-radius: .9rem; padding: .8rem 1rem; min-width: 110px; }
.hero .stat .value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.hero .stat .label { font-size: .75rem; opacity: .85; text-transform: uppercase; letter-spacing: .04em; }

.stat-card .value { font-size: 1.8rem; font-weight: 800; }
.stat-card .label { color: var(--app-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .icon { width: 44px; height: 44px; border-radius: .8rem; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; background: rgba(var(--app-primary-rgb), .12); color: var(--app-primary); }

/* ---------- Tab-Karten (statt untereinander gestapelter Bereiche) ---------- */
.tab-card > .card-header { padding: 0 1rem; }
.app-tabs {
    flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    gap: .25rem; border-bottom: 0;
}
.app-tabs::-webkit-scrollbar { display: none; }
.app-tabs .nav-link {
    white-space: nowrap; color: var(--app-muted); font-weight: 500;
    padding: 1rem .9rem; border: 0; border-bottom: 3px solid transparent; border-radius: 0;
    background: none; display: inline-flex; align-items: center; gap: .4rem;
}
.app-tabs .nav-link:hover { color: var(--bs-body-color); }
.app-tabs .nav-link.active { color: var(--app-primary); border-bottom-color: var(--app-primary); font-weight: 600; }
.app-tabs .nav-link .badge { font-size: .7rem; }
.app-tabs .nav-link.has-error { color: #dc2626; }
.app-tabs .nav-link.has-error::after { content: "!"; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: #dc2626; color: #fff; font-size: .65rem; font-weight: 700; }
/* Bootstrap blendet nur direkte Kinder von .tab-content aus. Tabs, die z. B. in einem gemeinsamen
   <form> liegen, wären sonst unsichtbar, nähmen aber weiter Platz ein und schöben den Inhalt nach unten. */
.tab-content .tab-pane:not(.active) { display: none; }
.tab-content .tab-pane.active { display: block; }
.tab-card > .tab-content > .tab-pane > .card-body { padding: 1.25rem; }
.tab-card .tab-pane > .match-list,
.tab-card .tab-pane > .list-group,
.tab-card .tab-pane > .table-responsive { border-radius: 0 0 1rem 1rem; overflow: hidden; }
.tab-card .tab-footer { border-top: 1px solid var(--app-border); padding: 1rem 1.25rem; display: flex; justify-content: flex-end; gap: .5rem; }

.notification-matrix th:not(:first-child), .notification-matrix td:not(:first-child) { width: 92px; }
.notification-matrix .form-switch .form-check-input { float: none; margin-left: 0; width: 2.4em; height: 1.3em; cursor: pointer; }

/* ---------- Vereine ---------- */
.min-w-0 { min-width: 0; }
.team-logo-xl { width: 96px; height: 96px; font-size: 1.4rem; }
.club-badge { width: 110px; height: 110px; object-fit: contain; }
.club-header { border-top: 6px solid var(--club-color, var(--app-primary)); }
.club-description { white-space: pre-line; max-height: 420px; overflow-y: auto; }
.club-card {
    display: flex; align-items: center; gap: .9rem; padding: .9rem; height: 100%;
    border: 1px solid var(--app-border); border-radius: .9rem; color: inherit; text-decoration: none;
    background: var(--app-surface); transition: transform .12s, box-shadow .12s;
}
.club-card:hover { color: inherit; transform: translateY(-2px); box-shadow: var(--app-shadow); }
.club-card.favorite { border-color: rgba(var(--app-primary-rgb), .6); background: rgba(var(--app-primary-rgb), .05); }
.player-card { display: flex; align-items: center; gap: .75rem; padding: .6rem; border: 1px solid var(--app-border); border-radius: .8rem; height: 100%; }
.player-photo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--app-surface-2); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.rank-change.up { color: #16a34a; }
.rank-change.down { color: #dc2626; }
.group-post { border-bottom: 1px solid var(--app-border); padding: .9rem 1.25rem; }
.group-post:last-child { border-bottom: 0; }
.group-post .text { white-space: pre-line; overflow-wrap: anywhere; }

/* Leere Fehlerzusammenfassung (asp-validation-summary) nicht als roten Kasten anzeigen. */
.validation-summary-valid { display: none !important; }

/* ---------- Cookie-Banner ---------- */
.cookie-banner {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1080;
    padding: 1rem; padding-bottom: max(1rem, env(safe-area-inset-bottom));
    pointer-events: none;
}
.cookie-banner-inner {
    pointer-events: auto; max-width: 960px; margin: 0 auto;
    background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25); padding: 1.25rem;
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
}
.cookie-banner-inner > :first-child { flex: 1 1 420px; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 575.98px) { .cookie-actions { width: 100%; } .cookie-actions .btn { flex: 1; } }

/* ---------- Meldungen & Inhaltsseiten ---------- */
.announcement { border-radius: .8rem; }
.footer-links a { color: inherit; }
.markdown-body h2 { font-size: 1.3rem; font-weight: 700; margin-top: 2rem; }
.markdown-body h3 { font-size: 1.1rem; font-weight: 700; margin-top: 1.5rem; }
.markdown-body table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; font-size: .9rem; }
.markdown-body th, .markdown-body td { border: 1px solid var(--app-border); padding: .4rem .6rem; }
.markdown-body th { background: var(--app-surface-2); }

/* ---------- Pills / Tabs ---------- */
.nav-pills .nav-link { border-radius: 2rem; color: var(--bs-body-color); }
.nav-pills .nav-link.active { background: var(--app-primary); }
[data-bs-theme="dark"] .nav-pills .nav-link.active { color: #052e16; }

/* ---------- Teams ---------- */
.team-logo { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.team-logo-lg { width: 64px; height: 64px; }
.team-logo-sm { width: 20px; height: 20px; }
.team-logo-fallback { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--app-surface-2); color: var(--app-muted); font-size: .7rem; font-weight: 700; }

/* ---------- Spiele ---------- */
.match-list { display: flex; flex-direction: column; }
.match-day-header { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--app-muted); font-weight: 700; padding: .9rem 1.25rem .4rem; background: var(--app-surface-2); border-bottom: 1px solid var(--app-border); }
.match-row {
    display: grid;
    grid-template-columns: 92px 1fr auto 1fr 110px;
    align-items: center; gap: .75rem;
    padding: .8rem 1.25rem; border-bottom: 1px solid var(--app-border);
    transition: background-color .15s;
}
.match-row:last-child { border-bottom: 0; }
.match-row:hover { background: var(--app-surface-2); }
.match-row .kickoff { font-size: .8rem; color: var(--app-muted); line-height: 1.2; }
.match-row .team { display: flex; align-items: center; gap: .6rem; min-width: 0; font-weight: 500; }
.match-row .team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-row .team.home { justify-content: flex-end; text-align: right; }
.match-row .team.favorite span { font-weight: 700; color: var(--app-primary); }
.match-row .center { display: flex; align-items: center; justify-content: center; min-width: 96px; }
.match-row .extra { text-align: right; }
.match-row a.stretched { color: inherit; text-decoration: none; }

.score {
    display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
    min-width: 76px; padding: .3rem .7rem; border-radius: .6rem;
    font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums;
    background: var(--app-surface-2); border: 1px solid var(--app-border); color: inherit; text-decoration: none;
}
.score.live { background: rgba(220, 38, 38, .1); border-color: rgba(220, 38, 38, .35); color: #dc2626; }
[data-bs-theme="dark"] .score.live { color: #f87171; }
.score.pending { font-weight: 600; font-size: .95rem; color: var(--app-muted); }
.score.flash { animation: score-flash 1.6s ease-out; }
@keyframes score-flash { 0% { transform: scale(1.25); background: #facc15; color: #000; } 100% { transform: scale(1); } }

.live-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 700; color: #dc2626; text-transform: uppercase; }
.live-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #dc2626; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .6); } 70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }

.tip-inputs { display: inline-flex; align-items: center; gap: .3rem; position: relative; }
.tip-input {
    width: 46px; height: 40px; text-align: center; font-weight: 700; font-size: 1.05rem;
    border-radius: .55rem; padding: 0; -moz-appearance: textfield;
}
.tip-input::-webkit-outer-spin-button, .tip-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tip-input.saved { border-color: #22c55e; background-color: rgba(34, 197, 94, .08); }
.tip-input.error { border-color: #dc2626; }
.tip-status { position: absolute; right: -22px; font-size: .9rem; }

.tip-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; padding: .25rem .55rem; border-radius: 2rem; background: var(--app-surface-2); border: 1px solid var(--app-border); white-space: nowrap; }
.tip-badge.outcome-exact { background: rgba(34, 197, 94, .15); border-color: rgba(34, 197, 94, .4); color: #15803d; }
.tip-badge.outcome-partial { background: rgba(234, 179, 8, .15); border-color: rgba(234, 179, 8, .45); color: #a16207; }
.tip-badge.outcome-miss { background: rgba(220, 38, 38, .1); border-color: rgba(220, 38, 38, .35); color: #b91c1c; }
[data-bs-theme="dark"] .tip-badge.outcome-exact { color: #4ade80; }
[data-bs-theme="dark"] .tip-badge.outcome-partial { color: #facc15; }
[data-bs-theme="dark"] .tip-badge.outcome-miss { color: #f87171; }

@media (max-width: 767.98px) {
    .match-row {
        grid-template-columns: 1fr auto 1fr;
        grid-template-areas: "kick kick extra" "home center away";
        row-gap: .45rem; padding: .75rem .9rem;
    }
    .match-row .kickoff { grid-area: kick; display: flex; gap: .5rem; align-items: center; }
    .match-row .kickoff br { display: none; }
    .match-row .team.home { grid-area: home; }
    .match-row .center { grid-area: center; min-width: 0; }
    .match-row .team.away { grid-area: away; }
    .match-row .extra { grid-area: extra; }
    .match-row .team { font-size: .88rem; gap: .4rem; }
    .match-row .team .team-logo { width: 24px; height: 24px; }
    .tip-input { width: 40px; height: 38px; }
    .tip-status { right: -18px; }
}

/* ---------- Tabelle ---------- */
.standings td, .standings th { vertical-align: middle; white-space: nowrap; }
.standings .pos { width: 44px; text-align: center; font-weight: 700; }
.standings tr.zone-cl td:first-child { box-shadow: inset 4px 0 0 #2563eb; }
.standings tr.zone-el td:first-child { box-shadow: inset 4px 0 0 #f97316; }
.standings tr.zone-ecl td:first-child { box-shadow: inset 4px 0 0 #14b8a6; }
.standings tr.zone-promo td:first-child { box-shadow: inset 4px 0 0 #16a34a; }
.standings tr.zone-releg td:first-child { box-shadow: inset 4px 0 0 #eab308; }
.standings tr.zone-down td:first-child { box-shadow: inset 4px 0 0 #dc2626; }
.standings tr.favorite { background: rgba(var(--app-primary-rgb), .08); }
.standings tr.favorite td { font-weight: 600; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; }

/* ---------- Rangliste ---------- */
.rank { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 800; font-size: .85rem; background: var(--app-surface-2); }
.rank-1 { background: linear-gradient(135deg, #fde047, #f59e0b); color: #422006; }
.rank-2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #111827; }
.rank-3 { background: linear-gradient(135deg, #fdba74, #c2410c); color: #fff; }
tr.me { background: rgba(var(--app-primary-rgb), .1); }
tr.me td { font-weight: 600; }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: .75rem; }
.podium .place { text-align: center; flex: 1; max-width: 180px; }
.podium .block { border-radius: .9rem .9rem 0 0; color: #fff; font-weight: 800; font-size: 1.6rem; display: flex; align-items: center; justify-content: center; }
.podium .p1 .block { height: 110px; background: linear-gradient(180deg, #f59e0b, #b45309); }
.podium .p2 .block { height: 80px; background: linear-gradient(180deg, #9ca3af, #4b5563); }
.podium .p3 .block { height: 60px; background: linear-gradient(180deg, #f97316, #9a3412); }
.podium .name { font-weight: 700; margin-top: .4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pts { color: var(--app-muted); font-size: .85rem; margin-bottom: .4rem; }

/* ---------- Diagramm (Punkte-Historie) ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 1rem; }
.bar-chart .bar { flex: 1; background: linear-gradient(180deg, #22c55e, #15803d); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bar-chart .bar:hover { filter: brightness(1.15); }
.bar-chart .bar.empty { background: var(--app-border); }

/* ---------- Auth ---------- */
.auth-wrapper { max-width: 480px; margin: 2rem auto; }
.auth-wrapper.wide { max-width: 640px; }
.auth-card .card-body { padding: 2rem; }
.auth-logo { width: 64px; height: 64px; border-radius: 1rem; }
.code-input { font-size: 2rem; letter-spacing: .6rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.app-footer { background: var(--app-surface); }
.toast { border-radius: .8rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--app-muted); }
.empty-state .bi { font-size: 2.5rem; display: block; margin-bottom: .75rem; opacity: .6; }
.goal-timeline .goal { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px dashed var(--app-border); }
.goal-timeline .goal:last-child { border-bottom: 0; }
.goal-timeline .minute { width: 48px; font-weight: 700; color: var(--app-muted); }
.goal-timeline .goal.away { flex-direction: row-reverse; text-align: right; }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .15em; background: var(--app-surface-2); border: 1px dashed var(--app-border); border-radius: .5rem; padding: .3rem .6rem; }

/* Vereinslinks – führen überall zur Vereinsseite; liegen auch über einer komplett anklickbaren Zeile (stretched-link) */
.club-link { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: .45rem; min-width: 0; color: inherit; text-decoration: none; }
.club-link > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.club-link:hover > span, .club-link:focus-visible > span { color: var(--app-primary); text-decoration: underline; text-underline-offset: 2px; }

/* App-Installation */
.install-steps { padding-left: 1.4rem; margin-bottom: .5rem; }
.install-steps li { margin-bottom: .45rem; }
.install-steps li::marker { font-weight: 700; color: var(--app-primary); }

/* Vereinsstatistik & Prognose – Datenfarben (validiert: Blau/Orange je Modus, neutrale Mitte für Remis) */
:root, [data-bs-theme="light"] { --viz-home: #2a78d6; --viz-away: #eb6834; --viz-neutral: #cbd5e1; --viz-neutral-text: #334155; }
[data-bs-theme="dark"] { --viz-home: #3987e5; --viz-away: #d95926; --viz-neutral: #475569; --viz-neutral-text: #e2e8f0; }

.stat-tile { background: var(--app-surface-2); border: 1px solid var(--app-border); border-radius: .75rem; padding: .85rem 1rem; height: 100%; }
.stat-tile .stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-tile .stat-label { font-size: .8rem; color: var(--app-muted); }

.form-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; font-size: .75rem; font-weight: 700; text-decoration: none; color: #fff; }
.form-badge.form-win { background: #15803d; }
.form-badge.form-draw { background: #64748b; }
.form-badge.form-loss { background: #b91c1c; }

.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: baseline; }
.series-for, .seg-home { background: var(--viz-home); }
.series-against, .seg-away { background: var(--viz-away); }
.seg-draw { background: var(--viz-neutral); }

.period-table th { width: 92px; white-space: nowrap; }
.period-table td { padding-top: .35rem; padding-bottom: .35rem; }
.period-bars { display: flex; align-items: center; gap: .4rem; height: 12px; margin: 2px 0; }
.period-bar { height: 8px; min-width: 2px; border-radius: 0 4px 4px 0; }

.prediction-bar { display: flex; gap: 2px; height: 26px; border-radius: 6px; overflow: hidden; }
.prediction-bar .seg { display: flex; align-items: center; justify-content: center; min-width: 4px; font-size: .75rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; }
.prediction-bar .seg-draw { color: var(--viz-neutral-text); }

.lineup-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .35rem 1rem; }
.lineup-list li { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.lineup-list li > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lineup-number { display: inline-block; min-width: 1.8rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--app-muted); font-weight: 600; }

.match-stat { margin-bottom: .6rem; }
.match-stat-bar { display: flex; gap: 2px; height: 6px; margin-top: 2px; }
.match-stat-bar > div { border-radius: 3px; min-width: 2px; }

/* Heimweg-Finder */
.line-badge { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .45rem; border-radius: .35rem; font-size: .75rem; font-weight: 700; background: var(--app-surface-2); color: var(--bs-body-color); border: 1px solid var(--app-border); white-space: nowrap; }
.journey summary { cursor: pointer; list-style: none; }
.journey summary::-webkit-details-marker { display: none; }
.journey-legs { list-style: none; padding: 0; font-size: .875rem; }
.journey-legs li { display: flex; align-items: baseline; gap: .5rem; padding: .25rem 0; border-top: 1px dashed var(--app-border); }
.journey-legs .leg-time { min-width: 2.8rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.matchday-card { border-left: 4px solid var(--app-primary); }
.journey-planned { border-left: 3px solid var(--bs-primary); }
.journey-legs .leg-time .d-block { line-height: 1; }
