:root {
    --fanat-green: #34a853;
    --fanat-green-dark: #267a3d;
    --fanat-green-soft: #eaf7ee;
    --fanat-green-hover: #d9f0df;
    --text: #202124;
    --muted: #6b7280;
    --line: #e2ebe5;
    --white: #ffffff;
    --page-bg: #f5faf6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--text);
    background: var(--page-bg);
    font-family: Arial, Helvetica, sans-serif;
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 38px 0 48px;
}

.league-selector {
    margin-bottom: 30px;
}

.league-selector h2 {
    margin: 0 0 14px;
    color: var(--text);
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.15;
}

.league-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 190px));
    gap: 10px;
}

.league-tab {
    display: grid;
    min-height: 48px;
    padding: 11px 22px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--fanat-green-dark);
    background: var(--white);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.league-tab:hover {
    border-color: var(--fanat-green);
    background: var(--fanat-green-soft);
}

.league-tab.is-active {
    border-color: var(--fanat-green);
    color: var(--white);
    background: var(--fanat-green);
    box-shadow: 0 8px 20px rgb(52 168 83 / 20%);
}

.league-tab.is-disabled {
    cursor: default;
    opacity: .55;
}

.league-tab.is-disabled:hover {
    border-color: var(--line);
    background: var(--white);
}

.standings-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--white);
    box-shadow: 0 16px 45px rgb(52 168 83 / 10%);
}

.card-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px;
    color: var(--white);
    background: linear-gradient(120deg, var(--fanat-green-dark), var(--fanat-green));
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .85;
}

h1 {
    margin: 0;
    font-size: clamp(27px, 4vw, 42px);
    line-height: 1.1;
}

.season {
    display: grid;
    gap: 4px;
    text-align: right;
}

.season span {
    font-size: 14px;
    opacity: .9;
}

.season strong {
    font-size: 20px;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 790px;
    border-collapse: collapse;
}

th,
td {
    height: 58px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    text-align: center;
    white-space: nowrap;
}

th {
    height: 52px;
    color: var(--fanat-green-dark);
    background: #f7fcf8;
    font-size: 13px;
    letter-spacing: .04em;
}

tbody tr {
    transition: background-color .15s ease;
}

tbody tr:nth-child(even) {
    background: var(--fanat-green-soft);
}

tbody tr:hover {
    background: var(--fanat-green-hover);
}

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

.position {
    width: 54px;
    color: var(--fanat-green-dark);
    font-weight: 700;
}

.club-column {
    width: 34%;
    text-align: left;
}

.club {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    font-weight: 700;
}

.club img {
    flex: 0 0 36px;
    object-fit: contain;
}

.points {
    color: var(--text);
    font-weight: 800;
}

.card-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 20px;
    padding: 16px 32px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: #f8fbf9;
    font-size: 12px;
}

.error {
    display: grid;
    gap: 8px;
    margin: 30px;
    padding: 20px;
    border: 1px solid #f2c6c6;
    border-radius: 12px;
    color: #8e2222;
    background: #fff3f3;
}

/* ==================================================
   MPL TURNIR START
   ================================================== */
.standings-card--mpl .card-header {
    background: linear-gradient(120deg, var(--fanat-green-dark), var(--fanat-green));
}
/* ==================================================
   MPL TURNIR FINISH
   ================================================== */

/* ==================================================
   I LIQA TURNIR START
   ================================================== */
.standings-card--1 .card-header {
    background: linear-gradient(120deg, var(--fanat-green-dark), var(--fanat-green));
}
/* ==================================================
   I LIQA TURNIR FINISH
   ================================================== */

/* ==================================================
   II LIQA TURNIR START
   ================================================== */
.standings-card--2 .card-header {
    background: linear-gradient(120deg, var(--fanat-green-dark), var(--fanat-green));
}
/* ==================================================
   II LIQA TURNIR FINISH
   ================================================== */

@media (max-width: 700px) {
    .page {
        width: 100%;
        padding: 24px 0 0;
    }

    .league-selector {
        margin: 0 16px 24px;
    }

    .league-selector h2 {
        margin-bottom: 12px;
        font-size: 28px;
    }

    .league-tabs {
        grid-template-columns: repeat(3, 1fr);
        gap: 7px;
    }

    .league-tab {
        min-height: 44px;
        padding: 9px 6px;
        font-size: 14px;
    }

    .standings-card {
        border-inline: 0;
        border-bottom: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .card-header {
        align-items: start;
        padding: 22px 18px;
    }

    .season span {
        display: none;
    }

    .season strong {
        font-size: 15px;
    }

    th,
    td {
        padding-inline: 9px;
    }

    .card-footer {
        padding: 14px 18px;
    }
}
