/* Onglet Ligues, les ligues terminées : une saison à la fois, la couleur de chaque course, ta place en dossard.
   Les jetons --lgb-* viennent de lgb-tiles.css, les couleurs --race-* et les illustrations de race-style-card.css. */

/* Jetons partagés : la tuile de saison et le ticket servent aussi sur le Radio Tour, hors de .fl */
:root {
    --fl-gold: #FFC21A;
    --fl-silver: #DDE1EA;
    --fl-bronze: #F0AE7E;
    --fl-night: #1E1446;
    --fl-chip-line: #E4E1EA;
    --fl-rule: #DEDAE6;
}

.fl {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    color: var(--lgb-ink);
}

.fl button {
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.fl button:focus-visible,
.fl-tk:focus-visible,
.fl-sum--link:focus-visible {
    outline: 3px solid var(--lgb-violet);
    outline-offset: 2px;
}

.fl-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ==========================================================================
   Le ruban des saisons : « Toutes » épinglé, puis les années qui défilent
   ========================================================================== */

.fl-rib {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.fl-rib-pin {
    flex-shrink: 0;
    padding-right: 8px;
    border-right: 1px solid var(--fl-rule);
}

.fl-rib-scroll {
    display: flex;
    gap: 6px;
    min-width: 0;
    padding: 2px 32px 6px 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(90deg, #000000 calc(100% - 32px), transparent);
}

.fl-rib-scroll::-webkit-scrollbar { display: none; }

.fl-yr {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 70px;
    height: 54px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--lgb-surface);
    box-shadow: inset 0 0 0 1px var(--fl-chip-line);
    color: var(--lgb-ink);
}

.fl-yr b {
    font-family: 'LGB-Garaje', sans-serif;
    font-weight: 900;
    font-size: 20px;
    line-height: 1;
}

.fl-yr small {
    font-size: 10.5px;
    color: var(--lgb-ink-2);
    white-space: nowrap;
}

.fl-yr--all { width: 74px; }

.fl-yr--all b {
    font-family: 'LGB-Equip', sans-serif;
    font-size: 14px;
    font-weight: 800;
}

/* Une saison avec au moins un bouquet : un point doré */
.fl-yr i {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fl-gold);
    box-shadow: 0 0 0 1.5px var(--lgb-surface);
}

.fl-yr--on {
    background: var(--lgb-violet);
    color: #FFFFFF;
    box-shadow: 0 8px 14px -10px rgba(58, 31, 158, 0.9);
}

.fl-yr--on small { color: var(--lgb-lilac); }
.fl-yr--on i { box-shadow: 0 0 0 1.5px var(--lgb-violet); }

/* À la souris, le ruban défile avec une barre fine plutôt qu'au doigt */
@media (hover: hover) and (pointer: fine) {
    .fl-rib-scroll {
        scrollbar-width: thin;
        scrollbar-color: var(--lgb-lilac-2) transparent;
    }

    .fl-rib-scroll::-webkit-scrollbar { display: block; height: 6px; }
    .fl-rib-scroll::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--lgb-lilac-2); }
}

/* ==========================================================================
   Les pastilles de course
   ========================================================================== */

.fl-chips {
    display: flex;
    gap: 8px;
    min-width: 0;
    padding: 2px 32px 6px 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(90deg, #000000 calc(100% - 32px), transparent);
}

.fl-chips::-webkit-scrollbar { display: none; }

.fl-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 13px 0 10px;
    border: 0;
    border-radius: 999px;
    background: var(--lgb-surface);
    box-shadow: inset 0 0 0 1px var(--fl-chip-line);
    color: #3B3747;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
}

.fl-chip small {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--lgb-ink-2);
}

.fl-chip--all { padding-left: 13px; }

.fl-dot {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--race-bg);
    box-shadow: inset 0 0 0 1px rgba(21, 18, 31, 0.18);
}

