:root {
    --header-h: 52px;
    --strip-h: 34px;
    --max-width: 1100px;
    --orange: #ffa000;
    --bleu: #F0F1F5;
    
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}


* {
    box-sizing: border-box;
        scrollbar-width: none;   
    -ms-overflow-style: none; 
}
*::-webkit-scrollbar {
  display: none;
}
html,
body {
    margin: 0;
    padding: 0;
}


body {
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--bleu);
    color: #18202a; 
    padding-bottom: var(--safe-bottom);
}
body.sheet-open {
    overflow: hidden;
    overscroll-behavior: none;
}

a {
    color: inherit;
}


/*header-----------------------------------------*/
.app-header {
    position: fixed;
    top: 0;
    z-index: 100;
    background: var(--bleu);
    width: 100%;
    height: calc(
        var(--header-h)
        + var(--safe-top)
    );

    padding-top: var(--safe-top);   
}
.app-header__inner {    
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 5px 0;
    line-height: 20px;
    margin: 0 auto;
    max-width: var(--max-width);
}
@media(max-width: 1100px) {
    .app-header__inner {
        padding: 10px 10px;
    }
}
.brand__title {
    font-size: 21px;
    font-weight: 800;
}
.brand__subtitle {
    font-size: 12px;
}
.app-header__inner IMG {
    height: 40px;
}


.app-main {
    min-height: calc(100vh - var(--header-h));
}


.page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 14px 0 20px;
}
@media(max-width: 1100px) {
   .page {
       padding: 14px 10px 20px;
    } 
}

/* Navigation semaine */
.weeks-strips {
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
    
    position: fixed;
    top: calc(
        var(--header-h)
        + var(--safe-top)
    );
    left: 0;
    background: var(--bleu);
    z-index: 30;
    height: var(--strip-h);    
    width: 100%;
    border-bottom: 1px solid #b1b1b1;
}
.weeks-strip {
    margin: 0 auto;
    max-width: var(--max-width);
    
    display: flex;
    gap: 5px;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 5px 0;
}

@media(max-width: 1100px) {
    .weeks-strip {
        margin: auto 5px;
    }
}

.weeks-strip.is-dragging {
    cursor: grabbing;
}

.week-item {
    position: relative;

    flex: 0 0 auto;

    border: 0;
    padding: 0 2px 5px;

    font: inherit;
    cursor: pointer;

    background: transparent;
    width: 90px;
}
.week-item::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: 0;

    width: 100%;
    height: 2px;

    border-radius: 5px;

    background: var(--orange);

    transform: scaleX(0);
    transform-origin: left;

    transition: transform .2s ease;
}

.week-item.active::after {
    transform: scaleX(1);
}
.week-item.active.is-loading::after {
    animation: week-loading .65s ease-in-out infinite alternate;
}

@keyframes week-loading {
    from {
        transform: scaleX(.15);
    }

    to {
        transform: scaleX(.8);
    }
}

.week-item__dates {
    white-space: nowrap;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    line-height: 12px;
}
.week-item__dates SPAN {
    display: block;
}

.week-item.active {
    color: var(--orange);
    font-weight: 800;
}


.team.winner {
    font-weight: 600;
    color: var(--orange);
}
.game-card:has(.winner) .team:not(.winner) {
    color: #72767c;
}

.serie-card {
    margin-bottom: 14px;

    background: #fff;
    border-radius: 10px;

    overflow: hidden;

    box-shadow: 0 1px 5px rgba(0, 0, 0, .05);
    
    scroll-margin-top:
        calc(var(--header-h) + var(--strip-h) + 5px);
}
.serie-card:last-child {
    margin-bottom: 0;
}


.serie-card__header {
    width: 100%;
    min-height: 44px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    padding: 7px 16px;

    border: 0;
    background: transparent;

    color: inherit;
    font: inherit;

    cursor: default;
}

.serie-card__title {
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
}

.serie-card__header.has-ranking {
    cursor: pointer;
}

