:root {
    /* Fonds */
    --fond: #0e1218;
    --fond-eleve: #0f141c;
    --fond-champ: #0f172a;
    --carte: #161c26;
    --carte-alt: #1d2635;
    --carte-entete: #1b2535;
    --survol: #202b3c;
    --fond-bouton: #1e293b;

    /* Texte */
    --texte: #e6edf3;
    --texte-attenue: #8b9bb0;
    --texte-doux: #a3b2c8;
    --texte-subtil: #9eafc3;
    --texte-estompe: #7f8b9b;
    --texte-faible: #5f6b7a;
    --texte-secondaire: #aeb7c3;
    --texte-evenement: #c7d2df;
    --texte-lien: #e8f0fa;
    --texte-meta: #cbd5e1;
    --texte-tableau: #dbe5f0;
    --texte-lien-match: #dbeafe;
    --texte-sur-direct: #ffffff;

    /* Bordures */
    --bordure: #263142;
    --bordure-ligne: #1e2a3a;
    --bordure-champ: #334155;
    --bordure-bouton: #475569;
    --bordure-douce: #7f7f7f40;

    /* Accent */
    --accent: #00ff88;

    /* Direct (live) */
    --direct: #ff3b3b;
    --direct-doux: #ff6b6b;
    --bordure-direct: #ff3b3b59;
    --fond-direct: #ff3b3b1a;
    --fond-direct-fort: #ff3b3b26;
    --bordure-direct-forte: #ff3b3b66;

    /* Aujourd’hui / succès */
    --aujourdhui: #31c48d;
    --bordure-aujourdhui: #31c48d8c;
    --succes: #22c55e;

    /* À venir */
    --a-venir: #3f8cff;
    --a-venir-doux: #69a7ff;
    --fond-a-venir: #3f8cff14;

    /* Terminé */
    --termine: #5f6b7a;
    --fond-termine: #5f6b7a1a;

    /* Annulé */
    --annule: #f59e0b;
    --annule-doux: #fbbf24;
    --fond-annule: #f59e0b1f;

    /* Stats domicile / extérieur */
    --stat-domicile: #7dd3fc;
    --stat-domicile-debut: #0ea5e9;
    --stat-domicile-fin: #38bdf8;
    --stat-exterieur: #f9a8d4;
    --stat-exterieur-debut: #ec4899;
    --stat-exterieur-fin: #f472b6;

    /* Danger / neutre */
    --danger: #ef4444;
    --neutre: #94a3b8;

    /* Blanc / noir avec alpha */
    --blanc-03: #ffffff06;
    --blanc-04: #ffffff09;
    --blanc-05: #ffffff0b;
    --blanc-05b: #ffffff0d;
    --blanc-06: #ffffff0e;
    --blanc-06b: #ffffff0f;
    --blanc-07: #ffffff12;
    --blanc-08: #ffffff14;
    --noir-28: #00000047;
    --noir-35: #00000059;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--fond);
    color: var(--texte);
    font-family: system-ui, -apple-system, sans-serif;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: 50px;
    box-sizing: border-box;
    padding: 10px 18px;
    background: var(--carte);
    border-bottom: 1px solid var(--bordure);
    position: sticky;
    top: 0;
    z-index: 99;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    font-weight: 900;
    font-size: 1.15rem;
    line-height: 1;
    white-space: nowrap;
}

.site-brand-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

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

.tools input {
    background: var(--fond);
    border: 1px solid var(--bordure);
    color: var(--texte);
    padding: 8px 12px;
    border-radius: 8px;
    width: 160px;
    font-size: 13px;
}

.tools input::placeholder { color: var(--texte-attenue); }

.language {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 900;
    font-size: 0.8rem;
    white-space: nowrap;
}

.language-label {
    line-height: 1;
}

.lang-switch {
    background: var(--fond);
    border: 1px solid var(--bordure);
    color: var(--texte);
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.back-btn {
    color: var(--texte);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid var(--bordure);
    padding: 7px 11px;
    border-radius: 8px;
    white-space: nowrap;
}

.back-btn:hover { background: var(--carte-alt); }


@media (max-width: 600px) {
    .topbar { padding: 9px 12px; gap: 8px; }
    .site-brand { font-size: 1rem; }
    .site-brand-logo { width: 22px; height: 22px; }
    .language-label { display: none; }
    .topbar-actions { gap: 6px; }
}

.container {
    max-width: 1200px;
    margin: 18px auto;
    padding: 0 12px;
}

.card {
    background: var(--carte);
    border: 1px solid var(--bordure);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    text-align: center;
    color: var(--texte-attenue);
}

.timeline {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    align-items: center;
}

.tab {
    flex: 0 0 auto;
    background: var(--carte);
    border: 1px solid var(--bordure);
    color: var(--texte-attenue);
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    font-size: 13px;
}

.tab.active { background: var(--texte); color: var(--fond); }
.tab.day-tab.today-tab { color: var(--aujourdhui); border-color: var(--bordure-aujourdhui); }
/* The TODAY tab must always show its complete label and match count. */
.tab.day-tab.today-tab {
    min-width: 110px !important;
    width: max-content !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    position: relative;
    z-index: 3;
}
.tab.day-tab.today-tab.active { color: var(--aujourdhui); }
.tab.live-tab { border-color: var(--bordure-direct); color: var(--direct-doux); }
.tab.live-tab.active { background: var(--direct); color: var(--texte-sur-direct); }

.country-group {
    margin-bottom: 20px;
    background: var(--carte);
    border: 1px solid var(--bordure);
    border-radius: 14px;
    overflow: hidden;
}

.country-header {
    padding: 12px 14px;
    background: var(--carte-alt);
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--bordure);
    color: var(--texte-doux);
}

.league-group { border-bottom: 1px solid var(--bordure); }
.league-group:last-child { border-bottom: 0; }

.league-header {
    padding: 12px 14px;
    background: var(--carte-entete);
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.competition-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 5px;
}

.competition-logo-fallback {
    margin-right: 5px;
}

.league-title-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    flex-wrap: wrap;
}

.league-group-header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.league-group-header .league-title-wrap {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    flex-wrap: nowrap;
}

