/* ==========================================================================
   Football Tracker – globale Styles (ergänzt das MudBlazor-Theme)
   ========================================================================== */

:root {
    /* Standardwerte – werden vom MainLayout je Wettbewerb überschrieben */
    --ft-primary: #d20a11;
    --ft-primary-dark: #8c070b;
    --ft-primary-light: #ff5252;
    --ft-win: #2e7d32;
    --ft-draw: #f9a825;
    --ft-loss: #d32f2f;
    --ft-cl: #1565c0;
    --ft-el: #ef6c00;
    --ft-ecl: #2e7d32;
    --ft-rel: #f9a825;
    --ft-down: #c62828;
}

html, body {
    font-family: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1:focus {
    outline: none;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.ft-appbar {
    background: linear-gradient(90deg, var(--ft-primary-dark) 0%, var(--ft-primary) 55%, var(--ft-primary-light) 100%) !important;
}

.ft-appbar.ft-appbar-dark {
    background: var(--mud-palette-appbar-background) !important;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.ft-brand {
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.ft-brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    min-width: 38px;
    padding: 2px;
    border-radius: 8px;
    background: white;
    flex-shrink: 0;
}

.ft-brand-logo img {
    height: 34px;
    width: auto;
    display: block;
}

.ft-brand-logo.wordmark {
    padding: 0 10px;
}

.ft-brand-logo.wordmark img {
    height: 13px;
}

.ft-brand-logo-short {
    display: none;
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--ft-primary);
}

@media (max-width: 600px) {
    /* Auf dem Smartphone ist die Wortmarke zu breit – stattdessen ein kompaktes Badge */
    .ft-brand-logo.wordmark {
        padding: 0;
    }

    .ft-brand-logo.wordmark img {
        display: none;
    }

    .ft-brand-logo.wordmark .ft-brand-logo-short {
        display: inline;
    }
}

.ft-brand-title {
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.ft-brand-subtitle {
    font-size: 0.72rem;
    opacity: 0.8;
}

.ft-season-button {
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.14) !important;
}

.ft-account-avatar {
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--ft-primary) !important;
    font-weight: 700;
    cursor: pointer;
}

.ft-drawer {
    border-right: 1px solid var(--mud-palette-lines-default) !important;
}

.ft-drawer .mud-nav-link {
    border-radius: 10px;
    margin: 1px 0;
}

.ft-drawer .mud-nav-link.active {
    font-weight: 700;
}

.ft-main {
    min-height: 100vh;
}

.content-wrapper {
    animation: ft-fade-in 0.25s ease-out;
}

@keyframes ft-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Allgemeine Bausteine
   -------------------------------------------------------------------------- */

.ft-card {
    border-radius: 14px !important;
    border-color: var(--mud-palette-lines-default) !important;
    background: var(--mud-palette-surface);
}

.ft-hover-lift {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ft-hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.ft-clickable,
.ft-clickable td {
    cursor: pointer;
}

.ft-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ft-two-lines {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.ft-nowrap {
    white-space: nowrap;
}

.ft-team-logo {
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
}

.ft-table th {
    font-weight: 700 !important;
    color: var(--mud-palette-text-secondary) !important;
    font-size: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ft-scroll-list {
    max-height: 460px;
    overflow-y: auto;
}

/* Seitenkopf */
.ft-page-header {
    border-radius: 16px !important;
    background: linear-gradient(135deg, var(--mud-palette-surface) 0%, var(--mud-palette-background) 100%) !important;
    border: 1px solid var(--mud-palette-lines-default);
}

.ft-page-header-icon {
    background: linear-gradient(135deg, var(--ft-primary) 0%, var(--ft-primary-dark) 100%) !important;
    color: white !important;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--ft-primary) 35%, transparent);
}

.ft-page-title {
    line-height: 1.15 !important;
}

.ft-page-subtitle {
    color: var(--mud-palette-text-secondary);
    margin-top: 2px;
}

/* Kennzahlen */
.ft-stat-card {
    border-radius: 14px !important;
    height: 100%;
}

/* Kennzahlen-Raster für fünf Karten (MudGrid teilt nur durch 12) */
.ft-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 960px) {
    .ft-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1440px) {
    .ft-stat-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.ft-stat-icon {
    background: var(--mud-palette-action-default-hover) !important;
    flex-shrink: 0;
}

/* Hero (Dashboard, Spieler) */
.ft-hero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 32px;
    color: white;
    background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.16) 0%, transparent 40%),
                linear-gradient(135deg, var(--ft-primary) 0%, var(--ft-primary-dark) 70%, #3b0306 100%);
    box-shadow: 0 16px 40px color-mix(in srgb, var(--ft-primary) 25%, transparent);
}