.serie-card__icon {
    flex: 0 0 auto;
    width: 18px;

    text-align: center;

    font-size: 13px;
    color: #697480;
}

.serie-card__games {
    border-top: 1px solid #e5e8eb;
}

.match-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;

    align-items: stretch;
    gap: 14px;

    min-height: 58px;

    padding: 8px 16px;

    border-bottom: 1px solid #e7e9ec;
}

.match-row:last-child {
    border-bottom: 0;
}

.match-teams,
.match-info {
    display: grid;
    grid-template-rows: 1fr 1fr;

    align-items: center;
}

.team {
    min-width: 0;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 13px;
    font-weight: 400;
}


.match-info {
    min-width: 82px;

    text-align: right;

    color: #697480;

    font-size: 12px;

    font-variant-numeric: tabular-nums;
}

.match-info--score {
    min-width: 30px;

    color: #17202a;

    /*font-size: 16px;
    font-weight: 800;*/
}
.match-info--score .winner {
    font-weight: 600;
    color: var(--orange);
}



.match-info--today {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 82px;
    text-align: right;
}

.sheet-backdrop {
    position: fixed;
    inset: 0;

    z-index: 500;

    background: rgba(0, 0, 0, .35);

    opacity: 0;
    pointer-events: none;

    transition: opacity .2s ease;
}

.sheet-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.ranking-sheet {
    position: fixed;
    left: 50%;
    bottom: 0;

    z-index: 510;

    width: min(700px, 100%);
    max-height: 85%;

    background: #fff;
    border-radius: 20px 20px 0 0;

    transform: translate(-50%, 100%);

    visibility: hidden;

    transition:
        transform .25s ease,
        visibility 0s linear .25s;

    overflow: hidden;
}

.ranking-sheet.show {
    transform: translate(-50%, 0);

    visibility: visible;

    transition:
        transform .25s ease,
        visibility 0s;
}
.sheet-handle {
    width: 42px;
    height: 5px;

    margin: 8px auto;

    border-radius: 99px;

    background: #d2d5d9;
}

.ranking-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 5px 16px 12px;

    border-bottom: 1px solid #e6e8eb;
}

.ranking-sheet__title {
    font-size: 18px;
    font-weight: 800;
}

.sheet-close {
    width: 42px;
    height: 42px;

    border: 0;
    background: transparent;

    font-size: 28px;

    cursor: pointer;
}

.ranking-sheet__content {
    max-height: calc(85vh - 70px);

    overflow-y: auto;

    padding: 12px 16px 25px;
}



.results-wrap {
    margin-top: calc(
        var(--header-h)
        + var(--safe-top)
        + var(--strip-h)
        + 5px
    );

    min-height: calc(
        100dvh
        - var(--header-h)
        - var(--safe-top)
        - var(--strip-h)
         - var(--safe-bottom)
        - 5px
    );

    overflow: hidden;
    touch-action: pan-y;
}

.results-track {
    display: flex;

    width: 300%;

    transform: translateX(-33.333333%);
    align-items: flex-start;
    will-change: transform;
}

.results-page {
    flex: 0 0 33.333333%;
    width: 33.333333%;

    padding: 0 1px;

    min-width: 0;
}

.results-page.is-loading {
    opacity: .55;
}

.results-page.scores-refreshing .match-info--score span {
    color: transparent;

    position: relative;
}

.results-page.scores-refreshing .match-info--score span::after {
    content: "";

    position: absolute;
    left: 50%;
    top: 50%;

    width: 16px;
    height: 10px;

    transform: translate(-50%, -50%);

    border-radius: 3px;

    background: #dfe3e8;

    animation: score-skeleton .7s ease-in-out infinite alternate;
}

@keyframes score-skeleton {
    from {
        opacity: .35;
    }

    to {
        opacity: .9;
    }
}