.league-group-label {
    display: inline-block;
    margin-left: 7px;
    color: var(--texte-attenue);
    font-weight: 700;
}

.league-group-header .league-title-wrap > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.league-group-header .league-actions {
    flex: 0 0 auto;
    margin-top: 0;
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: auto;
    max-width: none;
    white-space: nowrap;
}

.league-group-buttons {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.league-group-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 9px;
    border: 1px solid var(--bordure);
    border-radius: 999px;
    background: var(--fond);
    color: var(--texte);
    font-size: 10px;
    font-weight: 900;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    transition: .15s ease;
}

.league-group-button:hover,
.league-group-button:focus-visible {
    border-color: var(--accent);
    background: var(--blanc-06b);
    outline: none;
}

.competition-group-matches {
    scroll-margin-top: 12px;
    border-top: 1px solid var(--bordure);
}

.league-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    white-space: nowrap;
}

.league-actions a,
.league-switch a {
    flex: 0 0 auto;
    white-space: nowrap;
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid var(--bordure);
    border-radius: 7px;
    color: var(--texte);
    text-decoration: none;
    background: var(--fond);
    font-size: 11px;
    font-weight: 800;
}

.league-actions a:hover,
.league-switch a:hover,
.league-switch a.active {
    background: var(--texte);
    color: var(--fond);
}

.match-row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) 96px minmax(0, 1fr) 112px 126px;
    align-items: center;
    padding: 11px 0 11px 12px;
    border-bottom: 1px solid var(--bordure-ligne);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    min-height: 66px;
}

.match-row:hover {
    background: var(--survol);
}

.match-row.live {
    border-left: 3px solid var(--direct);
    background: linear-gradient(90deg, var(--fond-direct), transparent);
}

.match-row.finished {
    border-left: 3px solid var(--termine);
    background: linear-gradient(90deg, var(--fond-termine), transparent);
}

.match-row.upcoming {
    border-left: 3px solid var(--a-venir);
    background: linear-gradient(90deg, var(--fond-a-venir), transparent);
}

.time {
    font-size: 11px;
    color: var(--texte-attenue);
    text-align: center;
}

.match-countdown-cell,
.match-actions-cell {
    min-width: 0;
    width: 100%;
    align-items: center;
    justify-items: center;
    text-align: center;
}

.match-countdown-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    line-height: 1;
}

.match-actions-cell {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
}

.match-countdown-label {
    display: block;
    font-size: 8px;
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--texte-attenue);
}

.match-countdown {
    display: block;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--texte);
}

.match-countdown-cell-empty {
    visibility: hidden;
}

.match-detail-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 4px;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--texte-lien-match);
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
}

.match-detail-icon { display: none; }

.action-icon {
    width: 19px;
    height: 19px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.match-detail-link .action-icon,
.match-h2h-button .action-icon {
    flex: 0 0 auto;
}


.action-vs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    height: 19px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.3px;
}

.h2h-tooltip {
    position: fixed;
    z-index: 10000;
    max-width: 360px;
    padding: 9px 11px;
    border: 1px solid var(--bordure);
    border-radius: 7px;
    background: var(--carte);
    color: var(--texte);
    box-shadow: 0 5px 18px rgba(0,0,0,.18);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
    white-space: pre-line;
    pointer-events: none;
}
.h2h-tooltip[hidden] { display: none; }

.match-h2h-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 4px;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--texte-lien-match);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
}
.match-h2h-button:hover,
.match-h2h-button:focus-visible {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    outline: none;
}

.match-h2h-panel {
    display: block;
    margin: 0;
    padding: 14px 16px 16px;
    border-bottom: 1px solid var(--bordure);
    background: var(--fond);
}
.match-h2h-panel[hidden] { display: none; }

.match-h2h-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 12px;
}
.match-h2h-head > strong { font-size: 13px; }
.match-h2h-head > span { color: var(--texte-attenue); text-align: right; }

.match-h2h-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 12px;
}
.match-h2h-summary > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 6px 5px;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    background: var(--carte);
    text-align: center;
}
.match-h2h-summary b {
    font-size: 14px;
    font-weight: 900;
}
.match-h2h-summary span {
    margin-top: 2px;
    color: var(--texte-attenue);
    font-size: 9px;
    line-height: 1.2;
}

.match-h2h-recent-title {
    margin-bottom: 5px;
    color: var(--texte-doux);
    font-size: 11px;
    font-weight: 800;
}
.match-h2h-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-top: 1px solid var(--bordure-ligne);
    font-size: 11px;
}
.match-h2h-result > a,
.match-h2h-result > span:first-child {
    min-width: 0;
}
.match-h2h-result a {
    color: var(--texte);
    text-decoration: none;
}
.match-h2h-result a:hover,
.match-h2h-result a:focus-visible {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    outline: none;
}
.match-h2h-result strong {
    margin: 0 4px;
    font-weight: 900;
}
.match-h2h-result-date {
    flex: 0 0 auto;
    color: var(--texte-attenue);
    font-size: 10px;
    white-space: nowrap;
}
.match-h2h-loading,
.match-h2h-empty {
    color: var(--texte-attenue);
    font-size: 11px;
    text-align: center;
    padding: 7px 0;
}

.match-h2h-detail .match-h2h-summary {
    max-width: 900px;
    margin: 0 auto 16px;
}
.match-h2h-detail .match-h2h-recent {
    max-width: 900px;
    margin: 0 auto;
}
.match-detail-link:hover,
.match-detail-link:focus-visible {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    outline: none;
}



.time.live {
    color: var(--direct);
    font-weight: 900;
}

.time.finished {
    color: var(--texte-estompe);
    font-weight: 700;
}

.time.upcoming {
    color: var(--a-venir-doux);
    font-weight: 800;
}