.ft-hero-content {
    position: relative;
    z-index: 1;
}

.ft-hero-overline {
    color: rgba(255, 255, 255, 0.8) !important;
}

.ft-hero-title {
    color: white !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
}

.ft-hero-text {
    color: rgba(255, 255, 255, 0.88) !important;
    margin-top: 4px;
}

.ft-hero-button {
    background: white !important;
    color: var(--ft-primary) !important;
}

.ft-hero-ball {
    position: absolute;
    right: -30px;
    bottom: -40px;
    font-size: 220px !important;
    width: 220px !important;
    height: 220px !important;
    opacity: 0.12;
    color: white;
    transform: rotate(-15deg);
}

.ft-hero-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.ft-hero-fav .mud-icon-button {
    background: rgba(255, 255, 255, 0.92);
}

.ft-player-hero-avatar {
    width: 84px !important;
    height: 84px !important;
    font-size: 2.2rem !important;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--ft-primary) !important;
}

/* --------------------------------------------------------------------------
   Tabelle
   -------------------------------------------------------------------------- */

.ft-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 4px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    background: var(--mud-palette-action-default-hover);
}

.ft-pos-cl { background: var(--ft-cl); color: white; }
.ft-pos-el { background: var(--ft-el); color: white; }
.ft-pos-ecl { background: var(--ft-ecl); color: white; }
.ft-pos-rel { background: var(--ft-rel); color: #1f2937; }
.ft-pos-down { background: var(--ft-down); color: white; }

.ft-legend {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.ft-rank {
    font-weight: 700;
    color: var(--mud-palette-text-secondary);
}

/* Form */
.ft-form {
    display: inline-flex;
    gap: 3px;
    vertical-align: middle;
}

.ft-form-chip {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: white;
}

.ft-form-win { background: var(--ft-win); }
.ft-form-draw { background: var(--ft-draw); color: #1f2937; }
.ft-form-loss { background: var(--ft-loss); }
.ft-form-none { background: var(--mud-palette-lines-default); color: var(--mud-palette-text-secondary); }

/* Sieg/Remis/Niederlage-Balken */
.ft-wdl-bar {
    display: flex;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--mud-palette-lines-default);
}

.ft-wdl-bar .win { background: var(--ft-win); }
.ft-wdl-bar .draw { background: var(--ft-draw); }
.ft-wdl-bar .loss { background: var(--ft-loss); }

/* Prognosen */
.ft-prediction-match {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    gap: 8px;
}

.ft-prediction-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    text-align: center;
}

.ft-prediction-team-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: inherit;
    text-decoration: none;
}

.ft-prediction-team-name:hover {
    color: var(--ft-primary);
}

.ft-prediction-tip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 4px;
}

.ft-prediction-score {
    font-size: 1.6rem;
    font-weight: 800;
    padding: 2px 14px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--ft-primary) 10%, transparent);
    color: var(--ft-primary);
    font-variant-numeric: tabular-nums;
}

.ft-prediction-bar {
    height: 12px;
}

.ft-prediction-facts {
    padding-left: 1.1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--mud-palette-text-secondary);
}

.ft-prediction-facts li + li {
    margin-top: 4px;
}

.ft-sim-cell {
    font-variant-numeric: tabular-nums;
    min-width: 58px;
}

.ft-row-selected td {
    background: color-mix(in srgb, var(--ft-primary) 7%, transparent);
    font-weight: 600;
}

/* Prognose im Detail */
.ft-prediction-score-large {
    font-size: 2.2rem;
    padding: 4px 20px;
}

.ft-detail-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
}

.ft-detail-step-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
}

.ft-detail-step-link:hover {
    color: var(--ft-primary);
}

.ft-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ft-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ft-step-text {
    max-width: 820px;
}

