*{
    box-sizing: border-box;
}

html{
    --bg-color-dark: #0B1220;
    --bg-color-light: white;
    --bg-body-light: #F1F5F9;
    --text-color: #101C30;
    --card-color-dark: #f3eed8;

    --bg-color: var(--bg-color-light);
    --text-color: var(--text-color);
    --card-color: var(--bg-color-light);
    --bg-body: var(--bg-body-light);
}

body{
    margin: 0;

    font-family: 'Barlow', sans-serif;
    color: #101C30;

    background: var(--bg-body);
}

header{
    position: sticky;
    top: 0;
    z-index: 100;

    display: flex;
    justify-content: space-between;

    background: #101C30;
    border-bottom: 1px solid #39BDE0;
}

.header-title, .footer-title{
    color: white;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 40px;
}

.header-title{
    padding: 20px;
}

.header-title span, .footer-title span{
    color: #39BDE0;
}

.selectors-mode{
    display: flex;
    gap: 20px;
    padding: 20px;
}

.selectors-mode p{
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.header-menu{
    display: flex;
    align-items: center;
    gap: 30px;

    padding: 20px;

    color: white;
    font-weight: bold;
}

a{
    color: inherit;
    text-decoration: none;
}

a:hover{
    color: #39BDE0;
}

i{
    margin-right: 10px;
}

main{
    max-width: 1280px;
    margin-inline: auto;
    padding: 48px 32px;
}

h1{
    margin: 0 0 12px;
    font-size: 52px;
    text-align: center;
    color: var(--text-color);
}

.standings-meta{
    margin: 0 0 32px;
    text-align: center;
    color: var(--text-color);
}

.rankings-menu{
    display: grid;
    gap: 12px;

    margin-bottom: 32px;
}

.rankings-filter-group{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.rankings-menu button{
    padding: 12px 20px;

    font: inherit;
    font-weight: 600;
    color: #354960;

    border: 1px solid #D4DFEB;
    border-radius: 10px;
    background: white;

    transition: background-color .2s, border-color .2s;

    cursor: pointer;
}

.rankings-menu button:hover{
    background: #E7F6FB;
    border-color: #39BDE0;
}

.rankings-menu button[aria-pressed="true"]{
    color: #101C30;

    background: #39BDE0;
    border-color: #39BDE0;
}

button:focus-visible, a:focus-visible, .ranking:focus-visible{
    outline: 3px solid #087DA0;
    outline-offset: 4px;
}

.ranking{
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 16px;

    box-shadow: 0 8px 28px rgb(16 28 48 / 7%);

    overflow-x: auto;
}

.ranking[hidden]{
    display: none;
}

table{
    width: 100%;
    min-width: 720px;

    font-variant-numeric: tabular-nums;

    border-collapse: separate;
    border-spacing: 0;
}

caption{
    padding: 24px;

    text-align: left;
    font-size: 24px;
    font-weight: 700;
}

th, td{
    padding: 17px 14px;

    text-align: center;
}

thead th{
    color: white;
    font-size: 13px;
    letter-spacing: .06em;
    text-transform: uppercase;

    background: #101C30;
}

thead th:first-child{
    border-top-left-radius: 10px;
}

thead th:last-child{
    border-top-right-radius: 10px;
}

th:nth-child(2), td:nth-child(2){
    text-align: left;
}

td{
    font-size: 16px;

    border-bottom: 1px solid #E9EEF4;
}

td:first-child{
    width: 64px;

    color: #64748B;
}

td:nth-child(2){
    min-width: 220px;

    font-weight: 600;
}

tbody tr:nth-child(odd){
    background: white;
}

tbody tr:nth-child(even){
    background: #F8FAFC;
}

tbody tr:hover{
    background: #EAF6FC;
}

tbody td:nth-child(7){
    font-weight: 800;
    color: #08627E;

    background: rgb(57 189 224 / 9%);
}

tbody tr:last-child td{
    border-bottom: 0;
}

.ranking[data-division] tbody tr:nth-child(-n+3) td:first-child{
    color: #08627E;
    font-weight: 700;

    box-shadow: inset 4px 0 #39BDE0;
}

.streak{
    display: inline-block;

    min-width: 46px;

    padding: 5px 10px;

    font-size: 13px;
    font-weight: 700;
    color: #475569;

    border-radius: 6px;
    background: #E8EEF5;
}

.streak-win{
    color: #17643C;

    background: #DCF3E5;
}

.streak-loss{
    color: #9C2937;

    background: #FCE5E7;
}

.standings-legend{
    margin: 18px 4px 0;

    color: var(--text-color);
    font-size: 14px;
    line-height: 1.8;
}

.information-container{
    margin-top: 40px;
    padding: 28px;

    line-height: 1.7;

    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
}

.information-container h2{
    margin-top: 0;
}

.standings-explain{
    display: flex;
    gap: 12px;
}

.standings-note span{
    border-left: 4px solid #39BDE0;
    padding-left: 8px;
}

footer{
    display: flex;
    justify-content: space-between;
    gap: 24px;

    padding: 40px;

    background: #101C30;
}

.footer-menu{
    display: flex;
    gap: 30px;

    color: white;
    font-weight: bold;
}

@media (max-width: 700px){
    main{
        padding: 28px 16px;
    }

    header{
        position: static;

        flex-wrap: wrap;
    }

    .header-title{
        padding: 16px;

        font-size: 30px;
    }

    .header-menu{
        gap: 18px;
        flex-wrap: wrap;

        width: 100%;

        padding: 0 16px 12px;
    }

    .header-menu p{
        margin: 8px 0;
    }

    .rankings-filter-group{
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rankings-filter-group:first-child button:first-child{
        grid-column: 1 / -1;
    }

    .rankings-menu button{
        padding: 12px 8px;
    }

    caption{
        padding: 20px;

        font-size: 22px;
    }

    .information-container{
        padding: 20px;
    }

    footer{
        flex-direction: column;

        padding: 28px 20px;
    }

    .footer-title{
        font-size: 30px;
    }

    .footer-menu{
        flex-wrap: wrap;
        gap: 12px;

        font-size: 13px;
    }

}

@media (prefers-reduced-motion: reduce){
    .rankings-menu button{
        transition: none;
    }

}

/* Adaptation des images */
img{
    max-width: 100%;
    height: auto;
}

/* Tablettes et mobiles */

@media (max-width: 768px){
    main{
        padding: 24px 16px;
    }
    .rankings-filter-group{
        flex-wrap: wrap;
    }
}

@media (max-width: 768px){
    header{
        position: static;
        flex-direction: column;
        align-items: center;
    }

    .header-title{
        padding: 16px;
        font-size: 30px;
    }

    .header-menu{
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px 18px;
        padding: 0 16px 16px;
    }

    .header-menu p{
        margin: 8px 0;
    }

    h1{
        font-size: 36px;
        overflow-wrap: anywhere;
    }

    footer{
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 28px 16px;
        text-align: center;
    }

    th{
        font-size: 10px;
        padding: 8px;
    }

    td{
        font-size: 10px;
        padding: 8px;
    }
    .footer-title{
        font-size: 30px;
    }

    .footer-menu{
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 16px;
    }
}

@media (max-width: 600px){
    table{
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    th, td{
        padding: 6px 3px;
        font-size: 11px;
    }

    th:first-child, td:first-child{
        width: 8%;
    }

    th:nth-child(2), td:nth-child(2){
        width: 34%;
        min-width: 0;
    }

    th:last-child, td:last-child{
        width: 17%;
    }

    td:nth-child(2){
        overflow-wrap: anywhere;
    }

    .streak{
        min-width: 0;
        padding: 3px 4px;
        font-size: 10px;
    }
}

/* Sélecteurs de mode (Dark/Light) */

.dark-mode{
    color: black;
    --bg-color: var(--bg-color-dark);
    --description-text: var(--color-text);
    --text-color: var(--bg-color-light);
    --card-color: var(--card-color-dark);
    --bg-body: var(--bg-color-dark);
}