.team {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-cell {
    display: grid;
    align-items: center;
    min-width: 0;
    gap: 7px;
}

.team-cell.home {
    grid-template-columns: minmax(0, 1fr) 28px;
}

.team-cell.away {
    grid-template-columns: 28px minmax(0, 1fr);
}

.team-logo-slot {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-logo {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.team-logo-flag {
    display: none;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    flex: 0 0 24px;
}

.team.home { text-align: right; }
.team.away { text-align: left; }

.match-score {
    text-align: center;
    min-width: 0;
    font-weight: 900;
}

.match-score strong {
    display: block;
    font-size: 15px;
    line-height: 1.1;
}

.match-score.live strong { color: var(--direct); }
.match-score.finished strong { color: var(--texte-secondaire); }
.match-score.upcoming strong { color: var(--a-venir-doux); }

/* The stacked mobile score is rendered only on mobile. Desktop keeps the single "1 - 0" score. */
.mobile-score { display: none; }

.knockout-info {
    margin-top: 4px;
    color: var(--texte-attenue);
    font-size: 9px;
    line-height: 1.25;
    font-weight: 700;
}

.match-detail-card {
    background: var(--carte);
    border: 1px solid var(--bordure);
    border-radius: 14px;
    overflow: hidden;
}

.detail-head {
    padding: 24px 20px;
    background: var(--carte-alt);
    text-align: center;
    border-bottom: 1px solid var(--bordure);
}

.detail-head .competition-name { font-size: 18px; font-weight: 900; }
.detail-head .competition-round { color: var(--texte-attenue); font-size: 12px; margin-top: 4px; }

.detail-status {
    display: inline-block;
    margin: 14px 0 4px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.detail-status.live {
    background: var(--fond-direct-fort);
    color: var(--direct-doux);
    border: 1px solid var(--bordure-direct-forte);
}

.detail-status.finished {
    background: var(--blanc-05b);
    color: var(--texte-attenue);
    border: 1px solid var(--bordure);
}

.detail-match {
    display: grid;
    grid-template-columns: 1fr 150px 1fr;
    align-items: center;
    gap: 18px;
    margin: 18px auto;
    max-width: 760px;
}

.detail-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    font-size: 18px;
}

.detail-team-logo { width: 58px; height: 58px; object-fit: contain; display: block; }
.detail-team-flag {
    display: none;
    width: 58px;
    height: 58px;
    align-items: center;
    justify-content: center;
    font-size: 46px;
    line-height: 1;
}
.detail-team-flag.visible { display: flex; }
.detail-score { font-size: 38px; font-weight: 950; white-space: nowrap; }
.detail-score small { display: block; color: var(--direct-doux); font-size: 14px; margin-top: 4px; }
.detail-score .knockout-label,
.detail-score .penalty-label { color: var(--texte-attenue); font-size: 12px; font-weight: 800; display: block; }
.detail-score .penalty-label span { font-weight: 900; }

.match-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    color: var(--texte-attenue);
    font-size: 12px;
}

.detail-section { padding: 22px; border-bottom: 1px solid var(--bordure); }
.detail-section:last-child { border-bottom: 0; }
.detail-section h2 { font-size: 17px; margin: 0 0 16px; font-weight: 800; }

.events-grid,
.lineups-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.event-team h3,
.lineup h3 { font-size: 14px; margin: 0 0 9px; color: var(--texte-doux); }

.event-card {
    background: var(--fond);
    border: 1px solid var(--bordure);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 9px;
    min-height: 78px;
}

.event-card h4 { font-size: 12px; margin: 0 0 8px; color: var(--texte-evenement); }

.event-line {
    display: grid;
    grid-template-columns: 40px 24px 1fr;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    border-top: 1px solid var(--bordure-ligne);
    font-size: 12px;
}

.event-line:first-of-type { border-top: 0; }
.event-minute { color: var(--texte-attenue); font-weight: 800; }
.empty-event { color: var(--texte-attenue); font-size: 12px; padding: 6px 0; }

.stats-list {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stat-row {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr) 60px;
    align-items: center;
    gap: 12px;
    min-height: 48px;
}

.stat-val { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-val.home { text-align: right; color: var(--stat-domicile); }
.stat-val.away { text-align: left; color: var(--stat-exterieur); }

.stat-center { display: flex; flex-direction: column; gap: 6px; }
.stat-label { text-align: center; font-size: 12px; color: var(--texte-attenue); font-weight: 600; }

.stat-bar-bg {
    height: 8px;
    background: var(--fond-eleve);
    border-radius: 99px;
    overflow: hidden;
    display: flex;
}

.stat-bar-fill { height: 100%; transition: none; }
.stat-bar-fill.home-fill {
    background: linear-gradient(90deg, var(--stat-domicile-debut), var(--stat-domicile-fin));
    border-radius: 99px 0 0 99px;
}
.stat-bar-fill.away-fill {
    background: linear-gradient(90deg, var(--stat-exterieur-debut), var(--stat-exterieur-fin));
    border-radius: 0 99px 99px 0;
    margin-left: auto;
}

.player-row {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 7px;
    align-items: center;
    padding: 8px 10px;
    border-top: 1px solid var(--bordure);
    font-size: 12px;
}

.player-row:first-child { border-top: 0; }
.player-row .shirt { color: var(--texte-attenue); font-weight: 800; }
.player-row b { font-size: 11px; color: var(--accent); }
.sub-title { margin-top: 18px !important; padding-top: 12px; border-top: 1px solid var(--bordure); }

.league-page-head {
    padding: 16px;
    background: var(--carte-alt);
    border-bottom: 1px solid var(--bordure);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.league-page-head .competition-name { font-size: 17px; font-weight: 900; }
.league-page-title-wrap { min-width: 0; }
.league-page-group-buttons { display: inline-flex; gap: 5px; margin-left: 8px; vertical-align: middle; flex-wrap: wrap; }
.league-page-group-buttons .league-group-button { cursor: default; }
.league-page-head .competition-round { color: var(--texte-attenue); font-size: 11px; margin-top: 3px; }
.league-switch { display: flex; gap: 7px; }

.standings-list { padding: 0; }

.standings-head,
.standings-row {
    display: grid;
    grid-template-columns: 36px 1fr 36px 36px 36px 36px 36px 36px 44px 44px;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    font-size: 12px;
}

.standings-head {
    background: var(--carte-entete);
    color: var(--texte-subtil);
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
}

.standings-row { border-bottom: 1px solid var(--bordure-ligne); }

.standings-row.live-team { color: var(--danger); }
.standings-row.live-team .st-pos,
.standings-row.live-team .st-stat { color: var(--danger); }
.standings-row.live-team .st-team-name,
.standings-row.live-team .st-pts { color: var(--danger); }

.standings-movement {
    display: inline-block;
    margin-left: 5px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}
.standings-movement.up { color: var(--succes); }
.standings-movement.down { color: var(--danger); }
.standings-movement.same { color: var(--neutre); }
.standings-row:last-child { border-bottom: 0; }
.st-pos { text-align: center; font-weight: 800; color: var(--texte-attenue); }
.st-team { display: flex; align-items: center; min-width: 0; font-weight: 700; overflow: hidden; white-space: nowrap; }
.st-team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.standings-movement { flex: 0 0 auto; }
.st-stat { text-align: center; color: var(--texte-attenue); }
.st-pts { text-align: center; font-weight: 900; }

.scorers-list { padding: 8px; }

.scorer-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--bordure);
}

.scorer-rank { font-size: 16px; font-weight: 900; color: var(--texte-attenue); text-align: center; }
.scorer-row b { display: block; }
.scorer-row small { display: block; color: var(--texte-attenue); margin-top: 3px; }
.scorer-row > strong { font-size: 18px; }

@media (max-width: 800px) {
    .hide-mobile { display: none !important; }
    .standings-head,
    .standings-row {
        grid-template-columns: 32px 1fr 36px 40px 44px;
    }
}

@media (max-width: 700px) {
    .tools input { max-width: 120px; }
    .league-header { flex-direction: column; align-items: flex-start; }
    .league-actions { width: max-content; max-width: 100%; justify-content: flex-start; flex-wrap: nowrap !important; }

    /* Mobile match layout is deliberately different from desktop:
       time | teams (logo + name) | aligned scores | actions. */
    .match-row {
        /* Mobile: time | teams | score | detail/TV. The score column is deliberately
           wider and separated from the actions so it sits visually halfway between
           the team names and the detail/TV block. */
        grid-template-columns: 54px minmax(0, 1fr) 52px 78px;
        grid-template-rows: minmax(27px, auto) minmax(27px, auto);
        column-gap: 9px;
        row-gap: 0;
        padding: 8px 7px 8px 8px;
        min-height: 58px;
    }

    .match-row > .time {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: center;
        line-height: 1.2;
        padding-right: 2px;
    }

    .match-row > .team-cell.home,
    .match-row > .team-cell.away {
        grid-column: 2;
        justify-self: stretch;
        display: grid;
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 6px;
        min-width: 0;
    }

    .match-row > .team-cell.home {
        grid-row: 1;
    }

    .match-row > .team-cell.away {
        grid-row: 2;
    }

    /* On mobile the logo is always BEFORE the team name, for both teams. */
    .team-cell.home .team-logo-slot,
    .team-cell.away .team-logo-slot {
        grid-column: 1;
        grid-row: 1;
        order: 0;
    }

    .team-cell.home .team,
    .team-cell.away .team {
        grid-column: 2;
        grid-row: 1;
        order: 0;
        text-align: left;
    }

    .team {
        font-size: 12px;
        line-height: 1.25;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        min-width: 0;
    }

    .team-logo-slot { width: 24px; height: 24px; }
    .team-logo { width: 20px; height: 20px; }
    .team-logo-flag { width: 20px; height: 20px; font-size: 18px; flex-basis: 20px; }

    /* One score column: home and away values are stacked, so every match
       has the exact same score x-position. */
    .match-row > .match-score {
        grid-column: 3;
        grid-row: 1 / span 2;
        align-self: stretch;
        justify-self: stretch;
        display: flex;
        align-items: stretch;
        justify-content: center;
        min-width: 0;
    }

    .desktop-score { display: none !important; }

    .mobile-score {
        display: grid;
        grid-template-rows: minmax(27px, auto) minmax(27px, auto);
        align-items: center;
        justify-items: center;
        width: 100%;
        height: 100%;
        font-size: 14px;
        font-weight: 900;
        line-height: 1;
        font-variant-numeric: tabular-nums;
        text-align: center;
    }

    .mobile-score span {
        display: block;
        min-width: 32px;
        text-align: center;
    }

    .match-score.live .mobile-score { color: var(--direct); }
    .match-score.finished .mobile-score { color: var(--texte-secondaire); }
    .match-score.upcoming .mobile-score { color: var(--a-venir-doux); }

    .match-score .knockout-info {
        display: none;
    }

    .match-row > .match-countdown-cell {
        grid-column: 1;
        grid-row: 2;
        align-self: end;
        transform: translateY(1px);
    }

    .match-row > .match-countdown-cell.match-countdown-cell-empty { display: none; }

    .match-row > .match-actions-cell {
        grid-column: 4;
        grid-row: 1 / span 2;
        align-self: center;
        width: 100%;
        height: 100%;
    }

    .match-actions-cell .match-detail-link,
    .match-actions-cell .match-h2h-button,
    .match-actions-cell .tv-broadcast {
        width: 24px;
        min-width: 24px;
        height: 24px;
        min-height: 24px;
        padding: 0;
        justify-self: center;
    }

    .match-countdown-cell { gap: 2px; }
    .match-countdown-label { font-size: 7px; }
    .match-countdown { font-size: 9px; }
    .match-detail-link {
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
        padding: 0;
        border-radius: 7px;
        text-decoration: none;
    }

    .match-detail-link:hover,
    .match-detail-link:focus-visible {
        background: var(--blanc-08);
        text-decoration: none;
        outline: none;
    }

    .match-detail-label { display: none; }
    .match-h2h-button {
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
        padding: 0;
        border-radius: 7px;
        text-decoration: none;
    }
    .match-h2h-button:hover,
    .match-h2h-button:focus-visible {
        background: var(--blanc-08);
        text-decoration: none;
        outline: none;
    }

    .match-detail-icon {
        width: 22px;
        height: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 2px solid currentColor;
        border-radius: 50%;
        font-size: 14px;
        font-weight: 950;
        line-height: 1;
        font-family: Arial, Helvetica, sans-serif;
        text-decoration: none;
    }

    .tv-broadcast { width: 30px; min-width: 30px; height: 30px; }
    .tv-broadcast-icon { font-size: 17px; }

    .detail-match { grid-template-columns: 1fr 90px 1fr; gap: 7px; }
    .detail-team { font-size: 14px; }
    .detail-team-logo { width: 45px; height: 45px; }
    .detail-team-flag { width: 45px; height: 45px; font-size: 36px; }
    .detail-score { font-size: 27px; }
    .events-grid, .lineups-grid { grid-template-columns: 1fr; }
    .league-page-head { flex-direction: column; align-items: flex-start; }
    .league-switch { width: 100%; }
    .league-switch a { flex: 1; text-align: center; }
    .stat-row { grid-template-columns: 44px 1fr 44px; gap: 8px; }
}

@media (max-width: 430px) {
    .match-row {
        grid-template-columns: 50px minmax(0, 1fr) 48px 34px;
        column-gap: 7px;
        padding-left: 6px;
        padding-right: 5px;
    }
    .team { font-size: 11px; }
    .team-cell.home, .team-cell.away { grid-template-columns: 22px minmax(0, 1fr); gap: 5px; }
    .team-logo-slot { width: 22px; height: 22px; }
    .team-logo { width: 19px; height: 19px; }
    .team-logo-flag { width: 19px; height: 19px; font-size: 17px; flex-basis: 19px; }
    .mobile-score { font-size: 13px; }
    .mobile-score span { min-width: 30px; }
    .match-countdown { font-size: 8px; }
    .match-detail-link { font-size: 9px; }
}


.competition-filter-wrap {
    margin: 14px 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.competition-filter-wrap label { color: var(--texte-attenue); font-size: 12px; font-weight: 800; }
.competition-filter {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    background: var(--carte);
    color: var(--texte);
    border: 1px solid var(--bordure);
    border-radius: 9px;
    padding: 9px 12px;
    font-weight: 700;
}
.league-rounds {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    padding: 10px;
    background: var(--carte);
    border: 1px solid var(--bordure);
    border-radius: 12px;
}
.round-list { display: flex; gap: 7px; overflow-x: auto; flex: 1; padding: 2px; }
.round-btn, .round-arrow {
    flex: 0 0 auto;
    background: var(--fond);
    color: var(--texte-attenue);
    border: 1px solid var(--bordure);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.round-btn.active { background: var(--texte); color: var(--fond); }
.round-arrow { font-size: 18px; line-height: 1; }
.match-link { cursor: pointer; }
.match-link:hover { animation: matchVibrate .18s linear 2; }
@keyframes matchVibrate {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}
@media (prefers-reduced-motion: reduce) { .match-link:hover { animation: none; } }
@media (max-width: 700px) {
    .competition-filter-wrap { align-items: stretch; flex-direction: column; }
    .competition-filter { width: 100%; min-width: 0; }
}

.competition-filter-wrap { margin-bottom: 28px; }
.competition-filter-wrap + .league-rounds { margin-top: 0; margin-bottom: 24px; }
.competition-filter-wrap + #leagueRounds + #matchesByCountry { margin-top: 4px; }
#matchesByCountry { min-height: 40px; }

.match-row.cancelled {
    border-left: 3px solid var(--annule);
    background: linear-gradient(90deg, var(--fond-annule), transparent);
}

.time.cancelled {
    color: var(--annule);
    font-weight: 900;
}

.match-score.cancelled strong {
    color: var(--annule-doux);
}

.league-rounds[hidden] {
    display: none !important;
}

.selection-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 28px;
}

.selection-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.selection-field label {
    color: var(--texte-attenue);
    font-size: 12px;
    font-weight: 800;
}

.team-autocomplete {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.team-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 8px;
}

.team-season-filter { width: 100%; }
.team-filter { width: 100%; }

.team-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 50;
    overflow: hidden;
    background: var(--carte);
    border: 1px solid var(--bordure);
    border-radius: 10px;
    box-shadow: 0 12px 30px var(--noir-35);
}

.team-suggestion {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--bordure);
    background: transparent;
    color: var(--texte);
    text-align: left;
    cursor: pointer;
}

.team-suggestion:last-child { border-bottom: 0; }
.team-suggestion:hover { background: var(--carte-alt); }
.team-suggestion span { color: var(--texte-attenue); font-size: 12px; margin-left: 6px; }
.team-suggestion-empty { padding: 10px 12px; color: var(--texte-attenue); }

.team-results-header {
    margin: 0 0 14px;
    padding: 12px 14px;
    background: var(--carte-alt);
    border: 1px solid var(--bordure);
    border-radius: 10px;
    font-weight: 800;
}

@media (max-width: 700px) {
    .selection-filters { grid-template-columns: 1fr; }
    .selection-filters .team-search-field { max-width: none; }
    .team-controls { grid-template-columns: 1fr; }
}

.team-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 10px 12px;
}