.ft-factor {
    display: flex;
    flex-direction: column;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--mud-palette-lines-default);
    min-width: 120px;
}

.ft-factor-label,
.ft-factor-hint {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.ft-factor-value {
    font-size: 1.3rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.ft-detail-table td,
.ft-detail-table th {
    font-variant-numeric: tabular-nums;
}

.ft-result-chip-small {
    width: auto;
    min-width: 34px;
    padding: 0 5px;
}

.ft-weight {
    display: inline-block;
    width: 36px;
    height: 6px;
    border-radius: 3px;
    background: var(--mud-palette-lines-default);
    overflow: hidden;
    vertical-align: middle;
    margin-right: 4px;
}

.ft-weight > div {
    height: 100%;
    background: var(--ft-primary);
}

.ft-formula {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.ft-formula-term {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 12px;
    border-radius: 10px;
    background: var(--mud-palette-action-default-hover);
    min-width: 76px;
}

.ft-formula-value {
    font-weight: 800;
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.ft-formula-label {
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
    text-align: center;
}

.ft-formula-result {
    background: color-mix(in srgb, var(--ft-primary) 12%, transparent);
    color: var(--ft-primary);
}

.ft-formula-op {
    font-weight: 700;
    color: var(--mud-palette-text-secondary);
}

.ft-pmf-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.ft-pmf-label {
    width: 22px;
    text-align: right;
    font-weight: 600;
    font-size: 0.85rem;
}

.ft-pmf-bar {
    flex: 1;
    height: 14px;
    border-radius: 4px;
    background: var(--mud-palette-lines-default);
    overflow: hidden;
}

.ft-pmf-bar > div {
    height: 100%;
    background: var(--ft-primary);
}

.ft-pmf-value {
    width: 40px;
    text-align: right;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.ft-matrix-wrap {
    overflow-x: auto;
}

.ft-matrix {
    border-collapse: separate;
    border-spacing: 3px;
    font-variant-numeric: tabular-nums;
}

.ft-matrix th {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
    padding: 2px 6px;
}

.ft-matrix-corner {
    font-weight: 500;
    font-size: 0.7rem !important;
    text-align: left;
    max-width: 120px;
}

.ft-matrix td {
    width: 52px;
    height: 38px;
    text-align: center;
    border-radius: 6px;
    font-size: 0.82rem;
}

.ft-matrix-diagonal {
    font-style: italic;
}

.ft-matrix-tip {
    outline: 2px solid var(--ft-primary);
    outline-offset: -2px;
    font-weight: 800;
}

.ft-matrix-actual {
    box-shadow: inset 0 0 0 3px var(--ft-win);
    font-weight: 800;
}

.ft-matrix-key {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    vertical-align: middle;
}

.ft-matrix-key.ft-matrix-tip {
    outline-offset: -2px;
}

/* Kalender auf der Teamseite */
.ft-calendar-month {
    min-width: 130px;
    text-align: center;
}

.ft-calendar-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 16px;
    border: 1px solid var(--mud-palette-lines-default);
    background: transparent;
    color: var(--mud-palette-text-primary);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

.ft-calendar-filter.off {
    opacity: 0.45;
    text-decoration: line-through;
}

.ft-calendar-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.ft-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.ft-calendar-weekday {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--mud-palette-text-secondary);
    padding-bottom: 2px;
}

.ft-calendar-day {
    min-height: 78px;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--mud-palette-lines-default);
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ft-calendar-day.outside {
    opacity: 0.35;
}

.ft-calendar-day.today {
    border-color: var(--ft-primary);
    box-shadow: inset 0 0 0 1px var(--ft-primary);
}

.ft-calendar-date {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

.ft-calendar-day.today .ft-calendar-date {
    color: var(--ft-primary);
}

/* Zeile 1: Logo und Ergebnis bzw. Uhrzeit, Zeile 2: Gegner */
.ft-calendar-game {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "logo score" "name name";
    align-items: center;
    gap: 2px 4px;
    width: 100%;
    min-width: 0;
    padding: 3px 4px 3px 6px;
    border: none;
    border-left: 3px solid var(--ft-comp);
    border-radius: 0 6px 6px 0;
    background: color-mix(in srgb, var(--ft-comp) 10%, transparent);
    color: var(--mud-palette-text-primary);
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
    text-align: left;
}

.ft-calendar-game:hover {
    background: color-mix(in srgb, var(--ft-comp) 22%, transparent);
}

.ft-calendar-game > img,
.ft-calendar-game > .mud-avatar {
    grid-area: logo;
}

.ft-calendar-opponent {
    grid-area: name;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ft-calendar-result,
.ft-calendar-time {
    grid-area: score;
    justify-self: end;
}

.ft-calendar-result {
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 700;
    color: white;
    font-variant-numeric: tabular-nums;
}

.ft-calendar-result.ft-form-draw {
    color: #1f2937;
}

.ft-calendar-live {
    background: var(--ft-loss);
}

.ft-calendar-time {
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
    .ft-calendar-day {
        min-height: 56px;
        padding: 2px;
    }

    .ft-calendar-game {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "logo" "score";
        justify-items: center;
        gap: 1px;
        padding: 2px;
        border-left-width: 0;
        border-top: 3px solid var(--ft-comp);
        border-radius: 0 0 6px 6px;
    }

    .ft-calendar-opponent {
        display: none;
    }

    .ft-calendar-result,
    .ft-calendar-time {
        font-size: 0.65rem;
        justify-self: center;
    }
}

/* Spielkarte als Link zur Detailseite */
.ft-prediction-card {
    cursor: pointer;
    border-radius: 14px;
}

.ft-prediction-card > .ft-card {
    transition: border-color 0.15s ease;
}

.ft-prediction-card:hover > .ft-card,
.ft-prediction-card:focus-visible > .ft-card {
    border-color: var(--ft-primary) !important;
}

.ft-prediction-card:focus-visible {
    outline: none;
}

.ft-prediction-more {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    margin-top: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ft-primary);
}

@media (max-width: 600px) {
    .ft-matrix td {
        width: 40px;
        height: 32px;
        font-size: 0.72rem;
    }
}

/* --------------------------------------------------------------------------
   Spiele
   -------------------------------------------------------------------------- */

.ft-game-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ft-game-row:hover {
    background: var(--mud-palette-action-default-hover);
}

.ft-game-row-highlight {
    background: color-mix(in srgb, var(--ft-primary) 7%, transparent);
    box-shadow: inset 3px 0 0 var(--ft-primary);
}

.ft-game-row-team {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    font-weight: 500;
    font-size: 0.9rem;
}

.ft-game-row-team.away {
    justify-content: flex-start;
}

.ft-game-row-score {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 64px;
    justify-content: center;
}

.ft-game-row-time {
    font-size: 0.85rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 600;
}

.ft-score-badge {
    font-weight: 800;
    min-width: 52px;
    text-align: center;
    padding: 3px 8px;
    border-radius: 8px;
    background: var(--mud-palette-dark);
    color: white;
    font-variant-numeric: tabular-nums;
}

.ft-score-badge.live {
    background: var(--ft-primary);
}

.ft-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f44336;
    display: inline-block;
    animation: ft-pulse 1.4s infinite;
    flex-shrink: 0;
}

.ft-pulse {
    animation: ft-pulse 1.6s infinite;
}

@keyframes ft-pulse {
    0% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(244, 67, 54, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0); }
}

/* Spieltagsauswahl */
.ft-matchday-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    padding: 4px 2px;
}

.ft-matchday {
    flex: 0 0 auto;
    min-width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--mud-palette-lines-default);
    background: transparent;
    color: var(--mud-palette-text-primary);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ft-matchday:hover {
    border-color: var(--ft-primary);
}

.ft-matchday.current {
    border-color: var(--ft-primary);
    color: var(--ft-primary);
}

.ft-matchday.selected {
    background: var(--ft-primary);
    border-color: var(--ft-primary);
    color: white;
}

/* Spielplan eines Teams */
.ft-fixture {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 10px;
    cursor: pointer;
}

.ft-fixture:hover {
    background: var(--mud-palette-action-default-hover);
}

.ft-fixture.next {
    background: rgba(25, 118, 210, 0.08);
    box-shadow: inset 3px 0 0 #1976d2;
}

.ft-fixture-day { min-width: 26px; }
.ft-fixture-date { min-width: 42px; }
.ft-fixture-venue { min-width: 30px; }

.ft-result-chip {
    min-width: 54px;
    justify-content: center;
}

/* Spieldetails */
.ft-match-hero {
    padding: 24px 20px 20px;
    color: white;
    background: linear-gradient(135deg, var(--ft-primary) 0%, var(--ft-primary-dark) 100%);
}

.ft-match-hero-meta {
    color: rgba(255, 255, 255, 0.85) !important;
    display: block;
    text-align: center;
}

.ft-match-hero-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.ft-match-hero-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-weight: 700;
    text-align: center;
}

.ft-match-hero-team img {
    background: white;
    border-radius: 14px;
    padding: 6px;
}

.ft-match-hero-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ft-match-hero-result {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.ft-goal-timeline {
    position: relative;
}

.ft-goal-timeline::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--mud-palette-lines-default);
    transform: translateX(-50%);
}