@media (max-width: 700px) {

    .ranking-sheet {
        top: auto;
        bottom: 0;

        width: 100%;
        height: auto;
        max-height: 92%;

        border-radius: 18px 18px 0 0;
    }

    .sheet-handle {
        display: block;

        width: 42px;
        height: 5px;

        margin: 8px auto 4px;

        border-radius: 99px;

        background: #d2d5d9;
    }

    .ranking-sheet__header {
        position: relative;

        min-height: 42px;

        display: flex;
        align-items: center;
        justify-content: center;

        padding: 0 48px 6px;

        border-bottom: 1px solid #e6e8eb;
    }

    .ranking-sheet__title {
        width: 100%;

        text-align: center;

        font-size: 17px;
        font-weight: 800;
        line-height: 1.2;
    }

    .sheet-close {
        position: absolute;
        top: 50%;
        right: 6px;

        width: 38px;
        height: 38px;

        transform: translateY(-55%);

        display: flex;
        align-items: center;
        justify-content: center;

        padding: 0;

        font-size: 25px;
        line-height: 1;
    }

    .ranking-sheet__content {
        height: auto;
        max-height: calc(92vh - 58px);

        overflow-y: auto;

        padding: 0 10px 12px;
        padding-bottom: calc(
            12px
            + var(--safe-bottom)
        );
    }
    

    .results-wrap {
        margin-top: calc(
            var(--header-h)
            + var(--safe-top)
            + var(--strip-h)
            + 5px
        );

        min-height: calc(
            100dvh
            - var(--header-h)
            - var(--safe-top)
            - var(--strip-h)
            - var(--safe-bottom)
            - 50px
        );
    }
}

.ranking-table {
    display: grid;

    grid-template-columns:
        24px
        var(--rank-team, minmax(0, 1fr))
        30px
        var(--rank-stats, 90px)
        38px;

    width: 100%;

    font-size: 12px;
}


/*
|--------------------------------------------------------------------------
| Colonnes
|--------------------------------------------------------------------------
*/

.ranking-column {
    display: grid;

    grid-template-rows: 32px;
    grid-auto-rows: 42px;

    min-width: 0;
}


.ranking-cell {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 0;

    border-bottom: 1px solid rgba(0, 0, 0, .06);
}


.ranking-head {
    color: #747b84;

    font-size: 10px;
    font-weight: 700;
}


/*
|--------------------------------------------------------------------------
| Equipe
|--------------------------------------------------------------------------
*/

.ranking-team {
    justify-content: flex-start;

    padding: 0 4px;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-weight: 500;
}


.ranking-pos {
    color: #777;
}


/*
|--------------------------------------------------------------------------
| Zone scrollable G N P B+ B- +/-
|--------------------------------------------------------------------------
*/

.ranking-stats-viewport {
    width: 100%;

    overflow: hidden;

    touch-action: pan-y;
}

.ranking-stats-viewport::-webkit-scrollbar {
    display: none;
}


.ranking-stats-track {
    display: grid;

    grid-template-columns:
        repeat(6, 30px);

    width: 180px;

    transform: translateX(0);
}


.ranking-stats-track .ranking-column {
    width: 30px;
}


/*
|--------------------------------------------------------------------------
| Points
|--------------------------------------------------------------------------
*/

.ranking-column--points {
    border-left: 1px solid #d5d8dc;
}
.ranking-column--played {
    border-right: 1px solid #d5d8dc;
}


.ranking-points {
    font-weight: 800;
}

@media (min-width: 701px) {

    .ranking-table {
        grid-template-columns:
            28px
            minmax(0, 1fr)
            36px
            216px
            45px;
    }

    .ranking-stats-viewport {
        width: 216px;

        overflow: visible;
        touch-action: auto;
    }

    .ranking-stats-track {
        width: 216px;

        grid-template-columns:
            repeat(6, 36px);

        transform: none !important;
    }

    .ranking-stats-track .ranking-column {
        width: 36px;
    }
}


.sheet-handle,
.ranking-sheet__header {
    touch-action: none;
}