.team-results-title {
    min-width: 0;
    font-weight: 800;
}

.team-results-season {
    width: auto;
    min-width: 150px;
    flex: 0 0 auto;
}

@media (max-width: 640px) {
    .team-results-header {
        align-items: stretch;
        flex-direction: column;
    }
    .team-results-season { width: 100%; }
}

.selection-filters .selection-field,
.selection-filters .competition-filter,
.selection-filters .team-autocomplete,
.selection-filters .team-filter {
    width: 100%;
    box-sizing: border-box;
}

.selection-filters .team-filter {
    min-width: 0;
    width: 100%;
}

.st-team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
}

.st-team-logo {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.st-team-logo img {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.st-team-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .st-team {
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 6px;
    }
    .st-team-logo { width: 24px; height: 24px; }
    .st-team-logo img { width: 20px; height: 20px; }
}

.selection-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.selection-filters .team-search-field {
    min-width: 0;
}

.selection-filters .team-autocomplete {
    width: var(--team-filter-width, 180px);
    min-width: 0;
}

.selection-filters .team-search-field {
    width: 180px;
    max-width: 230px;
}

.selection-filters .team-controls {
    display: block;
    width: 100%;
}

.selection-filters .team-filter {
    display: block;
    width: 180px;
    min-width: 0;
    max-width: 230px;
    box-sizing: border-box;
    transition: width .12s ease;
}

@media (max-width: 700px) {
    .selection-filters { grid-template-columns: 1fr; }
    .selection-filters .team-search-field { max-width: none; }
}

.player-link {
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}
.player-link:hover { color: var(--accent); text-decoration: underline; }

.player-profile-card {
    background: var(--carte);
    border: 1px solid var(--bordure);
    border-radius: 14px;
    overflow: hidden;
}

.player-profile-head {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    background: var(--carte-alt);
    border-bottom: 1px solid var(--bordure);
}

.player-profile-head h1 { margin: 0 0 6px; font-size: 24px; }
.player-profile-team { color: var(--texte-attenue); font-weight: 700; }
.player-profile-photo {
    width: 88px;
    height: 88px;
    object-fit: contain;
    flex: 0 0 88px;
}
.player-profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.player-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 16px;
    border-right: 1px solid var(--bordure);
    border-bottom: 1px solid var(--bordure);
}
.player-info-item span { color: var(--texte-attenue); font-size: 11px; font-weight: 700; }
.player-info-item strong { font-size: 14px; }
@media (max-width: 700px) {
    .player-profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .player-profile-head { padding: 16px; }
    .player-profile-photo { width: 68px; height: 68px; flex-basis: 68px; }
}