.ft-goal-row {
    display: grid;
    grid-template-columns: 1fr 88px 1fr;
    align-items: center;
    padding: 6px 0;
}

.ft-goal-row.home .ft-goal-side:first-child {
    display: flex;
    justify-content: flex-end;
}

.ft-goal-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.ft-goal-minute {
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-surface);
    padding: 0 4px;
}

.ft-goal-score {
    font-weight: 800;
    background: var(--mud-palette-surface);
    border: 2px solid var(--ft-primary);
    border-radius: 999px;
    padding: 1px 10px;
    font-size: 0.85rem;
}

.ft-goal-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.ft-goal-row.home .ft-goal-label {
    justify-content: flex-end;
    text-align: right;
}

/* --------------------------------------------------------------------------
   Teams
   -------------------------------------------------------------------------- */

.ft-team-tile {
    position: relative;
    height: 100%;
}

.ft-team-tile-fav {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 1;
}

.ft-team-tile-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 12px 18px;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.ft-team-hero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, #111827 0%, #1f2937 60%, var(--ft-primary-dark) 140%);
    color: white;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
}

.ft-team-hero-bg {
    position: absolute;
    inset: -20%;
    background-repeat: no-repeat;
    background-position: 110% 50%;
    background-size: 55%;
    opacity: 0.08;
    filter: blur(1px);
}