.fl-chip--on {
    background: var(--race-bg, var(--lgb-violet));
    color: var(--race-ink, #FFFFFF);
    box-shadow: 0 6px 12px -8px rgba(21, 18, 31, 0.7);
    font-weight: 800;
}

.fl-chip--on small {
    color: var(--race-ink, #FFFFFF);
    opacity: 0.75;
}

.fl-chip--on .fl-dot { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9); }

.fl-chip--all.fl-chip--on {
    background: var(--lgb-violet);
    color: #FFFFFF;
}

/* ==========================================================================
   Le bilan : la saison, ta carrière, ou toi sur une course
   ========================================================================== */

.fl-sum {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    background: var(--fl-night);
    color: #FFFFFF;
    overflow: hidden;
}

.fl-sum-wm {
    position: absolute;
    right: -6px;
    top: -14px;
    z-index: -1;
    font-family: 'LGB-Garaje', sans-serif;
    font-weight: 900;
    font-size: 110px;
    line-height: 1;
    color: rgba(201, 187, 255, 0.1);
    pointer-events: none;
}

.fl-sum-k {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lgb-lilac-2);
}

.fl-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.fl-kpi {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.fl-kpi b {
    font-family: 'LGB-Garaje', sans-serif;
    font-weight: 900;
    font-size: 30px;
    line-height: 0.9;
    white-space: nowrap;
}

.fl-kpi b sup {
    font-family: 'LGB-Equip', sans-serif;
    font-size: 0.42em;
    vertical-align: 1em;
}

.fl-kpi > span {
    font-size: 11px;
    line-height: 1.2;
    color: var(--lgb-lilac-2);
}

.fl-kpi--gold b { color: var(--fl-gold); }

.fl-sum-q {
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
    color: var(--lgb-lilac);
}

.fl-sum-q b { color: #FFFFFF; }
.fl-sum-q sup { font-size: 0.7em; }

/* La tuile qui mène à l'onglet Ligues (Radio Tour) */
.fl-sum--link {
    text-decoration: none;
    transition: transform 0.22s var(--lgb-ease), box-shadow 0.22s var(--lgb-ease);
}

.fl-sum--link:hover,
.fl-sum--link:visited { color: #FFFFFF; }

@media (hover: hover) {
    .fl-sum--link:hover {
        transform: translateY(-2px);
        box-shadow: var(--lgb-shadow-hover);
    }
}

/* Aux couleurs d'une course */
.fl-sum--race {
    background: var(--race-bg);
    color: var(--race-ink);
}

.fl-sum--race .fl-sum-k,
.fl-sum--race .fl-kpi > span,
.fl-sum--race .fl-sum-q { color: var(--race-muted); }
.fl-sum--race .fl-sum-q b { color: var(--race-ink); }
.fl-sum--race .fl-kpi--gold b { color: var(--race-ink); }

/* La remontée : ta place finale en officielle, une barre par édition */
.fl-climb {
    display: grid;
    grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
    gap: 8px;
    align-items: end;
}

.fl-climb-c {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.fl-climb-bar {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    padding-top: 6px;
    border-radius: 6px 6px 2px 2px;
    background: rgba(0, 0, 0, 0.12);
    font-family: 'LGB-Garaje', sans-serif;
    font-weight: 900;
    font-size: 20px;
    line-height: 1;
}

.fl-climb-bar sup {
    font-family: 'LGB-Equip', sans-serif;
    font-size: 0.5em;
    vertical-align: 0.8em;
}

.fl-climb-c--now .fl-climb-bar {
    background: var(--race-ink);
    color: var(--race-bg);
}

.fl-climb-y {
    font-size: 11px;
    font-weight: 700;
    color: var(--race-muted);
    white-space: nowrap;
}

.fl-climb--dense { gap: 5px; }

.fl-climb--dense .fl-climb-bar {
    padding-top: 5px;
    border-radius: 4px 4px 2px 2px;
    font-size: 13px;
}

.fl-climb--dense .fl-climb-y { font-size: 10.5px; }

/* ==========================================================================
   Le ticket : une ligue terminée sur une ligne, aux couleurs de la course
   ========================================================================== */

.fl-tk {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42%;
    align-items: center;
    min-height: 88px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--race-bg);
    color: var(--race-ink);
    text-decoration: none;
    box-shadow: 0 1px 0 rgba(21, 18, 31, 0.05), 0 10px 18px -16px rgba(21, 18, 31, 0.7);
    transition: transform 0.22s var(--lgb-ease), box-shadow 0.22s var(--lgb-ease);
}

.fl-tk:hover,
.fl-tk:visited { color: var(--race-ink); }

@media (hover: hover) {
    .fl-tk:hover {
        transform: translateY(-2px);
        box-shadow: 0 1px 0 rgba(21, 18, 31, 0.05), 0 16px 24px -18px rgba(21, 18, 31, 0.8);
    }

    .fl-tk:hover .fl-tk-art > span { transform: scale(1.05); }
}

.fl-tk-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 10px 28px 10px 16px;
}

.fl-tk-k {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--race-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fl-tk-n {
    font-size: 16.5px;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fl-tk-s {
    font-size: 12px;
    color: var(--race-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fl-tk-s b {
    color: var(--race-ink);
    font-weight: 800;
}

/* L'illustration, en biais comme sur la carte de course : presque la moitié du ticket, le dossard sur la couture */
.fl-tk-art {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    position: relative;
    overflow: hidden;
}

.fl-tk .fl-tk-art > span {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    clip-path: polygon(16% 0, 100% 0, 100% 100%, 0 100%);
    transition: transform 0.5s var(--lgb-ease);
}

/* Le dossard : ta place, épinglée */
.fl-bib {
    position: relative;
    z-index: 1;
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 58px;
    height: 52px;
    margin-left: -24px;
    padding: 4px 6px 3px 6px;
    border-radius: 5px;
    background: #FFFFFF;
    color: var(--lgb-ink);
    box-shadow: 0 6px 12px -6px rgba(0, 0, 0, 0.55);
}

/* Les quatre épingles */
.fl-bib::before {
    content: "";
    position: absolute;
    inset: 4px;
    background:
        radial-gradient(circle, rgba(21, 18, 31, 0.28) 1.6px, transparent 2px) 0 0 / 6px 6px no-repeat,
        radial-gradient(circle, rgba(21, 18, 31, 0.28) 1.6px, transparent 2px) 100% 0 / 6px 6px no-repeat,
        radial-gradient(circle, rgba(21, 18, 31, 0.28) 1.6px, transparent 2px) 0 100% / 6px 6px no-repeat,
        radial-gradient(circle, rgba(21, 18, 31, 0.28) 1.6px, transparent 2px) 100% 100% / 6px 6px no-repeat;
    pointer-events: none;
}

.fl-bib-n {
    font-family: 'LGB-Garaje', sans-serif;
    font-weight: 900;
    font-size: 24px;
    line-height: 0.9;
    white-space: nowrap;
}

.fl-bib-n sup {
    margin-left: 1px;
    font-family: 'LGB-Equip', sans-serif;
    font-size: 0.45em;
    font-weight: 800;
    vertical-align: 0.95em;
}

.fl-bib-t {
    font-size: 9.5px;
    color: var(--lgb-ink-2);
    white-space: nowrap;
}

.fl-bib--1 { background: var(--fl-gold); }
.fl-bib--2 { background: var(--fl-silver); }
.fl-bib--3 { background: var(--fl-bronze); }

.fl-bib--1 .fl-bib-t,
.fl-bib--2 .fl-bib-t,
.fl-bib--3 .fl-bib-t {
    color: rgba(21, 18, 31, 0.72);
    font-weight: 700;
}

/* ==========================================================================
   « Toutes » : une ligne par saison, qu'on déplie
   ========================================================================== */

.fl-seas {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fl-sea {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    background: var(--lgb-surface);
    box-shadow: var(--lgb-shadow);
    overflow: hidden;
}

.fl-sea-h {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 74px;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    color: var(--lgb-ink);
    text-align: left;
}

.fl-sea-y {
    font-family: 'LGB-Garaje', sans-serif;
    font-weight: 900;
    font-size: 30px;
    line-height: 1;
}

.fl-sea-m {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.fl-sea-t {
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fl-sea-s {
    font-size: 12px;
    color: var(--lgb-ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fl-sea-s sup { font-size: 0.7em; }

.fl-sea-h .mud-icon-root { color: var(--lgb-ink-2); }

/* La saison en couleurs : un trait par ligue, dans l'ordre du calendrier */
.fl-sea-bar {
    display: flex;
    gap: 2px;
    height: 7px;
    margin-top: 2px;
}

.fl-sea-bar i {
    flex: 1;
    border-radius: 2px;
    background: var(--race-bg);
    box-shadow: inset 0 0 0 1px rgba(21, 18, 31, 0.08);
}

.fl-sea--open { box-shadow: 0 0 0 2px var(--lgb-violet), 0 10px 20px -16px rgba(58, 31, 158, 0.8); }
.fl-sea--open .fl-sea-h .mud-icon-root { color: var(--lgb-violet); }

.fl-sea-body { padding: 0 10px 10px 10px; }