.player-link {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    width: fit-content;
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 7px;
    color: var(--texte-lien);
    background: var(--blanc-04);
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 800;
    line-height: 1.2;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.player-link:hover,
.player-link:focus-visible {
    color: var(--accent);
    background: var(--blanc-07);
    border-color: var(--accent);
    text-decoration: none;
    transform: translateX(2px);
    outline: none;
}

.player-profile-identity { min-width: 0; }
.player-profile-short-name { color: var(--texte-attenue); font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.player-profile-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.player-profile-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--fond);
    border: 1px solid var(--bordure);
    color: var(--texte-meta);
    font-size: 11px;
    font-weight: 800;
}
.player-profile-team { display: inline-flex; align-items: center; gap: 7px; color: var(--texte-attenue); font-weight: 800; }
.player-profile-team img { width: 22px; height: 22px; object-fit: contain; }

.player-summary-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-bottom: 1px solid var(--bordure);
}
.player-summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 86px;
    padding: 12px 8px;
    border-right: 1px solid var(--bordure);
}
.player-summary-card:last-child { border-right: 0; }
.player-summary-card strong { font-size: 20px; font-weight: 950; }
.player-summary-card span { color: var(--texte-attenue); font-size: 10px; font-weight: 800; text-align: center; }

.player-stats-card {
    margin-top: 16px;
    background: var(--carte);
    border: 1px solid var(--bordure);
    border-radius: 14px;
    overflow: hidden;
}
.player-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: var(--carte-alt);
    border-bottom: 1px solid var(--bordure);
}
.player-section-title h2 { margin: 0; font-size: 17px; }
.player-section-title span { color: var(--texte-attenue); font-size: 11px; font-weight: 700; }
.player-stat-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.player-stat-group { padding: 16px; border-right: 1px solid var(--bordure); }
.player-stat-group:last-child { border-right: 0; }
.player-stat-group h3 { margin: 0 0 10px; color: var(--texte-doux); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.player-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.player-stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    background: var(--fond);
}
.player-stat-item span { color: var(--texte-attenue); font-size: 11px; }
.player-stat-item strong { font-size: 13px; }