.ft-team-hero-content {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    padding: 32px;
}

.ft-team-hero-logo {
    background: white;
    border-radius: 20px;
    padding: 12px;
    display: flex;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.ft-team-hero-fav .mud-icon-button {
    background: rgba(255, 255, 255, 0.92);
}

/* Team-Vergleich */
.ft-compare-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

.ft-compare-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
}

.ft-compare-row {
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.ft-compare-value {
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--mud-palette-text-secondary);
}

.ft-compare-value.better {
    color: var(--mud-palette-text-primary);
    font-weight: 800;
}

.ft-compare-bar {
    flex: 1;
    height: 8px;
    border-radius: 6px;
    background: var(--mud-palette-lines-default);
    overflow: hidden;
    display: flex;
}

.ft-compare-bar.left {
    justify-content: flex-end;
}

.ft-compare-bar.left span { background: var(--ft-primary); }
.ft-compare-bar.right span { background: var(--ft-compare-second, #1976d2); }

.ft-compare-bar span {
    display: block;
    height: 100%;
    border-radius: 6px;
    transition: width 0.4s ease;
}

/* --------------------------------------------------------------------------
   Torschützen & Player Tracker
   -------------------------------------------------------------------------- */

.ft-podium {
    cursor: pointer;
    border-top-width: 4px !important;
    border-top-style: solid !important;
}

.ft-podium-1 { border-top-color: #d4af37 !important; }
.ft-podium-2 { border-top-color: #a8a9ad !important; }
.ft-podium-3 { border-top-color: #cd7f32 !important; }

.ft-podium-rank {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.ft-podium-1 .ft-podium-rank { background: #d4af37; }
.ft-podium-2 .ft-podium-rank { background: #a8a9ad; }
.ft-podium-3 .ft-podium-rank { background: #cd7f32; }

.ft-player-card {
    display: flex;
    flex-direction: column;
}

.ft-player-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 8px;
}

.ft-player-avatar {
    background: linear-gradient(135deg, var(--ft-primary) 0%, var(--ft-primary-dark) 100%) !important;
    color: white !important;
    font-weight: 800;
}

.ft-player-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px 16px;
    text-align: center;
}

.ft-player-stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.ft-player-stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
}

.ft-sparkbars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 44px;
    padding: 4px 16px;
}

.ft-sparkbars span {
    flex: 1;
    min-width: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--mud-palette-lines-default);
}

.ft-sparkbars span.hit {
    background: var(--ft-primary);
}

.ft-player-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 8px 8px 16px;
    margin-top: auto;
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* Profil */
.ft-profile-banner {
    height: 96px;
    background: linear-gradient(135deg, var(--ft-primary) 0%, var(--ft-primary-dark) 100%);
}

.ft-profile-avatar {
    width: 96px !important;
    height: 96px !important;
    margin-top: -48px;
    font-size: 2.4rem !important;
    font-weight: 800;
    background: var(--mud-palette-surface) !important;
    color: var(--ft-primary) !important;
    border: 4px solid var(--mud-palette-surface);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
    .ft-stat-icon {
        display: none !important;
    }

    .ft-stat-card {
        padding: 12px !important;
    }

    .ft-hero,
    .ft-team-hero-content {
        padding: 22px;
    }

    .ft-hero-title {
        font-size: 1.8rem !important;
    }

    .ft-hero-ball {
        font-size: 150px !important;
        width: 150px !important;
        height: 150px !important;
    }

    .ft-match-hero-result {
        font-size: 2rem;
    }

    .ft-game-row-team span {
        font-size: 0.82rem;
    }

    .ft-compare-row {
        grid-template-columns: 44px 1fr 44px;
        gap: 6px;
    }
}

/* --------------------------------------------------------------------------
   Blazor Standard & Ladebildschirm
   -------------------------------------------------------------------------- */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "Es ist ein Fehler aufgetreten.";
}

.app-loader {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 35%, #1e293b 0%, #0f172a 70%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    font-family: 'Inter', system-ui, sans-serif;
}

.loader-logo {
    width: 120px;
    height: auto;
    border-radius: 24px;
    animation: ft-loader-fade 1s ease-in-out;
}

.loader-bar-container {
    width: 220px;
    height: 6px;
    background: #1e293b;
    border-radius: 6px;
    overflow: hidden;
}

.loader-bar {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, #d20a11, #ff6b6b);
    animation: ft-loading 1.4s infinite;
}

.loader-text {
    color: #cbd5f5;
    font-size: 14px;
}

@keyframes ft-loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

@keyframes ft-loader-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ft-stat-value {
    line-height: 1.25 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mud-tab {
    text-transform: none !important;
    font-weight: 600 !important;
}

/* Tabellenverlauf */
.ft-position-chart {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.ft-chart-grid {
    stroke: var(--mud-palette-lines-default);
    stroke-width: 1;
}

.ft-chart-axis {
    fill: var(--mud-palette-text-secondary);
    font-size: 11px;
}

.ft-chart-label {
    font-size: 12px;
    font-weight: 700;
}

.ft-chart-point {
    cursor: default;
}

.ft-chart-series:hover polyline {
    stroke-width: 5;
}

.ft-zone { opacity: 0.12; }
.ft-zone-cl { fill: var(--ft-cl); }
.ft-zone-el { fill: var(--ft-el); }
.ft-zone-ecl { fill: var(--ft-ecl); }
.ft-zone-rel { fill: var(--ft-rel); opacity: 0.2; }
.ft-zone-down { fill: var(--ft-down); }

/* Zonen 2. Bundesliga */
.ft-pos-up { background: var(--ft-ecl); color: white; }
.ft-pos-relup { background: #66bb6a; color: white; }
.ft-zone-up { fill: var(--ft-ecl); }
.ft-zone-relup { fill: #66bb6a; }

/* Pokal */
.ft-cup-round-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 4px 16px;
}

.ft-cup-game {
    min-width: 0;
}

.ft-competition-button {
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.14) !important;
}

.ft-matchday {
    padding: 0 8px;
    white-space: nowrap;
}

/* Zonen Champions League (Ligaphase) */
.ft-pos-ko { background: var(--ft-ecl); color: white; }
.ft-pos-po { background: #1565c0; color: white; }
.ft-zone-ko { fill: var(--ft-ecl); }
.ft-zone-po { fill: #1565c0; opacity: 0.08; }