.player-matches-table-wrap { width: 100%; overflow-x: auto; }
.player-matches-table { width: 100%; min-width: 780px; border-collapse: collapse; }
.player-matches-table th,
.player-matches-table td { padding: 10px 12px; border-bottom: 1px solid var(--bordure); text-align: left; white-space: nowrap; font-size: 11px; }
.player-matches-table th { color: var(--texte-attenue); background: var(--carte-alt); font-weight: 800; }
.player-matches-table td { color: var(--texte-tableau); }
.player-matches-table tbody tr:last-child td { border-bottom: 0; }
.player-matches-table tbody tr:hover { background: var(--blanc-03); }
.player-match-link { color: var(--texte-lien-match); font-weight: 800; text-decoration: none; }
.player-match-link:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 900px) {
    .player-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .player-summary-card:nth-child(4) { border-right: 0; }
    .player-stat-groups { grid-template-columns: 1fr; }
    .player-stat-group { border-right: 0; border-bottom: 1px solid var(--bordure); }
    .player-stat-group:last-child { border-bottom: 0; }
}

@media (max-width: 600px) {
    .player-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .player-summary-card { border-right: 1px solid var(--bordure); }
    .player-summary-card:nth-child(2n) { border-right: 0; }
    .player-summary-card:nth-last-child(-n+2) { border-bottom: 0; }
    .player-profile-head { align-items: flex-start; }
    .player-profile-meta { gap: 5px; }
    .player-profile-photo { width: 72px; height: 72px; flex-basis: 72px; }
    .player-section-title { align-items: flex-start; flex-direction: column; }
}

.player-page { padding-bottom: 36px; }
.player-profile-card,
.player-stats-card { overflow: hidden; }
.player-profile-photo-wrap {
    width: 112px;
    height: 112px;
    flex: 0 0 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: var(--carte-alt);
    border: 1px solid var(--bordure);
    overflow: hidden;
}
.player-profile-photo { width: 100%; height: 100%; object-fit: contain; }
.player-profile-identity h1 { font-size: 28px; line-height: 1.1; }
.player-profile-short-name { opacity: .8; }
.player-profile-meta span {
    padding: 5px 9px;
    border: 1px solid var(--bordure);
    border-radius: 999px;
    background: var(--carte-alt);
}
.player-summary-card { min-height: 78px; display: flex; justify-content: center; }
.player-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.player-season-table { min-width: 900px; }
.player-transfers-list { display: flex; flex-direction: column; }
.player-transfer-row {
    display: grid;
    grid-template-columns: 90px minmax(120px, 1fr) 28px minmax(120px, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 11px 14px;
    border-bottom: 1px solid var(--bordure);
}
.player-transfer-row:last-child { border-bottom: 0; }
.player-transfer-date { color: var(--texte-attenue); font-size: 11px; font-weight: 800; }
.player-transfer-arrow { text-align: center; color: var(--texte-attenue); font-weight: 900; }
.player-transfer-type,
.player-transfer-fee { color: var(--texte-attenue); font-size: 11px; font-weight: 700; }
.player-link {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: inherit;
    text-decoration: none;
    font-weight: 800;
    transition: background .15s, border-color .15s, transform .15s, color .15s;
}
.player-link:hover,
.player-link:focus-visible {
    color: var(--accent);
    background: var(--blanc-05);
    border-color: var(--bordure);
    text-decoration: none;
    transform: translateX(2px);
    outline: none;
}
@media (max-width: 700px) {
    .player-profile-photo-wrap { width: 82px; height: 82px; flex-basis: 82px; }
    .player-profile-identity h1 { font-size: 22px; }
    .player-transfer-row { grid-template-columns: 78px minmax(110px, 1fr) 22px minmax(110px, 1fr); }
    .player-transfer-type,
    .player-transfer-fee { grid-column: auto; }
}

.player-current-season-label {
    padding: 12px 16px 0;
    color: var(--texte-attenue);
    font-size: 12px;
    font-weight: 800;
}
.player-stat-groups { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.player-stat-group { min-width: 0; }
@media (max-width: 1100px) {
    .player-stat-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .player-stat-groups { grid-template-columns: 1fr; }
    .player-current-season-label { padding-left: 12px; padding-right: 12px; }
}

.team-clickable { cursor: pointer; text-decoration: none; transition: transform .12s ease, opacity .12s ease; }
.team-clickable:hover { opacity: .82; transform: translateX(2px); text-decoration: underline; }

.team-clickable,
.team-profile-link,
.st-team-name,
.team-fixture-team {
    color: inherit;
    text-decoration: none;
    font-weight: 800;
    border-radius: 7px;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.team-clickable:hover,
.team-clickable:focus-visible,
.team-profile-link:hover,
.team-profile-link:focus-visible,
.st-team-name:hover,
.st-team-name:focus-visible,
.team-fixture-team:hover,
.team-fixture-team:focus-visible {
    color: var(--accent);
    text-decoration: none;
    background: var(--blanc-06);
    box-shadow: inset 0 0 0 1px var(--accent);
    outline: none;
}
.team-clickable { display: inline-block; padding: 4px 7px; cursor: pointer; }
.team-profile-link { display: inline-flex; align-items: center; padding: 4px 7px; }
.st-team-name { display: inline-flex; align-items: center; padding: 3px 6px; }

.team-results-section-title {
    font-weight: 700;
    padding: 10px 12px;
    margin: 10px 0 6px;
    border-bottom: 1px solid var(--bordure-douce);
}
.team-results-section-title.upcoming { margin-top: 18px; }

.stadium-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
    margin: 12px 0;
}
.stadium-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
}
.stadium-form input {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--bordure-champ);
    background: var(--fond-champ);
    color: inherit;
}
.stadium-form button {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--bordure-bouton);
    background: var(--fond-bouton);
    color: inherit;
    cursor: pointer;
}

.date-nav {
    flex: 0 0 34px;
    width: 34px;
    min-width: 34px;
    height: 36px;
    padding: 0;
    border-radius: 7px;
    font-size: 21px;
    line-height: 1;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.date-nav:disabled { opacity: .35; cursor: default; transform: none; }

.timeline {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 5px;
    overflow: hidden;
}
.timeline > .live-tab {
    flex: 0 0 auto;
    white-space: nowrap;
}
.timeline-dates {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(var(--timeline-visible-count, 2), minmax(0, 1fr));
    gap: 5px;
    overflow: hidden;
}
.timeline-dates > .day-tab {
    min-width: 0;
    width: 100%;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    justify-content: center;
}

@media (max-width: 900px) {
    .timeline { gap: 4px; }
    .date-nav { flex-basis: 30px; width: 30px; min-width: 30px; height: 34px; }
    .timeline-dates { gap: 4px; }
    .timeline-dates > .day-tab { font-size: 12px; padding-left: 4px; padding-right: 4px; }
    .timeline-dates > .day-tab.today-tab { min-width: 105px !important; }
}
@media (max-width: 600px) {
    .timeline { gap: 3px; }
    .date-nav { flex-basis: 27px; width: 27px; min-width: 27px; height: 33px; font-size: 19px; }
    .timeline-dates { gap: 3px; }
    .timeline-dates > .day-tab { font-size: 10px; padding-left: 2px; padding-right: 2px; }
    .timeline-dates > .day-tab.today-tab { min-width: 100px !important; }
}


.adsterra-banner {
    width: 468px;
    min-height: 60px;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
}
.adsterra-banner-header {
    flex: 0 0 468px;
    margin: 0 auto;
}
.adsterra-banner-footer {
    margin: 15px auto;
}
@media (max-width: 760px) {
    .adsterra-banner-header {
        flex-basis: min(468px, 48vw);
    }
}
@media (max-width: 600px) {
    .topbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .adsterra-banner-header {
        order: 3;
        flex-basis: 100%;
        margin: 2px auto 0;
    }
}

.site-footer {
    margin-top: 28px;
    border-top: 1px solid var(--bordure);
    background: var(--carte);
}
.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 58px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    flex-wrap: wrap;
}
.site-social-links { display: flex; align-items: center; gap: 9px; }
.site-social-icon {
    width: 31px;
    height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bordure);
    border-radius: 50%;
    background: var(--fond);
    color: var(--texte-attenue);
    transition: transform .15s ease, color .15s ease, background .15s ease;
}
.site-social-icon:hover {
    color: var(--texte);
    background: var(--carte-alt);
    transform: translateY(-2px);
}
.site-social-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 1.5;
}

@media (max-width: 700px) {
    .league-header.league-group-header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    .league-header.league-group-header .league-title-wrap {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        flex-wrap: nowrap !important;
    }
    .league-header.league-group-header .league-actions {
        flex: 0 0 auto !important;
        display: inline-flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        width: auto !important;
        max-width: none !important;
        margin-top: 0 !important;
    }
    .league-header.league-group-header .league-actions a {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        padding: 5px 7px;
        font-size: 10px;
    }
}

.tv-broadcast {
    position: relative;
    width: 30px;
    min-width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    cursor: help;
    border-radius: 7px;
    outline: none;
}
.tv-broadcast:hover,
.tv-broadcast:focus-visible { background: var(--blanc-08); }
.tv-broadcast-icon { font-size: 18px; line-height: 1; }
.tv-broadcast-tooltip {
    position: absolute;
    z-index: 1000;
    right: 0;
    top: calc(100% + 7px);
    width: min(280px, 70vw);
    padding: 10px 12px;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    background: var(--carte);
    color: var(--texte);
    box-shadow: 0 10px 28px var(--noir-28);
    font-size: 12px;
    line-height: 1.4;
    text-align: left;
    pointer-events: none;
}
.tv-broadcast-tooltip[hidden] { display: none; }
.tv-broadcast-title { font-weight: 900; margin-bottom: 6px; }
.tv-broadcast-tooltip ul { margin: 0; padding-left: 18px; }
.tv-broadcast-tooltip li { margin: 2px 0; }
.tv-broadcast-loading,
.tv-broadcast-none { color: var(--texte-attenue); }
@media (max-width: 700px) {
    .tv-broadcast-icon { font-size: 16px; }
    .tv-broadcast-tooltip { width: min(250px, 80vw); }
}
/* Live goal alert: the new score stays hidden briefly while the goal notice animates. */
.match-score.goal-alert {
    position: relative;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-score.goal-alert .goal-score {
    visibility: hidden;
}

.match-score.goal-alert .knockout-info {
    visibility: hidden;
}

.goal-alert-content {
    display: none;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 900;
    color: var(--direct);
    animation: goal-alert-pulse 1.5s ease both;
    white-space: nowrap;
}

.match-score.goal-alert .goal-alert-content {
    display: flex;
}

.goal-alert-ball {
    display: inline-block;
    font-size: 17px;
    animation: goal-alert-ball 1.5s ease both;
}

@keyframes goal-alert-pulse {
    0%, 100% { opacity: 0; transform: scale(.82); }
    18%, 70% { opacity: 1; transform: scale(1); }
}

@keyframes goal-alert-ball {
    0% { transform: translateX(-8px) rotate(-18deg) scale(.7); }
    30% { transform: translateX(0) rotate(0) scale(1.15); }
    65% { transform: translateX(5px) rotate(10deg) scale(1); }
    100% { transform: translateX(10px) rotate(18deg) scale(.8); }
}

@media (prefers-reduced-motion: reduce) {
    .goal-alert-content,
    .goal-alert-ball {
        animation-duration: .01ms;
    }
}


.site-footer-contact {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}
.site-footer-message {
    color: var(--texte-attenue);
    font-size: 12px;
    text-align: center;
}
.site-footer-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex-wrap: wrap;
}
.site-footer-email {
    width: 31px;
    height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bordure);
    border-radius: 50%;
    background: var(--fond);
    color: var(--texte-attenue);
    text-decoration: none;
    transition: transform .15s ease, color .15s ease, background .15s ease;
}
.site-footer-email:hover {
    color: var(--texte);
    background: var(--carte-alt);
    transform: translateY(-2px);
}
.site-footer-email svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
@media (max-width: 600px) {
    .privacy-card { padding: 18px; }
    .site-footer-contact { flex-direction: column; gap: 9px; }
}


/* Mobile competition headers: keep the full competition name readable and
   move the group/standings/scorers controls onto their own line. */
@media (max-width: 700px) {
    .league-header.league-group-header,
    .league-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 9px !important;
        padding: 11px 12px !important;
    }

    .league-header .league-title-wrap,
    .league-group-header .league-title-wrap {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        flex: 0 0 auto !important;
        flex-wrap: nowrap !important;
    }

    .league-header .league-title-wrap > span,
    .league-group-header .league-title-wrap > span {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        line-height: 1.2 !important;
    }

    .league-header .league-actions,
    .league-group-header .league-actions {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 0 0 auto !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        margin-top: 0 !important;
        white-space: normal !important;
    }

    .league-header .league-actions a,
    .league-group-header .league-actions a {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        padding: 5px 8px !important;
        font-size: 10px !important;
    }

    .league-header .league-actions .league-group-button,
    .league-group-header .league-actions .league-group-button {
        min-height: 24px !important;
        padding: 5px 9px !important;
        border-radius: 999px !important;
        font-size: 10px !important;
    }
}

@media (max-width: 430px) {
    .league-header,
    .league-header.league-group-header {
        padding: 10px 10px !important;
        gap: 8px !important;
    }

    .league-header .league-title-wrap > span,
    .league-group-header .league-title-wrap > span {
        font-size: 13px !important;
        line-height: 1.2 !important;
    }

    .league-header .league-actions,
    .league-group-header .league-actions {
        gap: 5px !important;
    }

    .league-header .league-actions a,
    .league-group-header .league-actions a {
        padding: 4px 7px !important;
        font-size: 9px !important;
    }
}

@media (max-width: 700px) {
    .match-h2h-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .match-h2h-summary > div:first-child,
    .match-h2h-summary > div:last-child {
        grid-column: span 1;
    }
    .match-h2h-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }
    .match-h2h-head > span {
        text-align: left;
    }
    .match-h2h-result {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }
}

@media (max-width: 700px) {
    .selection-filters .team-search-field,
    .selection-filters .team-autocomplete,
    .selection-filters .team-filter {
        width: 100%;
        max-width: none;
    }
}


/* Countdown displayed in place of the score before kickoff. */
.match-kickoff-countdown-wrap {
    width: max-content;
    margin: 0 auto;
    display: block;
}

.match-kickoff-countdown {
    display: block;
    width: max-content;
    margin: 0 auto;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Label displayed above the match countdown in the match sheet. */
.match-kickoff-countdown-label {
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--texte-attenue);
    margin: 0 0 3px;
    transform: none !important;
}
